/* Zine brut : noir sur blanc, police système mono, rien de plus.
   Pour changer l'ambiance, modifie surtout les 6 variables ci-dessous. */
:root {
  --fond: #ffffff;
  --encre: #111111;
  --gris: #777777;
  --largeur: 40rem;
  --bh: clamp(18rem, 64vh, 40rem); /* hauteur des photos en bande : suit la hauteur de la fenêtre */
  --police: "Courier New", Courier, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 1.5rem 1rem 4rem;
  background: var(--fond);
  color: var(--encre);
  font-family: var(--police);
  font-size: 1rem;
  line-height: 1.55;
}

a { color: var(--encre); text-decoration: underline; text-underline-offset: 2px; }
a:hover { background: var(--encre); color: var(--fond); text-decoration: none; }


h1 { font-size: 1.4rem; text-transform: uppercase; letter-spacing: .05em; margin: 0 0 1rem; }
h2 { font-size: 1rem; text-transform: uppercase; margin: 2.5rem 0 .75rem; border-bottom: 1px dashed var(--encre); }

.meta, figcaption, .date { color: var(--gris); font-size: .85rem; }

.photo { margin: 1.5rem 0; }
.photo img { display: block; width: 100%; height: auto; }
.photo figcaption { margin-top: .3rem; }

.liste { list-style: none; padding: 0; margin: 0; }
.liste li { padding: .35rem 0; border-bottom: 1px dotted var(--gris); }
.liste .date { display: inline-block; min-width: 6.5rem; }
.liste .type { color: var(--gris); }

.bouton { display: inline-block; border: 2px solid var(--encre); padding: .4rem 1rem;
          text-decoration: none; font-weight: bold; margin: 1rem 0; }

hr { border: 0; border-top: 1px dashed var(--encre); margin: 2.5rem 0 1rem; }
footer { font-size: .85rem; color: var(--gris); }
footer a { color: var(--gris); }

/* Variante « photocopie » : décommente pour un fond légèrement gris et du grain.
body { background: #f2f1ee; }
*/

/* Liste des séries : vignette + titre */
.series { list-style: none; padding: 0; margin: 2rem 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem 1rem; }
.series a { text-decoration: none; display: block; }
.series img { display: block; width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border: 1px solid var(--encre); }
.series span { display: block; margin-top: .3rem; text-transform: uppercase; font-size: .9rem; text-decoration: underline; text-underline-offset: 2px; }
.series a:hover span { background: var(--encre); color: var(--fond); text-decoration: none; }

/* Bord de négatif : cadre noir irrégulier autour des photos (comme un tirage scanné
   avec le bord du film). Pour le supprimer : efface ce bloc et remets
   ".photo img { border: 1px solid var(--encre); }" plus haut. */
