/* party-polls.css — Scoped under body.party-polls, prefix pp- */

body.party-polls {
    margin: 0;
    color: #333;
    background: #fff;
    -webkit-font-smoothing: antialiased;
}
.pp-wrap {
    font-family: Georgia, "Times New Roman", serif;
    max-width: 960px;
    margin: 0 auto;
    padding: 48px 24px 64px;
}

/* ── Breadcrumb ── */
.pp-breadcrumb {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #999;
    margin-bottom: 24px;
}
.pp-breadcrumb a {
    color: #999;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Hero ── */
.pp-kicker {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-bottom: 8px;
}
.pp-headline {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 36px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.15;
    margin: 0 0 8px;
}
.pp-subhead {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 15px;
    color: #666;
    margin: 0 0 24px;
}
.pp-hero-stat {
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
}
.pp-hero-value {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 56px;
    font-weight: 700;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.pp-hero-rank {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 18px;
    color: #666;
}
.pp-hero-changes {
    display: flex;
    gap: 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    margin-top: 8px;
    width: 100%;
}
.pp-hero-chg-label {
    color: #999;
    margin-right: 4px;
}
.pp-hero-chg.up { color: #2e7d32; }
.pp-hero-chg.down { color: #c62828; }
.pp-hero-chg.flat { color: #999; }

/* ── All Parties Strip ── */
.pp-all-parties {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    margin: 24px 0 0;
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
}
.pp-ap-item {
    flex: 1;
    min-width: 80px;
    padding: 8px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    text-align: center;
    border-bottom: 3px solid transparent;
}
.pp-ap-item.active {
    border-bottom-color: var(--pp-party-color, #333);
}
.pp-ap-name {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.pp-ap-pct {
    font-size: 18px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: #1a1a1a;
}
.pp-ap-item.active .pp-ap-pct {
    color: var(--pp-party-color, #1a1a1a);
}

/* ── Rules & Sections ── */
.pp-rule {
    border: none;
    border-top: 1px solid #e0e0e0;
    margin: 32px 0;
}
.pp-section { margin-bottom: 8px; }
.pp-section-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #999;
    margin-bottom: 16px;
}
.pp-section-intro {
    font-size: 15px;
    color: #666;
    margin: -8px 0 16px;
}

/* ── Chart ── */
.pp-chart-container {
    width: 100%;
    height: 400px;
    position: relative;
}
.pp-chart-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
}
.pp-range-btn {
    padding: 4px 12px;
    font-size: 13px;
    border: 1px solid #e0e0e0;
    background: #fff;
    color: #666;
    cursor: pointer;
    border-radius: 3px;
}
.pp-range-btn.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* ── Polls Table ── */
.pp-polls-table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
}
.pp-polls-table thead th {
    text-align: left;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #999;
    padding: 8px 12px;
    border-bottom: 2px solid #1a1a1a;
}
.pp-polls-table thead th:nth-child(n+3) { text-align: right; }
.pp-polls-table tbody td {
    padding: 8px 12px;
    border-bottom: 1px solid #e8e8e8;
    color: #333;
}
.pp-polls-table tbody td:nth-child(n+3) {
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.pp-polls-table tbody tr:hover { background: #fafafa; }
.pp-polls-table .pp-party-val {
    font-weight: 700;
    color: var(--pp-party-color);
}
.pp-polls-table .pp-chg.up { color: #2e7d32; }
.pp-polls-table .pp-chg.down { color: #c62828; }

/* ── Demographics ── */
.pp-demo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
}
.pp-demo-card h3 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px;
}
.pp-bar-row {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
}
.pp-bar-label {
    width: 60px;
    flex-shrink: 0;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pp-bar-track {
    flex: 1;
    height: 20px;
    background: #f5f5f5;
    border-radius: 2px;
    overflow: hidden;
    margin: 0 8px;
}
.pp-bar-fill {
    height: 100%;
    background: var(--pp-party-color);
    opacity: 0.75;
    border-radius: 2px;
    transition: width 0.3s ease;
}
.pp-bar-value {
    width: 36px;
    text-align: right;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: #333;
    flex-shrink: 0;
}

/* Transition bars - wider labels */
.pp-transition-bars .pp-bar-label { width: 100px; }
.pp-transition-bars .pp-bar-row { margin-bottom: 10px; }

/* Regional bars - wider labels */
.pp-regional-bars .pp-bar-label { width: 120px; }
.pp-regional-bars .pp-bar-row { margin-bottom: 10px; }

/* ── Source Attribution ── */
.pp-source {
    margin-top: 16px;
}
.pp-source-detail {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px 16px;
}
.pp-source-summary {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}
.pp-source-summary::-webkit-details-marker { display: none; }
.pp-source-icon {
    font-size: 12px;
    color: #6b7280;
    transition: transform 0.2s;
}
.pp-source-detail[open] > .pp-source-summary .pp-source-icon {
    transform: rotate(180deg);
}
.pp-source-content {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}
.pp-source-intro {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #6b7280;
    margin: 0 0 12px;
    line-height: 1.5;
}
.pp-source-table-wrap { overflow-x: auto; }
.pp-source-table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 13px;
}
.pp-source-table th {
    text-align: left;
    font-weight: 600;
    color: #1f2937;
    padding: 8px;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
    background: #f9fafb;
}
.pp-source-table th:last-child {
    text-align: center;
    font-size: 12px;
}
.pp-source-table td {
    padding: 8px;
    color: #374151;
    border-bottom: 1px solid #e5e7eb;
    white-space: nowrap;
}
.pp-source-table td:last-child {
    text-align: center;
    color: #9ca3af;
    font-variant-numeric: tabular-nums;
    font-size: 12px;
}
.pp-source-method {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    color: #9ca3af;
    margin: 12px 0 0;
    line-height: 1.6;
}

/* ── Seats CTA ── */
.pp-seats-link { font-size: 15px; }
.pp-seats-link p { margin: 0 0 12px; }
.pp-cta-btn {
    display: inline-block;
    padding: 8px 20px;
    background: #333;
    color: #fff;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    font-weight: 600;
    margin-right: 8px;
    margin-bottom: 8px;
}
.pp-cta-btn:hover { background: #555; }

/* ── Explore ── */
.pp-explore-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 15px;
}
.pp-explore-list li {
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}
.pp-explore-list a {
    color: #333;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── FAQ ── */
.pp-faq details { border-bottom: 1px solid #e0e0e0; }
.pp-faq summary {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 15px;
    font-weight: 600;
    color: #333;
    padding: 12px 0;
    cursor: pointer;
    list-style: none;
}
.pp-faq summary::-webkit-details-marker { display: none; }
.pp-faq summary::before {
    content: "+";
    display: inline-block;
    width: 16px;
    color: #999;
    font-weight: 400;
    margin-right: 8px;
}
.pp-faq details[open] summary::before { content: "\2212"; }
.pp-faq-answer {
    padding: 0 0 16px 24px;
    font-size: 15px;
    line-height: 1.6;
    color: #555;
}

/* ── Chart Tooltip & Crosshair ── */
.pp-chart-container .crosshair {
    stroke: #DDDDDD;
    stroke-width: 1;
}
.pp-chart-container .end-label {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 11px;
    font-weight: 600;
}
.pp-chart-container .raw-dot {
    opacity: 0.4;
}
.gbp-tooltip {
    position: absolute;
    pointer-events: none;
    background: #FFFFFF;
    border: 1px solid #E0E0E0;
    border-radius: 4px;
    padding: 8px 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 12px;
    z-index: 10;
    box-shadow: none;
    white-space: nowrap;
}
.gbp-tooltip-date {
    font-weight: 700;
    color: #333;
    margin-bottom: 4px;
    font-size: 11px;
}
.gbp-tooltip-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 1px 0;
}
.gbp-tooltip-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.gbp-tooltip-party {
    flex: 1;
    color: #555;
    font-size: 11px;
}
.gbp-tooltip-val {
    font-weight: 700;
    color: #111;
    font-variant-numeric: tabular-nums;
    font-size: 11px;
}

/* ── Loading ── */
.pp-hero-loading, .pp-demo-loading {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 14px;
    color: #999;
}
.pp-demo-loading { padding: 24px 0; }

/* ── Responsive ── */
@media (max-width: 768px) {
    .pp-wrap { padding: 32px 16px 48px; }
    .pp-headline { font-size: 28px; }
    .pp-hero-value { font-size: 40px; }
    .pp-demo-grid { grid-template-columns: 1fr; gap: 24px; }
    .pp-ap-item { min-width: 60px; }
    .pp-ap-pct { font-size: 15px; }
    .pp-chart-container { height: 300px; }
    .pp-polls-table { font-size: 13px; }
    .pp-polls-table thead th, .pp-polls-table tbody td { padding: 6px 8px; }
}
