/*
 * Maison de la Literie : ce qui sert sur toutes les pages. Boutons, titres de
 * section, en-tête, menu, pied de page et fenêtre de contact. Chaque section a sa propre feuille
 * (theme/blocks/<section>/src/style.scss), chargée seulement là où elle sert.
 */

body {
	/* Marge latérale d'une section pleine largeur : 1,25rem, ou plus quand l'écran
	   dépasse la largeur du contenu. Sur body : c'est là que WordPress écrit cette
	   largeur (1280 px, jusqu'à 1600 px sur les très grands écrans). */
	--mdl-marge: max(1.25rem, (100% - var(--wp--style--global--wide-size, 1280px)) / 2);
}

/* L'en-tête reste en haut de l'écran : les ancres s'arrêtent dessous. Sur :root, pour
   passer devant la règle que WordPress écrit pour sa barre d'administration. */
:root {
	--mdl-entete-hauteur: 70px;
	scroll-padding-top: calc(var(--mdl-entete-hauteur) + var(--wp-admin--admin-bar--height, 0px));
}

@media (min-width: 782px) {
	:root {
		--mdl-entete-hauteur: 90px;
	}
}

html {
	scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
	html {
		scroll-behavior: auto;
	}
}

body {
	-webkit-font-smoothing: antialiased;
}

/* Le pied de page reste en bas de l'écran, même sur une page courte. */
.wp-site-blocks {
	display: flex;
	flex-direction: column;
	min-height: calc(100dvh - var(--wp-admin--admin-bar--height, 0px));
}

.wp-site-blocks > main {
	flex: 1 0 auto;
}

