/* ==========================================================================
   public.css — shared stylesheet for nfg26.newlinforgeorgia.com public pages
   ==========================================================================
   Loaded by templates/public_base.html. Contains:
     1. Brand variables + reset
     2. Top nav (sticky) + A14 logo lockup + DONATE pill + hamburger
     3. Slim header / hero patterns
     4. Public-main + footer
     5. Per-page sections (scoped via body class — .page-kims-record, etc.)
   ========================================================================== */

/* ===== 1. Brand variables + reset ======================================== */

:root {
    --purple: #3d2260;
    --purple-deep: #2a1745;
    --purple-nav: #38245D;
    --purple-light: #5a3d80;
    --gold: #fbc926;
    --gold-hover: #e5b71e;
    --white: #ffffff;
    --cream: #faf8f5;
    --text: #1a1a2e;
    --text-dark: #1a1a2e;
    --text-muted: #6b6b78;
    --red: #c1272d;
    --green: #1e8b3e;
    --gray: #888;
    --border: rgba(0,0,0,0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; max-width: 100%; }

body {
    font-family: 'Roboto', sans-serif;
    background: var(--cream);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ===== 2. Top nav ======================================================== */

.public-nav {
    position: sticky; top: 0; z-index: 100;
    background: var(--purple-nav);
    width: 100%;
}
.nav-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.5rem 1.25rem;
    min-height: 92px;
    position: relative;
}
.nav-left { display: flex; align-items: center; gap: 2rem; }
.nav-right { display: flex; align-items: center; gap: 1rem; }

/* A14 logo lockup */
.logo-horiz {
    display: inline-grid;
    grid-template-columns: auto auto;
    column-gap: 0.6em;
    row-gap: 0;
    align-items: baseline;
    color: var(--white);
    text-decoration: none;
    line-height: 0.95;
}
.logo-horiz .logo-jeff {
    grid-column: 1; grid-row: 1;
    text-align: right;
    font-weight: 900; font-size: 30px; color: var(--gold);
    letter-spacing: 0.005em; line-height: 1;
}
.logo-horiz .logo-newlin {
    grid-column: 2; grid-row: 1;
    justify-self: end;
    font-weight: 900; font-size: 38px; color: var(--white);
    letter-spacing: 0.07em;
    margin-right: -0.07em;
    line-height: 1;
}
.logo-horiz .logo-tagline {
    grid-column: 2; grid-row: 2;
    justify-self: end;
    display: flex; align-items: baseline;
    gap: 0.6em; line-height: 1;
}
.logo-horiz .logo-for {
    font-family: 'Caveat', cursive;
    font-weight: 700; font-size: 22px;
    color: var(--white); line-height: 1;
    transform: translateY(2px);
}
.logo-horiz .logo-senate {
    font-weight: 800; font-size: 17px;
    color: var(--gold);
    letter-spacing: 0.005em;
    margin-right: -0.005em;
    text-transform: uppercase;
    line-height: 1;
}

/* Menu links */
.nav-menu { display: flex; align-items: center; gap: 1.6rem; }
.nav-menu a {
    color: var(--white);
    font-size: 20px; font-weight: 600;
    text-decoration: none; line-height: 1;
}
.nav-menu a:hover { opacity: 0.85; }

/* DONATE pill */
.donate-pill {
    display: inline-block;
    background: var(--gold); color: var(--purple-deep);
    font-weight: 800; font-size: 1rem;
    padding: 0.7rem 1.5rem; border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(251,201,38,0.25);
    letter-spacing: 0.04em;
    transition: background 0.18s, transform 0.18s;
}
.donate-pill:hover { background: var(--gold-hover); transform: translateY(-1px); }

/* Hamburger (hidden on desktop) */
.nav-hamburger {
    display: none;
    background: none; border: 0; cursor: pointer;
    padding: 0.5rem;
}
.nav-hamburger span {
    display: block;
    width: 28px; height: 3px;
    background: var(--white);
    margin: 5px 0;
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}

/* Mobile breakpoint */
@media (max-width: 920px) {
    .nav-inner { padding: 0.5rem 0.85rem; min-height: 76px; }
    .nav-left { gap: 1rem; }
    .logo-horiz .logo-jeff { font-size: 22px; }
    .logo-horiz .logo-newlin { font-size: 28px; }
    .logo-horiz .logo-for { font-size: 17px; transform: translateY(1px); }
    .logo-horiz .logo-senate { font-size: 13px; }
    .nav-menu {
        display: none;
        position: absolute; top: 100%; left: 0; right: 0;
        background: var(--purple-nav);
        flex-direction: column; gap: 0;
        padding: 0.5rem 0;
        border-top: 1px solid rgba(255,255,255,0.1);
        box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    }
    .nav-menu.open { display: flex; }
    .nav-menu a {
        padding: 0.85rem 1.25rem;
        border-bottom: 1px solid rgba(255,255,255,0.05);
        font-size: 18px;
    }
    .donate-pill { padding: 0.55rem 1.1rem; font-size: 0.88rem; }
    .nav-hamburger { display: block; }
}

/* ===== 3. Slim header (default for content pages) ======================== */

.slim-header {
    background: var(--white);
    padding: 1rem 1.25rem 0.85rem;
    text-align: center;
}
.slim-header-inner { max-width: 1100px; margin: 0 auto; }
.slim-header h1 {
    font-size: 1.65rem; font-weight: 900;
    color: var(--purple);
    line-height: 1.15;
    margin-bottom: 0.25rem;
    text-wrap: balance;
}
.slim-header h1 .accent { color: var(--gold); }
.slim-header .subtitle {
    font-size: 0.92rem; color: #555;
    line-height: 1.45;
    max-width: 760px; margin: 0 auto;
    text-wrap: balance;
}
.slim-header .subtitle strong { color: var(--purple); }
.page-district-map .dm-city {
    cursor: pointer;
    transition: color 0.15s, font-weight 0.15s;
}
.page-district-map .dm-city:hover {
    color: var(--purple-deep);
    text-decoration: underline;
}
.page-district-map .dm-city.active {
    color: var(--purple);
    font-weight: 700;
}
.slim-header .subtitle-back {
    margin-top: 0.7rem;
    font-size: 0.88rem;
    text-wrap: balance;
}
.slim-header .subtitle-back a {
    color: var(--purple);
    font-weight: 700;
    text-decoration: none;
}
.slim-header .subtitle-back a:hover { text-decoration: underline; }

@media (max-width: 600px) {
    .slim-header { padding: 0.85rem 1rem 0.7rem; }
    .slim-header h1 { font-size: 1.3rem; }
    .slim-header .subtitle { font-size: 0.85rem; }
}

/* ===== 4. Main content + footer ========================================== */

.public-main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1.25rem;
}

