/*
Theme Name: Éleveurs de Chevreaux
Theme URI: https://eleveursdechevreaux-aura.com/
Author: Divinemenciel
Author URI: https://divinemenciel.com/
Description: Thème sur mesure de l'Association de producteurs pour la valorisation des chevreaux d'Auvergne-Rhône-Alpes, d'après la maquette Figma « MAQUETTES DIV ». Les pages, le menu et les actualités sont créés automatiquement à l'activation.
Version: 1.0.0
Requires at least: 6.3
Requires PHP: 7.4
License: Propriétaire
Text Domain: chevreaux
*/

/* =========================================================
   1. Variables
   ========================================================= */
:root {
	--chx-beige: #ece9e5;        /* fond accueil + en-tête */
	--chx-rose: #f1e9e3;         /* fond pages intérieures */
	--chx-vert: #778068;         /* bandeaux, boutons */
	--chx-vert-logo: #838d71;    /* logo */
	--chx-vert-fonce: #2a3320;   /* liens précédent / suivant */
	--chx-gris: #818f8e;         /* pied de page */
	--chx-noir: #000;
	--chx-blanc: #fff;

	--chx-font-titre: "auster-rounded", "Auster Rounded", "Nunito", "Arial Rounded MT Bold", sans-serif;
	--chx-font-texte: "Andale Mono", "AndaleMono", "Cousine", "Courier New", monospace;

	--chx-marge: 40px;           /* marge des images pleine largeur */
	--chx-contenu: 1130px;       /* largeur des blocs texte */
	--chx-etroit: 900px;         /* largeur des pages intérieures */
}

/* =========================================================
   2. Base
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--chx-beige);
	color: var(--chx-noir);
	font-family: var(--chx-font-texte);
	font-size: 14px;
	line-height: 1.15;
	-webkit-font-smoothing: antialiased;
}
body.chx-interieur { background: var(--chx-rose); }

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }
a:hover { opacity: .75; }

p { margin: 0 0 1.15em; }
strong, b { font-weight: 700; }

h1, h2, h3 { margin: 0; font-weight: 800; }
.chx-page-title, .chx-entry h2, .chx-h2 { font-weight: 800; letter-spacing: -.005em; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	clip: auto; width: auto; height: auto; z-index: 999; top: 8px; left: 8px;
	padding: 8px 12px; background: var(--chx-blanc);
}

/* =========================================================
   3. En-tête
   ========================================================= */
.chx-header {
	background: var(--chx-beige);
	text-align: center;
	padding: 22px 16px 30px;
	position: relative;
	z-index: 20;
}
.chx-logo { display: inline-block; }
.chx-logo img, .chx-logo svg { width: 89px; height: auto; margin: 0 auto; }
.chx-logo-texte {
	font-family: var(--chx-font-titre); font-size: 22px; color: var(--chx-vert-logo);
	text-decoration: none; letter-spacing: .02em;
}

.chx-nav { margin-top: 62px; }
.chx-nav ul {
	list-style: none; margin: 0; padding: 0;
	display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 50px;
}
.chx-nav a {
	text-decoration: none; text-transform: uppercase;
	font-size: 14px; letter-spacing: .06em;
}
.chx-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }
.chx-entry .wp-block-columns { align-items: start !important; }
.chx-nav .sub-menu { display: none; }

.chx-burger {
	display: none; background: none; border: 0; cursor: pointer;
	margin: 18px auto 0; padding: 8px 10px; font: inherit; text-transform: uppercase;
	letter-spacing: .08em;
}
.chx-burger span {
	display: block; width: 26px; height: 2px; background: var(--chx-noir); margin: 5px auto;
	transition: transform .2s, opacity .2s;
}

/* =========================================================
   4. Mise en page générale
   ========================================================= */
.chx-main { overflow: hidden; }

.chx-entry > * { margin-left: auto; margin-right: auto; }
figure { margin: 0; }
.chx-entry .wp-block-image { margin-bottom: 0; }

