/* ---------- Agenda river (narrative-chart.js, ADR 0040 of hirhanyo-pro) ----------
 * Shared by the media monitor (media-monitor.html, the full block) and the home page (index.html,
 * the 7-day block of the main column, `.mm-trend.is-home`). Needs narrative-widgets.css for the
 * colours of the political forces and the experimental badge. */

/* The agenda river (narrative-chart.js): the weight of each force in the day's political articles as
 * one 100% river (Fidesz–KDNP at the bottom, Tisza at the top, Mi Hazánk the vein between), the net
 * context as a pulse of up and down bars below, the day card beside. The force colours are identity
 * only (not the stance pair): orange, violet, green of the named palette, dimmed in the dark mode;
 * checked for colour vision deficiency in both modes (worst pair ΔE 8.3 dark, 7.8 light, so the bands
 * carry their names and the buttons are the legend). Experimental: the heading and a note say so. */

.mm-trend { display: grid; }
.mm-trend .panel-heading h2 { margin-right: 0; }
.mm-trend .panel-heading .nw-lab { margin-right: auto; }
.mm-trend-lab { display: flex; gap: 10px; align-items: flex-start; margin: 14px 18px 0; padding: 9px 12px; border: 1px dashed var(--color-warning-text); border-radius: 4px; background: color-mix(in srgb, var(--color-warning-text) 7%, transparent); color: var(--muted); font-size: 12px; line-height: 1.5; }
.mm-trend-lab .icon { margin-top: 1px; color: var(--color-warning-text); font-size: 15px; }
.mm-trend-lab strong { color: var(--text); font-weight: 600; }
.mm-trend-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 16px 18px 6px; }
.mm-trend-top .ls-chips { margin: 0; }
.mm-trend-headline { margin: 0; max-width: 760px; font-family: var(--font-heading); font-size: clamp(17px, 2vw, 22px); font-weight: 500; line-height: 1.35; }
.mm-trend-headline strong { font-weight: 700; }
.mm-trend-forces { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 10px 18px 4px; list-style: none; }
.mm-trend-force { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 10px; align-items: end; width: 100%; padding: 12px 14px 11px 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 4px; background: var(--panel); color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .15s, opacity .15s, background-color .15s; }
.mm-trend-force > i { position: absolute; inset: 0 auto 0 0; width: 4px; background: var(--c); }
.mm-trend-force:hover { border-color: var(--line-bright); }
.mm-trend-force:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 2px; }
.mm-trend-force .name { overflow: hidden; font-size: 13px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.mm-trend-force b { grid-row: span 2; font-family: var(--font-heading); font-size: 28px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.mm-trend-force small { overflow: hidden; color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: .05em; text-overflow: ellipsis; white-space: nowrap; }
.mm-trend-force[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--panel)); }
.mm-trend.has-focus .mm-trend-force[aria-pressed="false"] { opacity: .5; }

