/* pollsters.css - pollster index and pages (prefix pl-), us_site/pollsters.py.
   Tokens only (pc-tokens.css). The lean scale repeats the approval page's
   pollster-table lean (approval.css .ap-lean) on its own prefix. */


/* ---- tables ---- */
.pl-table td, .pl-table th { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pl-table tbody td { padding-top: 6px; padding-bottom: 6px; }
.pl-index { min-width: 640px; }
.pl-index .pl-name a { color: var(--pc-text); font-weight: 600; }
.pl-name { max-width: 440px; overflow: hidden; text-overflow: ellipsis; }
.pl-name-txt { display: inline-block; max-width: 400px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.pl-date { color: var(--pc-text-secondary); }
.pl-polls { min-width: 520px; }
.pl-polls tbody td.pl-trk, .pl-polls thead th:nth-child(2), .pl-polls tbody td.pl-name, .pl-polls thead th:nth-child(3) { text-align: left; }
.pl-trk a { color: var(--pc-text); }
.pl-why { font-size: 12px; font-weight: 500; color: var(--pc-text-meta); margin-left: 4px; }
.pl-pops { color: var(--pc-text-secondary); }
.pl-pop { white-space: nowrap; }
.pl-pop + .pl-pop { margin-left: 8px; }
.pl-pop b { font-weight: 600; color: var(--pc-text); }
.pl-more-btn { margin-top: 12px; min-height: 40px; }
.pl-controls .pc-btn, .pl-controls .pc-mode-btn { min-height: 40px; }

/* ---- lean: a dot on a centred scale (house-effect cap either side), stem from zero ---- */
.pl-lean-th, .pl-lean-cell { text-align: left !important; }
.pl-lean-axis { display: inline-flex; justify-content: space-between; width: 120px; margin-right: 6px; vertical-align: middle; font-weight: 400; color: var(--pc-text-meta); }
.pl-lean { display: inline-block; position: relative; width: 120px; height: 14px; vertical-align: middle; margin-right: 6px; }
.pl-lean::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--pc-border-light); }
.pl-lean::after { content: ''; position: absolute; left: 50%; top: 0; bottom: 0; border-left: 1px solid var(--pc-text-meta); }
.pl-lean i { position: absolute; top: 50%; height: 3px; margin-top: -1.5px; }
.pl-lean b { position: absolute; top: 50%; width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; border-radius: 50%; z-index: 1; }
.pl-lean.is-pos i, .pl-lean.is-pos b { background: var(--pc-positive); }
.pl-lean.is-neg i, .pl-lean.is-neg b { background: var(--pc-negative); }
.pl-lean.is-nc b { background: var(--pc-text-meta); }
.pl-lean-val { display: inline-block; min-width: 42px; text-align: right; vertical-align: middle; }

/* the house page's single lean, drawn larger with its scale */
.pl-lean-big { position: relative; display: inline-block; font-family: var(--pc-sans); font-size: 18px; font-weight: 700; color: var(--pc-text); font-variant-numeric: tabular-nums; padding-bottom: 16px; }
.pl-lean-big .pl-lean { width: 280px; height: 20px; }
.pl-lean-big .pl-lean b { width: 13px; height: 13px; margin: -6.5px 0 0 -6.5px; }
.pl-lean-big .pl-lean i { height: 4px; margin-top: -2px; }
.pl-lean-scale { position: absolute; left: 0; bottom: 0; width: 280px; display: flex; justify-content: space-between; font-size: 11px; font-weight: 400; color: var(--pc-text-meta); }
.pl-lean-sec .pc-help { max-width: 680px; }