/* Image pleine largeur (avec marges de 40px comme sur la maquette) */
.chx-hero,
.chx-entry .chx-full {
	width: calc(100% - 2 * var(--chx-marge));
	max-width: none;
	margin: 0 auto;
}
.chx-hero img,
.chx-entry .chx-full img { width: 100%; height: auto; aspect-ratio: 1358 / 760; object-fit: cover; }
.chx-entry .chx-full.chx-bandeau img { aspect-ratio: 1360 / 600; }

/* Pages intérieures : titre + image étroite */
.chx-page-head {
	width: calc(100% - 2 * 16px); max-width: var(--chx-etroit);
	margin: 0 auto; padding-top: 70px;
}
.chx-page-title {
	font-family: var(--chx-font-titre);
	font-size: clamp(44px, 7vw, 88px);
	line-height: 1; text-transform: uppercase;
	margin: 0 0 22px;
}
.chx-page-head .chx-page-image img { width: 100%; aspect-ratio: 900 / 470; object-fit: cover; }
.chx-page-intro { text-align: center; font-size: clamp(18px, 2vw, 24px); letter-spacing: .04em; margin: 34px 0 0; }

/* Titres de section */
.chx-entry h2,
.chx-h2 {
	font-family: var(--chx-font-titre);
	font-size: clamp(30px, 3.2vw, 40px);
	line-height: 1.1; text-transform: uppercase;
}
.chx-entry h3 {
	font-family: var(--chx-font-texte); font-weight: 400;
	font-size: 18px; letter-spacing: .06em; text-transform: uppercase; line-height: 1.4;
	margin: 0 0 32px;
}

/* Séparateur fin */
.chx-entry hr,
.chx-entry .wp-block-separator,
.chx-sep {
	border: 0; border-top: 1px solid var(--chx-noir);
	width: calc(100% - 2 * 16px); max-width: var(--chx-contenu);
	margin: 0 auto; opacity: 1;
}
.chx-entry .wp-block-separator.chx-sep-large { max-width: none; width: 100%; }

/* Section « titre à gauche / texte à droite » */
.chx-entry .wp-block-columns.chx-split {
	width: calc(100% - 2 * 16px); max-width: var(--chx-contenu);
	margin: 0 auto; padding: 66px 0 90px;
	display: grid; grid-template-columns: 1fr 440px; column-gap: 60px;
}
.chx-entry .wp-block-columns.chx-split > .wp-block-column { flex-basis: auto !important; margin: 0; }
.chx-entry .wp-block-columns.chx-split p { max-width: 440px; }

.chx-entry .wp-block-columns.chx-split-nosep { padding-top: 110px; }

/* Section étroite (pages intérieures) */
.chx-entry .chx-narrow {
	width: calc(100% - 2 * 16px); max-width: var(--chx-etroit);
	margin: 0 auto; padding: 80px 0;
}
.chx-entry .chx-narrow > h2 { margin-bottom: 64px; }
.chx-entry .chx-narrow .wp-block-columns { gap: 50px; margin: 0; }
.chx-entry .chx-narrow .wp-block-columns + h3 { margin-top: 70px; }
.chx-entry .chx-text-col { max-width: 440px; }

/* Bandeau vert (4 engagements) */
.chx-entry .wp-block-columns.chx-goals {
	background: var(--chx-vert); color: var(--chx-blanc);
	max-width: none; width: 100%;
	padding: 40px 30px 36px; margin: 0;
	display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px;
	text-align: center; font-weight: 700;
}
.chx-entry .wp-block-columns.chx-goals > .wp-block-column { margin: 0; flex-basis: auto !important; }
.chx-entry .wp-block-columns.chx-goals img { width: auto; height: 46px; margin: 0 auto 50px; }
.chx-entry .wp-block-columns.chx-goals p { margin: 0; line-height: 1.3; }

/* Galerie 3 photos */
.chx-entry .wp-block-columns.chx-trio {
	width: calc(100% - 2 * var(--chx-marge)); max-width: none;
	margin: 0 auto; padding: 114px 0 106px;
	display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px;
}
.chx-entry .wp-block-columns.chx-trio > * { margin: 0 !important; flex-basis: auto !important; }
.chx-entry .wp-block-columns.chx-trio img { width: 100%; aspect-ratio: 440 / 576; object-fit: cover; }
.chx-entry .wp-block-columns.chx-trio.chx-recettes { width: calc(100% - 2 * 16px); max-width: 1015px; padding: 76px 0 96px; }
.chx-entry .wp-block-columns.chx-trio.chx-recettes img { aspect-ratio: 325 / 439; }
.chx-entry .wp-block-columns.chx-trio figcaption { font-size: 13px; margin-top: 10px; text-align: center; }

