/* =========================================================
   Gallery lightbox (album view) — see js/lightbox.js
========================================================= */

/* Gallery images are clickable */
.neta-lightbox-trigger {
    cursor: zoom-in;
}

.neta-lightbox-trigger:focus-visible {
    outline: 3px solid var(--neta-brass, #8f7b5d);
    outline-offset: 4px;
}

/* Page behind the album does not scroll */
html.neta-lightbox-open,
html.neta-lightbox-open body {
    overflow: hidden !important;
}

/* ---------- Overlay ---------- */

.neta-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2147483000; /* above the header and the floating buttons */

    /* Row 1: image area (takes all remaining height).
       Row 2: fixed bar with counter + buttons — never moves. */
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 18px;

    padding:
        max(24px, env(safe-area-inset-top))
        16px
        max(24px, env(safe-area-inset-bottom));

    background: rgba(24, 17, 10, 0.92);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);

    /* No browser zoom inside the album at all: quick taps on the arrows
       (double-tap zoom) and fast swipes (read as a pinch on iPhone) used to
       leave the page zoomed in. Swipes still work — they are handled in
       lightbox.js from the touch events. */
    touch-action: none;
    -webkit-tap-highlight-color: transparent;

    /* A fast double click must not select the counter text. */
    user-select: none;
    -webkit-user-select: none;

    animation: neta-lightbox-in 0.22s ease;
}

.neta-lightbox[hidden] {
    display: none;
}

@keyframes neta-lightbox-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ---------- Image ---------- */

.neta-lightbox__stage {
    margin: 0;
    min-height: 0;

    display: flex;
    align-items: center;
    justify-content: center;
}

/* The side thirds of the image area step through the album (lightbox.js) */
@media (hover: hover) {
    .neta-lightbox--multi .neta-lightbox__stage {
        cursor: pointer;
    }
}

.neta-lightbox__image {
    display: block;

    /* Scales to fit the image area — any size or orientation */
    max-width: min(100%, 1200px);
    max-height: 100%;
    width: auto;
    height: auto;

    object-fit: contain;
    border-radius: 18px;

    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);

    user-select: none;
    -webkit-user-drag: none;
}

.neta-lightbox__bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.neta-lightbox__counter {
    margin: 0;

    color: rgba(255, 250, 241, 0.72);
    font-family: var(--font-label, Arial, sans-serif);
    font-size: 13px;
    font-weight: 700;
    direction: ltr;
}

/* ---------- Controls:  ‹  ✕  › ---------- */

.neta-lightbox__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.neta-lightbox__btn {
    position: relative;
    touch-action: none;

    width: 54px;
    height: 54px;
    padding: 0;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;
    border: 1px solid rgba(255, 250, 241, 0.28);

    background: rgba(255, 250, 241, 0.1);
    color: #fffaf1;

    transition: background 0.2s ease, transform 0.2s ease;
}

.neta-lightbox__btn[hidden] {
    display: none;
}

/* Invisible hit area around each button: half the gap on every side, so
   neighbouring areas meet but never overlap. */
.neta-lightbox__btn::before {
    content: "";
    position: absolute;
    inset: -8px;
    border-radius: inherit;
}

.neta-lightbox__btn i {
    font-size: 30px;
    line-height: 1;
    pointer-events: none;
}

/* Hover styles only where a real hover exists — on a phone :hover sticks
   after a tap, which left the ✕ scaled up. */
@media (hover: hover) {
    .neta-lightbox__btn:hover {
        background: rgba(255, 250, 241, 0.2);
    }
}

.neta-lightbox__btn:focus-visible {
    outline: 3px solid var(--neta-brass-light, #cdbb98);
    outline-offset: 3px;
}

/* ✕ — the way back to the page */
.neta-lightbox__btn--close {
    width: 60px;
    height: 60px;

    background: #fffaf1;
    border-color: #fffaf1;
    color: var(--neta-walnut, #24190f);
}

@media (hover: hover) {
    .neta-lightbox__btn--close:hover {
        background: #ffffff;
        transform: scale(1.05);
    }
}

/* Touch screens: wider spacing and a bigger invisible hit area */
@media (pointer: coarse) {
    .neta-lightbox__controls {
        gap: 28px;
    }

    .neta-lightbox__btn::before {
        inset: -14px;
    }
}

@media (max-width: 560px) {
    .neta-lightbox {
        gap: 14px;
    }

    .neta-lightbox__image {
        border-radius: 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .neta-lightbox {
        animation: none;
    }

    .neta-lightbox__btn {
        transition: none;
    }
}
