/* Lightbox – modális fotónézegető (js/lightbox.js). Mindig sötét háttéren, a téma világos/sötét módjától függetlenül. */

/* ---------- a nyitó gomb (a képen) ---------- */
.mc-lb-open {
  position: absolute; inset: 0; z-index: 4; display: block; width: 100%; height: 100%; margin: 0; padding: 0;
  border: 0; border-radius: inherit; background: transparent; cursor: zoom-in; color: #fff;
  -webkit-tap-highlight-color: transparent;
}
.mc-lb-open__icon {
  position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(20, 12, 10, .66); border: 1px solid rgba(255, 255, 255, .5); color: #fff;
  transition: background .2s ease, transform .2s ease;
}
.mc-lb-open:hover .mc-lb-open__icon { background: rgba(20, 12, 10, .86); transform: scale(1.06); }
.mc-lb-open:focus-visible { outline: 3px solid #E2A862; outline-offset: -3px; }
.mc-lb-open:focus-visible .mc-lb-open__icon { background: rgba(20, 12, 10, .92); }
/* kis képek (album, idővonal): kisebb ikon */
.al-photo .mc-lb-open__icon { width: 26px; height: 26px; right: 5px; bottom: 5px; }
.al-photo .mc-lb-open__icon svg { width: 12px; height: 12px; }
.st-mimg .mc-lb-open__icon { right: 8px; bottom: 8px; }

/* ---------- a lightbox ---------- */
html.mc-lb-lock, html.mc-lb-lock body { overflow: hidden; }
.mc-lb {
  position: fixed; inset: 0; z-index: 2000; display: flex; background: #0A0604;
  opacity: 0; transition: opacity .2s ease; color: #F6F1E8;
}
.mc-lb[hidden] { display: none; }
.mc-lb.is-closing { pointer-events: none; }
.mc-lb.is-on { opacity: 1; }
.mc-lb.is-instant { transition: none; }
.mc-lb__dialog {
  position: relative; width: 100%; height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto;
  padding: clamp(60px, 9vh, 76px) clamp(12px, 3vw, 40px) clamp(14px, 3vh, 26px); outline: 0;
}
.mc-lb__stage { min-height: 0; display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; align-items: center; gap: 8px; }
.mc-lb__figure { margin: 0; height: 100%; min-height: 0; display: flex; align-items: center; justify-content: center; }
.mc-lb__img {
  display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 6px;
  box-shadow: 0 24px 60px -24px rgba(0, 0, 0, .8); background: #1a1210; transition: opacity .25s ease;
}
.mc-lb__img.is-loading { opacity: 0; }
.mc-lb.is-instant .mc-lb__img { transition: none; }

.mc-lb__btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; padding: 0;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, .5); background: rgba(20, 12, 10, .72); color: #fff; cursor: pointer;
  transition: background .2s ease, border-color .2s ease;
}
.mc-lb__btn:hover { background: rgba(60, 40, 28, .9); border-color: #fff; }
.mc-lb__btn:focus-visible { outline: 3px solid #E2A862; outline-offset: 3px; }
.mc-lb__btn[hidden] { display: none; }
.mc-lb__close { position: absolute; top: clamp(10px, 2vh, 18px); right: clamp(10px, 2vw, 22px); z-index: 2; }

.mc-lb__caption { max-width: 72ch; margin: 14px auto 0; padding: 0 8px; text-align: center; }
.mc-lb__count { margin: 0 0 6px; font-family: var(--ui, system-ui, sans-serif); font-size: 12px; font-weight: 500; letter-spacing: .18em; font-variant-numeric: tabular-nums; color: rgba(246, 241, 232, .78); }
.mc-lb__title { margin: 0; font-family: var(--serif, Georgia, serif); font-weight: 400; font-size: clamp(20px, 2.4vw, 26px); line-height: 1.25; color: #fff; text-wrap: balance; }
.mc-lb__desc { margin: 8px 0 0; font-size: 15px; line-height: 1.6; color: rgba(246, 241, 232, .88); text-wrap: pretty; max-height: 22vh; overflow-y: auto; }

@media (max-width: 640px) {
  .mc-lb__dialog { padding-left: 8px; padding-right: 8px; }
  .mc-lb__stage { grid-template-columns: 40px minmax(0, 1fr) 40px; gap: 4px; }
  .mc-lb__nav.mc-lb__btn { width: 40px; height: 44px; border-radius: 12px; }
  .mc-lb__desc { font-size: 14px; max-height: 26vh; }
}
@media (max-height: 520px) and (orientation: landscape) {
  .mc-lb__dialog { padding-top: 12px; grid-template-rows: minmax(0, 1fr) auto; }
  .mc-lb__desc { display: none; }
  .mc-lb__close { top: 8px; right: 8px; width: 44px; height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .mc-lb, .mc-lb__img, .mc-lb-open__icon { transition: none; }
}
@media (forced-colors: active) {
  .mc-lb__btn, .mc-lb-open__icon { border: 1px solid CanvasText; background: Canvas; color: CanvasText; }
}

/* ---------- finom mozgás ----------
   Nyitás: a háttér áttűnik, a kép a kisképből nő ki (JS, WAAPI), a felirat és a gombok utána jönnek be.
   Léptetés: a kép becsúszik, a felirat áttűnik (JS). Zárás: a kép visszaszáll a kisképre.
   Mozgáscsökkentésnél (prefers-reduced-motion) semmi nem animál. */
.mc-lb { transition: opacity .4s ease; }
.mc-lb__caption { opacity: 0; transform: translateY(10px); transition: opacity .5s ease .2s, transform .7s cubic-bezier(.2, .7, .2, 1) .2s; }
.mc-lb.is-on .mc-lb__caption { opacity: 1; transform: none; }
.mc-lb__btn { opacity: 0; transform: scale(.9); transition: opacity .45s ease .26s, transform .6s cubic-bezier(.2, .7, .2, 1) .26s, background .2s ease, border-color .2s ease; }
.mc-lb.is-on .mc-lb__btn { opacity: 1; transform: none; }
.mc-lb.is-on .mc-lb__btn:hover { transform: scale(1.07); transition-delay: 0s; }
.mc-lb.is-on .mc-lb__btn:active { transform: scale(.96); transition-delay: 0s; }
.mc-lb__img { will-change: transform, opacity; }

/* a kisképek finoman közelítenek, ha rájuk mutatsz (csak egérnél) */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  [data-lb-item] img { transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
  [data-lb-item]:hover img { transform: scale(1.035); }
}
@media (prefers-reduced-motion: reduce) {
  .mc-lb, .mc-lb__caption, .mc-lb__btn { transition: none; transform: none; }
  .mc-lb.is-on .mc-lb__caption, .mc-lb.is-on .mc-lb__btn { transform: none; }
}
.mc-lb.is-instant, .mc-lb.is-instant .mc-lb__caption, .mc-lb.is-instant .mc-lb__btn { transition: none; }
