/* RZ REKLAMY – popup.css */

.kzpa-visually-hidden {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* One owned layer escapes theme containers and covers floating site widgets. */
#kzpa-layer {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: visible;
    background: transparent;
    color: inherit;
    isolation: isolate;
    z-index: 2147483647;
    pointer-events: none;
}
#kzpa-layer::backdrop { background: transparent; pointer-events: none; }
#kzpa-layer .kzpa-overlay { z-index: 0; }
#kzpa-layer .kzpa-modal { z-index: 1; }
#kzpa-layer #kzpa-preview-notice { z-index: 2; }

.kzpa-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    opacity: 0;
    z-index: 99998;
    display: none;
    pointer-events: auto;
    transition: opacity 0.2s ease;
}
.kzpa-overlay.kzpa-visible { display: block; }
.kzpa-overlay.kzpa-blur {
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.kzpa-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 99999;
    pointer-events: auto;
    background: transparent;
    border-radius: 4px;
    /* fitPopupMedia sizes the complete media and controls; the ad never scrolls. */
    overflow: hidden;
    overscroll-behavior: contain;
    opacity: 0;
    transition: opacity 0.2s ease;
    box-sizing: border-box;

    /* Dopasowuje się do zawartości – nie rozciąga się niepotrzebnie */
    width: auto;
    max-width: 96vw;
    max-height: 92vh;
}
.kzpa-modal.kzpa-visible { opacity: 1; }
.kzpa-modal:focus {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.kzpa-close {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(16,24,32,0.5);
    color: #fff;
    border: none;
    border-radius: 4px;
    width: 28px;
    min-width: 28px;
    height: 28px;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    touch-action: manipulation;
}
.kzpa-close.kzpa-close-left { left: 4px; right: auto; }
.kzpa-close:focus { outline: 2px solid #fff; outline-offset: 2px; }
.kzpa-close:disabled { cursor: default; background: rgba(16,24,32,0.5); color: #fff; opacity: 1; font-size: 13px; }
#kzpa-preview-notice { position: fixed; bottom: 12px; left: 12px; right: 12px; z-index: 2147483646; padding: 10px 14px; background: #fff; color: #1d2327; border: 2px solid #2271b1; border-radius: 7px; font: 14px/1.5 system-ui,sans-serif; box-shadow: 0 2px 12px #0003; }

.kzpa-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 0;
    width: 100%;
}
.kzpa-content a { display: block; line-height: 0; }
.kzpa-content .kzpa-cta {
    display: inline-block;
    align-self: center;
    margin: 12px;
    padding: 10px 16px;
    border: 2px solid #fff;
    border-radius: 3px;
    color: #fff;
    background: #111;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.25;
    text-decoration: none;
    max-width: calc(100% - 24px);
    box-sizing: border-box;
}
.kzpa-content .kzpa-cta:focus {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

/* Obraz – dopasowuje się do okna */
.kzpa-image {
    display: block;
    max-width: 100%;
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Preview (miniatura wideo) */
.kzpa-preview {
    display: block;
    max-width: 100%;
    max-height: 92vh;
    width: auto;
    height: auto;
    object-fit: contain;
}

.kzpa-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.6);
    color: #fff;
    border: 2px solid #fff;
    border-radius: 50%;
    width: 64px;
    height: 64px;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    padding: 0;
    touch-action: manipulation;
}
.kzpa-play-btn:focus { outline: 2px solid #fff; outline-offset: 3px; }

/* Wideo – ograniczone przez szerokość modala i wysokość ekranu */
.kzpa-video {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: calc(92vh - 27px);
    height: auto;
    object-fit: contain;
}

.kzpa-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: kzpa-spin 0.8s linear infinite;
    z-index: 6;
}
.kzpa-loader.kzpa-hidden { display: none; }

@keyframes kzpa-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Mobile */
@media (max-width: 768px) {
    .kzpa-modal {
        max-width: 96vw;
        max-height: 88vh;
    }
    .kzpa-image,
    .kzpa-preview {
        width: 100%;
        max-width: 100%;
        max-height: 88vh;
        height: auto;
    }
    .kzpa-video {
        width: 100%;
        max-width: 100%;
        max-height: calc(88vh - 27px);
        height: auto;
    }
    .kzpa-close {
        width: 30px;
        height: 30px;
        font-size: 24px;
        top: 4px;
        right: 4px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kzpa-overlay,
    .kzpa-modal {
        transition: none;
    }
    .kzpa-loader {
        animation: none;
    }
}

@media (forced-colors: active) {
    .kzpa-modal,
    .kzpa-close,
    .kzpa-play-btn {
        border: 2px solid ButtonText;
    }
    .kzpa-close:focus,
    .kzpa-play-btn:focus,
    .kzpa-modal:focus {
        outline: 3px solid Highlight;
    }
}

/* The frame follows the active image; navigation stays outside its link. */
.kzpa-modal.kzpa-carousel-modal{background:transparent}
.kzpa-carousel{width:100%;color:#fff;background:transparent;font:14px/1.4 system-ui,sans-serif;box-sizing:border-box}
.kzpa-carousel-toolbar,.kzpa-carousel-navigation{background:rgba(16,24,32,.5)}
.kzpa-carousel-toolbar{display:flex;align-items:center;justify-content:center;padding:0 30px;min-height:24px;height:24px;box-sizing:border-box;font-size:11px}
.kzpa-carousel-counter{font-variant-numeric:tabular-nums;white-space:nowrap;color:#d8e2ed}
.kzpa-carousel button{appearance:none;display:inline-flex;align-items:center;justify-content:center;border:0;color:#fff;background:transparent;border-radius:3px;cursor:pointer;font:inherit;line-height:1;padding:0;min-height:24px;min-width:24px;touch-action:manipulation}
.kzpa-carousel button:focus-visible,.kzpa-carousel-link:focus-visible{outline:3px solid #7dd3fc;outline-offset:-3px}
.kzpa-carousel button[aria-disabled=true]{opacity:.5;cursor:default}
.kzpa-carousel-stage{position:relative;width:100%;height:1px;min-height:1px;margin:0 auto;background:transparent;overflow:hidden}
.kzpa-carousel .kzpa-carousel-link{position:absolute;inset:0;display:block}
.kzpa-carousel-slide{position:absolute;inset:0;opacity:0;pointer-events:none;transition:opacity 300ms ease}
.kzpa-carousel-slide.is-active{opacity:1;pointer-events:auto}
.kzpa-carousel-image{width:100%!important;height:100%!important;max-width:100%;object-fit:contain;display:block;margin:0!important}
.kzpa-carousel-navigation{display:flex;align-items:center;justify-content:center;gap:4px;padding:0 4px;min-height:24px;box-sizing:border-box}
.kzpa-carousel-dots{display:flex;flex:1 1 auto;flex-wrap:wrap;justify-content:center;gap:2px;min-width:0;max-width:178px}
.kzpa-carousel button.kzpa-carousel-dot{border:0;background:transparent;padding:0;flex:1 0 12px;min-width:12px;max-width:16px;width:16px;min-height:24px;height:24px}
.kzpa-carousel-dot:before{content:'';width:7px;height:7px;border:1px solid currentColor;border-radius:50%;box-sizing:border-box}
.kzpa-carousel-dot[aria-current=true]:before{background:currentColor;width:10px;height:10px;outline:1px solid currentColor;outline-offset:2px}
.kzpa-carousel button.kzpa-carousel-arrow{flex:none}
.kzpa-carousel-arrow:before{content:'';display:block;width:8px;height:8px;box-sizing:border-box;border:solid currentColor;border-width:0 2px 2px 0;transform:rotate(135deg)}
.kzpa-carousel-next:before{transform:rotate(-45deg)}
.kzpa-carousel-modal .kzpa-close{top:0;right:2px;width:24px;min-width:24px;height:24px;background:transparent}
.kzpa-carousel-modal .kzpa-close-left{left:2px;right:auto}
@media(pointer:coarse){.kzpa-carousel button{min-height:30px;min-width:30px}.kzpa-carousel button.kzpa-carousel-dot{width:16px;min-width:12px;height:30px}.kzpa-carousel-toolbar{min-height:30px;height:30px}.kzpa-carousel-modal .kzpa-close{width:30px;min-width:30px;height:30px}}
@media(prefers-reduced-motion:reduce){.kzpa-carousel-slide{transition:none}}
@media(forced-colors:active){.kzpa-carousel{color:CanvasText}.kzpa-carousel-toolbar,.kzpa-carousel-navigation{background:Canvas}.kzpa-carousel button{border:1px solid ButtonText;color:ButtonText;background:ButtonFace}.kzpa-carousel-counter{color:CanvasText}.kzpa-carousel-dot[aria-current=true]:before{background:Highlight}.kzpa-carousel button:focus-visible,.kzpa-carousel-link:focus-visible{outline-color:Highlight}}
