/* Modèles de page à présenter au client (pages /modeles/…, aperçu seulement).
   Chargé uniquement sur ces pages. Préfixes : m- commun, m1- à m5- par modèle, modeles- pour la page de choix. */

/* ---------- Commun ---------- */

.page-modele .contenu { padding-bottom: 0; }
.page-modele .contenu > .wp-block-post-content > .m-section { margin-block: 0; }
.page-modele .contenu > .wp-block-post-content > :first-child { margin-top: 0; }

.m-cadre {
	box-sizing: border-box;
	max-width: calc(76rem + var(--wp--style--root--padding-left) + var(--wp--style--root--padding-right));
	margin-inline: auto;
	padding-inline: var(--wp--style--root--padding-left) var(--wp--style--root--padding-right);
}
.m-section img { display: block; max-width: 100%; height: auto; }
.m-section h1, .m-section h2, .m-section h3 { margin-top: 0; text-wrap: balance; }

.m-boutons { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.75rem 0 0; }
.m-bouton {
	display: inline-block;
	padding: 0.8rem 1.4rem;
	border: 2px solid var(--rouge);
	border-radius: 4px;
	background: var(--rouge);
	color: #fff;
	font-weight: 700;
	text-decoration: none;
	line-height: 1.3;
}
.m-bouton:hover { background: var(--rouge-fonce); border-color: var(--rouge-fonce); color: #fff; }
.m-bouton-contour { background: transparent; color: var(--rouge-fonce); }
.m-bouton-contour:hover { color: #fff; }
.m-bouton-clair { background: transparent; border-color: #fff; color: #fff; }
.m-bouton-clair:hover { background: #fff; border-color: #fff; color: #000; }
.m-bouton-blanc { background: #fff; border-color: #fff; color: #000; }
.m-bouton-blanc:hover { background: #000; border-color: #000; color: #fff; }
.m-bouton-noir { background: #000; border-color: #000; color: #fff; }
.m-bouton-noir:hover { background: #fff; border-color: #fff; color: #000; }
.m-bouton-blanc-contour { background: transparent; border-color: #fff; color: #fff; }
.m-bouton-blanc-contour:hover { background: #fff; color: var(--rouge-fonce); }

/* Barre de navigation entre modèles, fixée en bas de l'écran. */
.contenu .modele-nav {
	max-width: none;
	margin: 0 !important;
	position: fixed;
	z-index: 100;
	inset: auto 0 0 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.25rem 1.5rem;
	padding: 0.6rem var(--wp--style--root--padding-left);
	background: #000;
	color: #fff;
	font-size: var(--wp--preset--font-size--petit);
	border-top: 3px solid var(--rouge);
}
.modele-nav p { margin: 0; }
.modele-nav-liens { display: flex; gap: 1.25rem; }
.modele-nav a { color: #fff; font-weight: 700; }
.page-modele .wp-site-blocks { padding-bottom: 3.5rem; }

/* ---------- Page de choix ---------- */

.modeles-liste {
	list-style: none;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
	gap: 2.5rem 2rem;
	counter-reset: modele;
}
.modeles-liste li { counter-increment: modele; }
@media (min-width: 1100px) { .modeles-liste { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2.5rem 1.5rem; } }
.modeles-vignette { display: block; border: 1px solid var(--carrelage); overflow: hidden; }
.modeles-vignette img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; }
.modeles-liste h2 { font-size: var(--wp--preset--font-size--grand); margin: 1rem 0 0.4rem; }
.modeles-liste h2::before { content: counter(modele) ". "; color: var(--rouge); }
.modeles-liste h2 a { color: #000; text-decoration: none; }
.modeles-liste li:hover h2 a, .modeles-liste h2 a:focus-visible { color: var(--rouge-fonce); text-decoration: underline; }
.modeles-liste p { margin: 0; color: var(--ardoise); }
.modeles-actuel { margin-top: var(--wp--preset--spacing--50); }

/* ---------- 1. Plein cadre : la photo d'abord, bord à bord ---------- */

.m1-heros { position: relative; display: grid; min-height: min(86vh, 52rem); color: #fff; }
.m1-heros > * { grid-area: 1 / 1; }
.m1-heros-photo { width: 100%; height: 100% !important; object-fit: cover; object-position: 30% 30%; }
.m1-heros::after {
	content: "";
	grid-area: 1 / 1;
	background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.55) 45%, rgba(0, 0, 0, 0) 75%);
}
.m1-heros-texte { position: relative; z-index: 1; align-self: end; width: 100%; padding-block: 3rem; }
.m1-heros h1 { max-width: 13em; color: #fff; }
.m1-chapo { max-width: 34em; font-size: var(--wp--preset--font-size--grand); line-height: 1.4; margin: 0; }

.m1-faits { background: var(--rouge); color: #fff; }
.m1-faits ul { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; margin-block: 0; }
.m1-faits li { padding: 1.5rem 1.5rem 1.5rem 0; }
.m1-faits li + li { padding-left: 1.5rem; border-left: 1px solid rgba(255, 255, 255, 0.45); }
.m1-faits strong { display: block; font-family: var(--wp--preset--font-family--titres); font-size: var(--wp--preset--font-size--grand); line-height: 1.15; }
.m1-faits span { display: block; margin-top: 0.3rem; }

.m1-mission { padding-block: var(--section); }
.m1-mission p {
	margin-block: 0;
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 700;
	font-size: clamp(1.6rem, 3.4vw, 2.6rem);
	line-height: 1.2;
	max-width: 30em;
}

.m1-rangee { display: grid; grid-template-columns: 1fr 1fr; }
.m1-rangee-photo { width: 100%; height: auto; aspect-ratio: 5 / 4; object-fit: cover; object-position: center 35%; }
.m1-rangee-texte { align-self: center; max-width: 34rem; padding: 3rem clamp(1.5rem, 5vw, 4.5rem); }
.m1-rangee-inverse { background: var(--carrelage); }
.m1-rangee-inverse .m1-rangee-photo { order: 2; }
.m1-rangee-texte p:last-child { margin-bottom: 0; }

.m1-appel { background: #000; color: #fff; padding-block: var(--section); }
.m1-appel p:first-child {
	margin-top: 0;
	max-width: 28em;
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 700;
	font-size: clamp(1.5rem, 3vw, 2.2rem);
	line-height: 1.2;
}

@media (max-width: 781px) {
	.m1-faits ul { grid-template-columns: 1fr; }
	.m1-faits li, .m1-faits li + li { padding: 1rem 0; border-left: 0; }
	.m1-faits li + li { border-top: 1px solid rgba(255, 255, 255, 0.45); }
	.m1-rangee { grid-template-columns: 1fr; }
	.m1-rangee-photo { aspect-ratio: 4 / 3; }
	.m1-rangee-inverse .m1-rangee-photo { order: 0; }
	.m1-rangee-texte { padding-inline: var(--wp--style--root--padding-left); }
}

/* ---------- 2. Éditorial : la typographie mène ---------- */

.m2-titre { padding-block: var(--section) 2.5rem; }
.m2-titre h1 {
	font-size: clamp(2.8rem, 8.5vw, 7rem);
	line-height: 0.95;
	letter-spacing: -0.02em;
	max-width: 11em;
	margin-bottom: 2rem;
}
.m2-chapo {
	max-width: 32em;
	margin: 0 0 0 auto;
	font-size: var(--wp--preset--font-size--grand);
	line-height: 1.45;
	color: var(--ardoise);
	border-top: 4px solid var(--rouge);
	padding-top: 1rem;
}
.m2-une img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; object-position: center 35%; }
.m2-une figcaption, .m2-figure-debord figcaption { font-size: var(--wp--preset--font-size--petit); color: var(--ardoise); padding-top: 0.6rem; }

.m2-corps { padding-block: var(--section); }
.m2-grille { display: grid; grid-template-columns: 15rem minmax(0, 40rem); gap: clamp(2rem, 6vw, 6rem); }
.m2-marge { font-size: var(--wp--preset--font-size--petit); }
.m2-marge > * { position: sticky; top: 1.5rem; }
.m2-marge nav { border-top: 2px solid #000; padding-top: 0.75rem; }
.m2-marge-titre { font-weight: 700; margin: 0 0 0.5rem; }
.m2-marge ol { margin: 0; padding-left: 1.2em; }
.m2-marge li { margin-bottom: 0.35rem; }
.m2-marge a { color: #000; }
.m2-marge-contact { position: sticky; top: 13rem; margin-top: 2rem; padding: 1.25rem; background: var(--carrelage); }
.m2-marge-contact p { margin: 0 0 0.75rem; }
.m2-marge-contact p:last-child { margin: 0; }
.m2-marge-contact a:not(.m-bouton) { color: #000; font-weight: 700; }

.m2-texte { font-size: 1.25rem; line-height: 1.65; }
.m2-texte > :first-child { margin-top: 0; }
.m2-lettrine { font-size: 1.45rem; line-height: 1.5; }
.m2-lettrine::first-letter {
	float: left;
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 700;
	font-size: 4.6em;
	line-height: 0.8;
	margin: 0.08em 0.12em 0 0;
	color: var(--rouge);
}
.m2-texte h2 { clear: both; margin-top: 3rem; font-size: clamp(1.7rem, 3vw, 2.1rem); }
.m2-texte ul { list-style: square; }
.m2-texte li::marker { color: var(--rouge); }
.m2-citation { margin: 3rem 0; padding: 0; border: 0; }
.m2-citation p {
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 700;
	font-size: clamp(1.8rem, 3.6vw, 2.6rem);
	line-height: 1.15;
	margin: 0;
	padding-left: 1.25rem;
	border-left: 6px solid var(--rouge);
}
.m2-figure-debord { float: right; width: min(26rem, 60%); margin: 0.4rem -8rem 1.25rem 2rem; }
.m2-figure-debord img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; }

.m2-fin { border-top: 2px solid #000; padding-block: var(--section); }
.m2-fin p:first-child {
	margin-top: 0;
	max-width: 26em;
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 700;
	font-size: clamp(1.5rem, 3vw, 2.2rem);
	line-height: 1.2;
}

@media (max-width: 1100px) { .m2-figure-debord { margin-right: 0; } }
@media (max-width: 860px) {
	.m2-grille { grid-template-columns: 1fr; }
	.m2-marge > * { position: static; }
	.m2-marge { order: 2; }
	.m2-chapo { margin-left: 0; }
}
@media (max-width: 560px) { .m2-figure-debord { float: none; width: 100%; margin: 1.5rem 0; } }

/* ---------- 3. Carrelage : la page posée sur un sol carrelé ---------- */

.m3-sol { --c: 4.5rem; background: var(--carreaux); padding-block: var(--c) calc(var(--c) * 2); }
.m3-sol .m-cadre { background-position: 0 0; }
.m3-grille {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	grid-auto-rows: minmax(var(--c), auto);
	gap: 6px;
}
.m3-carreau { background: #fff; padding: clamp(1.25rem, 2.5vw, 2rem); box-sizing: border-box; }
.m3-titre { grid-column: span 3; grid-row: span 2; display: flex; flex-direction: column; justify-content: center; }
.m3-titre h1 { font-size: clamp(2.4rem, 5.5vw, 4.25rem); }
.m3-chapo { font-size: var(--wp--preset--font-size--grand); line-height: 1.4; color: var(--ardoise); max-width: 32em; margin-bottom: 0; }
.m3-photo { position: relative; padding: 0; overflow: hidden; aspect-ratio: 1; }
.m3-photo img { position: absolute; inset: 0; width: 100%; height: 100% !important; object-fit: cover; }
.m3-photo-haute { grid-row: span 2; aspect-ratio: auto; }
.m3-photo-large { grid-column: span 3; aspect-ratio: 2 / 1; }
.m3-photo-large img { object-position: center 30%; }
.m3-photo-appel { aspect-ratio: auto; }
.m3-mission { background: var(--rouge); color: #fff; display: flex; align-items: center; }
.m3-mission p {
	margin: 0;
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 700;
	font-size: clamp(1.2rem, 1.9vw, 1.5rem);
	line-height: 1.25;
}
.m3-intertitre {
	grid-column: 1 / -1;
	margin: calc(var(--c) * 0.75) 0 0.25rem;
	padding: 0.4rem 0.9rem;
	justify-self: start;
	background: #000;
	color: #fff;
	font-size: clamp(1.5rem, 2.6vw, 2rem);
}
.m3-atout { position: relative; aspect-ratio: 1; display: flex; flex-direction: column; justify-content: flex-end; }
.m3-atout::before { content: ""; position: absolute; top: 0; left: 0; width: 1.25rem; height: 1.25rem; background: var(--rouge); }
.m3-atout h3 { margin-bottom: 0.4rem; }
.m3-atout p { margin: 0; color: var(--ardoise); }
.m3-etapes { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; list-style: none; margin: 0; padding: 0; counter-reset: m3; }
.m3-etapes li { counter-increment: m3; }
.m3-etapes li::before { content: counter(m3); display: block; font-family: var(--wp--preset--font-family--titres); font-weight: 700; font-size: 3rem; line-height: 1; color: var(--rouge); margin-bottom: 0.75rem; }
.m3-etapes h3 { margin-bottom: 0.3rem; }
.m3-etapes p { margin: 0; color: var(--ardoise); }
.m3-appel { grid-column: span 3; margin-top: calc(var(--c) * 0.75); background: #000; color: #fff; display: flex; flex-direction: column; justify-content: center; }
.m3-appel p:first-child { margin: 0; font-family: var(--wp--preset--font-family--titres); font-weight: 700; font-size: clamp(1.4rem, 2.6vw, 2rem); line-height: 1.2; max-width: 24em; }
.m3-photo-appel { margin-top: calc(var(--c) * 0.75); }

@media (max-width: 900px) {
	.m3-grille, .m3-etapes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.m3-titre, .m3-photo-large, .m3-appel { grid-column: 1 / -1; }
	.m3-titre { grid-row: auto; }
	.m3-photo-haute { grid-row: span 1; aspect-ratio: 1; }
	.m3-mission { grid-column: span 1; }
	.m3-photo-appel { display: none; }
}
@media (max-width: 520px) {
	.m3-atout { aspect-ratio: auto; min-height: 11rem; }
	.m3-mission, .m3-photo-haute { grid-column: 1 / -1; }
}

/* ---------- 4. Fiche pratique : l'essentiel d'un coup d'œil ---------- */

.m4-heros { padding-block: var(--wp--preset--spacing--50) var(--section); border-bottom: 1px solid var(--carrelage); }
.m4-heros-grille { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.m4-heros h1 { font-size: clamp(2.4rem, 5vw, 3.75rem); }
.m4-chapo { font-size: var(--wp--preset--font-size--grand); line-height: 1.45; color: var(--ardoise); max-width: 34em; }
.m4-heros-photo { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; margin-top: 2rem; border-radius: 4px; }
.m4-bref { position: sticky; top: 1.5rem; padding: 1.75rem; background: #000; color: #fff; border-top: 6px solid var(--rouge); }
.m4-bref h2 { font-size: var(--wp--preset--font-size--grand); margin-bottom: 1rem; }
.m4-bref dl { margin: 0 0 1.5rem; }
.m4-bref dl > div { padding-block: 0.7rem; border-top: 1px solid rgba(255, 255, 255, 0.25); }
.m4-bref dt { font-weight: 700; color: #fff; }
.m4-bref dd { margin: 0.1rem 0 0; color: #d9dde1; }
.m4-bref p { margin: 0; }
.m4-bref .m-bouton { display: block; text-align: center; }
.m4-bref-tel { margin-top: 1rem !important; font-size: var(--wp--preset--font-size--petit); }
.m4-bref-tel a { color: #fff; font-weight: 700; }

.m4-bloc { padding-block: var(--section); }
.m4-bloc-gris { background: var(--carrelage); }
.m4-intro { color: var(--ardoise); max-width: 40em; }
.m4-liste { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 3rem; margin: 2rem 0 0; }
.m4-liste > div { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 1rem; padding-block: 1rem; border-top: 2px solid #000; }
.m4-liste dt { font-weight: 700; display: flex; align-items: baseline; gap: 0.6rem; }
.m4-liste dt::before { content: ""; flex: none; width: 0.7rem; height: 0.7rem; background: var(--rouge); }
.m4-liste dd { margin: 0; color: var(--ardoise); }

.m4-etapes { list-style: none; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.5rem; counter-reset: m4; }
.m4-etapes li { counter-increment: m4; position: relative; padding-top: 3.25rem; }
.m4-etapes li::before {
	content: counter(m4);
	position: absolute; top: 0; left: 0;
	width: 2.4rem; height: 2.4rem;
	display: grid; place-items: center;
	background: var(--rouge); color: #fff;
	font-weight: 700; border-radius: 50%;
}
.m4-etapes li:not(:last-child)::after { content: ""; position: absolute; top: 1.2rem; left: 3rem; right: -1.5rem; border-top: 2px dashed var(--ardoise); }
.m4-etapes h3 { margin-bottom: 0.3rem; }
.m4-etapes p { margin: 0; color: var(--ardoise); }

.m4-questions > * { max-width: 48rem; }
.m4-questions details { border-top: 2px solid #000; }
.m4-questions details:last-of-type { border-bottom: 2px solid #000; }
.m4-questions summary { cursor: pointer; padding: 1rem 2.5rem 1rem 0; font-weight: 700; font-size: 1.2rem; list-style: none; position: relative; }
.m4-questions summary::-webkit-details-marker { display: none; }
.m4-questions summary::after { content: "+"; position: absolute; right: 0.25rem; top: 0.7rem; font-size: 1.6rem; line-height: 1; color: var(--rouge); }
.m4-questions details[open] summary::after { content: "−"; }
.m4-questions details p { margin: 0 0 1.25rem; color: var(--ardoise); max-width: 40em; }

.m4-appel { background: #000; color: #fff; padding-block: var(--section); }
.m4-appel p:first-child { margin-top: 0; max-width: 28em; font-family: var(--wp--preset--font-family--titres); font-weight: 700; font-size: clamp(1.5rem, 3vw, 2.2rem); line-height: 1.2; }
.m4-appel .m-bouton-contour { color: #fff; border-color: #fff; }
.m4-appel .m-bouton-contour:hover { background: #fff; color: #000; }

@media (max-width: 900px) {
	.m4-heros-grille { grid-template-columns: 1fr; }
	.m4-bref { position: static; }
	.m4-liste { grid-template-columns: 1fr; }
	.m4-etapes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.m4-etapes li::after { display: none; }
}
@media (max-width: 520px) {
	.m4-etapes { grid-template-columns: 1fr; }
	.m4-liste > div { grid-template-columns: 1fr; gap: 0.2rem; }
}

/* ---------- 5. Aplat rouge : une affiche ---------- */

.m5-heros { background: var(--rouge); color: #fff; padding-block: var(--section) calc(var(--section) + 8rem); }
.m5-heros-grille { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 2rem 4rem; align-items: end; }
.m5-heros h1 {
	margin: 0;
	color: #fff;
	font-size: clamp(3rem, 9vw, 7.5rem);
	line-height: 0.9;
	letter-spacing: -0.025em;
}
.m5-chapo { margin: 0; font-size: var(--wp--preset--font-size--grand); line-height: 1.4; }
.m5-photo { margin-top: -8rem !important; }
.m5-photo img { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; object-position: center 30%; border-radius: 0; }

.m5-mission { padding-block: var(--section) 0; }
.m5-mission p {
	margin: 0;
	max-width: 22em;
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 700;
	font-size: clamp(1.8rem, 4.2vw, 3.2rem);
	line-height: 1.1;
}

.m5-atouts { padding-block: var(--section) 0; }
.m5-atouts h2, .m5-etapes h2 { border-top: 8px solid #000; padding-top: 1rem; }
.m5-atouts ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 3rem; }
.m5-atouts li { padding-block: 1.25rem; border-bottom: 2px solid #000; font-size: 1.25rem; }
.m5-atouts strong { color: var(--rouge-fonce); }

.m5-etapes { padding-block: var(--section) 0; }
.m5-etapes ol { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2rem; counter-reset: m5; }
.m5-etapes li { counter-increment: m5; }
.m5-etapes li::before {
	content: counter(m5);
	display: block;
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 700;
	font-size: clamp(5rem, 10vw, 8rem);
	line-height: 0.85;
	color: var(--rouge);
	margin-bottom: 0.5rem;
}
.m5-etapes h3 { margin-bottom: 0.3rem; }
.m5-etapes p { margin: 0; color: var(--ardoise); }

.m5-duo { padding-block: var(--section); }
.m5-duo-grille { display: grid; grid-template-columns: 2fr 1fr; gap: 6px; height: clamp(18rem, 34vw, 30rem); }
.m5-duo img { width: 100%; height: 100% !important; min-height: 0; object-fit: cover; }

.m5-appel { background: var(--rouge); color: #fff; padding-block: var(--section); }
.m5-appel p:first-child { margin-top: 0; max-width: 18em; font-family: var(--wp--preset--font-family--titres); font-weight: 700; font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.1; }

@media (max-width: 900px) {
	.m5-heros-grille { grid-template-columns: 1fr; }
	.m5-atouts ul { grid-template-columns: 1fr; }
	.m5-etapes ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
	.m5-heros { padding-bottom: calc(var(--section) + 4rem); }
	.m5-photo { margin-top: -4rem !important; }
	.m5-etapes ol, .m5-duo-grille { grid-template-columns: 1fr; }
	.m5-duo-grille { height: auto; }
	.m5-duo img { aspect-ratio: 3 / 2; }
}
