/**
 * Core: Architektura stylów uniwersalnego frameworku Lightboxa
 * Zgodność z normami WCAG 2.1, płynne skalowanie transformacji oraz adaptacyjność Mobile
 */

.wp-lightbox-container {
    position: relative;
}

.wp-lightbox-container .lightbox-trigger {
    position: absolute;
    right: 16px;
    top: 16px;
    background: rgba(0, 0, 0, 0.6);
    border: 2px solid transparent;
    border-radius: 6px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

.wp-lightbox-container .lightbox-trigger:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

/* WCAG: Wyraźny indykator nawigacji klawiszowej */
.wp-lightbox-container .lightbox-trigger:focus-visible {
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
    background: #000;
}

.wp-lightbox-container img {
    cursor: zoom-in;
}

/* MODAL OVERLAY BACKDROP */
.addons-core-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(12, 12, 12, 0.96);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.25, 1, 0.5, 1);
    backdrop-filter: blur(10px);
    user-select: none;
}

.addons-core-lightbox.is-active {
    opacity: 1;
}

/* KONTENER STRUKTURALNY */
.addons-core-lightbox-content {
    position: relative;
    width: 90vw;
    height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    outline: none;
}

.addons-core-lightbox-viewport {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease-out;
    will-change: transform;
    cursor: grab;
}

.addons-core-lightbox-viewport:active {
    cursor: grabbing;
}

.addons-core-lightbox img {
    max-width: 100%;
    max-height: 72vh; /* Zmniejszono delikatnie wys. obrazka, by zrobić bezpieczne miejsce na podpis */
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.8);
    pointer-events: none;
    transform: scale(0.96);
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.addons-core-lightbox.is-active img {
    transform: scale(1);
}

/* PRZYCISKI PANELU KONTROLI */
.addons-lightbox-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.08);
    border: 2px solid transparent;
    border-radius: 50%;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    width: 50px;
    height: 50px;
    padding: 0;
}

.addons-lightbox-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.addons-lightbox-btn:focus-visible {
    outline: 3px solid #ffcc00;
    outline-offset: 2px;
    background: #000;
}

.addons-lightbox-close { top: 24px; right: 24px; width: 48px; height: 48px; }
.addons-lightbox-prev, .addons-lightbox-next { top: 50%; transform: translateY(-50%); width: 52px; height: 52px; }
.addons-lightbox-prev { left: 24px; }
.addons-lightbox-next { right: 24px; }
.addons-lightbox-btn svg { width: 22px; height: 22px; fill: currentColor; }

/* PODPIS I OPIS (STYLIZOWANY WEDŁUG PROŚBY W STYLU LICZNIKA) */
.addons-lightbox-caption {
    position: absolute;
    bottom: 56px; /* Ulokowany idealnie nad licznikiem */
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    background: rgba(0, 0, 0, 0.7);
    padding: 6px 18px;
    border-radius: 20px;
    pointer-events: none;
    z-index: 1000000;
    max-width: 75vw;
    text-align: center;
    line-height: 1.4;
    word-break: break-word;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* INTERAKTYWNY LICZNIK STRON */
.addons-lightbox-counter {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    color: #eeeeee;
    font-size: 12px;
    font-weight: 600;
    background: rgba(0, 0, 0, 0.7);
    padding: 4px 14px;
    border-radius: 20px;
    letter-spacing: 0.5px;
    pointer-events: none;
    z-index: 1000000;
}

/* Ukrycie kontrolek nawigacji i licznika gdy element jest pojedynczy */
.addons-core-lightbox.is-singular .addons-lightbox-prev,
.addons-core-lightbox.is-singular .addons-lightbox-next,
.addons-core-lightbox.is-singular .addons-lightbox-counter {
    display: none !important;
}
/* W przypadku braku licznika dla pojedynczego zdjęcia, podpis schodzi niżej na pozycję licznika */
.addons-core-lightbox.is-singular .addons-lightbox-caption {
    bottom: 16px !important;
}

@media (max-width: 768px) {
    .addons-lightbox-prev, .addons-lightbox-next { width: 44px; height: 44px; }
    .addons-lightbox-prev { left: 12px; }
    .addons-lightbox-next { right: 12px; }
    .addons-lightbox-close { top: 12px; right: 12px; }
    .addons-core-lightbox-content { width: 100vw; height: 75vh; }
    .addons-lightbox-caption { max-width: 90vw; bottom: 52px; font-size: 13px; }
}