/* Haute Ariège — feuille de style */
:root {
  --bg: #101714;
  --bg-2: #182220;
  --ink: #ede6d6;
  --ink-2: #a9a395;
  --line: #2b3831;
  --sapin: #4c8a63;
  --ocre: #c98d52;
  --ocre-2: #dca66e;
  --ciel: #93b7d6;
  --calcaire: #d8d2c4;
  --font-title: "Bricolage Grotesque", "Arial Narrow", sans-serif;
  --font-text: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --wrap: 1160px;
  --gutter: 16px;
  --side: max(var(--gutter), calc((100% - var(--wrap)) / 2));
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* Grands écrans : texte un peu plus grand pour que la colonne ne paraisse pas perdue. */
@media (min-width: 1800px) { html { font-size: 18px; } }
@media (min-width: 2400px) { html { font-size: 20px; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--font-text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ciel); text-underline-offset: .15em; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--ocre-2); outline-offset: 3px; }
h1, h2, h3 {
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.02em;
  margin: 0 0 .5em;
  font-variation-settings: "opsz" 96, "wdth" 92;
}
h1 { font-size: clamp(3.2rem, 11vw, 7.5rem); font-weight: 800; letter-spacing: -.035em; }
h2 { font-size: clamp(2rem, 4.6vw, 3rem); }
h3 { font-size: 1.35rem; font-weight: 600; font-variation-settings: "opsz" 24, "wdth" 100; }
p { margin: 0 0 1em; max-width: 62ch; }
.muted { color: var(--ink-2); }
.wrap { width: min(var(--wrap), 100% - 2 * var(--gutter)); margin-inline: auto; padding-block: clamp(3rem, 7vw, 5.5rem); }

/* Courbes de niveau : séparateur entre sections */
.contour {
  height: 56px;
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
  color: var(--line);
  overflow: hidden;
}
.contour svg { width: 100%; height: 100%; display: block; }

/* En-tête */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; flex-wrap: wrap; gap: .35rem 1.5rem; align-items: baseline;
  padding: .7rem var(--side);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--font-title); font-weight: 700; font-size: 1.2rem; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand small { font-family: var(--font-text); font-weight: 400; font-size: .8rem; color: var(--ink-2); margin-left: .5em; }
.topbar nav { display: flex; gap: 1.1rem; font-size: .95rem; overflow-x: auto; margin-left: auto; scrollbar-width: none; }
.topbar nav a { color: var(--ink-2); text-decoration: none; white-space: nowrap; padding: .2em 0; }
.topbar nav a:hover, .topbar nav a[aria-current] { color: var(--ink); }

