/* Le Carnet des diots, recettes de Savoie : DA « Boiserie d'alpage ».
   Tokens : neige bleutee, epicea, arolle, rouge diot, jacquere, ardoise (ratio 70 % clair / 20 % arolle / 10 % sombre).
   Contrastes AA verifies par scripts/contrast.py : l'arolle et la jacquere ne servent JAMAIS de couleur de texte. */

:root {
  --neige: #F2F4F1;
  --epicea: #23402F;
  --arolle: #C9A27A;        /* filets, fonds : jamais en texte */
  --arolle-clair: #EADFCF;  /* fond alterne */
  --arolle-texte: #664419;  /* variante foncee de l'arolle pour du texte */
  --diot: #8E2B2B;
  --diot-fonce: #6F1F1F;
  --jacquere: #E6D78A;      /* surlignage : jamais en texte */
  --ardoise: #3A3F44;
  --f-titre: 'Gloock', Georgia, 'Times New Roman', serif;
  --f-texte: 'Alegreya', Georgia, serif;
  --f-data: 'Barlow Semi Condensed', 'Arial Narrow', sans-serif;
  --measure-article: 840px;
  --measure-large: 1180px;
  --gutter: 20px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--neige); color: var(--epicea);
  font-family: var(--f-texte); font-size: 1.1875rem; line-height: 1.65;
  text-rendering: optimizeLegibility; overflow-wrap: break-word;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--diot); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--diot-fonce); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--diot); outline-offset: 3px; border-radius: 2px; }
.footer :focus-visible, .on-dark :focus-visible { outline-color: var(--jacquere); }
.skip { position: absolute; left: -999px; top: 0; background: var(--epicea); color: var(--neige); padding: .6rem 1rem; z-index: 100; }
.skip:focus { left: 0; }

h1, h2, h3, h4 { font-family: var(--f-titre); font-weight: 400; line-height: 1.15; color: var(--epicea); margin: 0 0 .6em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 4.6vw, 3.1rem); letter-spacing: -0.005em; }
h2 { font-size: clamp(1.55rem, 2.8vw, 2.05rem); margin-top: 2.1em; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); margin-top: 1.7em; }
p, ul, ol { margin: 0 0 1.15em; }
.donnee { font-family: var(--f-data); font-weight: 500; }

.container { width: 100%; max-width: var(--measure-large); margin-inline: auto; padding-inline: var(--gutter); }
.article { width: 100%; max-width: calc(var(--measure-article) + 2 * var(--gutter)); margin-inline: auto; padding: 1.6rem var(--gutter) 3rem; }

/* ---------- En-tete ---------- */
.header { background: var(--neige); border-bottom: 1px solid var(--arolle); }
.header__in { max-width: var(--measure-large); margin-inline: auto; padding: .8rem var(--gutter); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .4rem 1.6rem; }
.marque { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--epicea); }
.marque:hover { color: var(--epicea); }
.marque img { width: 42px; height: 42px; }
.marque__nom { font-family: var(--f-titre); font-size: 1.5rem; line-height: 1.05; display: block; }
.marque__sous { font-family: var(--f-data); font-weight: 500; font-size: .95rem; color: var(--arolle-texte); display: block; line-height: 1.2; }
.nav { display: flex; flex-wrap: wrap; gap: .1rem 1.3rem; }
.nav a { font-family: var(--f-data); font-weight: 600; font-size: 1.08rem; color: var(--epicea); text-decoration: none; padding: .45rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--diot); border-bottom-color: var(--diot); }
.nav a[aria-current="page"] { border-bottom-color: var(--diot); color: var(--diot); }

/* ---------- Hero pleine largeur, bord a bord ---------- */
.img-hero { width: 100%; aspect-ratio: 16 / 9; max-height: min(84vh, 800px); overflow: hidden; background: var(--arolle-clair); }
.img-hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 40%; }
.hero-titre { max-width: calc(var(--measure-article) + 2 * var(--gutter)); margin-inline: auto; padding: 1.8rem var(--gutter) 0; }
.hero-titre h1 { margin-bottom: .4em; }
.chapo { font-size: 1.3rem; line-height: 1.55; color: var(--epicea); margin-bottom: 1rem; }
.meta { font-family: var(--f-data); font-weight: 500; font-size: 1.02rem; color: var(--arolle-texte); display: flex; flex-wrap: wrap; gap: .2rem 1.1rem; margin: 0 0 1rem; }
.meta__cat { font-weight: 600; color: var(--diot); text-decoration: none; }
.meta__cat:hover { text-decoration: underline; }

.breadcrumbs { font-family: var(--f-data); font-size: 1rem; padding: 1rem 0 0; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .1rem .5rem; }
.breadcrumbs li:not(:last-child)::after { content: '/'; margin-left: .5rem; color: var(--arolle-texte); }
.breadcrumbs a { color: var(--arolle-texte); }
.breadcrumbs [aria-current] { color: var(--epicea); }