/* Deux photos décalées (cahier des charges) */
.chx-entry .wp-block-columns.chx-duo {
	width: calc(100% - 2 * 16px); max-width: 1245px; margin: 0 auto;
	display: grid; grid-template-columns: 1fr 1fr; gap: 135px; align-items: end;
	padding-bottom: 110px;
}
.chx-entry .wp-block-columns.chx-duo > * { margin: 0 !important; flex-basis: auto !important; }
.chx-entry .wp-block-columns.chx-duo .chx-duo-texte { padding-left: 115px; align-self: start; }
.chx-entry .wp-block-columns.chx-duo .chx-duo-texte + figure { grid-column: 1; }

/* Citation sur fond vert */
.chx-entry .chx-quote {
	background: var(--chx-vert); color: var(--chx-blanc);
	max-width: none; width: 100%; margin: 0;
	padding: 30px 16px; text-align: center;
	font-size: clamp(15px, 1.4vw, 18px); line-height: 1.3; font-weight: 700;
}
.chx-entry .chx-quote p { max-width: 640px; margin: 0 auto; }

/* Liste avec épingles */
.chx-entry .chx-pins { list-style: none; padding: 0; margin: 32px 0 0; }
.chx-entry .chx-pins li {
	position: relative; padding-left: 26px; margin-bottom: 22px; line-height: 1.3;
}
.chx-entry .chx-pins li::before {
	content: ""; position: absolute; left: 2px; top: 0; width: 14px; height: 18px;
	background: var(--chx-vert);
	-webkit-mask: url("assets/icons/pin.svg") no-repeat center / contain;
	mask: url("assets/icons/pin.svg") no-repeat center / contain;
}

/* Carte (Google Maps) */
.chx-entry .chx-map iframe { width: 100%; height: 520px; border: 0; display: block; margin-top: 60px; }

/* Boutons */
.chx-entry .wp-block-buttons { margin: 34px 0; }
.chx-entry .wp-block-button__link,
.chx-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 325px; min-height: 59px; padding: 14px 24px;
	background: var(--chx-vert); color: var(--chx-blanc);
	border-radius: 0; text-transform: uppercase; text-decoration: none;
	font-family: var(--chx-font-texte); font-size: 18px; letter-spacing: .06em;
}
.chx-entry .chx-btn-souligne .wp-block-button__link { text-decoration: underline; text-underline-offset: 3px; }

/* Ligne « titre + bouton » (Découpe, Recettes) */
.chx-entry .wp-block-columns.chx-cta-row {
	width: calc(100% - 2 * 16px); max-width: var(--chx-contenu); margin: 0 auto;
	display: grid; grid-template-columns: 575px 1fr; align-items: center; padding: 62px 0;
}
.chx-entry .wp-block-columns.chx-cta-row > * { margin: 0 !important; flex-basis: auto !important; }
.chx-entry .wp-block-columns.chx-cta-row .wp-block-buttons { margin: 0; }

/* FAQ (blocs « Détails ») */
.chx-entry .chx-faq {
	width: calc(100% - 2 * 16px); max-width: var(--chx-contenu); margin: 0 auto; padding: 62px 0 80px;
}
.chx-entry .chx-faq > h2 { margin-bottom: 40px; }
.chx-entry details {
	border-bottom: 1px solid rgba(0,0,0,.35); padding: 18px 0; max-width: 900px;
}
.chx-entry details summary {
	cursor: pointer; list-style: none; font-weight: 700; font-size: 16px;
	display: flex; justify-content: space-between; gap: 20px;
}
.chx-entry details summary::-webkit-details-marker { display: none; }
.chx-entry details summary::after { content: "+"; font-size: 20px; line-height: 1; }
.chx-entry details[open] summary::after { content: "–"; }
.chx-entry details > *:not(summary) { margin-top: 14px; line-height: 1.35; }