.cadre { position: relative; display: block; padding: 7px 9px 8px 6px; /* écrasé par photo, voir eleventy.config.js */ }
.cadre::before { content: ""; position: absolute; inset: 0; background: #0a0a0a; }
.cadre.f0::before { filter: url(#bn0); }
.cadre.f1::before { filter: url(#bn1); }
.cadre.f2::before { filter: url(#bn2); }
.cadre.f3::before { filter: url(#bn3); }
.cadre.f4::before { filter: url(#bn4); }
.cadre.f5::before { filter: url(#bn5); }
.cadre img { position: relative; display: block; }
.photo { margin: 2.2rem 0; }

/* Planche de vignettes (page série) */
.planche { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem .6rem; align-items: center; margin: 2.5rem 0; }
@media (max-width: 1200px) { .planche { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .planche { grid-template-columns: repeat(2, 1fr); gap: 2rem 1rem; } }
.vignette { margin: 0; }
.vignette a { display: flex; justify-content: center; text-decoration: none; background: none; }
.vignette .cadre { display: inline-block; }
.vignette img { width: auto; max-width: 100%; max-height: 13rem; }

/* Agrandissement (lightbox) */
#lb { position: fixed; inset: 0; z-index: 10; background: var(--fond); display: flex; flex-direction: column;
      align-items: center; justify-content: center; padding: 1rem; cursor: pointer; }
#lb[hidden] { display: none; }

#lb p { margin: .8rem 0 0; color: var(--gris); font-size: .85rem; }
body.lb-open { overflow: hidden; }

/* Grand cadre (agrandissement) : bord de négatif épais, avec les marques du bord de pellicule en bas */
.gcadre { position: relative; display: block; }
.gcadre::before { content: ""; position: absolute; inset: 0; background: #0a0a0a; }
.gcadre.g0::before { filter: url(#bg0); }
.gcadre.g1::before { filter: url(#bg1); }
.gcadre.g2::before { filter: url(#bg2); }
.gcadre::after { content: ""; position: absolute; left: 5%; right: 3%; bottom: 6px; height: 7px; border-radius: 4px;
  background: repeating-linear-gradient(90deg, #1d1d1d 0 44px, transparent 44px 112px); }
.gcadre img { position: relative; display: block; max-width: calc(min(92vw, 1200px) - 34px); max-height: 74vh; width: auto; height: auto; }

/* Mise en page : menu à gauche sur ordinateur (liste à plat, tout visible),
   bouton « ☰ menu » sur téléphone (sans JavaScript : case à cocher + étiquette).
   Le contenu du menu est dans src/_data/menu.json. */
.page { max-width: none; margin: 0; }
.corps { max-width: var(--largeur); }
body.large .corps { max-width: none; }
.logo { display: block; font-weight: bold; letter-spacing: .15em; text-decoration: none; }
.menu-case { position: absolute; opacity: 0; pointer-events: none; }
.menu-bouton { display: none; cursor: pointer; border: 2px solid var(--encre); padding: .1rem .6rem; font-weight: bold; }
/* Menu : tout est fermé au départ, seule « Photographie » se déplie (sans JavaScript : balise details) */
.menu .groupe, .menu .entree { margin: 0 0 .95rem; }
.menu .entree:first-child, .menu .groupe:first-child { margin-top: 1.6rem; }
.menu summary { cursor: pointer; list-style: none; text-decoration: underline; text-underline-offset: 2px; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary::after { content: " +"; }
.menu details[open] > summary::after { content: " −"; }
.menu ul { list-style: none; margin: .45rem 0 0; padding: 0 0 0 1rem; }
.menu li { padding: .1rem 0; }
@media (min-width: 901px) {
  .page { display: grid; grid-template-columns: 15rem 1fr; gap: 3rem; }
  header { position: sticky; top: 1.5rem; align-self: start; max-height: calc(100vh - 3rem); overflow-y: auto; overflow-x: hidden; }
}
@media (max-width: 900px) {
  header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
           border-bottom: 2px solid var(--encre); padding-bottom: .6rem; margin-bottom: 1.5rem; }
  .menu-bouton { display: inline-block; }
  .menu { display: none; width: 100%; }
  .menu-case:checked ~ .menu { display: block; }
  .menu-case:focus-visible + .menu-bouton { outline: 2px solid var(--encre); outline-offset: 2px; }
}

/* Bandes d image (collaborations, expos) : une bande d'images côte à côte, puis le texte dessous */
.expo { margin: 0 0 3.5rem; }
.expo h2 { margin: 0 0 1rem; }
.bande { display: flex; gap: 1rem; align-items: center; overflow-x: auto; padding: .4rem 0 .8rem; }
.bande .vignette { flex: 0 0 auto; }
.bande .vignette img { max-height: var(--bh); max-width: none; }
.expo .infos { margin: .6rem 0 0; }

/* Smartphone : tout se lit à la verticale, une photo sous l'autre */
@media (max-width: 600px) {
  .planche { grid-template-columns: 1fr; gap: 1.6rem; }
  .bande { flex-direction: column; align-items: stretch; overflow-x: visible; }
  .bande .vignette a { justify-content: center; }
  .bande .vignette img { max-width: 100%; max-height: none; width: auto; }
  .bande .cadre { display: inline-block; max-width: 100%; }
}

/* Infos de série (années, appareils, pellicules) et vidéo */
.infos { color: var(--gris); font-size: .85rem; letter-spacing: .02em; }
.video { position: relative; max-width: 40rem; aspect-ratio: 16 / 9; margin: 1rem 0 .4rem; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Menu : pas de soulignement, catégories en gras */
.menu a, .menu summary { text-decoration: none; }
.menu a:hover, .menu summary:hover { text-decoration: none; }
.menu summary, .menu .entree > a, .menu .groupe > a { font-weight: normal; -webkit-text-stroke: .35px currentColor; }
.menu li a { font-weight: normal; }
.menu li a[aria-current="page"], .menu li a.actif { font-weight: bold; }

/* Page sans contour de négatif (ex. Wave Radio : pages de magazine) */
.sansbord .cadre, .sansbord .gcadre { padding: 0 !important; }
.sansbord .cadre::before, .sansbord .gcadre::before { display: none; }

/* Texte présent pour Google et les lecteurs d'écran, invisible à l'écran */
.cache { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Accueil : photo plus petite, qui tient en entier dans l'écran */
.accueil .photo img { max-height: 65vh; width: auto; max-width: 100%; }
.accueil .cadre { display: inline-block; }

/* Liste des textes (/chroniques/) : date, titre, début du texte */
.textes-liste { list-style: none; margin: 1.5rem 0; padding: 0; }
.textes-liste li { margin: 0 0 1.6rem; }
.textes-liste .date { display: block; }
.textes-liste a { font-weight: bold; }
.textes-liste .extrait { display: block; margin-top: .2rem; }
article audio { display: block; width: 100%; max-width: 30rem; margin: 1rem 0; }

/* Loupe : recherche dans les textes */
.recherche { display: flex; align-items: center; gap: .6rem; margin: 1.2rem 0 1.6rem; border-bottom: 2px solid var(--encre); padding-bottom: .3rem; }
.recherche label { display: flex; cursor: text; }
.recherche input { flex: 1; font: inherit; border: 0; background: transparent; color: inherit; padding: .2rem 0; outline: none; min-width: 0; }
.recherche input::placeholder { color: var(--gris); }
.recherche-nb { color: var(--gris); font-size: .85rem; white-space: nowrap; }
.textes-liste li[hidden], .recherche-vide[hidden] { display: none; }

/* Récit complet des documentaires : replié sous les photos */
.recit { margin: 2rem 0; max-width: 42rem; }
.recit summary { cursor: pointer; font-weight: bold; list-style: none; }
.recit summary::-webkit-details-marker { display: none; }
.recit summary::after { content: " +"; }
.recit[open] > summary::after { content: " −"; }
.recit[open] > summary { margin-bottom: 1rem; }
.recit h2, .recit h3 { margin: 1.6rem 0 .5rem; font-size: 1rem; }
/* Sans cadre noir, bloc par bloc : <div class="sansbord"> autour d'une bande */
.gcadre.sans { padding: 0 !important; }
.gcadre.sans::before { display: none; }

/* Logo plus grand sur ordinateur ; sur l'accueil la photo remonte à la hauteur du logo */
@media (min-width: 901px) {
  .logo { font-size: 1.7rem; line-height: 1; letter-spacing: .08em; }
  .accueil .photo { margin-top: 0; }
}

/* Série en bande irrégulière (série avec "bande": true dans series.json) : hauteurs et décalages variés */
@media (min-width: 901px) {
  .bande-irreg { display: flex; align-items: center; gap: 0; padding: 2.2rem 0 2.2rem; }
  .bande-irreg .vignette img { max-width: none; max-height: none; height: calc(var(--bh) * 0.75); width: auto; }
  .bande-irreg .vignette:nth-child(7n+1) img { height: calc(var(--bh) * 0.95); }
  .bande-irreg .vignette:nth-child(7n+2) img { height: calc(var(--bh) * 0.65); }
  .bande-irreg .vignette:nth-child(7n+3) img { height: calc(var(--bh) * 1.15); }
  .bande-irreg .vignette:nth-child(7n+4) img { height: calc(var(--bh) * 0.8); }
  .bande-irreg .vignette:nth-child(7n+5) img { height: calc(var(--bh) * 1.05); }
  .bande-irreg .vignette:nth-child(7n+6) img { height: calc(var(--bh) * 0.6); }
  .bande-irreg .vignette:nth-child(7n+7) img { height: calc(var(--bh) * 0.9); }
  .bande-irreg .vignette:nth-child(5n+1) { transform: translateY(-1.3rem); }
  .bande-irreg .vignette:nth-child(5n+2) { transform: translateY(1.1rem); }
  .bande-irreg .vignette:nth-child(5n+4) { transform: translateY(-.4rem); }
  .bande-irreg .vignette:nth-child(5n+5) { transform: translateY(1.6rem); }
  /* espaces inégaux : parfois collées, parfois séparées */
  .bande-irreg .vignette:nth-child(6n+1) { margin-right: 0; }
  .bande-irreg .vignette:nth-child(6n+2) { margin-right: 1.2rem; }
  .bande-irreg .vignette:nth-child(6n+3) { margin-right: .1rem; }
  .bande-irreg .vignette:nth-child(6n+4) { margin-right: 0; }
  .bande-irreg .vignette:nth-child(6n+5) { margin-right: 2rem; }
  .bande-irreg .vignette:nth-child(6n+6) { margin-right: .5rem; }
}

/* Pages à bandes d'images : la page ne déborde plus (la bande défile toute seule),
   le contenu part de la gauche et les textes gardent une largeur de lecture */
.corps { min-width: 0; }
body.large .page { max-width: none; }
body.large main > h1,
body.large main > p,
body.large main > details,
body.large main > ul { max-width: 50rem; }
.bande, .planche.bande { max-width: 100%; }

/* Série en bande régulière (série avec "bande": "reguliere" dans series.json) : même hauteur, petits espaces égaux */
@media (min-width: 901px) {
  .bande-reg { display: flex; align-items: center; gap: .3rem; padding: .4rem 0 1rem; }
  .bande-reg .vignette img { max-width: none; max-height: none; height: var(--bh); width: auto; }
}

/* Tas de photos au bout d'une bande (ex. le off de la couverture Wave Radio) : une grande à gauche, deux empilées à droite */
.tas { flex: 0 0 auto; align-self: flex-end; display: flex; gap: .3rem; align-items: flex-end; }
.tas-droite { display: flex; flex-direction: column; gap: .3rem; }
.tas .vignette img { max-width: none; max-height: none; width: auto; }
.tas-gauche { display: flex; gap: .3rem; align-items: flex-end; }
.tas-gauche .vignette img { height: calc(var(--bh) * .4); }
.tas-droite .vignette img { height: calc((var(--bh) * .4 - (var(--n, 2) - 1) * .3rem) / var(--n, 2)); }
@media (max-width: 900px) {
  .tas { display: block; }
  .tas-droite { display: block; margin-top: 0; }
  .tas .vignette { margin-bottom: 1.6rem; }
  .tas .vignette img, .tas-gauche .vignette img, .tas-droite .vignette img { height: auto; width: auto; max-width: 100%; }
}

/* Grilles de vignettes comme chez Ed Templeton : cases de taille fixe et espaces fixes.
   Si la fenêtre s'agrandit, il y a plus de vignettes par ligne (les espaces ne grandissent pas). */
@media (min-width: 901px) {
  .planche:not(.bande) { grid-template-columns: repeat(auto-fill, 14rem); gap: 2rem 1rem; justify-content: start; }
  /* Grille alignée (série avec "alignee": true) : cases plus petites, plus serrées */
  .planche-align:not(.bande) { grid-template-columns: repeat(auto-fill, 12rem); gap: 1.4rem .6rem; align-items: center; }
  .planche-align .vignette a { justify-content: center; }
  .planche-align .vignette img { max-height: 10.5rem; }
}
@media (max-width: 900px) { .planche-align { grid-template-columns: repeat(2, 1fr); } }

/* Typo du logo MONVILAIN : Plane Crash (fichier à mettre dans src/fonts/PlaneCrash.woff2 ou .ttf).
   Tant que le fichier n'est pas là, ou s'il ne charge pas, le navigateur prend la police de remplacement : une sans empattement. */
@font-face {
  font-family: "Plane Crash";
  src: url("/fonts/PlaneCrash.woff2") format("woff2"), url("/fonts/PlaneCrash.ttf") format("truetype"), url("/fonts/PlaneCrash.otf") format("opentype");
  font-display: swap;
}
.logo { font-family: "Plane Crash", "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: normal; font-synthesis: none; }
.logo { text-transform: none; }