/* Texte lu par les lecteurs d'écran seulement. */
.mdl-cache {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Boutons                                                             */
/* ------------------------------------------------------------------ */

.mdl-bouton {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 45px;
	padding: 0.75rem 1.875rem;
	border: 1px solid var(--wp--preset--color--ardoise);
	border-radius: var(--wp--custom--rayon);
	background: var(--wp--preset--color--ardoise);
	color: var(--wp--preset--color--creme);
	font-family: var(--wp--preset--font-family--texte);
	font-size: var(--wp--preset--font-size--normal);
	font-weight: 700;
	line-height: 1.1;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.mdl-bouton:hover,
.mdl-bouton:focus-visible {
	border-color: var(--wp--preset--color--creme);
	background: var(--wp--preset--color--creme);
	color: var(--wp--preset--color--ardoise);
}

/* Fond crème, texte ardoise. */
.mdl-bouton--clair {
	border-color: var(--wp--preset--color--creme);
	background: var(--wp--preset--color--creme);
	color: var(--wp--preset--color--ardoise);
}

.mdl-bouton--clair:hover,
.mdl-bouton--clair:focus-visible {
	border-color: var(--wp--preset--color--ardoise);
	background: var(--wp--preset--color--ardoise);
	color: var(--wp--preset--color--creme);
}

/* Contour crème, sur fond ardoise. */
.mdl-bouton--contour {
	border-color: var(--wp--preset--color--creme);
	background: transparent;
	color: var(--wp--preset--color--creme);
}

.mdl-bouton--contour:hover,
.mdl-bouton--contour:focus-visible {
	background: var(--wp--preset--color--creme);
	color: var(--wp--preset--color--ardoise);
}

:where(.mdl-bouton, .mdl-entete a, .mdl-entete button, .mdl-menu a, .mdl-menu button, .mdl-pied a, .mdl-fenetre a, .mdl-fenetre button):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* ------------------------------------------------------------------ */
/* Textes communs aux sections                                         */
/* ------------------------------------------------------------------ */

/* Sans poids (:where) : la feuille d'une section passe toujours devant. */

:where(.mdl-surtitre) {
	margin: 0;
	font-size: var(--wp--preset--font-size--normal);
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

:where(.mdl-titre) {
	margin: 0;
	font-family: var(--wp--preset--font-family--titres);
	font-size: var(--wp--preset--font-size--titre);
	font-weight: 600;
	line-height: 1;
	text-wrap: balance;
}

/* Texte enrichi : paragraphes séparés par une ligne. */
:where(.mdl-texte) > * {
	margin: 0;
}

:where(.mdl-texte) > * + * {
	margin-top: 1.15em;
}

.mdl-texte strong {
	font-weight: 700;
}

/* ------------------------------------------------------------------ */
/* Pages sans section                                                  */
/* ------------------------------------------------------------------ */

/* Liste d'articles : la même colonne de lecture que la page de texte (mentions
   légales). La page introuvable a sa propre feuille (introuvable.css). */
.mdl-page-simple {
	padding: var(--wp--preset--spacing--60) var(--wp--style--root--padding-left, 1.25rem) var(--wp--preset--spacing--80);
	line-height: 1.4;
}

.mdl-page-simple > * {
	max-width: 50rem;
	margin: 0 auto;
}

.mdl-page-simple > * + * {
	margin-top: 0.75rem;
}

.mdl-page-simple h1 {
	margin-bottom: var(--wp--preset--spacing--40);
	font-size: var(--wp--preset--font-size--titre);
	text-wrap: balance;
}

/* ------------------------------------------------------------------ */
/* En-tête                                                             */
/* ------------------------------------------------------------------ */

.mdl-picto {
	display: block;
	flex: none;
	width: 24px;
	height: 24px;
}

/* La boîte que les modèles posent autour de l'en-tête : c'est elle qui reste en haut de
   l'écran. L'en-tête seul ne bougerait pas, il n'a pas de place pour glisser dans sa boîte. */
.mdl-entete-cadre {
	position: sticky;
	top: 0;
	z-index: 10;
}

/* Sous 601 px, la barre d'administration de WordPress part avec la page. */
@media (min-width: 601px) {
	.mdl-entete-cadre {
		top: var(--wp-admin--admin-bar--height, 0px);
	}
}

.mdl-entete {
	background: var(--wp--preset--color--ardoise);
	color: var(--wp--preset--color--creme);
}

.mdl-entete__barre {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 1rem;
	box-sizing: border-box;
	min-height: var(--mdl-entete-hauteur);
	padding-inline: var(--wp--style--root--padding-left, 1.25rem);
}

.mdl-entete__menu {
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	justify-self: start;
	padding: 0.5rem 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.mdl-entete__menu .mdl-picto {
	width: 26px;
}

.mdl-entete__logo,
.mdl-menu__logo,
.mdl-pied__logo {
	display: block;
	color: inherit;
}

.mdl-logo {
	display: block;
	width: 100%;
	height: auto;
}

.mdl-entete__logo {
	width: clamp(183px, 26.4vw, 380px);
}

.mdl-entete__contact {
	justify-self: end;
	min-width: 200px;
	font-weight: 500;
}

@media (max-width: 781px) {
	.mdl-entete__menu-texte,
	.mdl-entete__contact {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip-path: inset(50%);
		white-space: nowrap;
	}
}

/* ------------------------------------------------------------------ */
/* Menu : volet à gauche                                               */
/* ------------------------------------------------------------------ */

.mdl-menu {
	position: fixed;
	inset: 0 auto 0 0;
	box-sizing: border-box;
	width: min(493px, 100%);
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--wp--preset--color--ardoise);
	color: var(--wp--preset--color--creme);
	flex-direction: column;
	overflow-y: auto;
	translate: -100% 0;
	transition: translate 0.3s ease, display 0.3s allow-discrete, overlay 0.3s allow-discrete;
}

.mdl-menu:popover-open {
	display: flex;
	translate: 0 0;
}

@starting-style {
	.mdl-menu:popover-open {
		translate: -100% 0;
	}
}

.mdl-menu::backdrop {
	background: rgb(43 45 66 / 0.55);
}

body:has(.mdl-menu:popover-open) {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.mdl-menu {
		transition: none;
	}
}

.mdl-menu__haut {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	position: relative;
	min-height: var(--mdl-entete-hauteur);
	padding-inline: 4rem;
	border-bottom: 1px solid var(--wp--custom--trait);
}

.mdl-menu__logo {
	width: 222px;
}

.mdl-menu__fermer {
	position: absolute;
	right: 1rem;
	top: 50%;
	translate: 0 -50%;
	padding: 0.5rem;
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
}

.mdl-menu__liens {
	flex: 1 0 auto;
	margin: 0;
	padding: 3.5rem 1.25rem;
	list-style: none;
	text-align: center;
}

.mdl-menu__liens a {
	display: inline-block;
	padding: 0.6rem 0;
	color: inherit;
	font-family: var(--wp--preset--font-family--titres);
	font-size: clamp(1.375rem, 2vw, 1.75rem);
	line-height: 1.1;
	text-decoration: none;
}

.mdl-menu__liens a:hover {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
}

.mdl-menu__boutons {
	display: flex;
	flex: none;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: center;
	padding: 1.875rem 1.25rem;
	border-top: 1px solid var(--wp--custom--trait);
}

.mdl-menu__boutons .mdl-bouton {
	flex: 1 1 10rem;
	max-width: 200px;
	padding-inline: 1rem;
	white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Pied de page                                                        */
/* ------------------------------------------------------------------ */

.mdl-pied {
	padding: 0 var(--wp--style--root--padding-left, 1.25rem) 1.5rem;
	background: var(--wp--preset--color--ardoise);
	color: var(--wp--preset--color--creme);
}

.mdl-pied__grille {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2.5rem;
	max-width: var(--wp--style--global--wide-size, 1280px);
	margin-inline: auto;
	padding-top: 3.5rem;
	border-top: 1px solid var(--wp--custom--trait);
	text-align: center;
}

.mdl-pied p,
.mdl-pied__liste {
	margin: 0;
	padding: 0;
	line-height: 1.5;
	list-style: none;
}

.mdl-pied a {
	color: inherit;
	text-underline-offset: 0.15em;
}

.mdl-pied__discret {
	text-decoration: none;
}

.mdl-pied__discret:hover {
	text-decoration: underline;
}

.mdl-pied__logo {
	width: 307px;
	max-width: 100%;
	margin: 0 auto 1.25rem;
}

.mdl-pied__titre {
	margin-bottom: 0.9rem !important;
	font-family: var(--wp--preset--font-family--titres);
	font-size: var(--wp--preset--font-size--grand);
	font-weight: 600;
	line-height: 1;
}

.mdl-pied__reseaux {
	display: flex;
	justify-content: center;
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.mdl-pied__reseaux .mdl-picto {
	width: 28px;
	height: 28px;
}

/* La signature de l'agence : petite, atténuée, tout en bas. */
.mdl-pied .mdl-pied__credit {
	max-width: var(--wp--style--global--wide-size, 1280px);
	margin: 3.5rem auto 0;
	font-size: var(--wp--preset--font-size--petit);
	text-align: center;
	opacity: 0.7;
}

/* Trois colonnes sous la marque : à côté du logo, les coordonnées se couperaient. */
@media (min-width: 782px) {
	.mdl-pied__grille {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 2rem;
		text-align: left;
	}

	.mdl-pied__bloc--marque {
		grid-column: 1 / -1;
	}

	.mdl-pied__logo {
		margin-inline: 0;
	}

	.mdl-pied__reseaux {
		justify-content: flex-start;
	}

	.mdl-pied .mdl-pied__credit {
		text-align: right;
	}
}

@media (min-width: 1000px) {
	.mdl-pied__grille {
		grid-template-columns: 435fr 325fr 325fr 195fr;
	}

	.mdl-pied__bloc--marque {
		grid-column: auto;
	}
}

/* ------------------------------------------------------------------ */
/* Fenêtre de contact                                                  */
/* ------------------------------------------------------------------ */

/* La page ne défile plus sous la fenêtre, sans bouger d'un pixel. */
html:has(.mdl-fenetre[open]) {
	overflow: hidden;
	scrollbar-gutter: stable;
}

.mdl-fenetre {
	box-sizing: border-box;
	width: min(848px, 100% - 2.5rem);
	max-width: none;
	max-height: calc(100dvh - 2.5rem);
	margin: auto;
	padding: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	border: 0;
	background: var(--wp--preset--color--creme);
	color: var(--wp--preset--color--ardoise);
}

.mdl-fenetre::backdrop {
	background: var(--wp--custom--voile-fenetre);
}

/* Sans script, le lien vers la fenêtre l'affiche quand même. */
.mdl-fenetre:target:not(.est-pret) {
	display: block;
	position: fixed;
	inset: 0;
	z-index: 100;
	height: fit-content;
}

.mdl-fenetre__cadre {
	position: relative;
	padding: 3rem 1.25rem 2.5rem;
}

.mdl-fenetre__fermer {
	position: absolute;
	top: 0.9rem;
	right: 0.9rem;
	padding: 0.5rem;
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
}

.mdl-fenetre__fermer .mdl-picto {
	width: 18px;
	height: 18px;
}

.mdl-fenetre__titre {
	margin: 0 0 1.625rem;
	color: inherit;
	font-size: var(--wp--preset--font-size--citation);
	font-weight: 600;
	line-height: 1;
	text-align: center;
}

.mdl-fenetre__merci {
	margin: 0 0 1rem;
	line-height: 1.3;
	text-align: center;
}

.mdl-formulaire {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.25rem;
}

.mdl-formulaire[hidden] {
	display: none;
}

.mdl-formulaire p {
	margin: 0;
}

.mdl-formulaire .mdl-formulaire__intro {
	grid-column: 1 / -1;
	margin-bottom: 0.8125rem;
	line-height: 1.15;
	text-align: center;
}

.mdl-formulaire__champ input,
.mdl-formulaire__champ textarea {
	display: block;
	box-sizing: border-box;
	width: 100%;
	min-height: 45px;
	padding: 0.6875rem;
	border: 1px solid var(--wp--preset--color--ardoise);
	border-radius: 0;
	background: transparent;
	color: inherit;
	font-family: var(--wp--preset--font-family--texte);
	font-size: var(--wp--preset--font-size--normal);
	font-weight: 500;
	line-height: 1.15;
}

.mdl-formulaire__champ textarea {
	height: 158px;
	resize: vertical;
}

.mdl-formulaire ::placeholder {
	color: inherit;
	opacity: 0.5;
}

.mdl-formulaire__champ input:focus-visible,
.mdl-formulaire__champ textarea:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 1px;
}

.mdl-formulaire__erreur {
	grid-column: 1 / -1;
	line-height: 1.3;
	text-align: center;
}

.mdl-formulaire__erreur[hidden] {
	display: none;
}

.mdl-formulaire .mdl-bouton {
	grid-column: 1 / -1;
	justify-self: center;
	min-width: 229px;
	margin-top: 0.875rem;
}

/* Sur le fond crème, le survol garde son contour. */
.mdl-formulaire .mdl-bouton:hover,
.mdl-formulaire .mdl-bouton:focus-visible {
	border-color: var(--wp--preset--color--ardoise);
}

@media (min-width: 600px) {
	.mdl-formulaire {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.mdl-formulaire__champ--large {
		grid-column: 1 / -1;
	}
}

@media (min-width: 782px) {
	.mdl-fenetre__cadre {
		padding: 3.125rem clamp(2rem, 8vw, 6.8125rem) 4.25rem;
	}

	.mdl-fenetre__fermer {
		top: 0.9375rem;
		right: 0.9375rem;
	}
}
