/* Ads Management System — scoped styles */
.ads-system {
    --ads-accent: var(--gold, #5786c7);
    --ads-navy: var(--navy, #0F2044);
    --ads-cream: var(--cream, #FAF7F2);
    position: relative;
    z-index: 2;
}

.ads-system--course {
    padding-top: 0;
    padding-bottom: 0;
}

.ads-system--course .ads-slot__inner,
.ads-system--course .ads-button-wrap,
.ads-system--course .ads-section-banner {
    margin-bottom: 0;
}

.ads-slot {
    margin: 0 auto;
}

.ads-slot__inner {
    width: 100%;
}

/* Banner */
.ads-banner {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
}

.ads-banner__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ads-banner__picture,
.ads-banner__img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 320px;
    object-fit: cover;
}

.ads-banner__overlay {
    position: absolute;
    inset: auto 0 0 0;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(180deg, transparent 0%, rgba(15, 32, 68, 0.82) 100%);
    color: #fff;
}

.ads-banner__text {
    margin: 0 0 0.75rem;
    font-size: 1rem;
    line-height: 1.5;
}

/* Section banner card */
.ads-section-banner__card {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 1.5rem;
    align-items: center;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(15, 32, 68, 0.08);
    border: 1px solid rgba(15, 32, 68, 0.06);
}

.ads-section-banner__link {
    display: contents;
    text-decoration: none;
    color: inherit;
}

.ads-section-banner__media,
.ads-section-banner__img {
    display: block;
    width: 100%;
    min-height: 180px;
    object-fit: cover;
}

.ads-section-banner__content {
    padding: 1.5rem 1.75rem 1.5rem 0;
}

.ads-section-banner__title {
    margin: 0 0 0.5rem;
    font-family: var(--font-heading, 'Playfair Display', serif);
    color: var(--ads-navy);
    font-size: clamp(1.25rem, 2vw, 1.75rem);
}

.ads-section-banner__desc {
    margin: 0 0 1rem;
    color: rgba(15, 32, 68, 0.75);
    line-height: 1.6;
}

/* Buttons */
.ads-button-wrap {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0;
}

.ads-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    border: 2px solid transparent;
    cursor: pointer;
}

.ads-btn--primary {
    background: var(--ads-accent);
    color: #fff;
    box-shadow: 0 8px 24px rgba(87, 134, 199, 0.28);
}

.ads-btn--primary:hover {
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.ads-btn--outline {
    background: transparent;
    color: var(--ads-navy);
    border-color: var(--ads-accent);
}

.ads-btn--outline:hover {
    background: rgba(87, 134, 199, 0.08);
    color: var(--ads-navy);
    text-decoration: none;
}

.ads-btn--floating {
    background: #25d366;
    color: #fff;
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.35);
}

/* Floating global button */
.ads-system--floating-global {
    position: fixed;
    right: 1.25rem;
    bottom: 1.25rem;
    z-index: 900;
    pointer-events: none;
}

[dir="rtl"] .ads-system--floating-global {
    right: auto;
    left: 1.25rem;
}

.ads-floating-btn {
    pointer-events: auto;
    width: 56px;
    height: 56px;
    padding: 0;
    border-radius: 50%;
    overflow: hidden;
}

.ads-floating-btn__icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ads-floating-btn__label {
    font-size: 0.75rem;
    padding: 0 0.5rem;
    text-align: center;
    line-height: 1.2;
}

/* Popup */
.ads-system--popup-global {
    position: static;
}

.ads-popup[hidden] {
    display: none !important;
}

.ads-popup {
    position: fixed;
    inset: 0;
    z-index: 950;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.ads-popup__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 32, 68, 0.55);
}

.ads-popup__dialog {
    position: relative;
    width: min(100%, 520px);
    max-height: 90vh;
    overflow: auto;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 24px 60px rgba(15, 32, 68, 0.2);
}

.ads-popup__close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    z-index: 2;
    border: 0;
    background: rgba(255, 255, 255, 0.92);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    color: var(--ads-navy);
}

[dir="rtl"] .ads-popup__close {
    right: auto;
    left: 0.75rem;
}

.ads-popup__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ads-popup__img {
    display: block;
    width: 100%;
    max-height: 280px;
    object-fit: cover;
}

.ads-popup__body {
    padding: 1.25rem 1.5rem 1.5rem;
}

.ads-popup__title {
    margin: 0 0 0.5rem;
    font-family: var(--font-heading, 'Playfair Display', serif);
    color: var(--ads-navy);
}

.ads-popup__desc {
    margin: 0 0 1rem;
    color: rgba(15, 32, 68, 0.75);
    line-height: 1.6;
}

/* Sidebar compact */
.ads-slot--sidebar .ads-banner__picture,
.ads-slot--sidebar .ads-banner__img {
    max-height: 220px;
}

.ads-slot--sidebar .ads-section-banner__card {
    grid-template-columns: 1fr;
}

.ads-slot--sidebar .ads-section-banner__content {
    padding: 1rem;
}

/* Footer */
.ads-slot--footer {
    background: transparent;
    box-shadow: none;
    padding-top: 0;
    padding-bottom: 0;
}

.ads-slot--footer .ads-banner {
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 767px) {
    .ads-section-banner__card {
        grid-template-columns: 1fr;
    }

    .ads-section-banner__content {
        padding: 1rem 1rem 1.25rem;
    }

    .ads-banner__overlay {
        padding: 1rem;
    }

    .ads-system--floating-global {
        right: 1rem;
        bottom: 1rem;
    }

    [dir="rtl"] .ads-system--floating-global {
        left: 1rem;
    }
}
