/* P24 Image Lightbox + AdSense - style */

.p24-ilba-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    background: rgba(0, 0, 0, 0.92);
    -webkit-tap-highlight-color: transparent;
    animation: p24-ilba-fade 0.18s ease-out;
}

.p24-ilba-overlay.is-open {
    display: flex;
    flex-direction: column;
}

@keyframes p24-ilba-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.p24-ilba-clickable {
    cursor: zoom-in;
}

/* Górny pasek - przycisk zamykania + licznik */
.p24-ilba-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    color: #fff;
    z-index: 10;
    pointer-events: none;
}

.p24-ilba-counter {
    font-size: 14px;
    background: rgba(0, 0, 0, 0.5);
    padding: 4px 10px;
    border-radius: 4px;
    pointer-events: auto;
}

.p24-ilba-close {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.p24-ilba-close:hover,
.p24-ilba-close:focus {
    background: rgba(255, 255, 255, 0.2);
    outline: none;
}

/* Layout główny: 3 kolumny (lewy ad / obrazek / prawy ad) */
.p24-ilba-stage {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(160px, 300px) minmax(0, 1fr) minmax(160px, 300px);
    grid-template-rows: 1fr;
    gap: 20px;
    padding: 60px 20px 30px;
    box-sizing: border-box;
    align-items: center;
    width: 100%;
    overflow: hidden;
}

/* Sloty reklamowe */
.p24-ilba-ad-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 250px;
}

.p24-ilba-ad-label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 6px;
}

.p24-ilba-ad-inner {
    width: 100%;
    min-height: 250px;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.p24-ilba-ad-inner ins.adsbygoogle {
    width: 100% !important;
    display: block !important;
}

/* Obszar obrazka */
.p24-ilba-image-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 0;
    position: relative;
}

.p24-ilba-image-wrap img {
    max-width: 100%;
    max-height: calc(100vh - 180px);
    width: auto;
    height: auto;
    display: block;
    object-fit: contain;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    background: #111;
}

.p24-ilba-caption {
    color: #fff;
    text-align: center;
    margin-top: 12px;
    padding: 8px 16px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    max-width: 90%;
    font-size: 14px;
    line-height: 1.4;
}

/* Strzałki nawigacji */
.p24-ilba-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 44px;
    height: 60px;
    font-size: 26px;
    cursor: pointer;
    border-radius: 4px;
    z-index: 5;
    transition: background 0.15s;
}

.p24-ilba-nav:hover,
.p24-ilba-nav:focus {
    background: rgba(255, 255, 255, 0.25);
    outline: none;
}

.p24-ilba-prev { left: 10px; }
.p24-ilba-next { right: 10px; }

.p24-ilba-nav[hidden] { display: none; }

/* Loader */
.p24-ilba-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 14px;
    background: rgba(0, 0, 0, 0.6);
    padding: 10px 18px;
    border-radius: 4px;
    z-index: 4;
}

/* Mobile: reklamy ukryte, zdjęcie zajmuje pełną przestrzeń */
@media (max-width: 900px) {
    /* Ukryj reklamy boczne/górne/dolne na małych ekranach */
    .p24-ilba-ad-slot {
        display: none !important;
    }

    /* Tylko zdjęcie w jednej kolumnie/wierszu */
    .p24-ilba-stage {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        gap: 0;
        padding: 50px 8px 20px;
    }

    /* Zdjęcie może być wyższe, bo nie konkuruje z reklamami */
    .p24-ilba-image-wrap img {
        max-height: calc(100vh - 110px);
    }

    .p24-ilba-nav {
        width: 36px;
        height: 48px;
        font-size: 22px;
    }

    .p24-ilba-prev { left: 4px; }
    .p24-ilba-next { right: 4px; }
}

/* Zablokowanie scrollowania body kiedy lightbox otwarty */
body.p24-ilba-locked {
    overflow: hidden;
}
