/* Pro-Direct Agriculture : « Tôle et prairie ». CSS statique, sans framework. */
:root {
  --zinc: #EEF1EE;
  --prairie: #3F6B3A;
  --prairie-clair: #DDE7D8;
  --bardage: #2F4A5C;
  --encre: #1E2A24;
  --colza: #E8C547;
  --blanc: #FFFFFF;
  --filet: #C9D1C9;
  /* Rubriques : nuances de bardage et de prairie, jamais un arc-en-ciel. */
  --rub-batiments: #2F4A5C;
  --rub-stockage: #4F6B7C;
  --rub-materiel: #6E8794;
  --rub-elevage: #3F6B3A;
  --rub-precision: #5C8456;
  --rub-environnement: #7FA277;
  --rub-installation: #26394A;
  --font-titre: var(--af-archivo, 'Archivo'), 'Arial Narrow', Arial, sans-serif;
  --font-texte: var(--af-source-serif, 'Source Serif 4'), Georgia, serif;
  --gouttiere: 16px;
  --tole: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='14'%3E%3Cpath d='M0 14V12L4 2H14L18 12V14Z'/%3E%3C/svg%3E");
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; height: auto; display: block; }
body { margin: 0; background: var(--zinc); color: var(--encre); font-family: var(--font-texte); font-size: 1.0625rem; line-height: 1.6; }
h1, h2, h3, h4 { font-family: var(--font-titre); font-stretch: 118%; font-weight: 700; line-height: 1.18; color: var(--bardage); margin: 0; text-wrap: balance; }
a { color: var(--bardage); text-underline-offset: .18em; }
a:hover { color: var(--prairie); }
:focus-visible { outline: 3px solid var(--bardage); outline-offset: 2px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--colza); color: var(--encre); padding: 8px 14px; z-index: 10; }
.skip:focus { left: 8px; top: 8px; }
.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gouttiere); }

/* Anti-distorsion : wrappers à aspect-ratio fixe */
.img-hero, .img-card, .img-body, .img-portrait { overflow: hidden; background: var(--prairie-clair); }
.img-hero img, .img-card img, .img-body img, .img-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.img-hero { width: 100%; max-height: min(75vh, 44vw); }
.img-hero--16-9 { aspect-ratio: 16 / 9; }
.img-hero--3-2 { aspect-ratio: 3 / 2; }
.img-card { aspect-ratio: 3 / 2; }
.img-body { aspect-ratio: 3 / 2; }
.img-portrait { aspect-ratio: 1 / 1; border-radius: 50%; }

/* En-tête et pied de page : bleu bardage */
.site-header { background: var(--bardage); color: var(--blanc); }
.header-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; flex-wrap: wrap; }
.brand { font-family: var(--font-titre); font-stretch: 122%; font-weight: 700; font-size: 1.25rem; color: var(--blanc); text-decoration: none; }
.brand:hover { color: var(--blanc); }
.menu summary { list-style: none; cursor: pointer; font-family: var(--font-titre); font-weight: 700; padding: 8px 14px; border: 2px solid var(--blanc); border-radius: 2px; }
.menu summary::-webkit-details-marker { display: none; }
.menu[open] { flex-basis: 100%; }
.menu ul, .site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; }
.menu nav { padding: 10px 0 14px; }
.menu a { color: var(--blanc); text-decoration: none; font-family: var(--font-titre); font-weight: 700; font-stretch: 112%; font-size: .9375rem; display: inline-block; padding: 6px 0; border-bottom: 3px solid transparent; }
.menu a:hover, .menu a[aria-current] { border-bottom-color: var(--colza); color: var(--blanc); }
@media (min-width: 960px) {
  .menu summary { display: none; }
  .menu > nav { padding: 0; }
  .menu::details-content { content-visibility: visible; display: block; }
  .menu[open] { flex-basis: auto; }
}
.site-footer { background: var(--bardage); color: var(--blanc); margin-top: 64px; padding: 36px 0; }
.footer-in { display: grid; gap: 14px; }
.brand-foot { font-family: var(--font-titre); font-stretch: 122%; font-weight: 700; font-size: 1.125rem; margin: 0; }
.foot-desc { margin: 0; max-width: 60ch; opacity: .92; }
.site-footer a { color: var(--blanc); }
.site-footer a:hover { color: var(--colza); }

