.aa-article-ad-slot {
    width: 100%;
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
    box-sizing: border-box;
    text-align: center;
    clear: both;
    position: relative;
    z-index: 1;
}
.aa-article-ad-slot--above-title { margin-top: 18px; margin-bottom: 24px; }
.aa-article-ad-slot--below-share { margin-top: 14px; margin-bottom: 28px; }
.aa-article-ad-slot--after-paragraph-4 { margin-top: 30px; margin-bottom: 30px; padding-left: 0; padding-right: 0; }
.aa-article-ad-slot--before-comments { margin-top: 38px; margin-bottom: 38px; }
.aa-article-ad-slot--after-comments { margin-top: 38px; margin-bottom: 38px; }
.aa-article-ad-inner {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    overflow: visible;
    text-align: center;
}
.aa-article-ad-inner > iframe,
.aa-article-ad-inner > img,
.aa-article-ad-inner > video,
.aa-article-ad-inner ins,
.aa-article-ad-inner embed,
.aa-article-ad-inner object {
    max-width: 100% !important;
}
.aa-article-ad-inner iframe { display: inline-block; }
@media (max-width: 767px) {
    .aa-article-ad-slot { padding-left: 14px; padding-right: 14px; }
    .aa-article-ad-slot--above-title { margin-top: 12px; margin-bottom: 18px; }
    .aa-article-ad-slot--below-share,
    .aa-article-ad-slot--before-comments,
    .aa-article-ad-slot--after-comments { margin-top: 24px; margin-bottom: 24px; }
    .aa-article-ad-slot--after-paragraph-4 { margin-top: 24px; margin-bottom: 24px; }
}

/* Sidebar-specific placements live inside the sidebar column but outside
   the sticky Trending Now card, so the ads themselves do not become sticky. */
.aaee-sidebar-100 > .aa-article-ad-slot--sidebar-above,
.aaee-sidebar-100 > .aa-article-ad-slot--sidebar-below {
    width: 100%;
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}
.aaee-sidebar-100 > .aa-article-ad-slot--sidebar-above {
    margin-top: 0;
    margin-bottom: 24px;
}
.aaee-sidebar-100 > .aa-article-ad-slot--sidebar-below {
    margin-top: 24px;
    margin-bottom: 0;
}
@media (max-width: 860px) {
    .aaee-sidebar-100 > .aa-article-ad-slot--sidebar-above {
        margin-top: 0;
        margin-bottom: 20px;
    }
    .aaee-sidebar-100 > .aa-article-ad-slot--sidebar-below {
        margin-top: 20px;
        margin-bottom: 0;
    }
}

/* v1.2.0: dedicated immersive-feed ad treatment. */
body.aa-aap-immersive-post,
body.aa-aap-immersive-post #page,
body.aa-aap-immersive-post .site,
body.aa-aap-immersive-post .site-content,
body.aa-aap-immersive-post .content-area,
body.aa-aap-immersive-post main,
body.aa-aap-immersive-post article,
body.aa-aap-immersive-post .entry-content {
    background: #05060a !important;
}
body.aa-aap-immersive-post .aa-article-ad-slot--feed-top {
    width: 100%;
    max-width: none;
    padding: 14px 18px 10px;
    margin: 0;
    background: #05060a;
    line-height: 0;
    overflow: hidden;
}
body.aa-aap-immersive-post .aa-article-ad-slot--feed-top .aa-article-ad-inner {
    width: min(100%, var(--aa-feed-ad-max-width, 980px));
    margin: 0 auto;
    max-height: min(38vh, 430px);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #05060a;
}
body.aa-aap-immersive-post .aa-article-ad-slot--feed-top .aa-article-ad-inner > *,
body.aa-aap-immersive-post .aa-article-ad-slot--feed-top .aa-article-ad-inner a {
    max-width: 100% !important;
    max-height: inherit !important;
    margin: 0 auto !important;
}
body.aa-aap-immersive-post .aa-article-ad-slot--feed-top img,
body.aa-aap-immersive-post .aa-article-ad-slot--feed-top video,
body.aa-aap-immersive-post .aa-article-ad-slot--feed-top iframe {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: min(38vh, 430px) !important;
    object-fit: contain !important;
    border: 0 !important;
}
body.aa-aap-immersive-post:not(.aa-aap-has-feed-ad) .aaee-video-feed,
body.aa-aap-immersive-post:not(.aa-aap-has-feed-ad) [data-aaee-video-feed] {
    margin-top: 0 !important;
}
@media (max-width: 700px) {
    body.aa-aap-immersive-post .aa-article-ad-slot--feed-top { padding: 8px 8px 6px; }
    body.aa-aap-immersive-post .aa-article-ad-slot--feed-top .aa-article-ad-inner,
    body.aa-aap-immersive-post .aa-article-ad-slot--feed-top img,
    body.aa-aap-immersive-post .aa-article-ad-slot--feed-top video,
    body.aa-aap-immersive-post .aa-article-ad-slot--feed-top iframe {
        max-height: min(28vh, 260px) !important;
    }
}