.mm-trend-body { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 18px; padding: 12px 18px 16px 10px; }
.mm-trend-plot { min-width: 0; min-height: 460px; border-radius: 4px; cursor: crosshair; touch-action: pan-y; }
.mm-trend-plot:focus-visible { outline: 2px solid var(--color-primary); outline-offset: 4px; }
.nc-svg { display: block; overflow: visible; }
.nc-stop-top { stop-color: var(--c); stop-opacity: .95; }
.nc-stop-bottom { stop-color: var(--c); stop-opacity: .62; }
[data-theme="light"] .nc-stop-top { stop-opacity: .88; }
[data-theme="light"] .nc-stop-bottom { stop-opacity: .55; }
.nc-band { transition: opacity .2s; }
.nc-band.is-faded, .nc-band-name.is-faded, .nc-band-value.is-faded, .nc-row.is-faded { opacity: .18; }
.nc-seam { fill: none; stroke: var(--panel); stroke-width: 2; }
.nc-grid line { stroke: var(--panel); stroke-width: 1; }
.nc-grid line.is-quarter { stroke-dasharray: 1 5; opacity: .55; }
.nc-grid line.is-edge { stroke: var(--line); }
.nc-tick, .nc-title, .nc-band-name, .nc-band-value, .nc-flag-head, .nc-pill { font-family: var(--font-mono); }
.nc-tick { fill: var(--muted); font-size: 9px; }
.nc-tick.is-y { text-anchor: end; }
.nc-tick.is-x { text-anchor: middle; }
.nc-tick.is-x.is-end { text-anchor: end; }
.nc-row-name { font-size: 8px; letter-spacing: .04em; }
.nc-scale { text-anchor: end; font-size: 8px; letter-spacing: .06em; }
.nc-title { fill: var(--text); font-size: 9px; letter-spacing: .08em; }
.nc-band-name { fill: var(--color-background); font-size: 10px; font-weight: 600; letter-spacing: .08em; text-anchor: end; }
.nc-band-value { fill: var(--color-background); font-family: var(--font-heading); font-size: 15px; font-weight: 700; text-anchor: end; }
.nc-flag-pole { stroke: var(--c); stroke-width: 1; stroke-dasharray: 2 3; }
.nc-flag-dot { fill: var(--c); stroke: var(--panel); stroke-width: 2.5; }
.nc-flag-head { fill: var(--c); font-size: 9px; font-weight: 600; letter-spacing: .06em; }
.nc-flag-title { fill: var(--text); font-family: var(--font-heading); font-size: 12px; font-weight: 600; }
.nc-row-track { fill: color-mix(in srgb, var(--c) 6%, transparent); rx: 3px; }
.nc-row-mid { stroke: var(--line-bright); stroke-width: 1; }
.nc-beat { fill: var(--c); }
.nc-few { fill: var(--muted); opacity: .6; }
.nc-slice { fill: var(--text); opacity: .14; rx: 2px; }
.nc-pill { fill: var(--text); font-size: 11px; font-weight: 600; paint-order: stroke; stroke: var(--panel); stroke-width: 4px; stroke-linejoin: round; }
[data-theme="dark"] .nc-band { filter: drop-shadow(0 0 10px color-mix(in srgb, var(--c) 18%, transparent)); }
.nc-svg.is-revealing .nc-river, .nc-svg.is-revealing .nc-pulse { animation: nc-reveal 1.3s cubic-bezier(.3, .7, .2, 1) both; }
.nc-svg.is-revealing .nc-flags { animation: nc-fade .5s 1.1s ease-out both; }
@keyframes nc-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
@keyframes nc-fade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.mm-trend-card { display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 4px; background: linear-gradient(180deg, var(--panel-hover), var(--panel)); }
.mm-trend-card.is-pinned { border-color: var(--color-primary); }
.mm-trend-card-kicker { color: var(--color-primary); font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em; }
.mm-trend-card-day { font-family: var(--font-heading); font-size: 30px; font-weight: 700; line-height: 1.05; }
.mm-trend-card-weekday { color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; }
.mm-trend-card-stories { display: grid; gap: 12px; margin: 12px 0 0; padding: 0; list-style: none; counter-reset: story; }
.mm-trend-card-stories li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); counter-increment: story; }
.mm-trend-card-stories li::before { content: counter(story, decimal-leading-zero); color: var(--muted); font-family: var(--font-mono); font-size: 10px; line-height: 1.6; }
.mm-trend-card-stories a { display: -webkit-box; overflow: hidden; color: var(--text); font-family: var(--font-heading); font-size: 14px; font-weight: 600; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.mm-trend-card-stories a:hover { color: var(--color-primary); }
.mm-trend-card-hint { display: flex; gap: 6px; align-items: center; margin-top: 14px; color: var(--muted); font-size: 11px; }
.mm-trend-card.is-pinned .mm-trend-card-hint { visibility: hidden; }
/* The day's figures at the foot of the card: its political articles, the river of the day as one bar, the share and net context per force */
.mm-trend-card-figures { display: grid; gap: 8px; margin-top: auto; padding-top: 14px; border-top: 1px solid var(--line); }
.mm-trend-card-total { margin: 0; color: var(--muted); font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; }
.mm-trend-card-total b { margin-right: 4px; color: var(--text); font-family: var(--font-heading); font-size: 18px; letter-spacing: 0; }
.mm-trend-card-bar { display: flex; gap: 2px; height: 6px; }
.mm-trend-card-bar i { min-width: 0; border-radius: 2px; background: var(--c); transition: width .2s ease; }
.mm-trend-card-rows { width: 100%; border-collapse: collapse; font-size: 12px; }
.mm-trend-card-rows thead th { padding-bottom: 2px; color: var(--muted); font-family: var(--font-mono); font-size: 8px; font-weight: 400; letter-spacing: .08em; text-align: right; }
.mm-trend-card-rows tbody th { display: flex; gap: 7px; align-items: center; padding: 3px 0; font-weight: 500; text-align: left; }
.mm-trend-card-rows tbody th i { flex: none; width: 8px; height: 8px; border-radius: 2px; background: var(--c); }
.mm-trend-card-rows td { padding: 3px 0 3px 10px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.mm-trend-card-rows td.mm-trend-card-tone { width: 44px; padding-left: 12px; }
.mm-trend-card-tone span { position: relative; display: block; height: 8px; border-radius: 2px; background: var(--line); }
.mm-trend-card-tone span::after { position: absolute; top: -2px; bottom: -2px; left: 50%; width: 1px; background: var(--muted); content: ""; }
.mm-trend-card-tone i { position: absolute; top: 0; bottom: 0; border-radius: 2px; background: var(--text); opacity: .7; }
.mm-trend-card-note { margin: 0; color: var(--muted); font-size: 10px; line-height: 1.4; }
@media (prefers-reduced-motion: reduce) { .mm-trend-card-bar i { transition: none; } }

.mm-trend-notes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 24px; margin: 0; padding: 12px 18px 14px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; line-height: 1.55; }
.mm-trend-notes dt { color: var(--text); font-family: var(--font-mono); font-size: 9px; letter-spacing: .06em; }
.mm-trend-notes dd { margin: 0; }
.mm-trend-table { border-top: 1px solid var(--line); }
.mm-trend-table summary { padding: 10px 18px; color: var(--muted); font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; cursor: pointer; }
.mm-trend-table summary:hover { color: var(--text); }
.mm-trend-table .mm-table-wrap { max-height: 360px; overflow: auto; }
.mm-trend-table table { width: 100%; border-collapse: collapse; font-size: 12px; }
.mm-trend-table th, .mm-trend-table td { padding: 7px 14px; border-top: 1px solid var(--line); text-align: left; vertical-align: top; }
.mm-trend-table thead th { position: sticky; top: 0; background: var(--panel); color: var(--muted); font-family: var(--font-mono); font-size: 9px; font-weight: 500; letter-spacing: .06em; }
.mm-trend-table tbody th { font-family: var(--font-mono); font-size: 10px; font-weight: 500; white-space: nowrap; }
.mm-trend-table td { font-variant-numeric: tabular-nums; }
.mm-trend-table td:not(:last-child) { white-space: nowrap; }
.mm-trend-table td:last-child { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  .mm-trend-force, .nc-band { transition: none; }
}

@media (max-width: 1000px) {
  .mm-trend-body { grid-template-columns: minmax(0, 1fr); }
  .mm-trend-notes { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 700px) {
  .mm-trend-forces { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .mm-trend-force { padding: 9px 12px 9px 16px; }
  .mm-trend-force b { font-size: 22px; }
  .mm-trend-plot { min-height: 340px; }
}

/* The home page block: the 7-day river in the main column, no window chips, notes or table */
.mm-trend.is-home .panel-heading .nw-lab { margin-right: auto; }
.mm-trend.is-home .mm-trend-top { padding-top: 12px; }
.mm-trend.is-home .mm-trend-headline { font-size: clamp(16px, 1.6vw, 19px); }
.mm-trend.is-home .mm-trend-forces { gap: 8px; }
.mm-trend.is-home .mm-trend-force { padding: 8px 12px 8px 16px; }
.mm-trend.is-home .mm-trend-force b { font-size: 22px; }
.mm-trend.is-home .mm-trend-body { grid-template-columns: minmax(0, 1fr) 256px; gap: 14px; padding-bottom: 12px; }
.mm-trend.is-home .mm-trend-plot { min-height: 470px; }
.mm-trend.is-home .mm-trend-card { padding: 14px; }
.mm-trend.is-home .mm-trend-card-day { font-size: 24px; }
.mm-trend.is-home .mm-trend-card-stories { gap: 10px; margin-top: 8px; }
.mm-trend.is-home .mm-trend-card-stories li { padding-top: 10px; }
.mm-trend.is-home .mm-trend-card-stories a { font-size: 13px; }
.mm-trend-more { display: flex; justify-content: flex-end; padding: 0 18px 14px; }
.mm-trend-more .pw-cta { width: auto; }
@media (max-width: 700px) {
  .mm-trend.is-home .mm-trend-body { grid-template-columns: minmax(0, 1fr); }
  .mm-trend.is-home .mm-trend-plot { min-height: 290px; }
}
