/* Le Collectif In Extremis — feuille de style unique
   Reprend la mise en page de l'ancien site Indexhibit :
   menu fixe à gauche (251px), contenu à droite. */

:root {
  --menu-width: 251px;
  --pad-top: 27px;
  --pad-left: 29px;
  --img-height: 467px;   /* hauteur des photos dans les pages projet */
  --gap: 57px;           /* espace entre les photos */
  --text: #000;
  --hover: #525252;
  --grey: #999;
  --light: #dadada;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: #fff;
  color: var(--text);
  font-family: "Helvetica Neue", Arial, Verdana, sans-serif;
  font-size: 14px;
  line-height: 19px;
}
a { color: var(--text); text-decoration: none; }
a:hover { color: var(--hover); }
p { margin: 0 0 19px; }
img { border: 0; }
hr { border: 0; border-top: 1px solid var(--text); margin: 0 0 19px; }
.en { color: var(--grey); font-size: 13px; }   /* traductions anglaises */

/* ---------- menu ---------- */
#index {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--menu-width);
  padding: var(--pad-top) 20px 20px var(--pad-left);
  overflow-y: auto;
  background: #fff;
  z-index: 10;
}
#index .top { margin-bottom: 19px; }
#index .top img { display: block; max-width: 100%; height: auto; }
#index ul { list-style: none; margin: 0; padding: 0; }
#index ul.section { margin-bottom: 19px; }
#index .section-title { font-weight: bold; }
#index li.active a { color: var(--hover); font-style: italic; }
#index .bot { margin-top: 19px; }
#index .social a { margin-right: 6px; }
#index .social img { width: 24px; height: 24px; vertical-align: middle; }
#index .copy { color: var(--light); font-size: 12px; }

/* ---------- contenu ---------- */
#exhibit {
  margin-left: var(--menu-width);
  padding: var(--pad-top) var(--pad-left) 40px var(--pad-left);
}

/* accueil */
.home img { max-width: 100%; height: auto; display: block; margin-bottom: 8px; }

/* page Expositions : vignettes empilées */
.visual-index a { display: block; width: 300px; margin-bottom: 19px; }
.visual-index img { display: block; width: 300px; height: auto; }

/* pages texte (infos) */
.text-page { max-width: 600px; }

/* projet en défilement horizontal */
.format-horizontal #exhibit { padding-right: 0; }
.horizontal {
  display: flex;
  align-items: flex-start;
  gap: var(--gap);
  width: max-content;
  padding-right: var(--pad-left);
}
.horizontal .text { width: 457px; flex: none; }
.horizontal figure { margin: 0; flex: none; }
.horizontal figure img { display: block; height: var(--img-height); width: auto; }
.horizontal figure.video a.yt { position: relative; display: block; width: 700px; height: var(--img-height); background: #000; }
.horizontal figure.video a.yt img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.horizontal figure.video a.yt .play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px; background: #f00; border-radius: 12px; }
.horizontal figure.video a.yt .play::after { content: ""; position: absolute; left: 27px; top: 14px; border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff; }
.horizontal figure.video a.yt:hover img { opacity: 1; }
.horizontal figure.video iframe { display: block; width: 700px; height: var(--img-height); border: 0; }
.horizontal figcaption { margin-top: 3px; font-size: 12px; max-width: 700px; }


/* ---------- mobile ---------- */
@media (max-width: 760px) {
  #index { position: static; width: auto; padding: 20px 16px 0; overflow: visible; }
  #index .top img { width: 160px; }
  #index ul.section { margin-bottom: 12px; }
  #exhibit { margin-left: 0; padding: 20px 16px 40px; }
  .format-horizontal #exhibit { padding-right: 16px; }
  .horizontal { display: block; width: auto; padding-right: 0; }
  .horizontal .text { width: auto; margin-bottom: 19px; }
  .horizontal figure { margin-bottom: 16px; }
  .horizontal figure img { width: 100%; height: auto; }
  .horizontal figure.video a.yt { position: relative; display: block; width: 700px; height: var(--img-height); background: #000; }
.horizontal figure.video a.yt img { width: 100%; height: 100%; object-fit: cover; opacity: .85; }
.horizontal figure.video a.yt .play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; margin: -24px 0 0 -34px; background: #f00; border-radius: 12px; }
.horizontal figure.video a.yt .play::after { content: ""; position: absolute; left: 27px; top: 14px; border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff; }
.horizontal figure.video a.yt:hover img { opacity: 1; }
.horizontal figure.video iframe { width: 100%; height: auto; aspect-ratio: 3 / 2; }
  .visual-index a, .visual-index img { width: 100%; height: auto; }
}

/* ---------- agrandissement des photos ---------- */
.horizontal figure:not(.video) img { cursor: zoom-in; }
body.lb-open { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  background: #fff;
  display: flex; align-items: center; justify-content: center;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: calc(100vw - 140px); max-height: calc(100vh - 80px); width: auto; height: auto; cursor: pointer; }
.lightbox button {
  position: absolute; border: 0; background: none; color: var(--text);
  font: 300 56px/1 "Helvetica Neue", Arial, sans-serif; cursor: pointer; padding: 10px 18px;
}
.lightbox button:hover { color: var(--hover); }
.lb-prev { left: 8px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 8px; top: 50%; transform: translateY(-50%); }
.lb-close { top: 4px; right: 8px; font-size: 40px !important; }
.lb-count { position: absolute; bottom: 8px; left: 0; right: 0; margin: 0; text-align: center; font-size: 12px; color: var(--grey); }
@media (max-width: 760px) {
  .lightbox img { max-width: 100vw; max-height: calc(100vh - 100px); }
  .lb-prev, .lb-next { top: auto; bottom: 0; transform: none; }
}

/* titre lu par Google et les lecteurs d’écran, invisible à l’écran */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- ordinateur : photos à la hauteur de l'écran, menu et contenu centrés verticalement ---------- */
@media (min-width: 761px) {
  :root { --img-height: clamp(467px, calc(100vh - 160px), 1000px); }
  #index { display: flex; flex-direction: column; padding-top: 20px; padding-bottom: 20px; }
  #index > .top { margin-top: auto; }      /* auto en haut et en bas = centré, sans couper si l'écran est petit */
  #index > .bot { margin-bottom: auto; }
  .format-horizontal #exhibit,
  body:has(.text-page) #exhibit,
  .home-page #exhibit { min-height: 100vh; display: flex; align-items: center; padding-top: 20px; padding-bottom: 20px; }
  .horizontal { align-items: center; }
  .horizontal .text { max-height: var(--img-height); overflow-y: auto; }
  .horizontal figure.video a.yt,
  .horizontal figure.video iframe { width: calc(var(--img-height) * 1.5); }
}

/* photos en basse définition : jamais agrandies au-delà de leur taille réelle (--h, indiqué dans la page) */
@media (min-width: 761px) {
  .horizontal figure img[style*="--h"] { height: min(var(--img-height), var(--h)); }
}
