﻿/* politician.css — one official's page (/politicians/{id}/{slug}). Prefix: pol- */

.pol-page {
    --pol-gold: var(--ew-gold, var(--ew-color, #DDB785));
    --pol-line: var(--border, #d6dce6);
    max-width: 880px;
    margin: 0 auto;
    padding: 12px 16px 64px;
    color: var(--text, #323232);
}

    .pol-page a:focus-visible {
        outline: 2px solid var(--pol-gold);
        outline-offset: 2px;
    }

/* ---- header ---- */
.pol-head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--pol-line);
}

.pol-photo {
    width: 84px;
    height: 104px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--pol-line);
    background: var(--surface, #fff);
}

.pol-name {
    margin: 0;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    letter-spacing: -0.01em;
}

.pol-sub {
    margin: 4px 0 0;
    font-size: 0.95rem;
    color: var(--text-muted, #5b6472);
}

.pol-since {
    margin: 3px 0 0;
    font-size: 0.82rem;
    color: var(--text-muted, #5b6472);
}

/* A single letter, because party is a fact worth showing and not worth a sentence. */
.pol-party {
    justify-self: end;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.05rem;
    font-weight: 800;
    color: #fff;
}

    .pol-party.is-r {
        background: #c0392b;
    }

    .pol-party.is-d {
        background: #2b6fb5;
    }

    .pol-party.is-i {
        background: #6b7280;
    }

/* ---- sections ---- */
.pol-section {
    margin-top: 32px;
}

.pol-h2 {
    font-size: 1.15rem;
    font-weight: 800;
    margin: 0 0 14px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--pol-gold);
}

.pol-h3 {
    font-size: 0.76rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #5b6472);
    margin: 0 0 8px;
}

.pol-note {
    margin: 10px 0 0;
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--text-muted, #5b6472);
}

/* ---- activity summary ---- */
.pol-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
}

.pol-stat {
    padding: 14px 16px;
    border: 1px solid var(--pol-line);
    border-radius: 12px;
    background: var(--surface, #fff);
}

.pol-stat-n {
    display: block;
    font-size: 1.4rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
}

.pol-stat-l {
    display: block;
    margin-top: 3px;
    font-size: 0.76rem;
    color: var(--text-muted, #5b6472);
}

.is-buy {
    color: var(--positive, #0F8A3B);
}

.is-sell {
    color: var(--negative, #e13232);
}

/* ---- transactions ---- */
.pol-tablewrap {
    overflow-x: auto;
    border: 1px solid var(--pol-line);
    border-radius: 12px;
}

.pol-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

    .pol-table th,
    .pol-table td {
        padding: 9px 12px;
        text-align: left;
        border-bottom: 1px solid var(--pol-line);
        vertical-align: top;
    }

    .pol-table thead th {
        font-size: 0.72rem;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-muted, #5b6472);
        white-space: nowrap;
    }

    .pol-table tbody tr:last-child td {
        border-bottom: 0;
    }

.pol-tk a {
    font-weight: 800;
    text-decoration: none;
    color: var(--text, #323232);
}

    .pol-tk a:hover {
        color: var(--pol-gold);
    }

.pol-noticker {
    color: var(--text-muted, #5b6472);
}

.pol-asset {
    max-width: 280px;
    line-height: 1.4;
}

/* Spouse and joint holdings are disclosed alongside the member's own, and the
   distinction matters, so it rides with the asset rather than in its own column. */
.pol-owner {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 6px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--text-muted, #5b6472) 14%, transparent);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: lowercase;
    color: var(--text-muted, #5b6472);
}

.pol-type {
    font-weight: 700;
    white-space: nowrap;
}

.pol-amt {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.pol-lag {
    color: var(--text-muted, #5b6472);
    white-space: nowrap;
}

/* ---- committees ---- */
.pol-committees,
.pol-subs {
    list-style: none;
    margin: 0;
    padding: 0;
}

.pol-committee {
    padding: 12px 0;
    border-bottom: 1px solid var(--pol-line);
}

    .pol-committee:last-child {
        border-bottom: 0;
    }

.pol-cname {
    font-size: 0.98rem;
    font-weight: 700;
}

.pol-role {
    display: inline-block;
    margin-left: 8px;
    padding: 1px 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--pol-gold) 20%, transparent);
    font-size: 0.7rem;
    font-weight: 800;
}

.pol-juris {
    margin: 5px 0 0;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-muted, #5b6472);
}

.pol-subs {
    margin-top: 8px;
    padding-left: 16px;
    border-left: 2px solid var(--pol-line);
}

    .pol-subs li {
        padding: 3px 0;
        font-size: 0.88rem;
        color: var(--text-muted, #5b6472);
    }

/* ---- background ---- */
.pol-exp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
}

.pol-exp {
    list-style: none;
    margin: 0;
    padding: 0;
}

    .pol-exp li {
        padding: 5px 0;
        line-height: 1.45;
    }

.pol-exp-head {
    font-size: 0.9rem;
    font-weight: 600;
}

.pol-exp-yrs {
    display: block;
    font-size: 0.76rem;
    color: var(--text-muted, #5b6472);
}

/* ---- footer ---- */
.pol-foot {
    margin-top: 34px;
    padding-top: 16px;
    border-top: 1px solid var(--pol-line);
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text-muted, #5b6472);
}

    .pol-foot a {
        color: var(--pol-gold);
        font-weight: 700;
    }

@media (max-width: 560px) {
    .pol-head {
        grid-template-columns: auto minmax(0, 1fr);
    }

    .pol-party {
        grid-column: 2;
        justify-self: start;
        width: 30px;
        height: 30px;
        font-size: 0.9rem;
    }

    .pol-lag {
        display: none;
    }
}

/* A trade in a company the member's own committee oversees. Marked, not shouted:
   it is a fact worth surfacing, not an accusation. */
.pol-juris-flag {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--pol-gold) 28%, transparent);
    font-size: 0.66rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: help;
}

/* Committee jurisdiction prose runs to paragraphs, so it opens on demand. */
.pol-jdetail {
    margin-top: 6px;
}

    .pol-jdetail summary {
        font-size: 0.78rem;
        font-weight: 700;
        color: var(--text-muted, #5b6472);
        cursor: pointer;
    }

    .pol-jdetail p {
        margin: 6px 0 0;
        font-size: 0.82rem;
        line-height: 1.6;
        color: var(--text-muted, #5b6472);
    }
