/* ==========================================================================
   Mahroussa — styles communs (toutes les pages)
   Maquette de référence : Figma « Mahroussa B » / frame home (1920 px)
   ========================================================================== */

:root {
	/* Couleurs */
	--g:   #224F24;  /* vert principal */
	--gd:  #142E16;  /* vert profond (header, footer, bandes) */
	--gm:  #3A7A3E;  /* vert label */
	--gl:  #D6EBCA;  /* vert clair (badges, fond actus) */
	--gp:  #EFF7EE;  /* vert pâle (sections alternées) */
	--go:  #E8C30C;  /* or (CTA, chiffres) */
	--god: #C4A000;  /* or foncé (survol) */
	--nd:  #1A1A18;  /* titres sur fond clair */
	--nm:  #5A5A52;  /* texte courant */
	--line:#E8E6DE;  /* bordures */
	--wh:  #FFFFFF;

	/* Typographie */
	--fh: 'Roboto Slab', Georgia, 'Times New Roman', serif;
	--fb: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, sans-serif;
	--fn: 'DM Sans', 'Source Sans 3', system-ui, sans-serif;

	/* Mise en page */
	--max: 1436px;
	--gutter: 24px;
	--header-h: 104px;
	--rad: 8px;
	--rad-lg: 14px;
	--ease: cubic-bezier(.22, .61, .36, 1);
	--section-y: 112px;
}

/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--fb); font-size: 16px; line-height: 1.65; color: var(--nm); background: var(--wh); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3 { font-family: var(--fh); color: var(--nd); text-wrap: balance; }
strong { font-weight: 700; }
:focus-visible { outline: 2px solid var(--go); outline-offset: 3px; border-radius: 4px; }
.icon { flex-shrink: 0; }

.skip-link { position: absolute; left: 16px; top: -60px; z-index: 1000; background: var(--go); color: var(--g); padding: 10px 16px; border-radius: var(--rad); font-weight: 700; transition: top .2s; }
.skip-link:focus { top: 16px; }

.container { width: min(var(--max), calc(100% - var(--gutter) * 2)); margin-inline: auto; }
.container.narrow { width: min(860px, calc(100% - var(--gutter) * 2)); }
.section { padding-block: var(--section-y); }

/* ── Titres & textes de section ───────────────────────────────────────── */
.tag { display: inline-block; font-family: var(--fb); font-size: 11px; font-weight: 600; line-height: 18.7px; letter-spacing: .12em; text-transform: uppercase; color: var(--gm); background: var(--gl); padding: 5px 12px; border-radius: 20px; margin-bottom: 18px; }
.tag-white { background: var(--wh); }
.h2 { font-family: var(--fh); font-weight: 700; font-size: clamp(28px, 2.2vw + 10px, 42px); line-height: 1.05; color: var(--g); margin-bottom: 22px; }
.lead { font-size: 18px; line-height: 1.6; color: var(--nm); max-width: 627px; }
.lead + .lead { margin-top: 18px; }
.lead strong { font-weight: 700; }

