/*
 * Kép-nagyító (lightbox) — a natív <dialog> elemen.
 *
 * A sötét háttér és a fehér vezérlők itt nem design-döntés, hanem a nagyító működésének része:
 * a kép a teljes képernyőt kapja, a többi elem háttérbe lép. A gombok alakja, a betű a design-kör
 * dolga marad (currentColor, a téma betűje öröklődik).
 */
.lightbox {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    overflow: hidden;
}
.lightbox::backdrop { background: rgba(0, 0, 0, .92); }
/* A háttér ne görögjön a nagyító alatt (a ::backdrop ezt magától nem zárja). */
body.lightbox-open { overflow: hidden; }

.lightbox-figure {
    position: absolute;
    inset: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3.5rem 4rem 3rem;
    pointer-events: none; /* a háttér-kattintás a <dialog>-ra essen, a kép és a felirat viszont fogja */
}
.lightbox-image {
    max-width: 100%;
    max-height: calc(100vh - 7.5rem);
    object-fit: contain;
    pointer-events: auto;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .5);
}
.lightbox-fade { animation: lightbox-fade .25s ease-out; }
@keyframes lightbox-fade { from { opacity: 0; } to { opacity: 1; } }
.lightbox-loading .lightbox-image { opacity: .35; }
.lightbox-error .lightbox-image { visibility: hidden; }
.lightbox-caption {
    margin-top: .75rem;
    max-width: 60ch;
    text-align: center;
    font-size: .95rem;
    opacity: .85;
    pointer-events: auto;
}
.lightbox-caption[hidden] { display: none; }

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: inherit;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s;
}
.lightbox-close:hover, .lightbox-prev:hover, .lightbox-next:hover { background: rgba(255, 255, 255, .25); }
.lightbox-close:focus-visible, .lightbox-prev:focus-visible, .lightbox-next:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
.lightbox-close { top: .75rem; right: .75rem; }
.lightbox-prev { left: .75rem; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: .75rem; top: 50%; transform: translateY(-50%); }
.lightbox-prev[hidden], .lightbox-next[hidden] { display: none; }

.lightbox-counter {
    position: absolute;
    left: 0;
    right: 0;
    bottom: .75rem;
    text-align: center;
    font-size: .85rem;
    opacity: .7;
    font-variant-numeric: tabular-nums;
}
.lightbox-counter[hidden] { display: none; }

/* Telefonon a gombok kisebbek, a kép szélesebb: a lapozás úgyis húzással megy. */
@media (max-width: 575.98px) {
    .lightbox-figure { padding: 3rem .75rem 2.5rem; }
    .lightbox-image { max-height: calc(100vh - 5.5rem); }
    .lightbox-prev, .lightbox-next { width: 2.25rem; height: 2.25rem; font-size: 1.5rem; background: rgba(0, 0, 0, .35); }
    .lightbox-prev { left: .25rem; }
    .lightbox-next { right: .25rem; }
}
@media (prefers-reduced-motion: reduce) {
    .lightbox-fade { animation: none; }
    .lightbox-close, .lightbox-prev, .lightbox-next { transition: none; }
}