.public-footer {
    background: var(--cream);
    color: var(--text);
    margin-top: 3rem;
    padding: 1.25rem 1.25rem 0.85rem;
}

/* Centered social row */
.public-footer .footer-social {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.7rem;
    margin: 0 0 0.85rem;
    padding: 0;
    border: 0;
    width: 100%;
}
.footer-social a {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--purple);
    border: 1.5px solid rgba(61,34,96,0.25);
    border-radius: 50%;
    transition: all 0.2s;
}
.footer-social a:hover {
    color: var(--white);
    background: var(--purple);
    border-color: var(--purple);
    transform: translateY(-1px);
}
.footer-social a svg {
    width: 16px;
    height: 16px;
    display: block;
    flex-shrink: 0;
}

/* Disclosure line — same style for all text including Privacy Policy */
.footer-bottom {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-style: italic;
    text-wrap: balance;
}
.footer-bottom a {
    color: inherit;
    font: inherit;
    text-decoration: none;
    transition: color 0.15s;
}
.footer-bottom a:hover {
    color: var(--purple);
    text-decoration: underline;
}

/* ===== 5. Page-specific sections ==========================================
   Each page scopes its styles under a body class set via {% block body_class %}.
   ========================================================================== */


/* ----- .page-kims-record (compare landing) -------------------------------- */

.page-kims-record .container {
    max-width: 720px;
    margin: 0 auto 2.5rem;
    padding: 1.5rem 1.2rem 0;
    position: relative;
    z-index: 1;
}

.page-kims-record .section {
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(61,34,96,0.08), 0 1px 4px rgba(0,0,0,0.04);
    margin-bottom: 1.25rem;
    overflow: hidden;
}
.page-kims-record .section-header {
    padding: 1rem 1.25rem 0.85rem;
    border-bottom: 1px solid #eee;
}
.page-kims-record .section-header h2 {
    font-size: 1.1rem; font-weight: 900;
    color: var(--purple);
    margin-bottom: 0.25rem;
    text-wrap: balance;
}
.page-kims-record .section-header p {
    font-size: 0.88rem; color: var(--text-muted);
    line-height: 1.5;
    text-wrap: pretty;
}