/* ── Boutons ──────────────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 48px; padding: 8px 22px; border-radius: var(--rad); border: 1px solid transparent; font-family: var(--fb); font-size: 16px; font-weight: 600; line-height: 1.2; white-space: nowrap; transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease); }
.btn:active { transform: translateY(1px); }
.btn-gold { background: var(--go); color: var(--g); }
.btn-gold:hover { background: var(--god); }
.btn-green { background: var(--g); color: var(--wh); }
.btn-green:hover { background: var(--gd); }
.btn-ghost { border-color: var(--g); color: var(--g); }
.btn-ghost:hover { background: var(--g); color: var(--wh); }
.btn-outline-light { border-color: var(--line); color: var(--wh); font-weight: 700; }
.btn-outline-light:hover { background: rgba(255,255,255,.1); }
.btn-upper { text-transform: uppercase; letter-spacing: .04em; }
.btn-lg { font-size: 18px; padding-inline: 24px; }

.card-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 14px; color: var(--g); }
.card-link .icon { transition: transform .2s var(--ease); }
.card-link:hover .icon { transform: translateX(4px); }

/* ── Header ───────────────────────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 100; background: var(--gd); transition: box-shadow .3s var(--ease); }
.admin-bar .site-header { top: 32px; }
.site-header.is-scrolled { box-shadow: 0 8px 30px rgba(0,0,0,.25); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 32px; }
.header-logo { display: flex; align-items: center; flex-shrink: 0; }
.site-logo { width: auto; height: 80px; max-width: none; }
.site-logo-text { font-family: var(--fh); font-weight: 800; font-size: 22px; color: var(--wh); }

.main-nav { margin-inline: auto; }
.nav-menu { display: flex; align-items: center; gap: clamp(18px, 1.9vw, 36px); }
.nav-menu a { position: relative; font-family: var(--fn); font-weight: 500; font-size: 16px; color: var(--wh); white-space: nowrap; padding-block: 8px; }
.nav-menu a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: var(--go); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.nav-menu a:hover::after,
.nav-menu .current-menu-item > a::after,
.nav-menu a[aria-current="page"]::after { transform: scaleX(1); }

.header-actions { display: flex; align-items: center; gap: 24px; flex-shrink: 0; }
.header-badge { display: inline-flex; align-items: center; height: 36px; padding: 0 13px; border: 1px solid var(--wh); border-radius: 20px; font-weight: 600; font-size: 16px; color: var(--wh); white-space: nowrap; transition: background-color .2s; }
.header-badge:hover { background: rgba(255,255,255,.1); }
.header-cta { width: 192px; font-size: 18px; text-transform: none; }

.burger { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; flex-direction: column; gap: 5px; }
.burger span { display: block; width: 24px; height: 2px; background: var(--wh); border-radius: 2px; transition: transform .25s var(--ease), opacity .2s; }
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { background: var(--gd); border-top: 1px solid rgba(255,255,255,.08); padding: 12px var(--gutter) 24px; }
.mobile-menu .nav-menu { flex-direction: column; align-items: stretch; gap: 0; }
.mobile-menu .nav-menu a { display: block; padding: 14px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: 17px; }
.mobile-menu .nav-menu a::after { display: none; }
.mobile-cta { width: 100%; margin-top: 18px; font-size: 17px; }

/* ── Fil d'Ariane ─────────────────────────────────────────────────────── */
.breadcrumb-bar { background: var(--gp); border-bottom: 1px solid var(--line); font-size: 14px; }
.breadcrumb-bar .container { padding-block: 12px; }
.breadcrumb ol, .rank-math-breadcrumb p { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.breadcrumb li + li::before { content: '/'; margin-right: 8px; color: #b6b4aa; }
.breadcrumb a, .rank-math-breadcrumb a { color: var(--g); font-weight: 600; }
.breadcrumb [aria-current], .rank-math-breadcrumb .last { color: var(--nm); }

/* ── Pages standard ───────────────────────────────────────────────────── */
.page-default { padding-block: 72px 96px; }
.entry-content { color: var(--nm); font-size: 17px; line-height: 1.75; }
.entry-content > * + * { margin-top: 1.1em; }
.entry-content h2, .entry-content h3 { color: var(--g); margin-top: 1.6em; }
.entry-content a { color: var(--g); text-decoration: underline; }
.entry-content ul { list-style: disc; padding-left: 1.3em; }

/* ── Cartes actualités (communes à l'accueil et aux archives) ─────────── */
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
.news-card { display: flex; flex-direction: column; background: var(--wh); border: 1px solid var(--line); border-radius: var(--rad-lg); overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
.news-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(20,46,22,.12); }
.news-img { display: block; aspect-ratio: 373 / 205; overflow: hidden; background: rgba(0,0,0,.2); }
.news-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.news-card:hover .news-img img { transform: scale(1.05); }
.news-img-empty { background: linear-gradient(135deg, #c8dcbf, #a9c79f); }
.news-body { display: flex; flex-direction: column; gap: 10px; padding: 24px; flex: 1; }
.news-date { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gm); }
.news-title { font-family: var(--fh); font-size: 18px; font-weight: 700; line-height: 1.35; color: var(--nd); }
.news-title a:hover { color: var(--g); }
.news-excerpt { font-size: 15px; line-height: 1.6; color: var(--nm); flex: 1; }

/* ── Bande contact ────────────────────────────────────────────────────── */
.contact-band { background: var(--gp); padding-block: 66px; }
.contact-grid { display: grid; grid-template-columns: repeat(3, auto); justify-content: center; gap: 32px 116px; }
.ci { display: flex; align-items: flex-start; gap: 13px; }
.ci-icon { width: 61px; height: 46px; border-radius: 11px; background: var(--g); color: var(--wh); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.ci-label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--gm); line-height: 18.7px; }
.ci-val { font-size: 15px; font-weight: 600; color: var(--nd); line-height: 25.5px; }
.ci-val a:hover { color: var(--g); text-decoration: underline; }
.ci-note { font-size: 12px; color: var(--nm); line-height: 20.4px; }

/* ── Footer ───────────────────────────────────────────────────────────── */
.site-footer { background: var(--gd); color: var(--wh); padding-block: 150px 0; }
.footer-grid { display: grid; grid-template-columns: 1.35fr 1fr 1fr 1fr; gap: 48px; padding-inline: clamp(0px, 4.5vw, 72px); }
.footer-logo { display: inline-block; margin-bottom: 16px; }
.footer-desc { font-size: 13px; line-height: 22.75px; max-width: 253px; margin-bottom: 22px; }
.footer-agrodiv { display: inline-block; font-size: 12px; color: rgba(255,255,255,.42); background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); border-radius: var(--rad); padding: 7px 13px; margin-bottom: 18px; }
.footer-agrodiv strong { color: rgba(255,255,255,.72); }
.footer-social { display: flex; gap: 8px; }
.footer-social a { width: 36px; height: 36px; border-radius: var(--rad); background: rgba(255,255,255,.07); display: flex; align-items: center; justify-content: center; color: rgba(255,255,255,.75); transition: background-color .2s, color .2s; }
.footer-social a:hover { background: var(--go); color: var(--g); }
.footer-col { padding-top: 22px; }
.footer-title { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--wh); margin-bottom: 18px; }
.footer-links { display: flex; flex-direction: column; gap: 15px; }
.footer-links a { font-size: 13px; line-height: 22.1px; color: var(--wh); opacity: .9; transition: color .2s, opacity .2s; overflow-wrap: anywhere; }
.footer-links a:hover { color: var(--go); opacity: 1; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; margin-top: 96px; padding-block: 24px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; color: rgba(255,255,255,.4); }
.footer-legal { display: flex; flex-wrap: wrap; gap: 20px; }
.footer-legal a:hover { color: var(--wh); }

