/* =============================================
   PollCheck Homepage — Editorial Design
   Scoped under body.homepage, prefix: hp-
   ============================================= */

/* --- Party colours --- */
body.homepage {
    --hp-ref: #12B6CF;
    --hp-lab: #E4003B;
    --hp-con: #0087DC;
    --hp-ld:  #FAA61A;
    --hp-grn: #6AB023;
    --hp-snp: #FCD34D;
    --hp-pc:  #3F8428;
    --hp-oth: #999999;

    --hp-serif: Georgia, "Times New Roman", serif;
    --hp-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

    --hp-text: #111111;
    --hp-body: #333333;
    --hp-secondary: #444444;
    --hp-meta: #999999;
    --hp-border: #e0e0e0;
    --hp-border-light: #f0f0f0;
    --hp-hover: #fafafa;
    --hp-positive: #2e7d32;
    --hp-negative: #c62828;
}

body.homepage {
    margin: 0;
    padding: 0;
    background: #fff;
    color: var(--hp-body);
    font-family: var(--hp-sans);
    -webkit-font-smoothing: antialiased;
}

/* --- Main wrapper --- */
.hp-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 48px 24px 64px;
}

/* --- Masthead --- */
.hp-masthead {
    margin-bottom: 32px;
}

.hp-kicker {
    font-family: var(--hp-serif);
    font-size: 28px;
    font-weight: 700;
    color: var(--hp-text);
    letter-spacing: 0.02em;
    line-height: 1;
}

.hp-masthead-rule {
    border: none;
    border-top: 3px solid var(--hp-text);
    margin: 10px 0 8px;
}

.hp-updated {
    font-family: var(--hp-sans);
    font-size: 11px;
    color: var(--hp-meta);
    letter-spacing: 0.02em;
}

/* --- Headline --- */
.hp-headline {
    font-family: var(--hp-serif);
    font-size: 32px;
    font-weight: 700;
    color: var(--hp-text);
    line-height: 1.15;
    margin: 0 0 6px;
}

.hp-subtitle {
    font-family: var(--hp-sans);
    font-size: 16px;
    color: var(--hp-secondary);
    line-height: 1.5;
    margin: 0 0 28px;
}

/* --- Section dividers --- */
.hp-rule {
    border: none;
    border-top: 1px solid var(--hp-border);
    margin: 32px 0;
}

.hp-section-label {
    font-family: var(--hp-sans);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--hp-meta);
    margin: 0 0 14px;
}

.hp-section-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 14px;
}

.hp-section-header .hp-section-label {
    margin-bottom: 0;
}

.hp-section-sub {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 6px;
}

.hp-section-link {
    font-family: var(--hp-sans);
    font-size: 12px;
    color: var(--hp-meta);
    text-decoration: underline;
    text-decoration-color: #ddd;
    text-underline-offset: 2px;
    white-space: nowrap;
}
.hp-section-link:hover {
    color: var(--hp-body);
    text-decoration-color: var(--hp-body);
}

.hp-section-footer {
    margin-top: 10px;
}

.hp-control-label {
    font-family: var(--hp-sans);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--hp-meta);
    margin: 20px 0 10px;
}

/* --- Latest poll callout --- */
.hp-callout {
    border-left: 3px solid var(--hp-ref);
    padding: 10px 16px;
    margin-bottom: 32px;
}

.hp-callout-line {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-family: var(--hp-sans);
    font-size: 14px;
    color: var(--hp-body);
}

.hp-callout-meta {
    font-size: 12px;
    color: var(--hp-meta);
}

.hp-callout-parties {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
}

