/* ============================================================
   Version « brut »
   Une couverture jaune gilet jaune, des galeries noires où la photo prend tout l'écran.
   ============================================================ */

@font-face {
  font-family: "Archivo";
  src: url("polices/archivo-wdth.woff2") format("woff2");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --jaune: #ffd400;
  --bleu: #0155af;
  --noir: #000;
  --blanc: #fff;
  --marge: clamp(1rem, 2.6vw, 2.4rem);
}

* { box-sizing: border-box; }

html {
  background: var(--noir);
  color: var(--blanc);
  -webkit-text-size-adjust: 100%;
}
html.accueil { background: var(--jaune); color: var(--noir); }
html.accueil body { background: var(--jaune); color: var(--noir); }
html.galerie body { background: var(--noir); color: var(--blanc); }
/* Page Archives : bleu du blindé de gendarmerie */
html.accueil.bleu, html.accueil.bleu body { background: var(--bleu); color: var(--blanc); }
html.bleu .ligne { border-top-color: var(--blanc); }
html.bleu .sommaire li:last-child .ligne { border-bottom-color: var(--blanc); }
html.bleu .ligne:hover, html.bleu .ligne:focus-visible { background: var(--blanc); color: var(--bleu); }
html.bleu :focus-visible { outline-color: var(--blanc); }
html.bleu .couverture__photo img { object-position: 50% 82%; }

