/* Alafia Sénégal — compléments à theme.json.
   Couleurs et polices : variables --wp--preset--* générées depuis theme.json. */

:root {
	/* Motif signature : un carrelage gris clair aux joints blancs, en fond des en-têtes de page. */
	--carreaux:
		linear-gradient(to right, rgba(255, 255, 255, 0.85) 2px, transparent 2px) 0 0 / 4.5rem 4.5rem,
		linear-gradient(to bottom, rgba(255, 255, 255, 0.85) 2px, transparent 2px) 0 0 / 4.5rem 4.5rem,
		var(--wp--preset--color--carrelage);
	--rouge: var(--wp--preset--color--rouge);
	--rouge-fonce: var(--wp--preset--color--rouge-fonce);
	--ardoise: var(--wp--preset--color--ardoise);
	--carrelage: var(--wp--preset--color--carrelage);
	--section: var(--wp--preset--spacing--60);
}

/* ---------- Accessibilité ---------- */

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

:where(a, button, input, select, textarea, summary, .wp-element-button):focus-visible {
	outline: 3px solid var(--rouge-fonce);
	outline-offset: 2px;
}

/* ---------- Barre haute ---------- */

.barre-haute { padding-block: 0.35rem; }
.barre-haute p { margin: 0; text-align: right; }
.barre-haute a { color: inherit; font-weight: 700; text-decoration: none; }
.barre-haute a:hover { text-decoration: underline; }
.barre-haute .sep { display: inline-block; width: 1.75rem; }

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

.entete { padding-block: 0.9rem; border-bottom: 1px solid var(--carrelage); }
.entete-ligne { gap: 1.5rem; }
.entete .wp-block-site-logo img { height: auto; }
.nav-principale { font-weight: 700; font-size: 1.0625rem; gap: 1.4rem; margin-left: auto; }
.nav-principale a { text-decoration: none; }
.nav-principale a:hover,
.nav-principale .current-menu-item > a { color: var(--rouge-fonce); text-decoration: underline; text-underline-offset: 0.3em; }
.nav-principale .wp-block-navigation__submenu-container {
	border: 1px solid var(--carrelage) !important;
	padding-block: 0.5rem;
	min-width: 19rem !important;
	font-weight: 400;
}
.nav-principale .wp-block-navigation__submenu-container a { padding: 0.45rem 1rem !important; }
.entete-devis .wp-block-button__link { white-space: nowrap; }

@media (max-width: 1100px) {
	.entete .entete-devis { display: none; }
}
@media (max-width: 599px) {
	.barre-haute p { text-align: center; }
	.entete .wp-block-site-logo { max-width: 190px; }
}

/* ---------- Contenu ---------- */

.contenu { padding-bottom: var(--section); }

.chapo {
	font-size: var(--wp--preset--font-size--grand);
	line-height: 1.45;
	color: var(--ardoise);
	max-width: 36em;
}

body { overflow-x: clip; }
.wp-site-blocks > .contenu { margin-block-start: 0; }

/* En-tête de page sur le carrelage, en pleine largeur ; la grande photo qui suit le chevauche. */
.en-tete-page,
.article-entete {
	position: relative;
	isolation: isolate;
	padding-block: var(--wp--preset--spacing--50);
	margin-top: 0 !important;
	margin-bottom: var(--wp--preset--spacing--50);
}
.en-tete-page::before,
.article-entete::before {
	content: "";
	position: absolute;
	z-index: -1;
	inset: 0 calc(50% - 50vw);
	background: var(--carreaux);
	border-bottom: 4px solid var(--rouge);
}
.en-tete-page h1 { max-width: 16em; margin-top: 0; }
.en-tete-page .chapo { margin-bottom: 0; }
.en-tete-page .wp-block-buttons { margin-top: 1.5rem; }
/* Avec une grande photo juste après : le carrelage descend derrière son premier tiers. */
.en-tete-page:has(+ .wp-block-image.alignwide) { padding-bottom: 0; margin-bottom: 0; }
.en-tete-page:has(+ .wp-block-image.alignwide)::before { bottom: -7rem; border-bottom: 0; }
.en-tete-page + .wp-block-image.alignwide { position: relative; z-index: 1; margin-top: var(--wp--preset--spacing--40); margin-bottom: var(--wp--preset--spacing--50); }
.article-entete::before { border-bottom: 0; }
.article-entete + .wp-block-post-featured-image { position: relative; z-index: 1; margin-top: calc(-1 * var(--wp--preset--spacing--40)); }

