/* Wie draagt het nieuws? Builds on the shared distribution-view styles. */
.news-page [hidden] { display: none !important; }
.news-page { --alle: #8a94a3; --alle-soft: #cbd5e1; --wit: var(--dd-darkblue); --kleur: var(--dd-blue); }
.news-page .distribution-toolbar { flex-wrap: wrap; }
.news-page .subject-control select { min-width: 260px; }
.news-legend { display: flex; gap: 18px; font-size: 12px; color: var(--muted); }
.news-legend .key { display: inline-flex; align-items: center; gap: 7px; transition: opacity .4s; }
.news-legend .key::before { content: ''; width: 12px; height: 12px; border-radius: 3px; background: var(--alle); }
.news-legend .key.wit::before { background: var(--wit); }
.news-legend .key.kleur::before { background: var(--kleur); }
.news-legend[data-mode="none"] { visibility: hidden; }
.news-legend[data-mode="alle"] .key:not(.alle) { opacity: .25; }
.news-legend[data-mode="groups"] .key.alle::before { background: var(--alle-soft); }

.news-stage { min-height: 460px; display: flex; flex-direction: column; justify-content: center; }
.news-svg { display: block; width: 100%; max-width: 900px; height: auto; margin-inline: auto; overflow: visible; }

/* Intro dots */
.person { fill: var(--alle); transition: transform .9s cubic-bezier(.45,0,.2,1), fill .7s; }
#people.colored .person.wit { fill: var(--wit); }
#people.colored .person.kleur { fill: var(--kleur); }
#people.colored .person.anders { fill: var(--alle-soft); stroke: var(--alle); stroke-width: 1.5; }
.people-name { fill: var(--ink); font: 600 20px var(--font-body); }
.people-name.kleur { fill: var(--kleur); }
.people-name.anders { fill: var(--muted); }
.people-count { fill: var(--muted); font: 16px var(--font-body); }

/* Bars */
.grid { stroke: var(--line); stroke-width: 1; }
.baseline { stroke: var(--muted); stroke-width: 1.5; }
.neutral { stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 6 6; }
.axis-tick { fill: var(--muted); font: 16px var(--font-body); }
.axis-note { fill: var(--muted); font: 15px var(--font-body); }
.bar-group { opacity: 0; transition: transform .9s cubic-bezier(.45,0,.2,1), opacity .5s; }
.bar-group.on { opacity: 1; }
.bar-group .bar { fill: var(--alle); transition: fill .7s; }
.bar-group.wit .bar { fill: var(--wit); }
.bar-group.kleur .bar { fill: var(--kleur); }
.bar-group.muted .bar { fill: var(--alle-soft); }
.bar-value { fill: var(--ink); font: 500 40px var(--font-body); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.bar-group.kleur .bar-value { fill: var(--kleur); }
.bar-group.muted .bar-value { fill: var(--muted); font-size: 30px; }
.bar-name { fill: var(--ink); font: 600 18px var(--font-body); }
.bar-n { fill: var(--muted); font: 14px var(--font-body); }
.bracket-line { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.bracket.ns .bracket-line { stroke: var(--muted); stroke-dasharray: 4 4; }
.bracket-text { fill: var(--ink); font: 600 17px var(--font-body); }
.bracket.ns .bracket-text { fill: var(--muted); font-weight: 500; }

/* Statements */
.statements { width: 100%; max-width: 760px; margin-inline: auto; padding: 8px 0 16px; }
.stmt { margin: 0; }
.stmt-kicker { font-size: 11px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; color: var(--muted); }
.stmt-quote { margin: 12px 0 0; color: var(--ink); font: 400 clamp(21px, 2.6vw, 28px)/1.35 var(--font-heading); letter-spacing: -.02em; }
.stmt-measure { margin: 26px 0 8px; font-size: 13px; color: var(--muted); }
.stmt-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); align-items: center; gap: 16px; padding-block: 10px; }
.stmt-label { font-size: 14px; font-weight: 600; color: var(--ink); }
.stmt-row.kleur .stmt-label { color: var(--kleur); }
.stmt-track { position: relative; height: 34px; margin-right: 64px; background: #eef1f4; border-radius: 4px; }
.stmt-fill { position: absolute; inset: 0 auto 0 0; width: 0; border-radius: 4px; background: var(--wit); }
.stmt-row.kleur .stmt-fill { background: var(--kleur); }
.stmt-value { position: absolute; top: 50%; left: 0; transform: translate(10px, -50%); font: 500 20px var(--font-body); letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.stmt-row.kleur .stmt-value { color: var(--kleur); }
.stmt-list .stmt-measure { margin-top: 0; }
.stmt.compact { padding: 16px 0 10px; border-top: 1px solid var(--line); }
.stmt-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.stmt.compact .stmt-quote { margin: 0; font: 500 15px/1.5 var(--font-body); letter-spacing: 0; }
.stmt-tag { flex-shrink: 0; padding: 2px 8px; border-radius: 4px; font-size: 11px; color: var(--muted); background: #eef1f4; }
.stmt-tag.sig { color: #fff; background: var(--wit); }
.stmt.compact .stmt-row { padding-block: 4px; }
.stmt.compact .stmt-track { height: 20px; }
.stmt.compact .stmt-value { font-size: 14px; }

/* Confidence intervals on the bars */
.ci line { stroke: var(--ink); stroke-width: 2; }
.bar-group.kleur .ci line { stroke: #1b3f8f; }
.bar-group.muted .ci line { stroke: var(--muted); }

/* More numbers */
.more-bar { display: flex; justify-content: flex-end; max-width: 900px; width: 100%; margin: 4px auto 0; }
.more-toggle { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); font: 500 13px var(--font-body); cursor: pointer; }
.more-toggle:hover { border-color: var(--dd-blue); background: #edf2fc; }
.more-toggle[aria-expanded="true"] { border-color: var(--dd-blue); color: var(--ui-blue); }
.more-panel { max-width: 900px; width: 100%; margin: 12px auto 8px; padding: 18px 20px; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.more-scroll { overflow-x: auto; }
.more-table { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.more-table th, .more-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: right; white-space: nowrap; }
.more-table th:first-child { text-align: left; }
.more-table thead th { font-weight: 500; font-size: 11px; color: var(--muted); white-space: normal; vertical-align: bottom; }
.more-table tbody th { font-weight: 600; color: var(--ink); }
.more-table tr.kleur th { color: var(--kleur); }
.more-test { display: grid; grid-template-columns: repeat(4, auto); justify-content: start; gap: 2px 28px; margin: 16px 0 0; font-size: 13px; }
.more-test dt { grid-row: 1; font-size: 11px; color: var(--muted); }
.more-test dd { grid-row: 2; margin: 0; color: var(--ink); font-weight: 500; font-variant-numeric: tabular-nums; }
.more-note { margin-top: 12px !important; font-size: 11px; color: var(--muted); }

/* Statement tools */
.stmt-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.stmt-pager { display: flex; gap: 4px; }
.stmt-pager button { position: relative; width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink); font: 500 13px var(--font-body); cursor: pointer; }
.stmt-pager button:hover { border-color: var(--dd-blue); }
.stmt-pager button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.stmt-pager button.is-example::after { content: ''; position: absolute; top: -2px; right: -2px; width: 9px; height: 9px; border-radius: 50%; background: var(--dd-blue); border: 2px solid var(--dd-bg); }
.stmt-tools { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 22px 0 8px; }
.stmt-tools .stmt-measure { margin: 0; }
.stmt-list .stmt-tools { margin-top: 0; }
.view-switch { display: inline-flex; padding: 3px; border-radius: 8px; background: #eef1f4; }
.view-switch button { min-height: 32px; padding: 0 12px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); font: 500 12px var(--font-body); cursor: pointer; }
.view-switch button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px #0e2a5e22; }
.stmt-means { margin-top: 14px !important; font-size: 12px; color: var(--muted); }

/* Stacked answer bars */
.stack-track { height: 30px; border-radius: 4px; overflow: hidden; background: #eef1f4; }
.stack-inner { display: flex; height: 100%; }
.seg { display: flex; align-items: center; justify-content: center; height: 100%; min-width: 0; font: 500 12px var(--font-body); color: var(--ink); }
.seg-label { white-space: nowrap; }
.seg-5-0 { background: #b9573a; color: #fff; }
.seg-5-1 { background: #e8b4a0; }
.seg-5-2 { background: #dfe3e8; }
.seg-5-3 { background: #b9cdb0; }
.seg-5-4 { background: #5f7f52; color: #fff; }
.seg-4-0 { background: #5f7f52; color: #fff; }
.seg-4-1 { background: #b9573a; color: #fff; }
.seg-4-2 { background: #dfe3e8; }
.seg-4-3 { background: #f1f3f5; }
.stmt-row.stack.alle .stmt-label { color: var(--muted); }
.stack-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 0 106px; font-size: 11px; color: var(--muted); }
.stack-key { display: inline-flex; align-items: center; gap: 6px; }
.stack-key::before { content: ''; width: 10px; height: 10px; border-radius: 2px; }
.stack-key[data-seg="5-0"]::before { background: #b9573a; } .stack-key[data-seg="5-1"]::before { background: #e8b4a0; }
.stack-key[data-seg="5-2"]::before { background: #dfe3e8; } .stack-key[data-seg="5-3"]::before { background: #b9cdb0; }
.stack-key[data-seg="5-4"]::before { background: #5f7f52; }
.stack-key[data-seg="4-0"]::before { background: #5f7f52; } .stack-key[data-seg="4-1"]::before { background: #b9573a; }
.stack-key[data-seg="4-2"]::before { background: #dfe3e8; } .stack-key[data-seg="4-3"]::before { background: #f1f3f5; border: 1px solid var(--line); }

/* Histogram 0-10 */
.hist-row { display: grid; grid-template-columns: 90px minmax(0, 1fr); gap: 16px; align-items: end; padding-block: 10px; }
.hist { display: grid; grid-template-columns: repeat(11, minmax(0, 1fr)); gap: 4px; height: 130px; }
.hist-col { display: grid; grid-template-rows: auto 1fr auto; align-items: end; justify-items: center; height: 100%; }
.hist-col { position: relative; }
.hist-bar { grid-row: 2; align-self: end; width: 100%; height: 0; border-radius: 3px 3px 0 0; background: var(--wit); }
.hist-row.kleur .hist-bar { background: var(--kleur); }
.hist-value { grid-row: 1; font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums; }
.hist-score { grid-row: 3; padding-top: 4px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--muted); width: 100%; text-align: center; }

/* Caption */
.news-page .distribution-progress { max-width: 760px; margin-inline: auto; }
.news-say { display: block; color: var(--ink); font-size: 15px; font-weight: 600; line-height: 1.4; }
.news-note { display: block; margin-top: 4px; font-size: 12.5px; line-height: 1.6; color: var(--muted); }

/* Completion dialog with theme list */
.news-completion { max-width: 520px; }
.news-completion h2 { max-width: none; }
.theme-list { display: flex; flex-direction: column; }
.theme-choice { min-height: 44px; padding: 10px 0; border: 0; border-top: 1px solid var(--line); background: transparent; color: var(--ink); font: 500 15px var(--font-body); text-align: left; cursor: pointer; }
.theme-choice:hover { color: var(--ui-blue); }
.theme-choice[aria-current="true"] { color: var(--muted); }
.theme-choice[aria-current="true"]::after { content: ' · net bekeken'; font-weight: 400; font-size: 12px; }

@media (max-width: 700px) {
  .news-page .subject-control select { min-width: 0; max-width: 100%; font-size: 14px; }
  .news-legend { width: 100%; gap: 12px; font-size: 11px; }
  .news-page .distribution-canvas { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; padding: 0; }
  .news-page .news-stage { grid-column: 1 / -1; grid-row: 1; min-height: 300px; }
  .news-page .chart-arrow { position: static; transform: none; grid-row: 2; }
  .news-page .chart-prev { grid-column: 1; justify-self: start; }
  .news-page .chart-next { grid-column: 2; justify-self: end; }
  .news-page .distribution-progress { padding: 4px 0 20px; }
  .people-name { font-size: 34px; }
  .people-count { font-size: 28px; }
  .person { r: 11px; }
  .axis-tick, .axis-note { font-size: 34px; }
  .bar-value { font-size: 72px; }
  .bar-group.muted .bar-value { font-size: 54px; }
  .bar-name { font-size: 38px; }
  .bar-n { font-size: 30px; }
  .bracket-text { font-size: 34px; }
  .bar-name { transform: translateY(12px); }
  .bar-n { transform: translateY(26px); }
  .axis-note { display: none; }
  .bracket { transform: translateY(-26px); }
  .stmt-row { grid-template-columns: 72px minmax(0, 1fr); gap: 10px; }
  .stmt-track { margin-right: 52px; }
  .stmt-value { font-size: 17px; }
  .stmt-head { flex-direction: column; gap: 8px; }
  .stack-legend { margin-left: 0; }
  .hist-row { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .hist-value { font-size: 8px; }
  .more-panel { padding: 14px 12px; }
  .more-test { grid-template-columns: repeat(2, auto); }
  .more-test dt:nth-of-type(n+3) { grid-row: 3; } .more-test dd:nth-of-type(n+3) { grid-row: 4; }
  .news-say { font-size: 14px; }
  .news-note { font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .person, .bar-group { transition-duration: 1ms !important; transition-delay: 0ms !important; }
}