/* Hero : bandeau bord à bord, titre dessous, aligné à gauche */
.hero-text { padding-block: 22px 8px; }
.hero h1 { font-size: clamp(1.7rem, 1.1rem + 2.6vw, 2.9rem); max-width: 24ch; }
.kicker { font-family: var(--font-titre); font-weight: 700; font-stretch: 112%; font-size: .9375rem; color: var(--prairie); margin: 0 0 6px; }
.lead { font-size: 1.1875rem; max-width: 62ch; margin: 12px 0 0; }

/* Article */
.article-grid { max-width: calc(72ch + 2 * var(--gouttiere)); padding-block: 8px; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .9375rem; margin: 0 0 18px; color: #3B4A41; }
.prose { max-width: 72ch; }
.prose h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); margin: 2.2rem 0 .7rem; }
.prose h3 { font-size: 1.2rem; margin: 1.6rem 0 .5rem; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.05rem; }
.prose li { margin-bottom: .35rem; }
.prose figure { margin: 1.6rem 0; }
.prose figure .img-body { aspect-ratio: 3 / 2; }
.prose blockquote { margin: 1.4rem 0; padding: 4px 0 4px 18px; border-left: 4px solid var(--prairie); background: var(--prairie-clair); }
.toc { background: var(--prairie-clair); padding: 14px 18px; margin: 0 0 24px; max-width: 72ch; }
.toc-title { font-family: var(--font-titre); font-weight: 700; font-stretch: 112%; margin: 0 0 6px; color: var(--bardage); }
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.faq { margin-top: 2.4rem; max-width: 72ch; }
.faq h2, .sources h2, .related h2 { font-size: 1.5rem; margin-bottom: 12px; }
.faq details { background: var(--blanc); border-left: 4px solid var(--prairie); margin-bottom: 8px; padding: 12px 16px; }
.faq summary { cursor: pointer; font-family: var(--font-titre); font-weight: 700; font-stretch: 108%; color: var(--bardage); }
.faq details p { margin: 10px 0 0; }
.sources { margin-top: 2rem; padding: 16px 18px; border: 1px solid var(--filet); background: var(--blanc); max-width: 72ch; font-size: .9375rem; }
.sources ul { margin: 0 0 10px; padding-left: 1.1rem; }
.verifie { margin: 0; font-weight: 600; }

/* Tableaux techniques : en-tête bardage, filet colza sur la ligne active */
.tableau { margin: 1.6rem 0; }
.tableau figcaption { font-family: var(--font-titre); font-weight: 700; font-stretch: 112%; color: var(--bardage); margin-bottom: 8px; }
.tableau-scroll { overflow-x: auto; }
.prose table, .tableau table { border-collapse: collapse; width: 100%; font-size: .9375rem; background: var(--blanc); }
.prose th, .tableau th { background: var(--bardage); color: var(--blanc); text-align: left; padding: 10px 12px; font-family: var(--font-titre); font-weight: 700; font-size: .9375rem; }
.prose td, .tableau td { padding: 10px 12px; border-bottom: 1px solid var(--filet); vertical-align: top; }
.prose tr:hover td, .tableau tr.actif td, .tableau tr:hover td { box-shadow: inset 0 -3px 0 var(--colza); }
.prose table { display: block; overflow-x: auto; }

