/* ============================================================
   Onyx Basketball Academy — visionneuse des photos d'archives
   ------------------------------------------------------------
   Les photos de la page Archives sont affichées en vignettes
   d'environ 230 px alors que les fichiers font 480 à 900 px.
   Un clic les ouvre en grand par-dessus la page.

   Tout est en position:fixed et masqué au repos : la mise en
   page du site n'est touchée à aucune largeur.
   Couleurs et typographies reprises des tokens du README.
   ============================================================ */

/* --- Les vignettes deviennent cliquables ------------------- */
[data-onyx-zoom] {
  cursor: zoom-in;
  transition: filter 160ms ease, transform 160ms ease;
}
[data-onyx-zoom]:hover {
  filter: brightness(1.08);
}
[data-onyx-zoom]:focus-visible {
  outline: 3px solid #FFCB05;
  outline-offset: 3px;
}

/* --- La visionneuse ---------------------------------------- */
.onyx-lb {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 72px 64px 96px;
  background: rgba(6, 13, 32, 0.95);
  box-sizing: border-box;
}
.onyx-lb[data-ouvert] {
  display: flex;
  animation: onyx-lb-entree 180ms ease-out both;
}
@keyframes onyx-lb-entree {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.onyx-lb__image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  background: #0B1533;
  box-shadow: 0 24px 60px rgba(3, 7, 20, 0.6);
}

/* --- Légende et compteur ----------------------------------- */
.onyx-lb__pied {
  position: absolute;
  left: 64px;
  right: 64px;
  bottom: 26px;
  display: flex;
  align-items: baseline;
  gap: 18px;
  pointer-events: none;
}
.onyx-lb__legende {
  flex: 1;
  font-family: 'Archivo', sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: #c8d0e4;
}
.onyx-lb__compteur {
  flex: none;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.16em;
  color: #FFCB05;
}

/* --- Commandes --------------------------------------------- */
.onyx-lb button {
  position: absolute;
  background: rgba(11, 21, 51, 0.72);
  border: 2px solid #FFCB05;
  color: #FFCB05;
  cursor: pointer;
  font-family: 'Archivo', sans-serif;
  line-height: 1;
  transition: background 160ms ease, color 160ms ease;
}
.onyx-lb button:hover {
  background: #FFCB05;
  color: #0B1533;
}
.onyx-lb button:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 2px;
}

.onyx-lb__fermer {
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  font-size: 26px;
}
.onyx-lb__prec,
.onyx-lb__suiv {
  top: 50%;
  margin-top: -27px;
  width: 54px;
  height: 54px;
  font-size: 24px;
  font-weight: 700;
}
.onyx-lb__prec { left: 16px; }
.onyx-lb__suiv { right: 16px; }

/* --- Téléphone.
       Les flèches descendent au-dessus de la légende : sur les
       côtés elles mordraient sur une photo déjà étroite.       */
@media (max-width: 719px) {
  .onyx-lb {
    padding: 60px 12px 104px;
  }
  .onyx-lb__pied {
    left: 16px;
    right: 16px;
    bottom: 72px;
    flex-direction: column;
    gap: 6px;
  }
  .onyx-lb__legende { font-size: 14px; }

  .onyx-lb__prec,
  .onyx-lb__suiv {
    top: auto;
    margin-top: 0;
    bottom: 14px;
    width: 50px;
    height: 46px;
  }
  .onyx-lb__prec { left: 16px; }
  .onyx-lb__suiv { right: 16px; }

  .onyx-lb__fermer {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
  }
}

/* --- Mouvement réduit : on garde l'ouverture instantanée. */
@media (prefers-reduced-motion: reduce) {
  .onyx-lb[data-ouvert] { animation: none; }
  [data-onyx-zoom] { transition: none; }
}
