/* =========================
   NLH LIGHTBOX (assets/scripts/lightbox.js)
   ========================= */

/* Wyzwalacze */
.nlh-lb-zoom {
    cursor: zoom-in;
}

img.nlh-lb-zoom,
.nlh-lb-zoom img {
    transition: opacity 0.2s ease, transform 0.3s ease;
}

img.nlh-lb-zoom:hover,
.nlh-lb-zoom:hover img {
    opacity: 0.9;
}

.nlh-lb-zoom:focus-visible {
    outline: 3px solid var(--main-orange, #ff6900);
    outline-offset: 3px;
}

/* Blokada przewijania strony pod spodem */
html.nlh-lb-open {
    overflow: hidden;
}

html.nlh-lb-open body {
    padding-right: var(--nlh-lb-scrollbar, 0);
}

/* Okno */
.nlh-lb {
    position: fixed;
    inset: 0;
    z-index: 1090; /* nad navbarem i modalami Bootstrapa */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(4, 10, 24, 0.97);
    animation: nlh-lb-fade 0.2s ease;
    -webkit-tap-highlight-color: transparent;
}

.nlh-lb[hidden] {
    display: none;
}

.nlh-lb__stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 64px 80px 56px;
    touch-action: pan-y;
}

.nlh-lb__figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
}

.nlh-lb__img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 160px);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.25s ease, transform 0.25s ease;
    user-select: none;
}

.nlh-lb__img.is-visible {
    opacity: 1;
    transform: none;
}

.nlh-lb__caption {
    max-width: 800px;
    margin-top: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-primary, sans-serif);
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: center;
}

.nlh-lb__caption[hidden] {
    display: none;
}

.nlh-lb__counter {
    position: absolute;
    top: 14px;
    left: 20px;
    color: rgba(255, 255, 255, 0.75);
    font-family: var(--font-secondary, sans-serif);
    font-size: 1.4rem;
    letter-spacing: 0.05em;
}

/* Przyciski */
.nlh-lb__btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.nlh-lb__btn:hover {
    background: var(--main-orange, #ff6900);
}

.nlh-lb__btn:focus-visible {
    outline: 3px solid var(--main-orange, #ff6900);
    outline-offset: 2px;
}

.nlh-lb__btn[hidden] {
    display: none;
}

.nlh-lb__close {
    top: 10px;
    right: 14px;
}

.nlh-lb__prev,
.nlh-lb__next {
    top: 50%;
    transform: translateY(-50%);
}

.nlh-lb__prev {
    left: 16px;
}

.nlh-lb__next {
    right: 16px;
}

.nlh-lb__prev:active,
.nlh-lb__next:active {
    transform: translateY(-50%) scale(0.92);
}

/* Ładowanie / błąd */
.nlh-lb__spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    margin: -21px 0 0 -21px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--main-orange, #ff6900);
    border-radius: 50%;
    animation: nlh-lb-spin 0.8s linear infinite;
}

.nlh-lb__spinner[hidden],
.nlh-lb__error[hidden] {
    display: none;
}

.nlh-lb__error {
    position: absolute;
    color: rgba(255, 255, 255, 0.8);
    font-family: var(--font-primary, sans-serif);
}

@keyframes nlh-lb-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes nlh-lb-spin {
    to { transform: rotate(360deg); }
}

/* Telefony: strzałki na dole, mniej marginesu na zdjęcie */
@media (max-width: 767.98px) {
    .nlh-lb__stage {
        padding: 56px 8px 84px;
    }

    .nlh-lb__img {
        max-height: calc(100vh - 170px);
        border-radius: 4px;
    }

    .nlh-lb__prev,
    .nlh-lb__next {
        top: auto;
        bottom: 16px;
        transform: none;
    }

    .nlh-lb__prev:active,
    .nlh-lb__next:active {
        transform: scale(0.92);
    }

    .nlh-lb__prev {
        left: calc(50% - 60px);
    }

    .nlh-lb__next {
        right: calc(50% - 60px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .nlh-lb,
    .nlh-lb__img,
    .nlh-lb__btn,
    img.nlh-lb-zoom,
    .nlh-lb-zoom img {
        animation: none;
        transition: none;
    }

    .nlh-lb__spinner {
        animation-duration: 2s;
    }
}
