/* GE + primary polling Mediavine: class-only desktop leaderboard wells. v=20260901e */

.pm-tx-ad-band {
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    border: 0;
    background: transparent;
    text-align: center;
}

/* PC-only in-content wells. Page-top keeps its existing mobile well. */
@media (max-width: 767px) {
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-chart"],
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-methodology"],
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-table"] {
        display: none !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        border: 0 !important;
        pointer-events: none !important;
    }
}

html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop .pm-ad-slot {
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 250px !important;
    height: 250px !important;
    max-height: 250px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop .mv-ad-box,
html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop [id^="mvp-"] {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: max-content;
    max-width: 100%;
    height: auto !important;
    min-height: 0 !important;
    max-height: 100%;
    margin: auto !important;
    overflow: hidden;
    align-self: center;
}
html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop iframe,
html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop img {
    display: block !important;
    float: none !important;
    margin: auto !important;
    align-self: center;
    max-width: 100%;
    max-height: 100%;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="page-top"] {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        width: 100%;
        margin: 0 !important;
        padding: 16px 0 !important;
        border: 0;
        background: transparent;
        min-height: calc(250px + 32px) !important;
        height: calc(250px + 32px) !important;
        max-height: calc(250px + 32px) !important;
        overflow: hidden;
        text-align: center;
        pointer-events: auto;
    }
}

@media (min-width: 768px) {
    html.race-view-polling main.mv-content {
        overflow: visible;
    }
    html.race-view-polling main > section:has(#senLineViz) > div,
    html.race-view-polling main > section:has(#govLineViz) > div,
    html.race-view-polling main > section:has(#houseLineViz) > div,
    html.race-view-polling main > section:has(#primaryLineViz) > div,
    html.race-view-polling main > section:has(#senBarViz) > div,
    html.race-view-polling main > section:has(#govBarViz) > div,
    html.race-view-polling main > section:has(#houseBarViz) > div,
    html.race-view-polling main > section:has(#primaryBarViz) > div {
        overflow: visible;
    }
    html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop {
        position: relative;
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        width: 100%;
        max-width: none;
        margin: 0;
        background: #0b0e13;
        border-top: none;
        border-bottom: 1px solid rgb(30 41 55 / 0.8);
        padding: 16px 1.5rem !important;
        min-height: calc(250px + 32px) !important;
        height: calc(250px + 32px) !important;
        max-height: calc(250px + 32px) !important;
        overflow: hidden;
        text-align: center;
        pointer-events: auto;
        opacity: 1;
    }
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-chart"] {
        border-top: 1px solid rgb(30 41 55 / 0.8) !important;
        border-bottom: 1px solid rgb(30 41 55 / 0.8) !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-methodology"],
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-table"] {
        border-top: 1px solid rgb(30 41 55 / 0.8) !important;
        border-bottom: 1px solid rgb(30 41 55 / 0.8) !important;
        margin-top: 2.5rem !important;
        margin-bottom: 0 !important;
    }
    /* Gap under the mid well, before the poll table / 4-panel row. */
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-chart"] + .mi-senate-chart-stat-head {
        margin-top: 2.5rem !important;
    }
    html.race-view-polling .pm-tx-ad-band[data-pm-rf-place="under-chart"] + section > div {
        padding-top: 2.5rem !important;
        margin-top: 0 !important;
    }
    html.race-view-polling section > div > .pm-tx-ad-band[data-pm-rf-place="under-chart"]:last-child {
        margin-bottom: 0 !important;
    }
    html.race-view-polling section:has(> div > .pm-tx-ad-band[data-pm-rf-place="under-chart"]:last-child) > div {
        padding-bottom: 2.5rem !important;
    }
    /* Bottom well owns the gap above it — don't stack table / about padding. */
    html.race-view-polling section:has(+ .pm-tx-ad-band[data-pm-rf-place="under-table"]) > div,
    html.race-view-polling section:has(+ .pm-tx-ad-band[data-pm-rf-place="under-methodology"]) > div {
        padding-bottom: 0 !important;
    }
    html.race-view-polling .polling-about:has(+ .pm-tx-ad-band[data-pm-rf-place="under-methodology"]) .polling-about__inner {
        padding-bottom: 0 !important;
    }
    html.race-view-polling:has(.pm-tx-ad-band[data-pm-rf-place="under-methodology"], .pm-tx-ad-band[data-pm-rf-place="under-table"]) main.mv-content {
        padding-bottom: 0 !important;
    }
    html.race-view-polling:has(.pm-tx-ad-band[data-pm-rf-place="under-methodology"], .pm-tx-ad-band[data-pm-rf-place="under-table"]) footer[data-et-site-footer="1"] {
        margin-top: 0 !important;
        border-top: none !important;
    }
    /* Line-chart mid well sits inside the padded chart section — break out to full bleed. */
    html.race-view-polling .pm-tx-ad-band[data-pm-ge-mid="line"] {
        width: calc(100% + 3rem) !important;
        max-width: none !important;
        margin-left: -1.5rem !important;
        margin-right: -1.5rem !important;
    }
    @media (min-width: 1024px) {
        html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop {
            padding-left: 2.5rem !important;
            padding-right: 2.5rem !important;
        }
        html.race-view-polling .pm-tx-ad-band[data-pm-ge-mid="line"] {
            width: calc(100% + 5rem) !important;
            margin-left: -2.5rem !important;
            margin-right: -2.5rem !important;
        }
    }
    @media (min-width: 1280px) {
        html.race-view-polling .pm-tx-ad-band.pm-tx-ad-band--desktop {
            padding-left: 3.5rem !important;
            padding-right: 3.5rem !important;
        }
        html.race-view-polling .pm-tx-ad-band[data-pm-ge-mid="line"] {
            width: calc(100% + 7rem) !important;
            margin-left: -3.5rem !important;
            margin-right: -3.5rem !important;
        }
    }
}