.page-kims-record .bill-row {
    display: block;
    padding: 0.95rem 1.25rem;
    border-bottom: 1px solid #f1eef5;
    text-decoration: none; color: inherit;
    transition: background 0.15s;
}
.page-kims-record .bill-row:hover { background: #faf8f5; }
.page-kims-record .bill-row:last-child { border-bottom: 0; }

.page-kims-record .bill-head {
    display: flex; align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.3rem;
    flex-wrap: wrap;
    min-width: 0;
}
.page-kims-record .bill-head > * { min-width: 0; max-width: 100%; }
.page-kims-record .bill-num,
.page-kims-record .vote-badge {
    white-space: normal;
    word-break: break-word;
}
.page-kims-record .bill-caption,
.page-kims-record .bill-context {
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.page-kims-record .bill-num {
    font-family: 'Roboto', monospace;
    font-weight: 900; font-size: 0.95rem;
    color: var(--purple);
    background: rgba(61,34,96,0.08);
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    letter-spacing: 0.02em;
}
.page-kims-record .vote-badge {
    font-size: 0.72rem; font-weight: 800;
    letter-spacing: 0.1em;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
}
.page-kims-record .vote-nay { background: rgba(193,39,45,0.14); color: var(--red); }
.page-kims-record .vote-yea { background: rgba(30,139,62,0.14); color: var(--green); }
.page-kims-record .vote-excused,
.page-kims-record .vote-skip { background: rgba(0,0,0,0.07); color: var(--gray); }
.page-kims-record .vote-passed { background: rgba(30,139,62,0.14); color: var(--green); }
.page-kims-record .vote-failed { background: rgba(193,39,45,0.14); color: var(--red); }
.page-kims-record .bill-arrow {
    margin-left: auto;
    color: var(--purple);
    font-weight: 800; font-size: 1.1rem;
}
.page-kims-record .bill-caption {
    font-size: 0.92rem; color: var(--text-dark);
    line-height: 1.45;
}
.page-kims-record .bill-context {
    font-size: 0.8rem; color: var(--text-muted);
    margin-top: 0.35rem;
    font-style: italic;
}

/* Filter bar (sticky under nav) */
.page-kims-record .filter-bar {
    position: sticky;
    top: 92px;
    z-index: 50;
    background: var(--cream);
    padding: 0.75rem 0 0.5rem;
    margin: 0 -1.2rem 1rem;
    border-bottom: 1px solid rgba(61,34,96,0.08);
}
@media (max-width: 920px) {
    .page-kims-record .filter-bar { top: 76px; }
}
.page-kims-record .filter-row {
    display: flex; gap: 0.4rem;
    align-items: center;
    padding: 0 1.2rem 0.4rem;
    flex-wrap: wrap;
}
.page-kims-record .filter-row:last-of-type { padding-bottom: 0; }
.page-kims-record .filter-label {
    font-size: 0.7rem; font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
    flex-shrink: 0;
    padding-right: 0.2rem;
    width: 100%;
    margin-bottom: 0.15rem;
}
.page-kims-record .filter-chip {
    background: var(--white);
    color: var(--purple);
    border: 1.5px solid rgba(61,34,96,0.18);
    border-radius: 999px;
    padding: 0.4rem 0.8rem;
    font-family: inherit;
    font-weight: 700; font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.page-kims-record .filter-chip:hover { border-color: var(--purple); }
.page-kims-record .filter-chip.active {
    background: var(--purple);
    color: var(--white);
    border-color: var(--purple);
}
.page-kims-record .filter-empty {
    text-align: center;
    padding: 1rem 1.2rem 0.4rem;
    font-size: 0.88rem;
    color: var(--text-muted);
}
.page-kims-record .filter-reset {
    background: transparent;
    color: var(--purple);
    border: none;
    font-family: inherit;
    font-weight: 700; font-size: 0.88rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

/* Section card variants */
.page-kims-record .section.section-link {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s, transform 0.15s;
}
.page-kims-record .section.section-link:hover {
    background: #faf8f5;
    transform: translateY(-1px);
}
.page-kims-record .section.section-link .section-arrow {
    color: var(--gold);
    font-weight: 900;
    margin-left: 0.3rem;
}
.page-kims-record .section.section-link .section-link-cta {
    margin-top: 0.6rem;
    font-weight: 800;
    color: var(--purple);
    font-size: 0.88rem;
}
.page-kims-record .section.section-throwaway {
    opacity: 0.85;
    box-shadow: 0 2px 8px rgba(61,34,96,0.05);
}
.page-kims-record .section.section-throwaway:hover { opacity: 1; }
.page-kims-record .section.section-throwaway .section-header h2 {
    font-size: 0.98rem;
}

/* CTA stack at bottom */
.page-kims-record .cta-stack {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.5rem;
}
.page-kims-record .btn-primary,
.page-kims-record .btn-secondary,
.page-kims-record .btn-ghost {
    display: block;
    width: 100%;
    padding: 0.95rem;
    border-radius: 10px;
    font-family: inherit;
    font-weight: 800; font-size: 1.02rem;
    cursor: pointer;
    border: 2px solid transparent;
    text-decoration: none;
    text-align: center;
    transition: all 0.18s;
}
.page-kims-record .btn-primary {
    background: var(--gold);
    color: var(--purple-deep);
    box-shadow: 0 4px 16px rgba(251,201,38,0.3);
}
.page-kims-record .btn-primary:hover {
    background: var(--gold-hover);
    transform: translateY(-1px);
}
.page-kims-record .btn-secondary {
    background: var(--purple);
    color: var(--gold);
    box-shadow: 0 4px 16px rgba(61,34,96,0.25);
}
.page-kims-record .btn-secondary:hover {
    background: var(--purple-deep);
    transform: translateY(-1px);
}
.page-kims-record .btn-ghost {
    background: transparent;
    color: var(--purple);
    border-color: var(--purple);
}
.page-kims-record .btn-ghost:hover {
    background: var(--purple);
    color: var(--white);
}

.page-kims-record .source-note {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 540px;
    margin: 0.5rem auto 0;
    line-height: 1.5;
}

/* Hidden by filter */
.page-kims-record .bill-row.is-hidden,
.page-kims-record .section.is-hidden { display: none; }

/* When .page-kims-record uses .public-main, override default padding */
.page-kims-record .public-main { padding: 0; max-width: none; }


/* ----- .page-district-map (District 41 map page) --------------------------
   Layout mirrors the original WP page: zip list at top, BIG interactive
   map (~720px tall on desktop), helper text, then the giant GA MY VOTER
   PAGE call-to-action button as the page's primary CTA. */

.page-district-map .public-main { padding: 0; max-width: none; }

.page-district-map .dm-wrap {
    max-width: 1100px;
    margin: 0 auto 3rem;
    padding: 1.5rem 1.25rem 0;
}

/* Zip-code chip list — sits under the city sentence in the slim-header */
.page-district-map .dm-zips {
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text);
    margin: 0.35rem 0 0;
    text-align: center;
    text-wrap: pretty;
}
.page-district-map .dm-zip-chip {
    color: var(--purple);
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.15s;
}
.page-district-map .dm-zip-chip:hover {
    color: var(--purple-deep);
    text-decoration: underline;
}
.page-district-map .dm-zip-chip.active {
    background: var(--purple);
    color: var(--white);
    padding: 0.1em 0.45em;
    border-radius: 4px;
}

/* Address-lookup widget — primary CTA above the map */
.page-district-map .dm-address-form {
    background: var(--white);
    border: 2px solid var(--purple);
    border-radius: 14px;
    padding: 1.1rem 1.25rem 0.95rem;
    margin: 0 0 1.25rem;
    box-shadow: 0 6px 24px rgba(61,34,96,0.08), 0 1px 4px rgba(0,0,0,0.04);
}
.page-district-map .dm-address-label {
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--purple);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.6rem;
}
.page-district-map .dm-address-row {
    display: flex;
    gap: 0.6rem;
    align-items: stretch;
}
.page-district-map #dm-address-input,
.page-district-map #dm-admin-search-input {
    flex: 1;
    min-width: 0;
    padding: 0.75rem 1rem;
    border: 1.5px solid #d6d2dd;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    background: var(--white);
    color: var(--text);
}
.page-district-map #dm-address-input:focus,
.page-district-map #dm-admin-search-input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(61,34,96,0.12);
}
.page-district-map .dm-address-submit {
    background: var(--gold);
    color: var(--purple-deep);
    border: 0;
    border-radius: 8px;
    padding: 0.75rem 1.4rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.page-district-map .dm-address-submit:hover {
    background: var(--gold-hover);
    transform: translateY(-1px);
}
.page-district-map .dm-address-help {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0.6rem 0 0;
    line-height: 1.45;
}

@media (max-width: 600px) {
    .page-district-map .dm-address-row { flex-direction: column; }
    .page-district-map .dm-address-submit { width: 100%; }
}

/* Lookup result panel */
.page-district-map .dm-result {
    background: var(--white);
    border-left: 4px solid var(--gold);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin: 0 0 1.25rem;
    box-shadow: 0 4px 16px rgba(61,34,96,0.06);
}
.page-district-map .dm-result-loading {
    color: var(--text-muted);
    font-size: 0.92rem;
    margin: 0;
}
.page-district-map .dm-result-loading strong { color: var(--purple); }
.page-district-map .dm-result-error {
    color: var(--red);
    font-size: 0.92rem;
    margin: 0;
}
.page-district-map .dm-result-error strong { color: var(--purple); }

/* Successful lookup — full result card */
.page-district-map .dm-result-card {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.page-district-map .dm-result-id {
    align-self: flex-start;
    background: var(--purple);
    color: var(--white);
    font-weight: 900;
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    padding: 0.18rem 0.55rem;
    border-radius: 4px;
    margin-bottom: 0.2rem;
}
.page-district-map .dm-result-precinct {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--purple);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.page-district-map .dm-result-loc {
    font-size: 1.05rem;
    color: var(--text);
    line-height: 1.3;
}
.page-district-map .dm-result-loc strong { font-weight: 800; }
.page-district-map .dm-result-addr {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.page-district-map .dm-result-dist {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-top: 0.2rem;
}
/* (.dm-result-link removed — replaced by .dm-directions picker) */

/* Mapbox map container — needs explicit height for the GL renderer */
.page-district-map .dm-map {
    width: 100%;
    height: 620px;
    border-radius: 12px;
    box-shadow: 0 6px 24px rgba(61,34,96,0.08), 0 1px 4px rgba(0,0,0,0.04);
    overflow: hidden;
    background: #e8e4dc;  /* fallback while map tiles load */
}
@media (max-width: 900px) {
    .page-district-map .dm-map { height: 540px; }
}
@media (max-width: 600px) {
    .page-district-map .dm-map { height: 460px; }
}

/* Mapbox control overrides — match brand. Higher specificity than .mapboxgl-ctrl-group default. */
.page-district-map .dm-map .mapboxgl-ctrl-group {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(61,34,96,0.18);
}
.page-district-map .dm-map .mapboxgl-ctrl-group button {
    width: 32px;
    height: 32px;
}

/* Mapbox popup — precinct details */
.page-district-map .mapboxgl-popup-content {
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(61,34,96,0.18);
    padding: 0.85rem 1rem;
    font-family: 'Roboto', sans-serif;
}
.page-district-map .mapboxgl-popup-close-button {
    font-size: 1.4rem;
    color: var(--text-muted);
    padding: 0 0.45rem;
}
.page-district-map .dm-popup .dm-popup-id {
    display: inline-block;
    background: var(--purple);
    color: var(--white);
    font-weight: 900;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.4rem;
}
.page-district-map .dm-popup .dm-popup-name {
    font-weight: 800;
    font-size: 0.92rem;
    color: var(--purple);
    margin-bottom: 0.15rem;
    line-height: 1.25;
}
.page-district-map .dm-popup .dm-popup-loc {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text);
    margin-bottom: 0.3rem;
    line-height: 1.3;
}
.page-district-map .dm-popup .dm-popup-addr {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-bottom: 0.55rem;
}
.page-district-map .dm-popup .dm-popup-link {
    display: inline-block;
    background: var(--gold);
    color: var(--purple-deep);
    font-weight: 800;
    font-size: 0.82rem;
    text-decoration: none;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    transition: background 0.15s;
}
.page-district-map .dm-popup .dm-popup-link:hover {
    background: var(--gold-hover);
}

/* Directions picker — gold pill button + dropdown menu of map platforms.
   Used in both Mapbox popups and the lookup-result card. */
.page-district-map .dm-directions {
    position: relative;
    display: inline-block;
    margin-top: 0.5rem;
}
.page-district-map .dm-directions-btn {
    display: inline-block;
    background: var(--gold);
    color: var(--purple-deep);
    font-weight: 800;
    font-size: 0.88rem;
    border: 0;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s, transform 0.15s;
}
.page-district-map .dm-directions-btn:hover {
    background: var(--gold-hover);
    transform: translateY(-1px);
}
.page-district-map .dm-directions-menu {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    z-index: 50;
    background: var(--white);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(61,34,96,0.18);
    padding: 0.35rem;
    min-width: 180px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.page-district-map .dm-directions-menu[hidden] { display: none; }
.page-district-map .dm-dir-opt {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    color: var(--text);
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.12s;
}
.page-district-map .dm-dir-opt:hover {
    background: rgba(61,34,96,0.08);
    color: var(--purple);
}
.page-district-map .dm-dir-icon {
    width: 18px; height: 18px;
    border-radius: 4px;
    flex-shrink: 0;
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}
/* Brand-colored icon backgrounds — small inline SVG so we don't ship 3 raster files */
.page-district-map .dm-dir-apple {
    background-color: #000;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M17.05 20.28c-.98.95-2.05.8-3.08.35-1.09-.46-2.09-.48-3.24 0-1.44.62-2.2.44-3.06-.35C2.79 15.25 3.51 7.59 9.05 7.31c1.35.07 2.29.74 3.08.8 1.18-.24 2.31-.93 3.57-.84 1.51.12 2.65.72 3.4 1.8-3.12 1.87-2.38 5.98.48 7.13-.57 1.5-1.31 2.99-2.54 4.09zM12 7.25c-.15-2.23 1.66-4.07 3.74-4.25.29 2.58-2.34 4.5-3.74 4.25z"/></svg>');
}
.page-district-map .dm-dir-google {
    background-color: #4285F4;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/></svg>');
}
.page-district-map .dm-dir-waze {
    background-color: #33CCFF;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M20.54 6.63c.79 1.4 1.21 2.98 1.21 4.6 0 4.66-3.41 8.51-7.92 9.42-.27 1.34-1.45 2.35-2.85 2.35-1.4 0-2.59-1.02-2.85-2.36-1.41-.16-2.74-.6-3.92-1.27-.5.39-1.13.62-1.81.62-1.62 0-2.95-1.32-2.95-2.95 0-1.06.56-2 1.41-2.51-.18-.61-.27-1.24-.27-1.89 0-4.69 4.14-8.5 9.25-8.5 1.85 0 3.61.5 5.13 1.41-.05.27-.08.54-.08.83 0 2.16 1.81 3.91 4.04 3.91.21 0 .42-.02.61-.05l.45.39h-.45zM10 11c0 .55.45 1 1 1s1-.45 1-1-.45-1-1-1-1 .45-1 1zm6 0c0 .55.45 1 1 1s1-.45 1-1-.45-1-1-1-1 .45-1 1zm-7.7 4.13c.42 1.46 1.96 2.37 3.7 2.37 1.74 0 3.28-.91 3.7-2.37.07-.27-.13-.55-.42-.55h-6.55c-.3 0-.5.27-.43.55z"/></svg>');
}

/* Result-card directions: same picker, but anchored to bottom of card */
.page-district-map .dm-result-card .dm-directions {
    align-self: flex-start;
    margin-top: 0.5rem;
}

/* Admin /district-map view toggle — switch between senate / house views */
.page-district-map .dm-view-toggle {
    display: inline-flex;
    background: var(--white, #fff);
    border: 1.5px solid #d6d2dd;
    border-radius: 8px;
    overflow: hidden;
    margin: 0.5rem 0 0.75rem;
}
.page-district-map .dm-view-btn {
    background: transparent;
    border: 0;
    padding: 0.55rem 1.1rem;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.page-district-map .dm-view-btn:hover { background: #f5f1ff; }
.page-district-map .dm-view-btn.active {
    background: var(--purple);
    color: var(--white, #fff);
}
.page-district-map .dm-view-btn + .dm-view-btn {
    border-left: 1.5px solid #d6d2dd;
}

/* Postal-vs-political legend — appears above the map only while ATLANTA is the active city */
.page-district-map .dm-atlanta-legend {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 auto 0.75rem;
    max-width: 880px;
    text-align: center;
    text-wrap: pretty;
}
.page-district-map .dm-swatch {
    display: inline-block;
    width: 0.9rem;
    height: 0.9rem;
    border-radius: 3px;
    vertical-align: -2px;
    margin-right: 0.25rem;
}
.page-district-map .dm-swatch-red  { background: #ff3b30; border: 1px solid #b71c1c; }
.page-district-map .dm-swatch-gold { background: #fbc926; border: 1px solid #b89215; }

/* Helper text right below the map */
.page-district-map .dm-help {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 1rem 0 1.5rem;
    text-align: center;
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
    text-wrap: balance;
}

/* Precinct list link line */
.page-district-map .dm-precincts-link {
    text-align: center;
    font-size: 1rem;
    margin: 0 0 2rem;
    color: var(--text);
    text-wrap: balance;
}
.page-district-map .dm-precincts-link a {
    color: var(--purple);
    font-weight: 800;
    text-decoration: none;
}
.page-district-map .dm-precincts-link a:hover { text-decoration: underline; }

/* The BIG GA My Voter Page CTA — page's primary call-to-action */
.page-district-map .dm-cta-block {
    text-align: center;
    margin: 2.5rem 0 1.5rem;
    padding: 0 1rem;
}
.page-district-map .dm-cta-big {
    display: inline-block;
    background: var(--gold);
    color: var(--purple-deep);
    font-size: 1.4rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    padding: 1.1rem 3rem;
    border-radius: 999px;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(251,201,38,0.4), 0 1px 4px rgba(0,0,0,0.06);
    transition: all 0.2s;
}
.page-district-map .dm-cta-big:hover {
    background: var(--gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(251,201,38,0.5), 0 2px 6px rgba(0,0,0,0.08);
}
.page-district-map .dm-cta-help {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 1rem auto 0;
    max-width: 600px;
    text-wrap: balance;
}

/* Secondary helper link */
.page-district-map .dm-secondary-link {
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin: 1.25rem auto 0;
    max-width: 700px;
    text-wrap: balance;
}
.page-district-map .dm-secondary-link a {
    color: var(--purple);
    font-weight: 700;
    text-decoration: none;
}
.page-district-map .dm-secondary-link a:hover { text-decoration: underline; }

@media (max-width: 600px) {
    .page-district-map .dm-cta-big { font-size: 1.1rem; padding: 0.95rem 2rem; }
    .page-district-map .dm-zips { font-size: 0.78rem; line-height: 1.55; }
}

/* ----- .page-precincts (District 41 precincts list — Grid.js) -------------- */

.page-precincts .public-main { padding: 0; max-width: none; }

.page-precincts .precincts-container {
    max-width: 1100px;
    margin: 0 auto 2.5rem;
    padding: 1.5rem 1.2rem 0;
}

.page-precincts .precincts-grid-card {
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 6px 24px rgba(61,34,96,0.08), 0 1px 4px rgba(0,0,0,0.04);
    padding: 1rem 1.25rem 0.5rem;
}

/* Grid.js — public-site brand overrides (purple/gold/cream).
   Scoped to .page-precincts so admin app's Grid.js styling stays untouched. */
.page-precincts .gridjs-container { padding: 0; color: var(--text); width: 100%; }
.page-precincts .gridjs-wrapper {
    border: 0; box-shadow: none; border-radius: 0;
    background: transparent; overflow-x: auto;
}
.page-precincts .gridjs-head { padding: 0 0 0.6rem; border-bottom: 0; }

.page-precincts .gridjs-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: auto;
    font-size: 0.92rem;
}
.page-precincts .gridjs-table th,
.page-precincts .gridjs-table td {
    padding: 0.65rem 0.85rem;
    text-align: left;
    background: none;
    border: 0;
    vertical-align: top;
    line-height: 1.4;
}
.page-precincts .gridjs-table th {
    font-size: 0.74rem;
    font-weight: 800;
    color: var(--purple);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1.5px solid rgba(61,34,96,0.15);
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.page-precincts .gridjs-table th:hover { color: var(--purple-deep); }
.page-precincts .gridjs-table td {
    color: var(--text);
    border-bottom: 1px solid #f1eef5;
}
.page-precincts .gridjs-table tbody tr:last-child td { border-bottom: 0; }
.page-precincts .gridjs-table tbody tr:hover td { background: #faf8f5; }

/* Code column — monospace, purple, never wraps */
.page-precincts .gridjs-table tbody td:first-child {
    font-family: 'Roboto', monospace;
    font-weight: 900;
    color: var(--purple);
    white-space: nowrap;
}

/* Address column links */
.page-precincts .gridjs-table td a {
    color: var(--purple);
    font-weight: 600;
    text-decoration: none;
}
.page-precincts .gridjs-table td a:hover { text-decoration: underline; }

/* Zip column — monospace muted */
.page-precincts .gridjs-table tbody td:last-child {
    font-family: 'Roboto', monospace;
    color: var(--text-muted);
    white-space: nowrap;
}

/* Sort caret indicators — Grid.js renders a button.gridjs-sort with arrows */
.page-precincts button.gridjs-sort {
    background-position: right center;
    padding-right: 1rem;
}

/* Grid.js search input — match our brand, sit at top-right of table */
.page-precincts .gridjs-search { margin-bottom: 0.6rem; }
.page-precincts .gridjs-search-input {
    width: 100%;
    max-width: 360px;
    padding: 0.6rem 0.95rem;
    background: var(--white);
    color: var(--text);
    border: 1.5px solid #d6d2dd;
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
}
.page-precincts .gridjs-search-input:focus {
    outline: none;
    border-color: var(--purple);
    box-shadow: 0 0 0 3px rgba(61,34,96,0.12);
}

.page-precincts .gridjs-notfound,
.page-precincts .gridjs-loading {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
}

@media (max-width: 720px) {
    .page-precincts .gridjs-table { font-size: 0.85rem; }
    .page-precincts .gridjs-table th,
    .page-precincts .gridjs-table td { padding: 0.5rem 0.6rem; }
    .page-precincts .precincts-grid-card { padding: 0.75rem 0.85rem 0.4rem; }
}

.page-precincts .source-note {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 700px;
    margin: 1rem auto 0;
    line-height: 1.5;
    text-wrap: balance;
}
.page-precincts .source-note a {
    color: var(--purple);
    text-decoration: none;
    font-weight: 600;
}
.page-precincts .source-note a:hover { text-decoration: underline; }

/* ─────────────────────────────────────────────────────────────────────
   Senator modal — admin /district-map only. Opens when an admin clicks
   any of the 56 senate districts on the map; shows their photo, contact
   info, leadership/committee assignments, and a link to the full profile.
   ───────────────────────────────────────────────────────────────────── */
.senator-modal-overlay {
    position: fixed; inset: 0;
    background: rgba(20, 12, 35, 0.55);
    display: flex; align-items: center; justify-content: center;
    z-index: 1500; padding: 1rem;
}
.senator-modal-overlay[hidden] { display: none; }
.senator-modal {
    position: relative;
    background: #fff;
    width: 100%; max-width: 760px;
    max-height: 92vh; overflow: auto;
    border-radius: 10px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.25);
    padding: 1.5rem 1.5rem 1.25rem;
}
.senator-modal-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
@media (max-width: 600px) {
    .senator-modal-body { grid-template-columns: 1fr; }
}
.senator-modal-left { min-width: 0; }
.senator-modal-right {
    min-width: 0;
    border-left: 1px solid #e6e1ee;
    padding-left: 1.5rem;
}
@media (max-width: 600px) {
    .senator-modal-right {
        border-left: 0; border-top: 1px solid #e6e1ee;
        padding-left: 0; padding-top: 1rem;
    }
}
/* House-rep mini-cards in the right column */
.senator-hd-list {
    list-style: none; padding: 0; margin: 0;
    display: flex; flex-direction: column; gap: 0.6rem;
}
.senator-hd-item {
    display: flex; align-items: center; gap: 0.7rem;
    padding: 0.4rem 0.5rem;
    border-radius: 6px;
    background: #faf8ff;
}
.senator-hd-photo {
    width: 44px; height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: #e6e1ee;
    flex-shrink: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}
.senator-hd-photo-empty {
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; font-weight: 700; color: #555;
    background: #d6cee5;
}
.senator-hd-text { min-width: 0; line-height: 1.3; }
.senator-hd-num {
    display: inline-block;
    font-size: 0.72rem; font-weight: 700;
    padding: 0.1rem 0.45rem;
    border-radius: 9999px;
    color: #fff;
    margin-right: 0.35rem;
}
.senator-hd-num.party-d { background: #0044c9; }
.senator-hd-num.party-r { background: #e9111b; }
.senator-hd-num.party-other { background: #6b7280; }
.senator-hd-name {
    font-size: 0.92rem; font-weight: 600;
    color: #1a1a1a; text-decoration: none;
}
a.senator-hd-name:hover { color: var(--purple); text-decoration: underline; }

/* Wrong-district modal — opens on outside-D41 address lookup */
.senator-modal-narrow { max-width: 520px; }
.wrong-district-title {
    margin: 0 0 0.5rem;
    font-size: 1.35rem;
    color: var(--purple);
}
.wrong-district-lead {
    margin: 0 0 1rem;
    font-size: 1rem;
    color: var(--text);
    line-height: 1.5;
}
.wrong-district-senator { margin: 0.25rem 0 1rem; }
.wrong-district-challengers {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 1rem;
}
.wrong-district-challengers li {
    margin: 0.4rem 0;
    font-size: 0.95rem;
    line-height: 1.5;
}
.wrong-district-section {
    list-style: none;
    margin: 0.7rem 0 0.25rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.wrong-district-section-second { margin-top: 1rem; }
.wrong-district-site a { color: var(--text-muted); text-decoration: none; }
.wrong-district-site a:hover { color: var(--purple); text-decoration: underline; }
.wrong-district-election {
    margin: 0.5rem 0 0;
    text-align: center;
    font-size: 0.95rem;
    color: var(--text-muted);
}
.senator-hd-name-empty { color: #999; font-style: italic; font-weight: 500; }
.senator-hd-empty {
    color: var(--text-muted); font-style: italic; margin: 0;
}
.senator-modal-close {
    position: absolute; top: 0.5rem; right: 0.6rem;
    background: none; border: 0;
    font-size: 1.8rem; line-height: 1; color: #888;
    cursor: pointer; padding: 0.25rem 0.5rem;
}
.senator-modal-close:hover { color: var(--purple); }
.senator-modal-loading,
.senator-modal-error {
    text-align: center; padding: 1.5rem 0; color: var(--text-muted);
}
.senator-modal-error { color: #b71c1c; }
.senator-photo {
    text-align: center; margin-bottom: 0.75rem;
}
.senator-photo img {
    max-width: 160px; max-height: 200px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.senator-meta h2 {
    margin: 0 0 0.25rem; text-align: center;
    font-size: 1.3rem; color: var(--purple);
}
.senator-subtitle {
    margin: 0 0 0.5rem;
    text-align: center; color: var(--text-muted); font-size: 0.92rem;
}
.senator-leadership {
    margin: 0 0 0.5rem;
    text-align: center; font-weight: 600; color: var(--purple-deep, #2a1745);
    font-size: 0.92rem;
}
.senator-contact {
    margin: 0.75rem 0; font-size: 0.95rem; line-height: 1.5;
}
.senator-contact p { margin: 0.25rem 0; }
.senator-contact a { color: var(--purple); text-decoration: none; font-weight: 600; }
.senator-contact a:hover { text-decoration: underline; }
.senator-section-h {
    margin: 1rem 0 0.4rem;
    font-size: 0.95rem; color: var(--purple);
    border-bottom: 1px solid #e6e1ee; padding-bottom: 0.3rem;
}
.senator-committees {
    margin: 0; padding-left: 1.2rem;
    font-size: 0.93rem; line-height: 1.55;
}
.senator-committees li { margin: 0.15rem 0; }
.senator-committees-empty { list-style: none; padding-left: 0; color: var(--text-muted); font-style: italic; }
.senator-role-badge {
    display: inline-block;
    background: var(--gold, #fbc926); color: #4a3500;
    font-size: 0.74rem; font-weight: 700;
    padding: 0.05rem 0.4rem; border-radius: 9999px;
    margin-left: 0.35rem; vertical-align: 1px;
}
.senator-link {
    margin: 1rem 0 0; text-align: center;
}
.senator-link a {
    color: var(--purple); font-weight: 700; text-decoration: none;
}
.senator-link a:hover { text-decoration: underline; }

/* Admin /district-map typeahead search — dropdown UI for picking a match. */
.dm-typeahead { position: relative; }
.dm-typeahead-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.dm-typeahead-input-wrap input {
    flex: 1; padding-right: 2.25rem;
    /* Inherits .dm-address-form input styling from existing rules */
}
.dm-typeahead-clear {
    position: absolute; right: 0.4rem; top: 50%;
    transform: translateY(-50%);
    background: none; border: 0;
    font-size: 1.4rem; line-height: 1; color: #999;
    cursor: pointer; padding: 0.2rem 0.45rem;
}
.dm-typeahead-clear:hover { color: var(--purple); }
.dm-typeahead-dropdown {
    position: absolute;
    top: calc(100% + 4px); left: 0; right: 0;
    z-index: 1100;
    background: #fff;
    border: 1px solid #d6cee5;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(20, 12, 35, 0.18);
    max-height: 440px; overflow-y: auto;
    padding: 0.35rem 0;
}
.dm-typeahead-dropdown[hidden] { display: none; }
.dm-ta-group-label {
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.05em;
    color: #888;
    padding: 0.4rem 0.85rem 0.2rem;
    font-weight: 700;
}
.dm-ta-group-label + .dm-ta-item { padding-top: 0.45rem; }
.dm-ta-item {
    display: block; width: 100%; text-align: left;
    background: none; border: 0;
    padding: 0.5rem 0.85rem;
    cursor: pointer;
    font-family: inherit;
}
.dm-ta-item:hover, .dm-ta-item:focus {
    background: #f5f1ff; outline: none;
}
.dm-ta-label {
    display: block;
    font-size: 0.96rem; color: #1a1a1a; font-weight: 600;
}
.dm-ta-sublabel {
    display: block;
    font-size: 0.83rem; color: var(--text-muted);
    margin-top: 0.1rem;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dm-result-success {
    background: #f0f7f0; border: 1px solid #c8e0c8;
    color: #2a5d2a;
    padding: 0.6rem 0.85rem; border-radius: 4px;
    margin: 0;
}
