/* Smart promo modal — gold/glass RTL; respects --bottom-nav-offset */
.promo-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px calc(var(--bottom-nav-offset, 83px) + 16px);
    pointer-events: none;
}

.promo-modal:not([hidden]) {
    pointer-events: auto;
}

.promo-modal[hidden] {
    display: none;
}

.promo-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(8, 7, 5, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.promo-modal__panel {
    position: relative;
    z-index: 1;
    width: min(440px, 100%);
    max-height: min(82vh, 640px);
    overflow: auto;
    background: var(--glass-bg, rgba(28, 24, 18, 0.92));
    border: 1px solid rgba(218, 178, 93, 0.28);
    border-radius: 22px;
    box-shadow: 0 22px 48px rgba(0, 0, 0, 0.35);
    padding: 22px 20px 20px;
    color: var(--text-primary);
}

.promo-modal__grab {
    display: none;
    width: 42px;
    height: 4px;
    margin: 0 auto 12px;
    border-radius: 99px;
    background: rgba(218, 178, 93, 0.35);
}

.promo-modal__close {
    position: absolute;
    top: 10px;
    inset-inline-start: 10px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border: 0;
    border-radius: 12px;
    background: rgba(218, 178, 93, 0.1);
    color: var(--text-primary);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
}

.promo-modal__close:focus-visible {
    outline: 2px solid var(--primary-color, #dab25d);
    outline-offset: 2px;
}

.promo-modal__media {
    margin: 8px 0 14px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(218, 178, 93, 0.18);
}

.promo-modal__media img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 180px;
    object-fit: cover;
}

.promo-modal__title {
    margin: 0 0 10px;
    font-family: 'Kalameh', sans-serif;
    font-size: 1.25rem;
    color: var(--text-heading);
    padding-inline-end: 52px;
}

.promo-modal__body {
    margin: 0 0 18px;
    line-height: 1.85;
    color: var(--text-muted);
    font-size: 0.98rem;
}

.promo-modal__cta {
    width: 100%;
    text-align: center;
}

body.promo-modal-open {
    overflow: hidden;
}

body.podcast-player-active .promo-modal {
    padding-bottom: calc(var(--bottom-nav-offset, 83px) + 88px);
}

[data-theme="light"] .promo-modal__backdrop {
    background: rgba(40, 32, 18, 0.28);
}

[data-theme="light"] .promo-modal__panel {
    background: rgba(255, 252, 246, 0.96);
    box-shadow: 0 18px 40px rgba(72, 52, 20, 0.14);
}

@media (max-width: 640px) {
    .promo-modal {
        align-items: flex-end;
        padding: 0;
    }

    .promo-modal__panel {
        width: 100%;
        max-height: min(78vh, 620px);
        border-radius: 22px 22px 0 0;
        padding: 12px 16px calc(var(--bottom-nav-offset, 83px) + 16px);
        animation: promo-sheet-up .38s cubic-bezier(.22, 1, .36, 1) both;
    }

    .promo-modal__grab {
        display: block;
    }

    body.podcast-player-active .promo-modal__panel {
        padding-bottom: calc(var(--bottom-nav-offset, 83px) + 88px);
    }
}

@keyframes promo-sheet-up {
    from { transform: translateY(110%); opacity: 1; }
    to { transform: none; opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
    .promo-modal__panel {
        animation: none;
    }
}
