/* 2026 US House district race pages (sleek layout; based on state GE pages) */
body.sleek-home.house-district-page {
    font-family: "DM Sans", ui-sans-serif, system-ui, sans-serif;
    background: #050608;
    color: #e2e8f0;
    min-height: 100vh;
}

body.sleek-home.house-district-page h1,
body.sleek-home.house-district-page h2,
body.sleek-home.house-district-page h3 {
    font-family: "Plus Jakarta Sans", "DM Sans", ui-sans-serif, system-ui, sans-serif;
}

body.sleek-home.house-district-page #mainHeader {
    position: relative;
    z-index: 50;
    background: rgba(5, 6, 8, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(51, 65, 85, 0.45);
    overflow: visible;
}

body.sleek-home.house-district-page .sleek-home-header-logo {
    transform: scale(1.18);
    transform-origin: left center;
}

body.sleek-home.house-district-page .sleek-chart-stage {
    position: relative;
    background-color: #0c0f14;
    border: 1px solid rgba(51, 65, 85, 0.5);
    border-radius: 0;
    padding: 0.5rem 0.65rem;
    overflow: visible;
}

body.sleek-home.house-district-page select.sleek-select {
    border-radius: 0;
    cursor: pointer;
    border-bottom: 1px solid rgba(71, 85, 105, 0.9) !important;
    border-top: none !important;
    border-left: none !important;
    border-right: none !important;
    background: transparent !important;
    color: #e2e8f0;
    padding: 0.35rem 1.5rem 0.35rem 0;
    font-size: 0.875rem;
}

body.sleek-home.house-district-page .pill {
    background: transparent;
    border: none;
    border-bottom: 1px solid rgba(71, 85, 105, 0.8);
    border-radius: 0;
}

/* Hero band: match state Senate GE section padding and photo grid */
body.sleek-home.house-district-page .house-hero-band {
    padding-top: 2rem;
    padding-bottom: calc(2.5rem - 5px);
}

body.sleek-home.house-district-page .ga-hero-cands {
    width: 100%;
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    box-sizing: border-box;
}

body.sleek-home.house-district-page .ga-hero-cands > div:nth-child(1) {
    transform: translateX(-2px);
}

body.sleek-home.house-district-page .ga-hero-cands > div:nth-child(3) {
    transform: translateX(2px);
}

body.sleek-home.house-district-page .ga-hero-cand-photo {
    width: 114px;
    height: 143px;
}

@media (min-width: 640px) {
    body.sleek-home.house-district-page .ga-hero-cand-photo {
        width: 130px;
        height: 163px;
    }
}

@media (min-width: 1024px) {
    body.sleek-home.house-district-page .ga-hero-cand-photo {
        width: 150px;
        height: 188px;
    }
}

@media (min-width: 1280px) {
    body.sleek-home.house-district-page .ga-hero-cand-photo {
        width: 163px;
        height: 204px;
    }
}

body.sleek-home.house-district-page .state-cand-photo {
    border: 1px solid rgba(51, 65, 85, 0.55);
    background: #0c0f14;
    border-radius: 0;
    overflow: hidden;
}

/* Party logo fallback: center-crop to 2:2.5 frame, no zoom */
body.sleek-home.house-district-page .house-photo-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

body.sleek-home.house-district-page .ga-hero-cand-name {
    display: inline-block;
    border-bottom: none;
    padding-bottom: 0;
}

body.sleek-home.house-district-page .ga-hero-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    min-width: 0;
    margin-top: -21px;
    transform: translateY(-2px);
}

@media (min-width: 1024px) {
    body.sleek-home.house-district-page .ga-hero-center {
        margin-top: -30px;
        transform: translateY(-10px);
    }
}

/* Flag + state/district/race only — visual shift without growing hero row height */
body.sleek-home.house-district-page .house-hero-center-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    transform: translateY(18px);
}

body.sleek-home.house-district-page .ga-hero-flag-wrap {
    display: flex;
    justify-content: center;
    width: 100%;
    padding-top: 30px;
    box-sizing: border-box;
    transform: translateY(-6px);
}

@media (min-width: 1024px) {
    body.sleek-home.house-district-page .ga-hero-flag-wrap {
        padding-top: 18px;
    }
}

body.sleek-home.house-district-page .ga-hero-flag-wrap .state-hero-flag {
    display: block;
    width: auto;
    height: 52px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

@media (min-width: 640px) {
    body.sleek-home.house-district-page .ga-hero-flag-wrap .state-hero-flag {
        height: 58px;
    }
}

/* Tight stack: state + district + race (replaces one Senate title line vertically) */
body.sleek-home.house-district-page .house-hero-center-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: 1px;
    width: 100%;
    max-width: 100%;
    transform: translateY(3px);
}

@media (min-width: 1024px) {
    body.sleek-home.house-district-page .house-hero-center-stack {
        margin-top: 0;
        width: max-content;
        max-width: none;
    }
}

body.sleek-home.house-district-page .house-hero-redistrict {
    margin: 0.35rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.25;
    text-align: center;
    color: #ff4142;
}