/* ---------- Frise de balcon (un seul separateur par page) ---------- */
.frise { display: block; width: 100%; height: 34px; color: var(--arolle); margin: 2.2rem 0 0; }
.frise--clair { color: var(--arolle); }
.frise-wrap { max-width: var(--measure-large); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Etiquette ronde facon tomme ---------- */
.tommes { display: flex; flex-wrap: wrap; gap: 1rem 1.4rem; margin: 1.2rem 0 1.6rem; }
.tomme { width: 112px; height: 112px; border-radius: 50%; background: var(--arolle-clair); border: 2px solid var(--arolle-texte); outline: 1px solid var(--arolle); outline-offset: -7px; display: grid; place-content: center; text-align: center; color: var(--epicea); padding: 6px; }
.tomme__val { font-family: var(--f-data); font-weight: 600; font-size: 1.5rem; line-height: 1.05; display: block; }
.tomme__lib { font-family: var(--f-data); font-weight: 500; font-size: .95rem; line-height: 1.1; color: var(--arolle-texte); display: block; margin-top: .15rem; }

/* ---------- Etapes numerotees (vraie sequence) ---------- */
.etapes { list-style: none; counter-reset: etape; padding: 0; margin: 1.2rem 0 2rem; }
.etapes > li { counter-increment: etape; position: relative; padding: 0 0 1.4rem 3.6rem; margin: 0; }
.etapes > li::before { content: counter(etape); position: absolute; left: 0; top: 0; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--jacquere); color: var(--epicea); font-family: var(--f-data); font-weight: 600; font-size: 1.3rem; display: grid; place-items: center; }
.etapes > li:not(:last-child)::after { content: ''; position: absolute; left: 1.2rem; top: 2.7rem; bottom: .2rem; width: 2px; background: var(--arolle); }
.etapes .etape-nom { display: inline; font-family: var(--f-data); font-weight: 600; font-size: 1.2rem; background: linear-gradient(transparent 58%, var(--jacquere) 58%); padding: 0 .15em; }
.etapes .etape-texte { display: block; margin-top: .3rem; }
.etapes figure { margin: .8rem 0 0; }

/* ---------- Encadres ---------- */
.encadre { background: var(--arolle-clair); border-left: 5px solid var(--arolle-texte); padding: 1.1rem 1.3rem; margin: 1.8rem 0; border-radius: 0 6px 6px 0; }
.encadre h2, .encadre h3 { font-size: 1.35rem; margin: 0 0 .5em; }
.encadre ul { margin: 0; padding-left: 1.2rem; }
.encadre li { margin-bottom: .35rem; }
.encadre p:last-child { margin-bottom: 0; }
.encadre--source { background: var(--neige); border: 1px solid var(--arolle); border-left: 5px solid var(--epicea); font-size: 1.02rem; }
.encadre--source a { overflow-wrap: anywhere; }
.verifie { font-family: var(--f-data); font-weight: 500; color: var(--arolle-texte); }
.independance { background: var(--arolle-clair); border-bottom: 1px solid var(--arolle); padding: .75rem var(--gutter); text-align: center; font-family: var(--f-data); font-weight: 500; font-size: 1.05rem; color: var(--epicea); }
.independance p { margin: 0; }

/* ---------- Corps d'article ---------- */
.prose { max-width: var(--measure-article); }
.prose a { font-weight: 500; }
.prose blockquote { margin: 1.6rem 0; padding: .2rem 1.3rem; border-left: 4px solid var(--arolle); font-style: italic; }
.prose figure { margin: 1.8rem 0; }
.img-fig { margin: 1.8rem 0; }
.prose figcaption { font-family: var(--f-data); font-size: 1rem; color: var(--arolle-texte); margin-top: .4rem; }
.prose li { margin-bottom: .35rem; }
.img-body { width: 100%; aspect-ratio: 3 / 2; overflow: hidden; border-radius: 6px; background: var(--arolle-clair); }
.img-body img, .img-card img, .img-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.img-portrait { width: 160px; aspect-ratio: 1 / 1; border-radius: 50%; overflow: hidden; border: 3px solid var(--arolle); }
.interview-q { font-weight: 700; color: var(--epicea); }

.table-wrap { overflow-x: auto; margin: 1.6rem 0; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: 1.02rem; font-family: var(--f-data); }
caption { text-align: left; font-family: var(--f-titre); font-size: 1.2rem; padding-bottom: .5rem; }
th, td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--arolle); vertical-align: top; }
thead th { background: var(--epicea); color: var(--neige); font-weight: 600; }
tbody tr:nth-child(even) { background: var(--arolle-clair); }
th[scope="row"] { font-weight: 600; }

