/* Category homepage: ad cells match news card layout */
.section-cat-block .category-ad-cell .post-item-ad,
.section-cat-block .category-ad-cell .post-item-ad-image {
    width: 100%;
    min-height: 0;
}

.section-cat-block .category-ad-cell--featured .post-item-vr.post-item-ad .image {
    height: 340px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
    background: #fafafa;
}

.section-cat-block .category-ad-cell .post-item-ad-image .avp-ad-standard-wrap--card,
.section-cat-block .category-ad-cell .post-item-ad-image .ad-slot,
.section-cat-block .category-ad-cell .post-item-ad-image .ad-slot.is-fallback-active,
.section-cat-block .category-ad-cell .post-item-ad-image .ad-slot.is-filled {
    display: flex !important;
    flex: 1 1 auto;
    width: 100% !important;
    height: 100% !important;
    min-height: 340px;
    margin: 0 !important;
}

.section-cat-block .category-ad-cell .post-item-ad-image .ad-slot-fallback,
.section-cat-block .category-ad-cell .post-item-ad-image .ad-slot-fallback .fallback-ad {
    height: 100%;
    min-height: 100%;
}

.section-cat-block .category-ad-cell--featured .fallback-ad-card {
    width: 100%;
    height: 100%;
    min-height: 340px;
    max-height: none;
    border-radius: 0;
}

.section-cat-block .category-grid-3x3 .category-ad-cell--grid .post-item-small-ad {
    margin-bottom: 25px;
}

.section-cat-block .category-grid-3x3 .category-ad-cell--grid .post-item-small-ad-image {
    width: 130px;
    height: 91px;
    display: flex;
    align-items: stretch;
    overflow: hidden;
}

.section-cat-block .category-grid-3x3 .category-ad-cell--grid .avp-ad-standard-wrap--card,
.section-cat-block .category-grid-3x3 .category-ad-cell--grid .post-item-small-ad-image .ad-slot {
    width: 100% !important;
    height: 100% !important;
    min-height: 91px !important;
    max-height: 91px !important;
    margin: 0 !important;
}

.section-cat-block .category-grid-3x3 .category-ad-cell--grid .fallback-ad-card {
    width: 100%;
    height: 100%;
    min-height: 91px;
    max-height: 91px;
    padding: 6px 8px;
    gap: 4px;
    border-radius: 0;
}

.section-cat-block .category-grid-3x3 .category-ad-cell--grid .fallback-ad-card .fallback-ad-brand {
    font-size: 11px !important;
}

.section-cat-block .category-grid-3x3 .category-ad-cell--grid .fallback-ad-card .fallback-ad-price {
    font-size: 10px !important;
}

.section-cat-block .category-grid-3x3 .category-ad-cell--grid .fallback-ad-card .fallback-ad-cta {
    padding: 4px 8px;
    font-size: 9px !important;
}

.section-cat-block .category-grid-3x3 .category-ad-cell--grid .fallback-ad-card .fallback-ad-icon svg {
    width: 24px;
    height: 24px;
}

.section-cat-block .category-grid-3x3 .category-ad-cell--grid .post-item-small-ad-right .title {
    min-height: 40px;
    visibility: hidden;
}

.section-cat-block .category-grid-3x3 .category-ad-cell--grid .post-item-small-ad-right .small-post-meta {
    min-height: 16px;
    visibility: hidden;
}

/* In-article: full-width blocks between paragraphs */
.post-text .article-inline-ad-host {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 1.25rem 0 1.5rem;
    clear: both;
}

.post-text .article-inline-ad-host .ad-slot,
.post-text .article-inline-ad-host .ad-slot.is-fallback-active,
.post-text .article-inline-ad-host .ad-slot.is-filled,
.post-text .article-inline-ad-host .ad-slot.ad-slot-prefill-fallback {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    line-height: normal !important;
}

.post-text .article-inline-ad-host .fallback-ad {
    width: 100%;
    max-width: 100%;
    min-height: 52px;
    max-height: 72px;
}

.post-text .article-inline-ad-host .adsense-in-article.ad-slot.is-fallback-active .fallback-ad {
    max-height: 64px;
}

/* In-article floats (legacy side floats) */
.post-text .adsense-in-article--left {
    float: left;
    width: 100%;
    max-width: 280px;
    margin: 0.25rem 1rem 0.75rem 0;
    clear: left;
}

.post-text .adsense-in-article--right {
    float: right;
    width: 100%;
    max-width: 280px;
    margin: 0.25rem 0 0.75rem 1rem;
    clear: right;
}

.post-text::after {
    content: "";
    display: table;
    clear: both;
}

@media (max-width: 991.98px) {
    .section-cat-block .category-ad-cell--featured .post-item-vr.post-item-ad .image,
    .section-cat-block .category-ad-cell .post-item-ad-image .ad-slot,
    .section-cat-block .category-ad-cell--featured .fallback-ad-card {
        min-height: 285px;
    }
}