/* ── Animations d'apparition (actives seulement avec JS) ──────────────── */
.js [data-reveal] { opacity: 0; transform: translateY(24px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: var(--reveal-delay, 0ms); }
.js [data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
	.js [data-reveal] { opacity: 1; transform: none; }
}

/* ── Responsive ───────────────────────────────────────────────────────── */
@media (max-width: 1440px) {
	.header-inner { gap: 24px; }
	.header-actions { gap: 16px; }
}
@media (max-width: 1320px) {
	.header-badge { display: none; }
}
@media (max-width: 1180px) {
	:root { --header-h: 84px; }
	.main-nav, .header-cta { display: none; }
	.header-actions { margin-left: auto; }
	.burger { display: inline-flex; }
	.site-logo { height: 64px; }
	.footer-grid { grid-template-columns: 1fr 1fr; padding-inline: 0; }
	.contact-grid { gap: 32px 56px; }
}
@media (max-width: 960px) {
	:root { --section-y: 80px; }
	.news-grid { grid-template-columns: 1fr 1fr; }
	.contact-grid { grid-template-columns: 1fr; justify-content: start; }
	.site-footer { padding-top: 80px; }
}
@media (max-width: 782px) {
	.admin-bar .site-header { top: 46px; }
}
@media (max-width: 640px) {
	:root { --gutter: 16px; --header-h: 72px; --section-y: 64px; }
	.site-logo { height: 54px; }
	.news-grid { grid-template-columns: 1fr; }
	.footer-grid { grid-template-columns: 1fr; gap: 32px; }
	.footer-col { padding-top: 0; }
	.footer-bottom { margin-top: 48px; }
	.lead { font-size: 17px; }
	.btn-lg { font-size: 16px; }
}
