/* Grafik för artikeln Five years of electric trucks. Allt är avgränsat under .nns.
   Samma panelfärger som de andra artiklarna: mörkgrön yta, vit text. */
.nns {
  --panel: #0E3B2C; --p-raise: #134634; --p-line: #2B5A49; --p-ink: #FFFFFF; --p-ink2: #A8C9B9;
  --c-el: #3CC48A; --c-ref: #9DB3A8; --c-hot: #D9A23A;
}
.nns .num { font-variant-numeric: tabular-nums; }
.nns-lede { font-size: 21px; line-height: 1.5; font-weight: 500; color: var(--ink); }
.nns-kicker { margin: 56px 0 8px !important; font-family: var(--mono); font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.nns-kicker + h2 { margin-top: 0 !important; }
.nns-after { margin-top: 24px; }

/* Två stora siffror överst */
.nns .duo { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin: 8px 0 8px; padding: 24px 0; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--line); }
.nns .duo b { display: block; font-family: var(--display); font-weight: 600; font-size: clamp(56px, 12vw, 96px); line-height: .9; letter-spacing: -.035em; color: var(--forest); }
.nns .duo b small { font-size: .45em; letter-spacing: 0; margin-left: .06em; }
.nns .duo span { display: block; font-size: 15px; line-height: 1.35; color: var(--muted); margin-top: 10px; }
.nns .meter { height: 6px; background: var(--line); margin-top: 12px; overflow: hidden; }
.nns .meter i { display: block; height: 100%; background: var(--accent); transform-origin: left center; }
.nns .meter i.hot { background: var(--c-hot); }

/* Grafikpaneler */
.nns-panel { margin: 28px 0 8px; background: var(--panel); color: var(--p-ink); padding: 20px; font-size: 15px; line-height: 1.45; }
.nns-panel h3 { font-family: var(--display); font-weight: 600; font-size: 18px; line-height: 1.25; margin: 0 0 12px; color: #fff; }
.nns-panel figcaption { font-size: 13.5px; line-height: 1.45; color: var(--p-ink2); margin-top: 14px; }
.nns .legend { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 13px; color: var(--p-ink2); margin: 0 0 12px; }
.nns .legend i { display: inline-block; width: 10px; height: 10px; margin-right: 6px; vertical-align: -1px; }
.nns .legend i.dot { border-radius: 50%; }
.nns .legend i.ring { border-radius: 50%; background: transparent; border: 2px solid #fff; box-sizing: border-box; }

/* Diagram */
.nns .chart { width: 100%; display: block; }
.nns .chart text { font-family: var(--body); fill: var(--p-ink2); font-size: 11.5px; }
.nns .chart .big { font-weight: 700; font-size: 12.5px; fill: #fff; }
.nns .chart .xl { font-family: var(--display); font-weight: 600; font-size: 17px; fill: #fff; }
.nns .chart .hot { fill: var(--c-hot); font-weight: 600; }
.nns .chart .halo { paint-order: stroke; stroke: var(--panel); stroke-width: 4px; stroke-linejoin: round; }

/* Rutor med siffror */
.nns .tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.nns .tiles:first-of-type { margin-top: 0; }
.nns .tiles + .tiles { margin-top: 8px; }
.nns .tile { background: var(--p-raise); padding: 10px; }
.nns .tile b { display: block; font-family: var(--display); font-weight: 600; font-size: clamp(18px, 5.3vw, 28px); line-height: 1.05; white-space: nowrap; }
.nns .tile span { display: block; font-size: 12.5px; line-height: 1.3; color: var(--p-ink2); margin-top: 5px; }
@media (max-width: 560px) { .nns .tiles.stack { grid-template-columns: 1fr; } .nns .tiles.stack .tile b { font-size: 26px; } }

/* Rader med staplar */
.nns .ledger { display: grid; gap: 11px; }
.nns .lr { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; align-items: baseline; }
.nns .lr span { font-size: 14px; line-height: 1.3; color: var(--p-ink2); }
.nns .lr b { font-weight: 700; font-size: 15px; color: #fff; white-space: nowrap; font-variant-numeric: tabular-nums; }
.nns .lr .bar { grid-column: 1 / -1; height: 12px; display: flex; }
.nns .lr .bar i { display: block; height: 100%; background: var(--c-el); transform-origin: left center; }
.nns .lr .bar i.ref { background: var(--c-ref); }
.nns .lr .bar i.hi { opacity: .45; }
.nns .lr .bar i.white { background: #fff; }
.nns .lr.top { border-bottom: 1px solid var(--p-line); padding-bottom: 11px; }
.nns .lr.top span { color: #fff; font-weight: 600; }

/* Listor */
.nns .steps { margin: 8px 0 20px; padding-left: 1.3em; }
.nns .steps li { margin-bottom: 10px; padding-left: .2em; }
.nns .steps li::marker { font-family: var(--display); font-weight: 600; color: var(--accent); }
.nns .steps li b { font-weight: 600; color: var(--ink); }
.nns > ul:last-child { font-size: 15px; line-height: 1.5; color: var(--muted); padding-left: 1.2em; }
.nns > ul:last-child li { margin-bottom: 6px; }
.nns-note { font-size: 15px; line-height: 1.55; color: var(--muted); }

/* Animationer. Gäller bara när skriptet har satt klassen js på .nns,
   så att allt syns även utan JavaScript. Klassen in sätts när grafiken rullas in i bild. */
.nns.js .anim .grow { transform: scaleX(0); transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
.nns.js .chart .grow { transform-box: fill-box; transform-origin: left center; }
.nns.js .chart .grow.r { transform-origin: right center; }
.nns.js .anim .fade { opacity: 0; transition: opacity .45s ease; }
.nns.js .anim .slide { transform: translateX(var(--dx, 0)); transition: transform .9s cubic-bezier(.2, .7, .2, 1); }
.nns.js .anim .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); transition: stroke-dashoffset 1.5s ease-out; }
.nns.js .anim.in .grow, .nns.js .anim.in .slide { transform: none; }
.nns.js .anim.in .fade { opacity: 1; }
.nns.js .anim.in .draw { stroke-dashoffset: 0; }

@media (max-width: 640px) {
  .nns-panel { padding: 16px; margin-inline: -8px; }
}
@media (max-width: 420px) {
  .nns .duo { gap: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .nns.js .anim .grow, .nns.js .anim .fade, .nns.js .anim .slide, .nns.js .anim .draw { transition: none; }
}