/* Accroche */
.hero {
  position: relative;
  min-height: 92svh;
  display: grid; align-items: end;
  overflow: hidden;
  background: var(--bg-2);
}
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; z-index: 0; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, var(--bg) 0%, rgba(16,23,20,.72) 32%, rgba(16,23,20,.12) 70%, rgba(16,23,20,0) 100%);
}
.hero-inner, .hero .contour { position: relative; z-index: 2; }
.hero-inner {
  width: min(var(--wrap), 100% - 2 * var(--gutter));
  margin-inline: auto;
  padding: 3rem 0 2.5rem;
}
.hero-inner > * { max-width: 46rem; }
.kicker { color: var(--ocre-2); font-size: 1.05rem; margin: 0 0 .6rem; }
.lead { font-size: clamp(1.15rem, 2.1vw, 1.4rem); line-height: 1.4; max-width: 34ch; }
.cta { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1.6rem 0 1.2rem; max-width: none; }
.meta { font-size: .95rem; color: var(--ink-2); max-width: none; }
.meta b { color: var(--ink); font-weight: 600; }
.btn {
  display: inline-block; padding: .85rem 1.5rem; border-radius: 6px;
  text-decoration: none; font-weight: 600; font-size: 1rem; line-height: 1.2;
  border: 1px solid transparent;
}
.btn-primary { background: var(--ocre); color: #1b130a; }
.btn-primary:hover { background: var(--ocre-2); }
.btn-ghost { border-color: rgba(237,230,214,.35); color: var(--ink); background: rgba(16,23,20,.35); }
.btn-ghost:hover { border-color: var(--ink); }
.hero .contour { position: absolute; z-index: 2; left: 0; right: 0; bottom: 0; width: 100%; height: 40px; color: rgba(216,210,196,.22); }

/* Vidéo */
.video-frame { position: relative; aspect-ratio: 16 / 9; background: var(--bg-2); border-radius: 8px; overflow: hidden; }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Galerie */
.gallery { display: grid; gap: 10px; grid-template-columns: 1fr; }
.gallery figure { margin: 0; }
.gallery a { display: block; border-radius: 6px; overflow: hidden; background: var(--bg-2); }
.gallery img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gallery a:hover img, .gallery a:focus-visible img { filter: brightness(1.08); }
.gallery figcaption { font-size: .92rem; color: var(--ink-2); padding: .45rem .1rem 0; }
@media (min-width: 640px) {
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery figure:first-child { grid-column: span 2; }
  .gallery figure:first-child img { aspect-ratio: 21 / 9; }
}
@media (min-width: 960px) {
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .gallery figure:first-child { grid-column: span 2; grid-row: span 2; }
  .gallery figure:first-child img { aspect-ratio: auto; height: 100%; }
}

/* Colonnes */
.cols { display: grid; gap: 2rem 2.5rem; grid-template-columns: 1fr; }
.cols article p { max-width: 40ch; }
@media (min-width: 720px) { .cols { grid-template-columns: repeat(3, 1fr); } .cols-2 { grid-template-columns: 1fr 1fr; } }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .98rem; }
th, td { text-align: left; padding: .55rem .6rem .55rem 0; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { color: var(--ink-2); font-weight: 400; }
tbody th { font-weight: 600; white-space: nowrap; color: var(--ink); padding-right: 1rem; }
.tag {
  display: inline-block; font: 600 .8rem/1.2 var(--font-text);
  color: var(--ink); background: var(--bg-2); border: 1px solid var(--line);
  padding: .2em .55em; border-radius: 4px; vertical-align: middle; margin-left: .35em;
}
.tag[data-todo] { color: #1b130a; background: var(--ocre); border-color: var(--ocre); }

/* Versions : chronologie à colonne de dates */
.version-list { display: grid; gap: 0; }
.version-list article {
  display: grid; grid-template-columns: 7.5rem 1fr; gap: .25rem 1.25rem;
  padding: 1.1rem 0; border-top: 1px solid var(--line);
}
.version-list article:last-child { border-bottom: 1px solid var(--line); }
.version-list time { font-family: var(--font-title); font-weight: 600; font-size: 1.05rem; color: var(--ocre-2); font-variation-settings: "opsz" 24, "wdth" 100; padding-top: .15rem; }
.version-list h3 { margin: 0 0 .25rem; grid-column: 2; }
.version-list p { margin: 0; grid-column: 2; }
.version-list ul { margin: .5rem 0 0; padding-left: 1.1em; color: var(--ink-2); grid-column: 2; }
.version-list li { margin: .15em 0; }
@media (max-width: 520px) {
  .version-list article { grid-template-columns: 1fr; gap: .15rem; }
  .version-list h3, .version-list p, .version-list ul { grid-column: 1; }
}

/* Pied */
.footer { font-size: .95rem; color: var(--ink-2); padding-block: 2rem 2.5rem; }
.footer p { max-width: 70ch; }
.footer a { color: var(--ink); }

/* Lightbox */
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(6,9,8,.94); display: grid; place-items: center; padding: 1rem; }
.lightbox[hidden] { display: none; }
.lightbox figure { margin: 0; max-width: 100%; }
.lightbox img { max-width: 100%; max-height: 82vh; object-fit: contain; border-radius: 4px; margin-inline: auto; }
.lightbox figcaption { color: var(--ink-2); text-align: center; margin-top: .75rem; font-size: .95rem; }
.lightbox button {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(237,230,214,.1); color: var(--ink); border: 0;
  font-size: 2rem; line-height: 1; width: 3rem; height: 3rem; border-radius: 50%; cursor: pointer;
}
.lightbox button:hover { background: rgba(237,230,214,.2); }
.lightbox .prev { left: .5rem; }
.lightbox .next { right: .5rem; }
.lightbox .close { top: 1rem; right: 1rem; transform: none; font-size: 1.5rem; }

/* Bandeau dev */
.dev-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 60; background: var(--ocre); color: #1b130a; font-size: .9rem; padding: .5rem var(--gutter); }
.dev-banner[hidden] { display: none; }

/* Page versions : titre moins massif */
#journal h1 { font-size: clamp(2.6rem, 6vw, 4rem); }

/* Ligne d'infos sous le bouton */
.meta code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; color: var(--ink); }
.checksum { display: block; margin-top: .35rem; word-break: break-all; }

/* Tableaux de config et de commandes : pleine section mais largeur de lecture bornée */
.config table, .commandes table { max-width: 56rem; }
.config .muted, .commandes .muted { margin-top: 1rem; }