.hp-callout-party {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.hp-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.hp-callout-name {
    font-family: var(--hp-sans);
    font-size: 13px;
    color: var(--hp-meta);
}

.hp-callout-val {
    font-family: var(--hp-sans);
    font-size: 14px;
    font-weight: 700;
    color: var(--hp-text);
    font-variant-numeric: tabular-nums;
}

/* --- 7-poll average strip --- */
.hp-avg-strip {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    margin-bottom: 32px;
}

.hp-avg-party {
    padding: 10px 8px;
    border-left: 3px solid var(--party-color, #ccc);
}

.hp-avg-name {
    font-family: var(--hp-sans);
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--hp-meta);
    margin-bottom: 2px;
}

.hp-avg-val {
    font-family: var(--hp-sans);
    font-size: 28px;
    font-weight: 700;
    color: var(--hp-text);
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}

.hp-avg-chg {
    font-family: var(--hp-sans);
    font-size: 12px;
    font-weight: 600;
    margin-top: 2px;
    font-variant-numeric: tabular-nums;
}
.hp-avg-chg.up   { color: var(--hp-positive); }
.hp-avg-chg.down { color: var(--hp-negative); }
.hp-avg-chg.flat { color: var(--hp-meta); }

/* --- Two-column seats section --- */
.hp-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 0;
}

.hp-seats-col-title {
    font-family: var(--hp-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--hp-text);
    margin: 0 0 4px;
}

.hp-seats-col-sub {
    font-family: var(--hp-sans);
    font-size: 12px;
    color: var(--hp-meta);
    margin: 0 0 12px;
}

.hp-seat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 0;
    border-bottom: 1px solid var(--hp-border-light);
}

.hp-seat-row:last-child {
    border-bottom: 2px solid var(--hp-text);
}

.hp-seat-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.hp-seat-name {
    font-family: var(--hp-sans);
    font-size: 14px;
    color: var(--hp-body);
}

.hp-seat-right {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.hp-seat-val {
    font-family: var(--hp-sans);
    font-size: 18px;
    font-weight: 700;
    color: var(--hp-text);
    font-variant-numeric: tabular-nums;
    min-width: 36px;
    text-align: right;
}

.hp-seat-chg {
    font-family: var(--hp-sans);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    min-width: 44px;
    text-align: right;
}
.hp-seat-chg.up   { color: var(--hp-positive); }
.hp-seat-chg.down { color: var(--hp-negative); }
.hp-seat-chg.flat { color: var(--hp-meta); }

/* --- Control changes grid --- */
.hp-control-section {
    margin-bottom: 0;
}

.hp-control-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.hp-control-cell {
    padding: 10px 0;
    border-bottom: 1px solid var(--hp-border-light);
    display: flex;
    align-items: center;
    gap: 6px;
}

.hp-control-cell:nth-child(odd) {
    padding-right: 16px;
}
.hp-control-cell:nth-child(even) {
    padding-left: 16px;
    border-left: 1px solid var(--hp-border-light);
}

.hp-control-name {
    font-family: var(--hp-sans);
    font-size: 13px;
    color: var(--hp-body);
    flex: 1;
}

.hp-control-arrow {
    font-size: 11px;
    color: var(--hp-meta);
    margin: 0 2px;
}

.hp-control-summary {
    font-family: var(--hp-sans);
    font-size: 13px;
    color: var(--hp-meta);
    margin-top: 12px;
}

.hp-control-summary a {
    color: var(--hp-body);
    text-decoration: underline;
    text-decoration-color: #ccc;
    text-underline-offset: 2px;
}
.hp-control-summary a:hover {
    text-decoration-color: var(--hp-text);
}

/* --- Devolved section --- */
.hp-devolved {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 0;
}

.hp-devolved-title {
    font-family: var(--hp-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--hp-text);
    margin: 0 0 6px;
}

.hp-devolved-text {
    font-family: var(--hp-sans);
    font-size: 14px;
    color: var(--hp-body);
    line-height: 1.5;
    margin: 0 0 8px;
}

.hp-devolved-link {
    font-family: var(--hp-sans);
    font-size: 13px;
    color: var(--hp-body);
    text-decoration: underline;
    text-decoration-color: #ccc;
    text-underline-offset: 2px;
}
.hp-devolved-link:hover {
    text-decoration-color: var(--hp-text);
}

/* --- Recent polls table --- */
.hp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 0;
}

.hp-polls-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--hp-sans);
    font-size: 14px;
    min-width: 600px;
}

.hp-polls-table thead th {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--hp-meta);
    padding: 8px 10px;
    border-bottom: 2px solid var(--hp-text);
    text-align: left;
    white-space: nowrap;
}