/* State name — small label above district (override shared.js .ga-hero-title clamp) */
body.sleek-home.house-district-page .ga-hero-title--house {
    margin: 0;
    padding: 0;
    font-family: "Plus Jakarta Sans", "DM Sans", ui-sans-serif, system-ui, sans-serif;
    font-size: 3.6875rem !important;
    line-height: 1.1;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
    transform: translateY(-1px);
}
        font-size: 3.75rem !important;
    }
}

@media (min-width: 1024px) {
    body.sleek-home.house-district-page .ga-hero-title--house {
        font-size: 3.8125rem !important;
    }
}

/* District — one line */
body.sleek-home.house-district-page .ga-hero-district {
    margin: 0.125rem 0 0;
    padding: 0;
    font-family: "Plus Jakarta Sans", "DM Sans", ui-sans-serif, system-ui, sans-serif;
    font-size: clamp(calc(1.125rem - 5px), calc(3.2vw - 5px), calc(1.875rem - 5px));
    font-weight: 500;
    letter-spacing: -0.015em;
    color: #fff;
    line-height: 1.08;
    white-space: nowrap;
    max-width: 100%;
    transform: translateY(1px);
}
body.sleek-home.house-district-page .ga-hero-race {
    font-family: "Plus Jakarta Sans", "DM Sans", ui-sans-serif, system-ui, sans-serif;
    font-size: clamp(0.625rem, 2.35vw, 1.0625rem);
    font-weight: 800;
    letter-spacing: clamp(0.1em, 0.55vw, 0.22em);
    text-transform: uppercase;
    color: #94a3b8;
    margin: 0;
    margin-top: calc(0.4rem + 13px);
    line-height: 1.15;
    white-space: nowrap;
    max-width: 100%;
    transform: translateY(2px);
}

body.sleek-home.house-district-page .ga-party-affil {
    font-family: "Plus Jakarta Sans", "DM Sans", ui-sans-serif, system-ui, sans-serif;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    margin-top: 0.2rem;
}

@media (min-width: 640px) {
    body.sleek-home.house-district-page .ga-party-affil {
        font-size: 0.9rem;
    }
}

#pollsTableShell .row {
    padding: .72rem 1rem;
    border-top: 1px solid rgba(51, 65, 85, 0.35);
    display: grid;
    grid-template-columns: 2.55fr 1.3fr 0.95fr 0.95fr 0.95fr 0.96fr;
    gap: 0 1.25rem;
    align-items: center;
}

#pollsTableShell .row.header {
    background: #0f1218;
    font-weight: 600;
    color: #94a3b8;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-top: none;
}

#pollsTableShell .row.avg {
    background: rgba(30, 41, 59, 0.45);
    border-bottom: 1px solid rgba(51, 65, 85, 0.45);
}

body.sleek-home.house-district-page .state-polls-shell {
    background: #0a0c10;
    border: 1px solid rgba(51, 65, 85, 0.5);
}

/* CA open-primary House: pollster / date / sample + candidates + margin (grid via injectPrimaryPollsTableGrid) */
body.house-ca-open-polls-grid #pollsTableShell .row {
    grid-template-columns:
        minmax(0, 2fr) minmax(0, 1.25fr) minmax(0, 1fr)
        repeat(var(--house-ca-cand-cols, 5), minmax(0, 0.85fr));
}

body.house-ca-open-polls-grid #pollsTableShell .row.header > div.house-ca-cand-head {
    text-transform: none;
    letter-spacing: 0.03em;
    font-size: 0.75rem;
    line-height: 1.25;
    white-space: nowrap;
    word-break: normal;
    color: #94a3b8;
}

body.house-ca-open-polls-grid #pollsTableShell .row:not(.header):not(.avg) > div.house-ca-cand-val {
    font-size: 1rem;
    line-height: 1.25;
}

/* CA open-primary multi-candidate chart (3+ polls): ME gov Dem primary layout */
body.house-ca-open-multi-chart #houseLineViz.sleek-chart-stage {
    display: block !important;
}

body.house-ca-open-multi-chart #houseLineViz .relative {
    height: 420px;
}

@media (min-width: 640px) {
    body.house-ca-open-multi-chart #houseLineViz .relative {
        height: 520px;
    }
}

/* CA open-primary: invisible side columns so center stack aligns like 3-across House pages */
body.sleek-home.house-district-page.house-ca-open-primary .house-ca-hero-spacer {
    display: none;
}

@media (min-width: 1024px) {
    body.sleek-home.house-district-page.house-ca-open-primary .house-ca-hero-spacer {
        display: block;
        width: 150px;
        min-height: 188px;
        visibility: hidden;
        pointer-events: none;
    }
}

@media (min-width: 1280px) {
    body.sleek-home.house-district-page.house-ca-open-primary .house-ca-hero-spacer {
        width: 163px;
        min-height: 204px;
    }
}

body.sleek-home.house-district-page footer {
    background: #0a0c10 !important;
    border-top: 1px solid rgba(51, 65, 85, 0.45) !important;
}
