/* Advertisement Styles */

/* ── Ad Rotator — hide all, show only active ── */
#ad-rotator .ad-item {
    display: none;
}
#ad-rotator .ad-item.ad-item--active {
    display: block;
}

.ad-container {
    margin: 20px 0;
    text-align: center;
    position: relative;
    background: var(--light-bg);
    border-radius: 8px;
    overflow: hidden;
}

.ad-wrapper {
    position: relative;
    display: inline-block;
}

.ad-link {
    display: block;
    transition: transform 0.3s ease;
}

.ad-link:hover {
    transform: scale(1.02);
}

.ad-image {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
}

.ad-label {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 2px 6px;
    font-size: 0.7rem;
    border-radius: 3px;
    z-index: 1;
}

/* ── Banner Ad Section (header leaderboard) ── */
.ads_section .ads_holder {
    text-align: center;
}

.ads_section .ad-item picture,
.ads_section .ad-item img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ── Sidebar Ad Images ── */
.sidebar_ad {
    max-width: 300px;
    width: 300px;
    height: 300px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.sidebar_ad picture,
.sidebar_ad img,
.sidebar_ad video {
    width: 300px;
    height: 300px;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}

/* ── Trend / In-content Ad Slot ── */
.ad-slot .trend_image picture,
.ad-slot .trend_image img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Specific Ad Styles */
.ad-brandcom {
    max-width: 728px;
    margin: 0 auto;
}

.ad-ace {
    max-width: 300px;
    margin: 20px auto;
}

.ad-ppp {
    max-width: 728px;
    margin: 20px auto;
}

/* ── Ad Container 300x300 ── */
.ad-300x300 {
    width: 300px;
    height: 300px;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ad-300x300 img,
.ad-300x300 picture {
    width: 300px;
    height: 300px;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}

/* ── Responsive Ads ── */

/* Tablet (≤768px) — banner switches to 320x100, sidebar to 300x250 */
@media (max-width: 768px) {
    .ads_section .ads_holder {
        max-width: 320px;
        margin: 0 auto;
    }

    .ad-brandcom,
    .ad-ppp {
        max-width: 100%;
    }

    .ad-ace {
        max-width: 100%;
    }

    .sidebar_ad {
        text-align: center;
    }

    .sidebar_ad picture,
    .sidebar_ad img {
        max-width: 300px;
        margin: 0 auto;
    }
}

/* Mobile (≤480px) — compact banner, centered sidebar */
@media (max-width: 480px) {
    .ads_section .ads_holder {
        max-width: 100%;
        padding: 0 10px;
    }

    .ads_section .ad-item picture,
    .ads_section .ad-item img {
        max-width: 320px;
        margin: 0 auto;
    }

    .sidebar_ad picture,
    .sidebar_ad img {
        max-width: 100%;
    }

    .ad-300x300 {
        width: 250px;
        height: 250px;
    }

    .ad-300x300 img,
    .ad-300x300 picture {
        width: 250px;
        height: 250px;
    }
}
