/* Baztab video pre-roll layer. Loaded only on single posts containing video. */
.baztab-video-ad-shell {
    position: relative;
    overflow: hidden;
    max-width: 100%;
    background: #000;
}

.baztab-video-ad-shell video {
    display: block;
    max-width: 100%;
}

.baztab-video-ad-container {
    position: absolute;
    inset: 0;
    z-index: 30;
    display: none;
    width: 100%;
    height: 100%;
    background: #000;
}

.baztab-video-ad-container.is-active {
    display: block;
}

.baztab-video-ad-play {
    position: absolute;
    inset: 0;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 16px;
    border: 0;
    background: rgba(0, 0, 0, .18);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.baztab-video-ad-play[hidden] {
    display: none !important;
}

.baztab-video-ad-play-icon {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .72);
    box-shadow: 0 2px 14px rgba(0, 0, 0, .28);
    position: relative;
}

.baztab-video-ad-play-icon::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 52%;
    transform: translate(-44%, -50%);
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #fff;
}

.baztab-video-ad-play-label {
    position: absolute;
    inset-inline-start: 12px;
    bottom: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, .62);
    font-size: .76rem;
    line-height: 1.5;
}

@media (max-width: 575.98px) {
    .baztab-video-ad-play-icon {
        width: 48px;
        height: 48px;
    }

    .baztab-video-ad-play-label {
        font-size: .7rem;
    }
}


/* 2.4.61 — Exact Persian label for IMA skip controls when the SDK
 * renders its UI in the page DOM. Cross-origin SDK frames remain governed
 * by IMA itself and are handled by the scoped JavaScript localization pass. */
.baztab-video-ad-container :is(.videoAdUiSkipButton, .videoAdUiSkipButtonExperimentalText) {
    direction: rtl;
    unicode-bidi: plaintext;
}

.baztab-video-ad-container .videoAdUiSkipButton {
    font-size: 0 !important;
}

.baztab-video-ad-container .videoAdUiSkipButton::after {
    content: 'رد کردن تبلیغ';
    font-family: inherit;
    font-size: 13px;
    line-height: 1.5;
}

/* 3.2.4 — Native direct pre-roll rendering and visible-frame guard. */
.baztab-video-ad-shell {
    width: 100%;
    min-height: 1px;
    isolation: isolate;
}

.baztab-video-ad-container.is-active {
    display: grid;
    place-items: center;
}

.baztab-video-ad-container.is-loading::before {
    content: '';
    width: 34px;
    height: 34px;
    border: 3px solid rgba(255, 255, 255, .28);
    border-top-color: #fff;
    border-radius: 50%;
    animation: baztab-video-ad-spin .8s linear infinite;
}

@keyframes baztab-video-ad-spin {
    to { transform: rotate(360deg); }
}

.baztab-video-ad-media {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: contain;
    background: #000;
    opacity: 0;
}

.baztab-video-ad-container.has-visible-frame .baztab-video-ad-media {
    opacity: 1;
}

.baztab-video-ad-chrome {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
    color: #fff;
    font-family: inherit;
}

.baztab-video-ad-badge,
.baztab-video-ad-status,
.baztab-video-ad-skip,
.baztab-video-ad-visit {
    position: absolute;
    padding: 5px 9px;
    border: 0;
    border-radius: 6px;
    background: rgba(0, 0, 0, .72);
    color: #fff;
    font: inherit;
    font-size: 12px;
    line-height: 1.5;
    text-decoration: none;
}

.baztab-video-ad-badge {
    inset-inline-start: 10px;
    top: 10px;
}

.baztab-video-ad-status {
    inset-inline-start: 10px;
    bottom: 10px;
    min-height: 28px;
}

.baztab-video-ad-skip {
    inset-inline-end: 10px;
    bottom: 10px;
    z-index: 6;
    pointer-events: auto;
    cursor: pointer;
}

.baztab-video-ad-visit {
    inset-inline-end: 10px;
    top: 10px;
    z-index: 6;
    pointer-events: auto;
}

.baztab-video-ad-skip[hidden] {
    display: none !important;
}

/* Google IMA external VAST must fill the reserved player surface. */
.baztab-video-ad-container.is-vast > div,
.baztab-video-ad-container.is-vast iframe,
.baztab-video-ad-container.is-vast video {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
}

@media (max-width: 575.98px) {
    .baztab-video-ad-badge,
    .baztab-video-ad-status,
    .baztab-video-ad-skip,
    .baztab-video-ad-visit {
        padding: 4px 7px;
        font-size: 11px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .baztab-video-ad-container.is-loading::before {
        animation-duration: 1.6s;
    }
}