.hp-polls-table thead th:not(:first-child):not(:nth-child(2)) {
    text-align: right;
}

/* Party-coloured bottom border on column headers */
.hp-polls-table thead th.hp-col-ref { border-bottom-color: var(--hp-ref); }
.hp-polls-table thead th.hp-col-lab { border-bottom-color: var(--hp-lab); }
.hp-polls-table thead th.hp-col-con { border-bottom-color: var(--hp-con); }
.hp-polls-table thead th.hp-col-ld  { border-bottom-color: var(--hp-ld); }
.hp-polls-table thead th.hp-col-grn { border-bottom-color: var(--hp-grn); }
.hp-polls-table thead th.hp-col-oth { border-bottom-color: var(--hp-oth); }

.hp-polls-table tbody td {
    padding: 10px 10px;
    border-bottom: 1px solid #e8e8e8;
    color: var(--hp-body);
    font-variant-numeric: tabular-nums;
}

.hp-polls-table tbody td:not(:first-child):not(:nth-child(2)) {
    text-align: right;
}

.hp-polls-table tbody tr:last-child td {
    border-bottom: 2px solid var(--hp-text);
}

.hp-polls-table tbody tr:hover {
    background: var(--hp-hover);
}

.hp-polls-table .hp-bold {
    font-weight: 700;
    color: var(--hp-text);
}

.hp-polls-table .hp-pollster {
    font-weight: 600;
    white-space: nowrap;
}

.hp-polls-table .hp-date {
    color: var(--hp-meta);
    font-size: 12px;
    white-space: nowrap;
}

/* --- Explore grid --- */
.hp-explore-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-bottom: 0;
}

.hp-explore-item {
    padding: 14px 0;
    border-bottom: 1px solid var(--hp-border-light);
}

.hp-explore-item:nth-child(odd) {
    padding-right: 16px;
}
.hp-explore-item:nth-child(even) {
    padding-left: 16px;
    border-left: 1px solid var(--hp-border-light);
}

.hp-explore-item a {
    text-decoration: none;
    display: block;
}

.hp-explore-label {
    font-family: var(--hp-sans);
    font-size: 14px;
    font-weight: 600;
    color: var(--hp-text);
    margin-bottom: 2px;
}

.hp-explore-desc {
    font-family: var(--hp-sans);
    font-size: 12px;
    color: var(--hp-meta);
    line-height: 1.4;
}

.hp-explore-item a:hover .hp-explore-label {
    text-decoration: underline;
}

/* --- Footer section --- */
.hp-footer-section {
    text-align: center;
    padding-top: 16px;
}

.hp-footer-brand {
    font-family: var(--hp-serif);
    font-size: 18px;
    font-weight: 700;
    color: var(--hp-text);
    letter-spacing: 0.02em;
}

.hp-footer-tagline {
    font-family: var(--hp-sans);
    font-size: 12px;
    color: var(--hp-meta);
    margin: 4px 0 12px;
}

.hp-footer-links {
    font-family: var(--hp-sans);
    font-size: 12px;
    color: var(--hp-meta);
}

.hp-footer-links a {
    color: var(--hp-meta);
    text-decoration: underline;
    text-decoration-color: #ddd;
    text-underline-offset: 2px;
    margin: 0 8px;
}
.hp-footer-links a:hover {
    color: var(--hp-body);
    text-decoration-color: var(--hp-body);
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .hp-wrap {
        padding: 32px 16px 48px;
    }

    .hp-headline {
        font-size: 26px;
    }

    .hp-avg-strip {
        grid-template-columns: repeat(3, 1fr);
    }

    .hp-avg-val {
        font-size: 22px;
    }

    .hp-two-col,
    .hp-devolved {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .hp-control-grid,
    .hp-explore-grid {
        grid-template-columns: 1fr;
    }

    .hp-control-cell:nth-child(even),
    .hp-explore-item:nth-child(even) {
        padding-left: 0;
        border-left: none;
    }

    .hp-control-cell:nth-child(odd),
    .hp-explore-item:nth-child(odd) {
        padding-right: 0;
    }

    .hp-callout-parties {
        gap: 10px 16px;
    }

    .hp-callout-val {
        font-size: 18px;
    }
}