/* Partenaires */
.chx-entry .chx-logos { display: flex; flex-wrap: wrap; gap: 40px; align-items: center; margin-top: 30px; }
.chx-entry .chx-logos img { max-height: 90px; width: auto; }

/* Texte courant des pages intérieures */
.chx-entry .chx-prose {
	width: calc(100% - 2 * 16px); max-width: var(--chx-etroit); margin: 0 auto; padding: 70px 0 40px;
	font-size: 15px; line-height: 1.45;
}
.chx-entry .chx-prose h2 { font-size: 26px; margin: 40px 0 16px; }

/* =========================================================
   5. Actualités (cartes)
   ========================================================= */
.chx-events {
	width: calc(100% - 2 * 16px); max-width: 1222px; margin: 0 auto; padding: 0 0 80px;
}
.chx-events > h2 { margin: 90px 46px 60px; }
.chx-cards {
	display: grid; grid-template-columns: 394px 1fr; gap: 30px 20px;
}
.chx-card {
	background: var(--chx-blanc); border-radius: 22px; padding: 48px 23px 28px;
	display: flex; flex-direction: column;
}
.chx-card.chx-card-large { padding-top: 32px; padding-left: 41px; padding-right: 39px; }
.chx-card .chx-card-img { display: block; margin-bottom: 26px; }
.chx-card .chx-card-img img { width: 100%; aspect-ratio: 348 / 296; object-fit: cover; }
.chx-card.chx-card-large .chx-card-img img { aspect-ratio: auto; object-fit: contain; }
.chx-card h3 { font-family: var(--chx-font-texte); font-size: 14px; font-weight: 700; margin: 0 0 4px; line-height: 1.2; }
.chx-card .chx-card-txt { font-size: 13px; line-height: 1.15; }
.chx-card .chx-card-txt p { margin: 0 0 .9em; }
.chx-card .chx-card-date { font-size: 12px; opacity: .65; margin-top: auto; padding-top: 12px; }
.chx-empty { padding: 40px 0; text-align: center; }

/* Article seul */
.chx-single { width: calc(100% - 2 * 16px); max-width: var(--chx-etroit); margin: 0 auto; padding: 70px 0 60px; }
.chx-single .chx-page-title { font-size: clamp(32px, 5vw, 56px); }
.chx-single .chx-single-img { margin: 30px 0; }
.chx-single .chx-single-content { font-size: 15px; line-height: 1.5; }

/* =========================================================
   6. Page précédente / suivante
   ========================================================= */
.chx-pager {
	width: calc(100% - 2 * 16px); max-width: 1160px; margin: 0 auto; padding: 60px 0 70px;
	display: flex; justify-content: space-between; gap: 20px;
	color: var(--chx-vert-fonce);
}
.chx-pager a { text-decoration: none; display: block; }
.chx-pager .chx-pager-label { font-size: 18px; letter-spacing: .04em; display: block; margin-bottom: 16px; }
.chx-pager .chx-pager-titre { font-size: clamp(24px, 3vw, 34px); letter-spacing: .1em; text-transform: uppercase; font-weight: 700; }
.chx-pager .chx-next { text-align: right; margin-left: auto; }

/* =========================================================
   7. Contact + pied de page
   ========================================================= */
.chx-contact { border-top: 1px solid var(--chx-noir); padding: 50px 16px 120px; }
.chx-contact .chx-h2 { max-width: var(--chx-contenu); margin: 0 auto 90px; }
.chx-contact-grid {
	display: flex; justify-content: center; flex-wrap: wrap; gap: 30px 100px; text-align: center;
}
.chx-contact-grid h3 {
	font-family: var(--chx-font-texte); font-size: 18px; font-weight: 700; letter-spacing: .06em;
	text-transform: uppercase; margin: 0 0 14px;
}
.chx-contact-grid p, .chx-contact-grid a { margin: 0; font-size: 14px; line-height: 1.4; text-decoration: none; }