/* Cards : bord haut en tôle nervurée à la couleur de la rubrique (l'unique audace) */
.grid { display: grid; gap: 22px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 17.5rem), 1fr)); }
.card { --rub: var(--bardage); position: relative; background: var(--blanc); padding-top: 14px; }
.card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 14px; background: var(--rub); -webkit-mask: var(--tole) repeat-x left top / 32px 14px; mask: var(--tole) repeat-x left top / 32px 14px; }
.rub-batiments { --rub: var(--rub-batiments); }
.rub-stockage { --rub: var(--rub-stockage); }
.rub-materiel { --rub: var(--rub-materiel); }
.rub-elevage { --rub: var(--rub-elevage); }
.rub-precision { --rub: var(--rub-precision); }
.rub-environnement { --rub: var(--rub-environnement); }
.rub-installation { --rub: var(--rub-installation); }
.card[hidden] { display: none; }
.card-link { display: block; color: inherit; text-decoration: none; height: 100%; }
.card-body { padding: 14px 16px 18px; }
.card-rub { font-family: var(--font-titre); font-weight: 700; font-stretch: 112%; font-size: .875rem; color: var(--bardage); margin: 0; }
.card h3 { font-size: 1.1875rem; margin: 6px 0 8px; color: var(--encre); }
.card time { font-size: .875rem; color: #3B4A41; }
.card-link:hover h3 { color: var(--prairie); text-decoration: underline; }
.related { margin-top: 3rem; }

/* Filtres de rubriques */
.filtre { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; }
.chip { font: 700 .9375rem/1 var(--font-titre); font-stretch: 108%; padding: 10px 14px; background: var(--blanc); color: var(--encre); border: 2px solid var(--bardage); border-radius: 2px; cursor: pointer; }
.chip:hover { background: var(--prairie-clair); }
.chip[aria-pressed="true"] { background: var(--colza); border-color: var(--encre); color: var(--encre); }

/* Bouton d'appel à l'action */
.btn { display: inline-block; background: var(--colza); color: var(--encre); font: 700 1rem/1 var(--font-titre); padding: 13px 20px; border: 2px solid var(--encre); border-radius: 2px; text-decoration: none; }
.btn:hover { background: var(--encre); color: var(--colza); }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }

/* Pages utilitaires */
.filtre[hidden] { display: none; }
.filtre-count { font-size: .9375rem; margin: 0 0 18px; color: #3B4A41; min-height: 1.6em; }
.bloc { padding-block: 40px 8px; }
.bloc h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); margin-bottom: 16px; }
.titre-page { font-size: clamp(1.7rem, 1.1rem + 2.6vw, 2.6rem); margin-bottom: 12px; max-width: 28ch; }
.plus { margin: 24px 0 0; }
.rubriques { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); }
.rubriques li { --rub: var(--bardage); background: var(--blanc); border-left: 8px solid var(--rub); }
.rubriques a { display: block; padding: 14px 16px; text-decoration: none; color: var(--encre); height: 100%; }
.rubriques a:hover { background: var(--prairie-clair); }
.rub-nom { display: block; font-family: var(--font-titre); font-stretch: 112%; font-weight: 700; color: var(--bardage); font-size: 1.125rem; margin-bottom: 4px; }
.rub-txt { display: block; font-size: .9375rem; }
.bloc-methode { max-width: calc(72ch + 2 * var(--gouttiere)); }
.page-texte { max-width: calc(72ch + 2 * var(--gouttiere)); padding-block: 8px 0; }
.page-texte .prose { max-width: 72ch; }

/* Formulaire de contact */
.contact-form { display: grid; gap: 16px; max-width: 560px; margin: 24px 0; }
.form-group { display: grid; gap: 6px; }
.contact-form label { font-family: var(--font-titre); font-weight: 700; font-stretch: 108%; color: var(--bardage); }
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form select, .contact-form textarea { width: 100%; font: inherit; padding: 11px 12px; border: 2px solid var(--bardage); border-radius: 2px; background: var(--blanc); color: var(--encre); }
.contact-form textarea { resize: vertical; }
.contact-form .btn { justify-self: start; cursor: pointer; }
.contact-form .btn:disabled { opacity: .6; cursor: wait; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#contact-status { margin: 0; min-height: 1.6em; font-weight: 600; }
#contact-status.ok { color: #25502A; }
#contact-status.ko { color: #8A2020; }
