/* Képnézegető (src/components/Lightbox.astro). Méretek az élő Avada-nézegetőből (2026-11-19):
   felső sáv számlálóval és kerek gombokkal, függőleges lapozás, bélyegképek jobbra,
   640 px alatt alul. */

html:has(dialog.nagyito[open]) {
  overflow: hidden;
}

.nagyito {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgb(255 255 255 / 0.9);
  backdrop-filter: blur(8px);
  color: var(--awb-color8);
  font-size: 14px;
  line-height: 1.5;
  overflow: hidden;
}
.nagyito::backdrop {
  background: transparent;
}
.nagyito[open] {
  display: grid;
  grid-template: 'sav sav' 68px 'szinpad belyegek' minmax(0, 1fr) / minmax(0, 1fr) auto;
}
.nagyito.egy-kep[open] {
  grid-template-columns: minmax(0, 1fr) 0;
}

.nagyito-sav {
  grid-area: sav;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
}
.nagyito-szamlalo {
  margin: 0;
  color: rgb(20 22 23 / 0.7);
}
.nagyito-gombok {
  display: flex;
  gap: 6px;
}

.nagyito-gomb,
.nagyito-nyil {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgb(20 22 23 / 0.08);
  color: var(--awb-color8);
}
.nagyito-gomb:hover,
.nagyito-nyil:hover {
  background: rgb(20 22 23 / 0.16);
}
.nagyito-gomb {
  width: 44px;
  height: 44px;
  font-size: 18px;
}
.nagyito-gomb[hidden] {
  display: none;
}
.nagyito-gomb .ikon-szunet,
.nagyito-gomb[aria-pressed='true'] .ikon-lejatszas {
  display: none;
}
.nagyito-gomb[aria-pressed='true'] .ikon-szunet {
  display: block;
}

.nagyito-szinpad {
  position: relative;
  grid-area: szinpad;
}
.nagyito-dia {
  position: absolute;
  inset: 72px 24px 71px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0;
}
.nagyito-media {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}
.nagyito-kep {
  display: block;
  max-width: 100%;
  max-height: 100%;
  cursor: zoom-in;
}
.nagyitva .nagyito-kep {
  transform: scale(2);
  cursor: zoom-out;
}
.nagyito-felirat {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.72;
  text-align: center;
}

.nagyito-nyil {
  position: absolute;
  left: 50%;
  width: 48px;
  height: 48px;
  font-size: 28px;
  transform: translateX(-50%);
}
.nagyito-elozo {
  top: 12px;
}
.nagyito-kovetkezo {
  bottom: 12px;
}
.egy-kep .nagyito-nyil,
.egy-kep .nagyito-belyegek {
  display: none;
}

.nagyito-belyegek {
  grid-area: belyegek;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px 16px;
  overflow: auto;
  scrollbar-width: none;
}
.nagyito-belyeg {
  /* az élő méretezés: max(48px, 64px × (0.4 + 0.6 × 100vw / 1280px)), legfeljebb 64px */
  --meret: clamp(48px, 25.6px + 3vw, 64px);
  flex: 0 0 auto;
  width: var(--meret);
  height: var(--meret);
  border: 2px solid transparent;
  border-radius: 6px;
  background: rgb(20 22 23 / 0.08);
  overflow: hidden;
}
.nagyito-belyeg.aktiv {
  border-color: #198fd9;
}
.nagyito-belyeg img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (prefers-reduced-motion: no-preference) {
  .nagyito-kep {
    transition: transform 0.3s;
  }
  .be-lentrol {
    animation: nagyito-lentrol 0.4s ease-out;
  }
  .be-fentrol {
    animation: nagyito-fentrol 0.4s ease-out;
  }
}
@keyframes nagyito-lentrol {
  from {
    opacity: 0;
    transform: translateY(15%);
  }
}
@keyframes nagyito-fentrol {
  from {
    opacity: 0;
    transform: translateY(-15%);
  }
}

@media (max-width: 640px) {
  .nagyito[open] {
    grid-template: 'sav' 60px 'szinpad' minmax(0, 1fr) 'belyegek' 56px / minmax(0, 1fr);
  }
  .nagyito.egy-kep[open] {
    grid-template-rows: 60px minmax(0, 1fr) 0;
  }
  .nagyito-sav {
    padding: 8px;
  }
  .nagyito-dia {
    inset: 65px 8px 64px;
  }
  .nagyito-nyil {
    width: 41px;
    height: 41px;
  }
  .nagyito-elozo {
    top: 4px;
  }
  .nagyito-kovetkezo {
    bottom: 4px;
  }
  .nagyito-belyegek {
    flex-direction: row;
    padding: 0 8px 8px;
  }
}