.chx-footer {
	background: var(--chx-gris); color: var(--chx-blanc); text-align: center;
	padding: 16px 16px 16px;
}
.chx-footer .chx-logo img, .chx-footer .chx-logo svg { width: 114px; }
.chx-footer nav ul {
	list-style: none; margin: 40px 0 0; padding: 0;
	display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 50px;
}
.chx-footer nav a { text-decoration: none; text-transform: uppercase; font-size: 14px; letter-spacing: .06em; }
.chx-footer .chx-legal { display: inline-block; margin-top: 24px; font-size: 14px; text-decoration: none; }
.chx-footer .chx-copy { font-size: 12px; letter-spacing: .04em; margin: 80px 0 0; }
.chx-footer .chx-copy a { text-decoration: none; }

/* =========================================================
   8. Intro animée (logo plein écran, 1re visite)
   ========================================================= */
.chx-intro {
	position: fixed; inset: 0; z-index: 1000; background: #000;
	display: flex; align-items: center; justify-content: center;
	transition: opacity .7s ease .1s, visibility .7s ease .1s;
}
.chx-intro img { width: min(340px, 60vw); animation: chx-zoom 1.6s ease forwards; }
.chx-intro.is-done { opacity: 0; visibility: hidden; }
.chx-intro[hidden] { display: none; }
@keyframes chx-zoom { from { transform: scale(1); } to { transform: scale(.42); } }
@media (prefers-reduced-motion: reduce) { .chx-intro { display: none; } }

/* =========================================================
   9. Responsive
   ========================================================= */
@media (max-width: 1100px) {
	.chx-entry .wp-block-columns.chx-split { grid-template-columns: 1fr 1fr; }
	.chx-entry .wp-block-columns.chx-duo { gap: 40px; }
	.chx-entry .wp-block-columns.chx-duo .chx-duo-texte { padding-left: 0; }
	.chx-entry .wp-block-columns.chx-cta-row { grid-template-columns: 1fr 1fr; }
	.chx-cards { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 782px) {
	:root { --chx-marge: 16px; }

	.chx-burger { display: block; }
	.chx-header .chx-logo img { width: 70px; }
	.chx-nav { margin-top: 0; }
	.chx-nav ul { display: none; flex-direction: column; gap: 18px; padding: 24px 0 8px; }
	.chx-nav.is-open ul { display: flex; }
	.chx-nav.is-open .chx-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
	.chx-nav.is-open .chx-burger span:nth-child(2) { opacity: 0; }
	.chx-nav.is-open .chx-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

	.chx-entry .wp-block-columns.chx-split,
	.chx-entry .wp-block-columns.chx-cta-row,
	.chx-entry .wp-block-columns.chx-duo { grid-template-columns: 1fr; padding: 44px 0; row-gap: 26px; }
	.chx-entry .wp-block-columns.chx-split p { max-width: none; }
	.chx-entry .wp-block-columns.chx-goals { grid-template-columns: 1fr 1fr; gap: 36px 16px; }
	.chx-entry .wp-block-columns.chx-goals img { margin-bottom: 18px; }
	.chx-entry .wp-block-columns.chx-trio { grid-template-columns: 1fr; padding: 50px 0; }
	.chx-entry .wp-block-columns.chx-trio img { aspect-ratio: 4 / 3; }
	.chx-entry .chx-narrow { padding: 50px 0; }
	.chx-entry .chx-narrow > h2 { margin-bottom: 30px; }
	.chx-entry .chx-narrow .wp-block-columns { flex-direction: column; gap: 10px; }
	.chx-entry .chx-btn, .chx-entry .wp-block-button__link { min-width: 0; width: 100%; }
	.chx-entry .chx-map iframe { height: 340px; }
	.chx-page-head { padding-top: 40px; }

	.chx-cards { grid-template-columns: 1fr; }
	.chx-events > h2 { margin: 50px 0 30px; }

	.chx-pager .chx-pager-label { font-size: 14px; }
	.chx-contact { padding-bottom: 70px; }
	.chx-contact .chx-h2 { margin-bottom: 40px; }
	.chx-footer nav ul { flex-direction: column; gap: 14px; }
	.chx-footer .chx-copy { margin-top: 40px; }
}
.chx-nav .menu-item-type-custom > a { text-decoration: none !important; }