/* Listes du contenu : puces carrées rouges, comme des carreaux. */
.contenu ul.wp-block-list:not(.references-noms) { list-style-type: square; }
.contenu ul.wp-block-list:not(.references-noms) > li::marker { color: var(--rouge); font-size: 1.15em; }

.contenu h2 { margin-top: var(--wp--preset--spacing--50); }
.contenu .colonnes-texte { gap: 2rem; margin-block: var(--wp--preset--spacing--50); }
.colonnes-texte .wp-block-image { margin: 0; }
.colonnes-texte .wp-block-image img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
.contenu .wp-block-columns h2:first-child,
.contenu .wp-block-columns h3:first-child { margin-top: 0; }

.wp-block-image.alignwide img,
.heros-photo img { width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.heros-photo img { aspect-ratio: 4 / 3; }

/* Encadré d'appel à l'action : la fin de chaque page, en noir. */
.appel {
	margin-top: var(--wp--preset--spacing--50);
	padding: 2rem 2.25rem;
	border-left: 6px solid var(--rouge);
}
.appel.has-background { background: var(--wp--preset--color--noir) !important; color: #fff; }
.appel p {
	font-family: var(--wp--preset--font-family--titres);
	font-size: clamp(1.4rem, 2.6vw, 1.75rem);
	font-weight: 700;
	line-height: 1.25;
	margin-top: 0;
}
.appel .is-style-outline .wp-block-button__link { color: #fff; border-color: #fff; }
.appel .is-style-outline .wp-block-button__link:hover { background: #fff; color: var(--wp--preset--color--noir); }

/* ---------- Accueil ---------- */

.heros {
	padding-block: var(--wp--preset--spacing--50);
	background: var(--carreaux);
	border-bottom: 4px solid var(--rouge);
	margin-top: 0 !important;
}
.heros + .services, .heros + * { margin-top: var(--section); }
.heros h1 { margin-top: 0; }
.heros-colonnes { gap: clamp(2rem, 5vw, 4.5rem); }

/* La liste des services : l'élément fort de la page. Chaque ligne entière est cliquable. */
.services { margin-top: 0; }
.autres-services { margin-top: var(--section) !important; }
.services > h2 { margin-bottom: 1.5rem; }
.service-ligne {
	position: relative;
	display: grid;
	grid-template-columns: 10rem minmax(0, 1.15fr) minmax(0, 1fr);
	align-items: center;
	gap: 1rem 2.5rem;
	padding-block: 1.25rem;
	border-top: 2px solid var(--wp--preset--color--noir);
	margin: 0 !important;
}
.service-ligne:last-child { border-bottom: 2px solid var(--wp--preset--color--noir); }
.service-ligne .wp-block-image { margin: 0; }
.service-ligne img { width: 10rem; aspect-ratio: 4 / 3; object-fit: cover; }
.service-ligne h3 {
	margin: 0;
	font-size: clamp(1.6rem, 3.2vw, 2.6rem);
	line-height: 1.05;
}
.service-ligne h3 a { color: var(--wp--preset--color--noir); text-decoration: none; }
.service-ligne h3 a::after { content: ""; position: absolute; inset: 0; }
.service-ligne p { margin: 0; color: var(--ardoise); }
.service-ligne:hover h3 a,
.service-ligne:focus-within h3 a { color: var(--rouge-fonce); text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 0.15em; }
.service-ligne:focus-within { outline: 3px solid var(--rouge-fonce); outline-offset: 4px; }
.service-ligne h3 a:focus-visible { outline: none; }

@media (max-width: 781px) {
	.service-ligne { grid-template-columns: 6rem minmax(0, 1fr); gap: 0.5rem 1.25rem; }
	.service-ligne img { width: 6rem; }
	.service-ligne .wp-block-image { grid-row: span 2; align-self: start; }
}

.bande-partenaire { margin-top: var(--section); padding-block: var(--section); }
.bande-partenaire h2 { margin-top: 0; }

.engagements { margin-top: var(--section); }
.engagements .wp-block-column,
.wp-block-columns.engagements .wp-block-column { border-top: 4px solid var(--rouge); padding-top: 0.75rem; }
.engagements h3 { margin-top: 0; }
.contenu .wp-block-columns.engagements { margin-block: var(--wp--preset--spacing--50); }

/* Méthode : une vraie suite d'étapes, d'où la numérotation. */
.methode { margin-top: var(--section); }
.methode > h2 { margin-bottom: 1.5rem; }
.methode-etapes {
	list-style: none;
	counter-reset: etape;
	padding: 0 !important;
	margin: 0;
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 2rem 2.5rem;
}
.methode-etapes li {
	counter-increment: etape;
	border-top: 2px solid var(--wp--preset--color--noir);
	padding-top: 0.75rem;
	color: var(--ardoise);
}
.methode-etapes li::before {
	content: counter(etape);
	display: block;
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 700;
	font-size: 3.5rem;
	line-height: 1;
	color: var(--rouge);
	margin-bottom: 0.6rem;
}
.methode-etapes strong {
	display: block;
	font-family: var(--wp--preset--font-family--titres);
	font-size: 1.45rem;
	line-height: 1.15;
	color: var(--wp--preset--color--noir);
	margin-bottom: 0.35rem;
}
@media (max-width: 1000px) { .methode-etapes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .methode-etapes { grid-template-columns: 1fr; gap: 1.5rem; } }

/* Références : les noms, lisibles, classés par secteur (au lieu de l'ancien collage de logos). */
.references { margin-top: var(--section); }
.references > h2 { margin-bottom: 0.4rem; }
.references-intro { color: var(--ardoise); margin-top: 0; }
.references-grille {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
	gap: 2rem 2.5rem;
	margin-top: 1.5rem;
}
.references-secteur { margin: 0 !important; border-top: 2px solid var(--wp--preset--color--noir); padding-top: 0.75rem; }
.references-secteur h3 {
	font-family: var(--wp--preset--font-family--texte);
	font-size: 1rem;
	font-weight: 700;
	color: var(--rouge-fonce);
	margin: 0 0 0.6rem;
}
.references-noms { list-style: none; padding: 0 !important; margin: 0; }
.references-noms li {
	font-family: var(--wp--preset--font-family--titres);
	font-weight: 700;
	font-size: 1.3rem;
	line-height: 1.25;
	margin-bottom: 0.3rem;
}

/* Vidéo en façade (shortcode alafia_video) */
.video-facade { margin: 0; }
.video-facade-lien { position: relative; display: block; color: #fff; }
.video-facade-lien img,
.video-facade-cadre { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border: 0; }
.video-facade-bouton {
	position: absolute;
	left: 1rem; bottom: 1rem;
	display: inline-flex; align-items: center; gap: 0.5rem;
	padding: 0.75rem 1.2rem 0.75rem 0.95rem;
	background: var(--rouge);
	font-weight: 700;
	border-radius: 4px;
}
.video-facade-lien:hover .video-facade-bouton,
.video-facade-lien:focus-visible .video-facade-bouton { background: var(--rouge-fonce); text-decoration: underline; }
.video-facade figcaption { margin-top: 0.5rem; font-size: var(--wp--preset--font-size--petit); color: var(--ardoise); }

/* ---------- Bandeau « Nos adresses » ---------- */

.adresses { padding-block: var(--section); }
.adresses-titre { margin-top: 0; }
.adresses h3 { margin-bottom: 0.4rem; }
.adresses p { margin-top: 0; }

/* ---------- Galeries ---------- */

/* Grille régulière : même cadrage pour toutes les photos. */
.galerie-section { margin-top: var(--wp--preset--spacing--50); }
.galerie-section h2 { margin: 0 0 1rem; padding-top: 0.75rem; border-top: 2px solid var(--wp--preset--color--noir); }
.galerie.wp-block-gallery {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: 0.75rem !important;
	margin-block: 0;
}
.galerie.wp-block-gallery > .wp-block-image { width: auto !important; margin: 0 !important; }
.galerie.wp-block-gallery > .wp-block-image img { width: 100%; height: auto !important; aspect-ratio: 4 / 3; object-fit: cover; }

/* ---------- Blog ---------- */

.titre-page { margin-top: var(--wp--preset--spacing--50); }
.liste-articles { margin-top: 0; }
.liste-articles .wp-block-post-title a { color: var(--wp--preset--color--noir); text-decoration: none; }
.liste-articles .wp-block-post-title a:hover { color: var(--rouge-fonce); text-decoration: underline; }
.retour-blog { margin-bottom: 0; }

/* ---------- Formulaires (mu-plugin alafia-formulaires) ---------- */

.formulaire form { max-width: 40rem; }
.wp-block-column:has(> .formulaire) { flex: 0 1 34rem !important; }
.wp-block-columns:has(.formulaire) { gap: clamp(2rem, 5vw, 5rem); }
.formulaire-champ { margin-block: 0 1.1rem; }
.formulaire label,
.formulaire legend { font-weight: 700; }
.formulaire .obligatoire { font-weight: 400; color: var(--ardoise); }
.formulaire input:not([type="checkbox"]),
.formulaire textarea {
	display: block;
	width: 100%;
	margin-top: 0.3rem;
	padding: 0.7rem 0.8rem;
	font: inherit;
	border: 1px solid #6E7881;
	border-radius: 4px;
	background: #fff;
}
.formulaire [aria-invalid="true"] { border: 2px solid var(--rouge-fonce); }
.formulaire fieldset { border: 0; padding: 0; margin: 0 0 1.1rem; }
.formulaire-cases { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0.4rem 1rem; margin-top: 0.5rem; }
.formulaire-cases label { font-weight: 400; display: flex; gap: 0.5rem; align-items: baseline; }
.formulaire-cases input { width: 1.1rem; height: 1.1rem; accent-color: var(--rouge); }
.formulaire button { border: 0; cursor: pointer; }
.formulaire-champ-erreur { display: block; color: var(--rouge-fonce); font-weight: 700; }
.formulaire-erreur,
.formulaire-succes { padding: 1rem 1.25rem; font-weight: 700; border-left: 6px solid; }
.formulaire-erreur { border-color: var(--rouge-fonce); background: #FBEAEA; }
.formulaire-succes { border-color: #1E7A3C; background: #E7F4EC; }
.formulaire-mention { font-size: var(--wp--preset--font-size--petit); color: var(--ardoise); }
.pot-de-miel { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

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

.pied { padding-block: var(--wp--preset--spacing--50) 1.5rem; }
.pied a { color: #fff; }
.pied a:hover { color: #fff; text-decoration-thickness: 2px; }
.pied-nom { font-family: var(--wp--preset--font-family--titres); font-weight: 700; font-size: 1.6rem; margin-bottom: 0.5rem; }
.pied-titre { font-family: var(--wp--preset--font-family--texte); font-size: 1.1rem; margin-top: 0; }
.pied-liens { list-style: none; padding-left: 0 !important; }
.pied-liens li { margin-bottom: 0.35rem; }
.pied-copyright { border-top: 1px solid rgba(255, 255, 255, 0.3); padding-top: 1rem; margin-top: var(--wp--preset--spacing--50); }

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