@media (max-width: 767.98px) {
    .post-text .adsense-in-article--left,
    .post-text .adsense-in-article--right {
        float: none;
        max-width: 100%;
        margin: 0.5rem 0;
        clear: both;
    }
}

/* Latest Posts grid — ad cells match post-item card size */
.latest-post-ad-cell {
    margin-bottom: 0;
}

.latest-post-ad-cell .post-item-latest-ad {
    margin-bottom: 1.5rem;
}

.latest-post-ad-cell .latest-post-ad-image {
    width: 100%;
    --bs-aspect-ratio: 61.9%;
    position: relative;
    overflow: hidden;
    background: #fafafa;
}

.latest-post-ad-cell .latest-post-ad-image .avp-ad-standard-wrap--card {
    position: absolute;
    inset: 0;
}

.latest-post-ad-cell .latest-post-ad-image .ad-slot,
.latest-post-ad-cell .latest-post-ad-image .ad-slot.is-fallback-active,
.latest-post-ad-cell .latest-post-ad-image .ad-slot.is-filled {
    display: flex !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 100%;
    margin: 0 !important;
}

.latest-post-ad-cell .latest-post-ad-image .ad-slot-fallback,
.latest-post-ad-cell .latest-post-ad-image .fallback-ad-card {
    width: 100%;
    height: 100%;
    min-height: 100%;
}

.latest-post-ad-cell .latest-post-ad-sync.title {
    min-height: 22px;
    margin-bottom: 0;
    visibility: hidden;
}

.latest-post-ad-cell .latest-post-ad-sync.post-meta {
    min-height: 18px;
    visibility: hidden;
}

.latest-post-ad-cell .latest-post-ad-sync.description {
    min-height: 38px;
    margin-bottom: 0;
    visibility: hidden;
}

.section-latest-posts .latest-post-ad-cell.ad-host-latest-infeed:empty {
    display: none;
}

.latest-posts {
    margin-bottom: 1rem;
}


/* Full-width compact banner bars (post image + homepage after slider) */
.post-image-ad-bar,
.content-banner-ad-bar {
    display: block;
    width: 100%;
    max-width: 100%;
    clear: both;
}

.post-image-ad-bar--before {
    margin: 0 0 0.75rem;
}

.post-image-ad-bar--after {
    margin: 0.75rem 0 0.5rem;
}

.post-image-ad-bar .ad-slot,
.post-image-ad-bar .ad-slot.is-fallback-active,
.post-image-ad-bar .ad-slot.is-filled,
.post-image-ad-bar .ad-slot.ad-slot-prefill-fallback,
.content-banner-ad-bar .ad-slot,
.content-banner-ad-bar .ad-slot.is-fallback-active,
.content-banner-ad-bar .ad-slot.is-filled,
.content-banner-ad-bar .ad-slot.ad-slot-prefill-fallback {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    line-height: normal !important;
}

.post-image-ad-bar .fallback-ad,
.content-banner-ad-bar .fallback-ad {
    width: 100%;
    max-width: 100%;
    min-height: 52px;
    max-height: 60px;
    padding: 6px 12px;
    border-radius: 6px;
}

.post-image-ad-bar .fallback-ad-brand,
.content-banner-ad-bar .fallback-ad-brand {
    font-size: 13px !important;
}

.post-image-ad-bar .fallback-ad-line,
.content-banner-ad-bar .fallback-ad-line {
    display: none;
}

.post-image-ad-bar .fallback-ad-cta,
.content-banner-ad-bar .fallback-ad-cta {
    padding: 5px 10px;
    font-size: 10px !important;
}

.post-image + .post-image-ad-bar--after,
.post-image-ad-bar--before + .post-image {
    margin-top: 0;
}

.section-home-banner-ad--pre-news {
    padding-top: 0.25rem;
    padding-bottom: 0.5rem;
}

.section-home-banner-ad {
    padding: 0.5rem 0 0.75rem;
    margin: 0;
}

.section-home-banner-ad:has(.ad-host-home-before-newsticker.is-collapsed),
.section-home-banner-ad:has(.ad-host-home-after-slider.is-collapsed) {
    display: none;
    padding: 0;
    margin: 0;
}

.section-home-banner-ad .content-banner-ad-bar {
    margin: 0;
}

/* Homepage: banner above each category section title */
.section-category-title-ad {
    padding: 0.5rem 0 0.625rem;
    margin: 0;
}

.section-category-title-ad:has(.ad-host-cat-title.is-collapsed) {
    display: none;
    padding: 0;
    margin: 0;
}

.section-category-title-ad .ad-host-cat-title {
    width: 100%;
}

.section-category-title-ad .avp-ad-standard-wrap {
    width: 100%;
    margin: 0;
}

.section-category-title-ad .avp-ad-standard-wrap .fallback-ad {
    width: 100%;
    min-height: 52px;
    max-height: 72px;
}

.section-category-title-ad .ad-host-cat-title:has(.ad-slot.is-fallback-active),
.section-category-title-ad .ad-host-cat-title:has(.ad-slot.is-filled),
.section-category-title-ad .ad-host-cat-title:has(.ad-slot.ad-slot-prefill-fallback) {
    display: block;
}