/* ---- house page header ---- */
.pl-facts { margin: 0 0 14px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.pl-facts dt { font-size: 13px; font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--pc-text-secondary); }
.pl-facts dd { font-size: 16px; font-weight: 600; color: var(--pc-text); }
.pl-labels { font-family: var(--pc-sans); font-size: 13px; line-height: 1.6; color: var(--pc-text-body); margin: 0 0 32px; max-width: 880px; }
.pl-labels-h { font-size: 13px; color: var(--pc-text-secondary); font-weight: 600; margin-right: 8px; }
.pl-labels ul { display: inline; list-style: none; margin: 0; padding: 0; }
.pl-labels li { display: inline; }
.pl-labels li + li::before, .pl-labels-rest li:first-child::before { content: ' / '; color: var(--pc-text-meta); }
/* "and N more": a text button on the same line; the rest of the list follows it when open */
.pl-labels-more {
    display: inline; margin: 0 0 0 6px; padding: 0; background: none; border: 0; font: inherit; font-size: 13px;
    color: var(--pc-text-secondary); text-decoration: underline; text-underline-offset: 2px; cursor: pointer;
    padding: 10px 0;   /* inline: the padding widens the tap area to ~40px without opening the line */
}
.pl-labels-more:hover { color: var(--pc-text); }
.pl-labels-rest[hidden] { display: none; }
/* phones: populations as one small line under the pollster's name (the column is hidden) */
.pl-pops-s { display: none; }
.pl-labels li span, .pl-trackers li span { color: var(--pc-text-secondary); font-variant-numeric: tabular-nums; }
.pl-trackers { list-style: none; margin: 0; padding: 0; columns: 2 240px; column-gap: 32px; font-family: var(--pc-sans); font-size: 14px; }
.pl-trackers li { padding: 5px 0; border-bottom: 1px solid var(--pc-border-light); break-inside: avoid; }
.pl-trackers a { color: var(--pc-text); }

/* ---- chart ---- */
.pl-chart-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 10px 24px; margin-bottom: 10px; }
.pl-chart-head .pc-section-title { margin: 0; }
.pl-controls { margin: 0; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.gbp-chart-container.pl-chart { height: 400px; }
.pl-chart + script + .pc-help { margin-top: 8px; }
/* poll-line-chart.css is light-only (raw hexes): restate its chrome on tokens */
.pl-chart .grid-line { stroke: var(--pc-border-grid); }
.pl-chart .axis text { fill: var(--pc-text-meta); }
.pl-chart .crosshair { stroke: var(--pc-border); }
.pl-chart .gbp-refline { stroke: var(--pc-text-meta); }
.pl-chart .gbp-reflabel-bg { fill: var(--pc-surface); }
.pl-chart .gbp-reflabel { fill: var(--pc-text-secondary); }
.pl-chart .gbp-tooltip { background: var(--pc-surface); border-color: var(--pc-border); }
.pl-chart .gbp-tooltip-date { color: var(--pc-text-body); }
.pl-chart .gbp-tooltip-party { color: var(--pc-text-body); }
.pl-chart .gbp-tooltip-val { color: var(--pc-text); }

@media (max-width: 768px) {
    .pl-opt { display: none; }
    .pl-index, .pl-polls { min-width: 0; }
    .pl-index td.pl-name { white-space: normal; max-width: 120px; min-width: 90px; }
    .pl-pops-s { display: block; font-size: 11px; line-height: 1.3; color: var(--pc-text-meta); margin-top: 2px; font-variant-numeric: tabular-nums; }
    .pl-index .pl-lean, .pl-index .pl-lean-axis { width: 44px; }
    .pl-index .pl-date { white-space: normal; min-width: 52px; }
    .pl-index td, .pl-index th { padding-left: 4px; padding-right: 4px; }
    .gbp-chart-container.pl-chart { height: 320px; }
    .pl-lean, .pl-lean-axis { width: 64px; margin-right: 3px; }
    .pl-lean-val { min-width: 34px; }
    .pl-l { display: none; }
    .pl-lean-big .pl-lean, .pl-lean-scale { width: 220px; }
    .pl-polls td.pl-trk { white-space: normal; min-width: 96px; }
    .pl-polls td.pl-res { white-space: normal; }
}
