/* AgriWeb 2.0 — habillage « Terroir » (le même que l'application) : crème, brun, vert AgriWeb.
   Chargé après site.css sur toutes les pages. */
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("fonts/inter-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Young Serif"; src: url("fonts/young-serif-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("fonts/caveat-latin-700-normal.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --green: #2c6b3c; --deep: #22532f; --lime: #a5c251; --soft: #eef1dc;
  --ink: #2a221c; --muted: #6b5d50; --line: #e2d8c8; --line-fort: #d8c8b4; --paper: #f4efe6; --papier-2: #fbf8f2; --terre: #2a221c;
  --titres: "Young Serif", Georgia, serif; --texte: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif; --main: "Caveat", "Segoe Script", cursive;
  --r: 14px;
}
html { scroll-padding-top: 96px; }
body { background: var(--paper); color: var(--ink); font: 16px/1.65 var(--texte); -webkit-text-size-adjust: 100%; }
h1, h2, h3 { font-family: var(--titres); font-weight: 400; letter-spacing: 0; color: var(--ink); }
h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.08; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.6rem); line-height: 1.12; }
h3 { font-size: 1.2rem; line-height: 1.3; }
a { color: var(--green); }
:focus-visible { outline: 3px solid #e08a6a !important; outline-offset: 3px; border-radius: 4px; }
.container { width: min(1180px, calc(100% - 48px)); }
.aw-main { font-family: var(--main); font-weight: 700; color: var(--green); font-size: 1.12em; line-height: 1; white-space: nowrap; }
.aw-surtitre { text-transform: uppercase; letter-spacing: .14em; font-size: .74rem; font-weight: 600; color: var(--muted); margin: 0 0 12px; }

/* Boutons en pastille */
.button, .wp-block-button__link { border-radius: 999px; background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; padding: 12px 22px; min-height: 46px; font-family: var(--texte); }
.button:hover, .wp-block-button__link:hover { background: var(--deep); border-color: var(--deep); color: #fff; }
.button.secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.button.secondary:hover { background: #fff; color: var(--ink); }
.button.small { min-height: 40px; padding: 8px 18px; font-size: .92rem; }
.button.clair { background: #fff; border-color: #fff; color: var(--terre); }
.button.clair:hover { background: var(--paper); color: var(--terre); }
.button.secondary.clair { background: transparent; color: #fff; border-color: rgba(255,255,255,.7); }
.button.secondary.clair:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ---------- En-tête ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(244, 239, 230, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 76px; gap: 24px; }
.brand img, .custom-logo { width: 150px; max-height: 44px; background: var(--papier-2); border-radius: 10px; padding: 6px 10px; box-sizing: content-box; }
#site-nav { display: flex; align-items: center; gap: 28px; flex: 1; justify-content: flex-end; }
#site-nav .nav-liens { display: flex; gap: 6px; list-style: none; margin: 0; padding: 0; }
#site-nav .nav-liens a { display: block; padding: 8px 12px; border-radius: 999px; color: var(--ink); font-size: .95rem; font-weight: 500; text-decoration: none; }
#site-nav .nav-liens a:hover, #site-nav .nav-liens a.actif { background: #fff; color: var(--green); }
.nav-actions { display: flex; align-items: center; gap: 16px; }
.nav-login { color: var(--ink) !important; font-weight: 600; font-size: .95rem; text-decoration: none; white-space: nowrap; }
.nav-login:hover { color: var(--green) !important; text-decoration: underline; }
.nav-contact { display: none; }
#site-nav a.button { color: #fff; white-space: nowrap; }
.menu-toggle { display: none; align-items: center; gap: 10px; min-height: 44px; padding: 8px 16px; border: 1px solid var(--ink); border-radius: 999px; background: transparent; color: var(--ink); font: 600 .95rem var(--texte); cursor: pointer; }
.burger { display: grid; gap: 4px; width: 18px; }
.burger span { display: block; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s, opacity .2s; }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Liens de contact (e-mail, téléphone) */
.lien-contact { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--ink); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.lien-contact:hover { color: var(--green); text-decoration: underline; }
.lien-contact svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; color: var(--green); }
.lien-contact.clair, .lien-contact.clair svg { color: #fff; }

/* Tablette et téléphone : menu en panneau */
@media (max-width: 1024px) {
  .menu-toggle { display: inline-flex; }
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--paper); }
  #site-nav { display: none; position: fixed; inset: 76px 0 0 0; z-index: 49; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 18px; padding: 20px 24px 32px; background: var(--paper); overflow-y: auto; border-top: 1px solid var(--line); }
  #site-nav.open { display: flex; }
  #site-nav .nav-liens { flex-direction: column; gap: 2px; }
  #site-nav .nav-liens a { padding: 14px 4px; border-radius: 0; border-bottom: 1px solid var(--line); font-family: var(--titres); font-size: 1.45rem; font-weight: 400; }
  #site-nav .nav-liens a:hover, #site-nav .nav-liens a.actif { background: transparent; }
  .nav-actions { flex-direction: column-reverse; align-items: stretch; gap: 12px; }
  .nav-actions .button { width: 100%; min-height: 50px; font-size: 1rem; }
  .nav-login { text-align: center; padding: 12px; border: 1px solid var(--ink); border-radius: 999px; }
  .nav-contact { display: grid; gap: 2px; padding-top: 8px; border-top: 1px solid var(--line); }
  body.menu-ouvert { overflow: hidden; }
}
@media (max-width: 600px) {
  .container { width: calc(100% - 32px); }
  .header-inner { min-height: 68px; }
  #site-nav { inset: 68px 0 0 0; padding: 12px 16px 28px; }
  .brand img, .custom-logo { width: 124px; }
  .menu-toggle-texte { display: none; }
  .menu-toggle { width: 46px; height: 46px; padding: 0; justify-content: center; }
}

/* ---------- Pied de page ---------- */
.site-footer { background: var(--terre); color: #d8c8b4; border-top: 0; padding: 56px 0 24px; }
.site-footer a { color: #f4efe6; }
.site-footer .lien-contact { color: #f4efe6; }
.site-footer .lien-contact svg { color: var(--lime); }
.footer-grid { display: grid !important; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.footer-marque p { color: #d8c8b4 !important; font-size: .92rem !important; margin-top: 14px !important; max-width: 30ch; }
.footer-titre { font-family: var(--texte); font-size: .74rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 600; color: #b9a993; margin: 0 0 12px; }
.footer-contact { display: grid; }
.footer-liens { list-style: none; padding: 0; margin: 0; display: grid !important; gap: 0 !important; }
.footer-liens a, .agriweb-legal-links a { display: inline-block; padding: 6px 0; font-size: .92rem !important; text-decoration: none; }
.footer-liens a:hover, .agriweb-legal-links a:hover { text-decoration: underline; }
.agriweb-legal-links { display: grid; }
.footer-bottom { border-top: 1px solid rgba(244,239,230,.12) !important; color: #b9a993 !important; font-size: .82rem !important; }
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: 26px; } .site-footer { padding-top: 40px; } }

/* ---------- Pages de contenu (pages légales, articles) ---------- */
.prose h1 { margin-bottom: 8px; }
.entry-content { font-size: 1rem; }
.entry-content h2 { font-size: 1.5rem; margin: 2em 0 .6em; }
.entry-content h3 { margin: 1.6em 0 .4em; }
.entry-content a { color: var(--green); }
.eyebrow { color: var(--muted); }
.module-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); }

/* Barre d'administration WordPress (connecté) : l'en-tête se place juste dessous */
.admin-bar .site-header { top: 32px; }
@media (max-width: 1024px) { .admin-bar #site-nav { top: 108px; } }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } .admin-bar #site-nav { top: 122px; } }
@media (max-width: 600px) { .admin-bar #site-nav { top: 114px; } html #wpadminbar { position: fixed; } }
html:has(body.admin-bar) { scroll-padding-top: 128px; }

/* ---------- Pages légales ---------- */
.aw-legal-tete { padding: 64px 0 40px; border-bottom: 1px solid var(--line); background: var(--papier-2); }
.aw-legal-tete h1 { margin: 0 0 14px; }
.aw-legal-resume { font-size: 1.12rem; color: var(--muted); max-width: 60ch; margin: 0 0 12px; }
.aw-legal-version { display: inline-block; margin: 0; padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: .85rem; color: var(--muted); border-radius: 12px; }
.aw-legal-grille { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 56px; padding: 48px 0 80px; align-items: start; }
.aw-legal-cote { position: sticky; top: 100px; display: grid; gap: 24px; max-height: calc(100vh - 120px); overflow-y: auto; }
.admin-bar .aw-legal-cote { top: 132px; }
.aw-legal-sommaire { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.aw-legal-sommaire summary { cursor: pointer; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); list-style: none; }
.aw-legal-sommaire summary::-webkit-details-marker { display: none; }
.aw-legal-sommaire ol { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 4px; font-size: .92rem; }
.aw-legal-sommaire a, .aw-legal-docs a { color: var(--ink); text-decoration: none; }
.aw-legal-sommaire a:hover, .aw-legal-docs a:hover { color: var(--green); text-decoration: underline; }
.aw-legal-sommaire a.actif { color: var(--green); font-weight: 600; }
.aw-legal-cote-titre { margin: 0 0 8px; font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.aw-legal-docs ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: .92rem; }
.aw-legal-docs a { display: block; padding: 6px 12px; border-radius: 10px; }
.aw-legal-docs a[aria-current="page"] { background: var(--soft); color: var(--deep); font-weight: 600; }
.aw-legal-texte { max-width: 760px; min-width: 0; font-size: 1.02rem; }
.aw-legal-texte h2 { font-size: 1.55rem; margin: 2.2em 0 .6em; padding-top: 8px; scroll-margin-top: 110px; }
.aw-legal-texte h2:first-child { margin-top: 0; }
.aw-legal-texte p, .aw-legal-texte li { color: #3a3029; }
.aw-legal-texte ul { padding-left: 22px; display: grid; gap: 6px; }
.aw-legal-texte a { color: var(--green); text-underline-offset: 3px; }
.aw-legal-texte code { font-size: .86em; background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; white-space: nowrap; }
.aw-fiche { display: grid; grid-template-columns: max-content 1fr; gap: 0; margin: 18px 0; border: 1px solid var(--line); border-radius: var(--r); background: #fff; overflow: hidden; }
.aw-fiche dt, .aw-fiche dd { margin: 0; padding: 12px 18px; border-bottom: 1px solid var(--line); }
.aw-fiche dt { font-weight: 600; color: var(--muted); font-size: .9rem; background: var(--papier-2); }
.aw-fiche dt:nth-last-of-type(1), .aw-fiche dd:last-of-type { border-bottom: 0; }
.aw-tableau { margin: 18px 0; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r); background: #fff; }
.aw-tableau table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
.aw-tableau th { text-align: left; background: var(--terre); color: #f4efe6; font-weight: 600; padding: 12px 14px; font-size: .82rem; letter-spacing: .02em; }
.aw-tableau td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.aw-tableau tbody tr:nth-child(even) td { background: var(--papier-2); }
.aw-legal-contact { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 32px; align-items: center; margin-top: 56px; padding: 26px 28px; border-radius: 18px; background: var(--deep); color: #eef1dc; }
.aw-legal-contact p { margin: 0; color: #dfe6cf; }
.aw-legal-contact-titre { font-family: var(--titres); font-size: 1.35rem; color: #fff !important; margin-bottom: 4px !important; }
.aw-legal-contact .lien-contact, .aw-legal-contact .lien-contact svg { color: #fff; }
.aw-legal-contact-liens { display: grid; }
@media (max-width: 960px) {
  .aw-legal-grille { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 28px; }
  .aw-legal-cote { position: static; max-height: none; overflow: visible; }
  .aw-legal-docs { display: none; }
  .aw-legal-sommaire summary { list-style: revert; }
  .aw-legal-tete { padding: 40px 0 28px; }
}
@media (max-width: 560px) {
  .aw-fiche { grid-template-columns: 1fr; }
  .aw-fiche dt { border-bottom: 0; padding-bottom: 2px; background: #fff; }
  .aw-fiche dd { padding-top: 0; }
  .aw-legal-contact { padding: 22px 20px; }
}

/* Lien « Gérer les cookies » du pied de page */
.lien-cookies { display: inline-block; padding: 6px 0; background: none; border: 0; color: #f4efe6; font: inherit; font-size: .92rem; cursor: pointer; text-align: left; }
.lien-cookies:hover { text-decoration: underline; }

/* ---------- Bandeau cookies ---------- */
.aw-cookies { position: fixed; z-index: 60; left: 50%; bottom: 20px; transform: translateX(-50%); width: min(760px, calc(100% - 32px)); display: flex; gap: 18px 24px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 18px 22px; border-radius: 18px; background: #fff; border: 1px solid var(--line-fort); box-shadow: 0 18px 50px rgba(42, 34, 28, .18); }
.aw-cookies[hidden] { display: none; }
.aw-cookies-texte { flex: 1 1 360px; }
.aw-cookies-texte p { margin: 0; font-size: .92rem; color: var(--muted); }
.aw-cookies-texte a { color: var(--green); }
.aw-cookies .aw-cookies-titre { font-family: var(--titres); font-size: 1.15rem; color: var(--ink); margin-bottom: 4px; }
.aw-cookies-boutons { display: flex; gap: 10px; }
.aw-cookies-boutons .button { min-height: 44px; padding: 8px 22px; }
@media (max-width: 560px) {
  .aw-cookies { bottom: 12px; padding: 16px; }
  .aw-cookies-boutons { width: 100%; }
  .aw-cookies-boutons .button { flex: 1; }
}
.aw-legal-texte p { margin: 0 0 1em; }
.aw-legal-texte dl p, .aw-legal-contact p { margin: 0; }
@media (max-width: 640px) {
  .aw-tableau { border: 0; background: transparent; overflow: visible; }
  .aw-tableau table { min-width: 0; display: block; }
  .aw-tableau thead { display: none; }
  .aw-tableau tbody { display: grid; gap: 12px; }
  .aw-tableau tr { display: block; background: #fff; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
  .aw-tableau td { display: block; border-top: 1px solid var(--line); padding: 10px 14px; background: #fff !important; }
  .aw-tableau td:first-child { border-top: 0; background: var(--terre) !important; color: #f4efe6; font-weight: 600; }
  .aw-tableau td:first-child a { color: #fff; }
  .aw-tableau td:not(:first-child)::before { content: attr(data-label); display: block; font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; color: var(--muted); margin-bottom: 2px; }
  .aw-tableau td:first-child code { background: rgba(255,255,255,.12); border-color: transparent; color: #fff; }
}