body {
  margin: 0;
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

img { display: block; }

a { color: inherit; }

:focus-visible { outline: 3px solid var(--jaune); outline-offset: 3px; }
.accueil :focus-visible,
.suite :focus-visible { outline-color: var(--noir); }
.barre :focus-visible { outline-color: var(--blanc); }

/* Le gros titre condensé, utilisé partout */
.display,
.ligne__nom {
  font-family: "Archivo", "Arial Narrow", "Helvetica Neue Condensed", Impact, sans-serif;
  font-stretch: 62%;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 0.8;
  letter-spacing: -0.005em;
}

/* ---------- Lignes de galeries (accueil + fin de galerie) ---------- */

.sommaire { list-style: none; margin: 0; padding: 0; }

.ligne {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0 0.75rem;
  border-top: 0.28rem solid var(--noir);
  text-decoration: none;
  color: inherit;
}
.sommaire li:last-child .ligne { border-bottom: 0.28rem solid var(--noir); }

.ligne__nom { font-size: clamp(2.2rem, 5.4vw, 5.6rem); line-height: 0.9; }
.ligne__n { font-weight: 600; font-variant-numeric: tabular-nums; }

.ligne:hover,
.ligne:focus-visible {
  background: var(--noir);
  color: var(--jaune);
  padding-inline: 0.8rem;
  margin-inline: -0.8rem;
}

/* ---------- Accueil ---------- */

.couverture {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  min-height: 100svh;
}

.couverture__texte {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2.5rem;
  padding: var(--marge);
  min-width: 0;
}

.couverture__titre {
  margin: 0;
  font-size: clamp(4.5rem, 15.5vw, 19rem);
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.couverture__sous {
  margin: 0;
  max-width: 40ch;
  text-wrap: balance;
  font-size: clamp(1rem, 1.4vw, 1.25rem);
  font-weight: 600;
}

/* La photo garde ses vraies couleurs, posée à côté du jaune */
.couverture__photo { position: relative; margin: 0; min-height: 60svh; }
.couverture__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.couverture.sans-photo { grid-template-columns: 1fr; }

/* Titre d'un sous-menu (ex. Archives) : un peu plus petit pour que le mot tienne sur une ligne */
.couverture__titre--sous { font-size: clamp(3.5rem, 10.5vw, 13rem); }

@media (max-width: 820px) {
  .couverture { grid-template-columns: 1fr; }
  .couverture__titre.couverture__titre--sous { font-size: clamp(3rem, 16vw, 8rem); }
  .couverture__photo { order: -1; min-height: 62svh; }
  .couverture__texte { gap: 3rem; }
  .couverture__titre { font-size: clamp(4.5rem, 26vw, 11rem); }
}

/* ---------- Galerie : barre du haut ---------- */

.barre {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem var(--marge);
  color: var(--blanc);
  font-size: 0.95rem;
  font-weight: 600;
  pointer-events: none; /* seuls les éléments cliquables captent la souris */
}

/* Chaque info est une pastille noire : lisible sur n'importe quelle photo */
.barre a,
.barre button,
.barre__titre,
.barre__compteur {
  padding: 0.35rem 0.65rem;
  background: var(--noir);
  color: var(--blanc);
  font: inherit;
  line-height: 1.2;
}
.barre a,
.barre button {
  pointer-events: auto;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 0.25em;
  cursor: pointer;
}
.barre a { justify-self: start; }
.barre__titre { justify-self: center; }

.barre__droite { justify-self: end; display: flex; align-items: center; gap: 0.35rem; }
.barre__compteur { font-variant-numeric: tabular-nums; }
.barre__compteur:empty { display: none; }

@media (max-width: 640px) {
  .barre { grid-template-columns: 1fr auto; }
  .barre__titre { display: none; }
}

/* ---------- Galerie : ouverture ---------- */

html.galerie { scroll-snap-type: y proximity; }
html.galerie[data-vue="planche"] { scroll-snap-type: none; }

.intro {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1.25rem;
  min-height: 100svh;
  padding: 6rem var(--marge) var(--marge);
  scroll-snap-align: start;
}
.intro h1 {
  margin: 0;
  color: var(--jaune);
  font-size: clamp(4rem, 17vw, 20rem);
  overflow-wrap: anywhere;
}
.intro p { margin: 0; max-width: 46ch; font-size: clamp(1rem, 1.5vw, 1.3rem); }
.intro .intro__lieu { font-weight: 700; }

/* ---------- Galerie : une photo par écran ---------- */

/* La photo a sa zone (sous la barre du haut), la légende a sa bande dessous :
   rien ne se pose par-dessus l'image. */
.plan {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100svh;
  margin: 0;
  padding-top: 3.5rem;
  scroll-snap-align: start;
}
.plan img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}
.plan figcaption {
  display: flex;
  flex-direction: column;
  max-width: 70ch;
  padding: 0.7rem var(--marge) 0.9rem;
  color: var(--blanc);
  font-size: 0.95rem;
}
.plan:not(:has(figcaption)) { padding-bottom: 0.9rem; }
.plan figcaption strong { font-weight: 800; }

/* ---------- Galerie : planche ---------- */

.planche {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 4.5rem 6px 6px;
  list-style: none;
}
.planche::after { content: ""; flex-grow: 1000000; }
.planche li {
  flex-grow: calc(var(--r) * 100);
  flex-basis: calc(var(--r) * 300px);
  aspect-ratio: var(--r);
  min-width: 0;
}
.planche a { display: block; height: 100%; }
.planche img { width: 100%; height: 100%; object-fit: cover; }
.planche a:hover img { opacity: 0.8; }

html[data-vue="planche"] .planche { display: flex; }
html[data-vue="planche"] .plan,
html[data-vue="planche"] .intro { display: none; }

/* ---------- Galerie : fin ---------- */

.suite {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 1.25rem;
  min-height: 60svh;
  padding: var(--marge);
  background: var(--jaune);
  color: var(--noir);
  scroll-snap-align: start;
}
.suite__texte { margin: 0; font-weight: 700; }

.vide { font-size: clamp(1.2rem, 2vw, 1.8rem); font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---------- Pied de page ---------- */
.pied { margin: 0; font-size: 0.85rem; font-weight: 600; }
.pied a { text-underline-offset: 0.2em; }
.pied--galerie { padding: 0.9rem var(--marge); background: var(--jaune); color: var(--noir); }