.section-category + .section-category .section-category-title-ad,
.section-cat-slider .section-category-title-ad,
.section-videos .section-category-title-ad {
    padding-top: 0.35rem;
}

.ad-host-home-before-newsticker:has(.ad-slot.is-fallback-active),
.ad-host-home-before-newsticker:has(.ad-slot.is-filled),
.ad-host-home-before-newsticker:has(.ad-slot.ad-slot-prefill-fallback),
.ad-host-home-after-slider:has(.ad-slot.is-fallback-active),
.ad-host-home-after-slider:has(.ad-slot.is-filled),
.ad-host-home-after-slider:has(.ad-slot.ad-slot-prefill-fallback) {
    display: block;
}

/* Sitewide banner directly above footer — full width, compact height */
.site-prefooter-ad {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: 0.5rem 0 0.625rem;
    margin: 0;
    background: transparent;
}

.site-prefooter-ad:has(.ad-host-site-prefooter.is-collapsed) {
    display: none;
    padding: 0;
    margin: 0;
}

.site-prefooter-ad:not(:has(.ad-slot.is-fallback-active)):not(:has(.ad-slot.is-filled)):not(:has(.ad-slot.ad-slot-prefill-fallback)) {
    display: none;
    padding: 0;
}

.site-prefooter-ad .container-xl {
    padding-left: 12px;
    padding-right: 12px;
}

.site-prefooter-ad .content-banner-ad-bar {
    margin: 0;
}

.site-prefooter-ad .content-banner-ad-bar .fallback-ad {
    width: 100%;
    max-width: 100%;
}

@media (max-width: 575.98px) {
    .site-prefooter-ad {
        padding: 0.375rem 0 0.5rem;
    }

    .site-prefooter-ad .content-banner-ad-bar .fallback-ad {
        min-height: 48px;
        max-height: 56px;
        padding: 5px 8px;
    }

    .site-prefooter-ad .fallback-ad-brand {
        font-size: 11px !important;
    }

    .site-prefooter-ad .fallback-ad-cta {
        padding: 4px 8px;
        font-size: 9px !important;
    }
}

/* Sidebar: one list-row ad between Popular Posts & Recommended Posts */
.sidebar-list-ad-slot {
    margin-bottom: 25px;
}

.sidebar-list-ad-slot .ad-slot,
.sidebar-list-ad-slot .ad-slot.is-fallback-active,
.sidebar-list-ad-slot .ad-slot.ad-slot-prefill-fallback {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
}

.sidebar-list-ad-slot .fallback-ad {
    display: grid !important;
    grid-template-columns: 130px 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 91px;
    max-height: 91px;
    padding: 8px 10px;
    border-radius: 4px;
}

.sidebar-list-ad-slot .fallback-ad-icon {
    grid-column: 1;
    width: 130px;
    height: 75px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.12);
    border-radius: 4px;
}

.sidebar-list-ad-slot .fallback-ad-icon svg {
    width: 40px;
    height: 40px;
}

.sidebar-list-ad-slot .fallback-ad-body {
    grid-column: 2;
    min-width: 0;
}

.sidebar-list-ad-slot .fallback-ad-brand {
    font-size: 14px !important;
    font-weight: 600;
    line-height: 20px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-list-ad-slot .fallback-ad-line {
    display: none;
}

.sidebar-list-ad-slot .fallback-ad-price {
    font-size: 12px !important;
    margin-top: 2px;
}

.sidebar-list-ad-slot .fallback-ad-cta {
    grid-column: 3;
    padding: 5px 10px;
    font-size: 10px !important;
}

@media (max-width: 575.98px) {
    .sidebar-list-ad-slot .fallback-ad {
        grid-template-columns: 90px 1fr auto;
        min-height: 72px;
        max-height: 80px;
    }

    .sidebar-list-ad-slot .fallback-ad-icon {
        width: 90px;
        height: 56px;
    }
}

/* Top Headlines sidebar — list-row ads match .item height */
.top-headlines .top-headlines-ad-item {
    padding-top: 12px;
    margin-top: 12px;
    border-top: 1px solid #ececec;
}

.top-headlines .top-headlines-ad-item.item-first {
    border: 0 !important;
    padding-top: 0;
    margin-top: 0;
}

.top-headlines .top-headlines-ad-item .avp-ad-standard-wrap {
    width: 100%;
    margin: 0;
}

.top-headlines .top-headlines-ad-item .ad-slot,
.top-headlines .top-headlines-ad-item .ad-slot.is-fallback-active,
.top-headlines .top-headlines-ad-item .ad-slot.is-filled {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    min-height: 72px;
    max-height: 91px;
}

.top-headlines .top-headlines-ad-item .fallback-ad {
    width: 100%;
    min-height: 72px;
    max-height: 91px;
    border-radius: 4px;
}

.top-headlines .top-headlines-ad-item.ad-host-headline-infeed:empty {
    display: none;
}