/* ---------- Recette ---------- */
.recette-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; margin: 1rem 0 0; }
.ingredients { background: var(--arolle-clair); border: 1px solid var(--arolle); border-radius: 8px; padding: 1.2rem 1.4rem; }
.ingredients h2 { margin: 0 0 .6rem; font-size: 1.45rem; }
.ingredients ul { list-style: none; margin: 0; padding: 0; }
.ingredients li { padding: .4rem 0 .4rem 1.5rem; border-bottom: 1px dashed var(--arolle); position: relative; font-family: var(--f-data); font-size: 1.12rem; font-weight: 500; line-height: 1.4; }
.ingredients li:last-child { border-bottom: 0; }
.ingredients .nutrition { margin-top: 1rem; padding-top: .8rem; border-top: 1px solid var(--arolle); }
.ingredients .nutrition h3 { margin: 0 0 .3rem; font-size: 1.1rem; }
.ingredients .nutrition .donnee { margin: 0; }
.ingredients .nutrition-note { margin: .3rem 0 0; font-size: .9rem; opacity: .8; }
.ingredients li::before { content: ''; position: absolute; left: 0; top: .95rem; width: .7rem; height: .7rem; border-radius: 50%; background: var(--diot); }

/* ---------- Cards ---------- */
.grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1.8rem 1.5rem; margin: 1.4rem 0 2rem; padding: 0; list-style: none; }
.card { background: #fff; border: 1px solid var(--arolle); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; height: 100%; }
.card[hidden] { display: none; }
.card__lien { color: inherit; text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.card__lien:hover .card__titre { color: var(--diot); text-decoration: underline; }
.img-card { width: 100%; aspect-ratio: 3 / 2; overflow: hidden; background: var(--arolle-clair); position: relative; }
.card__corps { padding: 1rem 1.15rem 1.2rem; display: flex; flex-direction: column; gap: .35rem; flex: 1; }
.card__meta { font-family: var(--f-data); font-weight: 500; font-size: .98rem; color: var(--arolle-texte); display: flex; flex-wrap: wrap; gap: .1rem .9rem; }
.card__cat { font-weight: 600; color: var(--diot); }
.card__titre { font-family: var(--f-titre); font-size: 1.32rem; line-height: 1.2; margin: 0; color: var(--epicea); }
.card__desc { font-size: 1.02rem; line-height: 1.5; margin: 0; }
.card__duree { position: absolute; right: .7rem; bottom: .7rem; background: var(--neige); color: var(--epicea); font-family: var(--f-data); font-weight: 600; font-size: 1rem; padding: .15rem .65rem; border-radius: 999px; border: 1.5px solid var(--arolle-texte); }

/* ---------- Filtre du blog ---------- */
.filtre { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.2rem 0 .4rem; padding: 0; list-style: none; }
.filtre a { display: inline-block; font-family: var(--f-data); font-weight: 600; font-size: 1.05rem; color: var(--epicea); text-decoration: none; background: var(--neige); border: 1.5px solid var(--arolle-texte); border-radius: 999px; padding: .35rem 1rem; }
.filtre a:hover { background: var(--arolle-clair); color: var(--epicea); }
.filtre a[aria-current="true"], .filtre a[aria-pressed="true"] { background: var(--epicea); color: var(--neige); border-color: var(--epicea); }
.filtre-etat { font-family: var(--f-data); color: var(--arolle-texte); margin: 0 0 .6rem; min-height: 1.6rem; }

/* ---------- FAQ ---------- */
.faq details { border-bottom: 1px solid var(--arolle); padding: .2rem 0; }
.faq summary { cursor: pointer; font-family: var(--f-titre); font-size: 1.2rem; line-height: 1.3; padding: .7rem 0; list-style-position: outside; }
.faq details[open] summary { color: var(--diot); }
.faq .reponse { padding: 0 0 .8rem; }

/* ---------- Boutons, formulaire ---------- */
.btn { display: inline-block; background: var(--diot); color: var(--neige); font-family: var(--f-data); font-weight: 600; font-size: 1.15rem; padding: .7rem 1.5rem; border-radius: 6px; border: 0; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--diot-fonce); color: var(--neige); }
.form label { display: block; font-family: var(--f-data); font-weight: 600; margin: 1rem 0 .3rem; }
.form input, .form textarea { width: 100%; font: inherit; color: var(--epicea); background: #fff; border: 1.5px solid var(--arolle-texte); border-radius: 6px; padding: .6rem .8rem; }
.form .hp { position: absolute; left: -9999px; }

/* ---------- Pied de page ---------- */
.footer { background: var(--ardoise); color: var(--neige); margin-top: 3rem; }
.footer__in { max-width: var(--measure-large); margin-inline: auto; padding: 2.2rem var(--gutter) 1.6rem; display: grid; gap: 1.6rem 3rem; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.footer a { color: var(--neige); }
.footer a:hover { color: var(--neige); text-decoration-thickness: 2px; }
.footer__nom { font-family: var(--f-titre); font-size: 1.45rem; margin: 0 0 .4rem; color: var(--neige); }
.footer p { margin: 0 0 .6rem; font-size: 1.05rem; }
.footer ul { list-style: none; margin: 0; padding: 0; font-family: var(--f-data); font-size: 1.1rem; }
.footer li { margin-bottom: .3rem; }
.footer__bas { grid-column: 1 / -1; border-top: 1px solid #5b6168; padding-top: 1rem; font-family: var(--f-data); font-size: 1rem; }

/* ---------- Tablette / mobile ---------- */
@media (min-width: 900px) {
  .recette-grid { grid-template-columns: minmax(260px, 340px) minmax(0, 1fr); align-items: start; gap: 2.4rem; }
  .ingredients { position: sticky; top: 1rem; }
}
@media (max-width: 640px) {
  body { font-size: 1.125rem; }
  .footer__in { grid-template-columns: minmax(0, 1fr); }
  .tomme { width: 98px; height: 98px; }
  .tomme__val { font-size: 1.3rem; }
  .nav { gap: .05rem 1rem; }
  .nav a { font-size: 1.02rem; }
  .etapes > li { padding-left: 3.1rem; }
  .img-hero { aspect-ratio: 4 / 3; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media print { .header, .footer, .filtre, .frise, .independance { display: none; } body { background: #fff; } }

/* ---------- Repli du bandeau sans image (phase 02, avant la generation des images) ---------- */
.img-hero--vide { aspect-ratio: auto; height: clamp(110px, 16vw, 190px); background: linear-gradient(90deg, var(--arolle-clair), var(--neige)); border-bottom: 3px solid var(--arolle); }
.plan-liste { list-style: none; padding: 0; margin: 0 0 1.4rem; }
.plan-liste li { padding: .3rem 0; border-bottom: 1px dotted var(--arolle); }
.plan-liste .attente { color: var(--arolle-texte); font-family: var(--f-data); font-size: 1rem; }
.piliers-acces { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; list-style: none; padding: 0; margin: 1.2rem 0 2rem; }
.piliers-acces a { display: block; height: 100%; padding: 1rem 1.1rem; background: var(--arolle-clair); border-left: 5px solid var(--diot); border-radius: 0 6px 6px 0; text-decoration: none; color: var(--epicea); }
.piliers-acces a:hover { background: var(--neige); box-shadow: 0 0 0 1px var(--arolle); }
.piliers-acces strong { display: block; font-family: var(--f-titre); font-size: 1.25rem; line-height: 1.2; margin-bottom: .3rem; }
.piliers-acces span { font-size: 1.02rem; line-height: 1.45; }
.form-statut { margin-top: 1rem; font-family: var(--f-data); font-weight: 600; }
.form-statut[data-etat="ok"] { color: var(--epicea); }
.form-statut[data-etat="erreur"] { color: var(--diot); }
.form select { width: 100%; font: inherit; color: var(--epicea); background: #fff; border: 1.5px solid var(--arolle-texte); border-radius: 6px; padding: .6rem .8rem; }

/* ---------- Entretiens (A2, A4) ---------- */
.prose .interview-expert-card { margin: 1.6rem 0 2rem; padding: 1.1rem 1.4rem; background: var(--arolle-clair); border-left: 5px solid var(--epicea); border-radius: 6px; }
.prose .interview-expert-card p { margin: .2rem 0; }
.prose .interview-expert-card .expert-name { font-family: var(--f-titre); color: var(--epicea); font-size: 1.15em; }
/* Garde-fou : les questions/réponses d'interview sont des <p> ici ; si un blockquote portait ces classes, il ne devrait pas hériter du style de citation. */
blockquote.journalist-question, blockquote.expert-answer { font-size: 1rem !important; font-style: normal !important; line-height: 1.7 !important; }
.prose p.journalist-question { font-family: var(--f-data); font-weight: 600; font-size: 1.15rem; color: var(--epicea); margin: 1.6rem 0 .6rem; padding-left: .9rem; border-left: 4px solid var(--diot); }

/* Sommaire des intertitres (nav.toc) */
.toc { margin: 1.6rem 0; padding: 1rem 1.3rem; background: var(--arolle-clair); border-left: 4px solid var(--arolle); border-radius: 6px; }
.toc-title { margin: 0 0 .5rem; font-family: var(--f-data); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; font-size: .95rem; color: var(--epicea); }
.toc ol { margin: 0; padding-left: 1.2rem; }
.toc li { margin: .3rem 0; }
.toc a { color: var(--epicea); text-decoration: underline; text-decoration-color: var(--arolle); text-underline-offset: 3px; }
.toc a:hover, .toc a:focus-visible { color: var(--diot); }
