/* Nordviks Affärsblad — an old newspaper on aged paper. Ink black, sepia, one oxblood accent for warnings. */
:root {
  --paper: #efe2bf;
  --paper-light: #f6ecd0;
  --paper-dark: #d9c590;
  --ink: #1b1510;
  --sepia: #6b4a2b;
  --faded: #8a7350;
  --blood: #8c2a1c;
  --rule: #3a2c1e;
  --serif: "Playfair Display", "Didot", "Bodoni MT", "Hoefler Text", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --text: "Libre Caslon Text", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --blackletter: "UnifrakturCook", "Old English Text MT", "Luminari", "Playfair Display", Georgia, serif;
}
* { box-sizing: border-box; }
html { background: #cdb98a; }
body {
  margin: 0; color: var(--ink); font-family: var(--text); font-size: 15px; line-height: 1.45;
  background-color: var(--paper);
  background-image:
    radial-gradient(ellipse at 50% 40%, rgba(255,247,220,.55) 0%, rgba(255,247,220,0) 60%),
    radial-gradient(ellipse at 50% 50%, rgba(0,0,0,0) 55%, rgba(110,72,25,.30) 100%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.35  0 0 0 0 0.24  0 0 0 0 0.1  0 0 0 0.16 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='600' height='600'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='0.012' numOctaves='2' seed='7'/><feColorMatrix values='0 0 0 0 0.55  0 0 0 0 0.36  0 0 0 0 0.12  0 0 0 0.20 0'/></filter><rect width='100%' height='100%' filter='url(%23f)'/></svg>");
  background-attachment: fixed, fixed, scroll, scroll;
  min-height: 100vh;
}
a { color: var(--sepia); }
.sheet { max-width: 1480px; margin: 0 auto; padding: 14px 26px 26px; }

/* ---- Masthead ---- */
.masthead { text-align: center; border-bottom: 4px double var(--ink); padding-bottom: 6px; margin-bottom: 14px; }
.ears { display: flex; justify-content: space-between; align-items: center; font-size: 12px; font-style: italic; border-bottom: 1px solid var(--ink); padding-bottom: 4px; }
.title { font-family: var(--blackletter); font-weight: 400; font-size: clamp(40px, 7vw, 84px); line-height: 1.05; margin: 6px 0 0; letter-spacing: .5px; text-shadow: 1px 1px 0 rgba(107,74,43,.35); }
.subtitle { font-variant: small-caps; letter-spacing: .18em; font-size: 13px; margin-bottom: 8px; }
.dateline { display: flex; justify-content: space-between; border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 3px 4px; font-size: 12.5px; text-transform: capitalize; font-variant: small-caps; letter-spacing: .06em; }
.dateline span:nth-child(2) { text-transform: none; }
.pill { font-style: normal; font-variant: small-caps; letter-spacing: .06em; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink); margin-right: 4px; vertical-align: -1px; }
.pill.on .dot { background: var(--ink); animation: pulse 2.4s ease-in-out infinite; }
.pill.off { color: var(--blood); } .pill.off .dot { border-color: var(--blood); }
@keyframes pulse { 0%,100% { opacity: 1 } 50% { opacity: .25 } }

/* ---- Layout ---- */
.body { display: grid; grid-template-columns: 188px 1fr; gap: 0; }
.sections { border-right: 1px solid var(--rule); padding-right: 14px; margin-right: 18px; }
.sections h4 { font-family: var(--serif); font-variant: small-caps; letter-spacing: .14em; font-size: 13px; margin: 0 0 6px; padding-bottom: 3px; border-bottom: 2px solid var(--ink); }
.sections a { display: flex; align-items: center; gap: 9px; padding: 7px 6px; color: var(--ink); text-decoration: none; font-family: var(--serif); font-size: 15px; border-bottom: 1px dotted var(--faded); }
.sections a svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.sections a:hover { background: rgba(107,74,43,.12); }
.sections a.active { background: var(--ink); color: var(--paper-light); }
.sections a.active svg { stroke: var(--paper-light); }
.sections .note { font-size: 12px; font-style: italic; color: var(--sepia); margin-top: 12px; }
.page { min-width: 0; }
.foot { margin-top: 24px; border-top: 4px double var(--ink); padding-top: 6px; text-align: center; font-size: 12px; font-style: italic; color: var(--sepia); }

/* ---- Typography ---- */
.section-title { font-family: var(--serif); font-size: 34px; margin: 0 0 8px; border-bottom: 3px solid var(--ink); padding-bottom: 2px; font-weight: 900; letter-spacing: -.5px; }
.kicker { font-variant: small-caps; letter-spacing: .16em; font-size: 12px; color: var(--sepia); border-top: 1px solid var(--ink); padding-top: 3px; margin-top: 2px; }
.headline { font-family: var(--serif); font-weight: 800; font-size: 20px; line-height: 1.15; margin: 2px 0 4px; }
.headline.xl { font-size: clamp(28px, 4vw, 48px); font-weight: 900; line-height: 1.05; margin: 4px 0 8px; letter-spacing: -.8px; }
.deck { font-style: italic; margin: 0 0 8px; color: #3b2d1c; font-size: 13.5px; }
.lede { font-size: 16px; margin: 0; text-align: justify; hyphens: auto; }
.dropcap::first-letter { font-family: var(--serif); font-weight: 900; font-size: 3.4em; float: left; line-height: .82; padding: 4px 6px 0 0; }
.lead-story { border-bottom: 1px solid var(--ink); padding-bottom: 12px; margin-bottom: 10px; }
.mini { font-family: var(--serif); font-variant: small-caps; letter-spacing: .08em; margin: 10px 0 2px; font-size: 13px; border-bottom: 1px solid var(--faded); }
.empty { font-style: italic; color: var(--sepia); margin: 6px 0; }
.note-line { font-size: 13px; font-style: italic; }
.more { font-style: italic; margin: 4px 0; }
.loading { padding: 40px 0; text-align: center; }

/* ---- Columns with thin rules ---- */
.cols { display: grid; gap: 0; margin-bottom: 10px; }
.cols.c2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols.c3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cols > .col { padding: 0 16px; min-width: 0; }
.cols > .col:first-child { padding-left: 0; }
.cols > .col:last-child { padding-right: 0; }
.cols > .col + .col { border-left: 1px solid var(--rule); }
.story { margin-bottom: 18px; }
@media (max-width: 1000px) {
  .body { grid-template-columns: 1fr; } .sections { border-right: 0; margin-right: 0; padding-right: 0; display: flex; flex-wrap: wrap; gap: 0 8px; border-bottom: 1px solid var(--rule); margin-bottom: 12px; }
  .sections h4, .sections .note { display: none; } .sections a { border: 0; }
  .cols.c2, .cols.c3 { grid-template-columns: 1fr; } .cols > .col { padding: 0; } .cols > .col + .col { border-left: 0; border-top: 1px solid var(--rule); padding-top: 8px; }
}

/* ---- Figures ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); border-top: 2px solid var(--ink); border-bottom: 2px solid var(--ink); margin: 6px 0 14px; }
.stat { padding: 6px 12px; border-left: 1px solid var(--rule); }
.stat:first-child { border-left: 0; }
.stat-label { font-variant: small-caps; letter-spacing: .1em; font-size: 12px; color: var(--sepia); }
.stat-value { font-family: var(--serif); font-weight: 900; font-size: 28px; line-height: 1.1; }
.stat-note { font-size: 12px; font-style: italic; color: #4b3a26; }
.stat.bad .stat-value { color: var(--blood); }

.alerts { list-style: none; margin: 0; padding: 0; }
.alerts li { padding: 5px 0 5px 12px; border-bottom: 1px dotted var(--faded); border-left: 4px solid var(--ink); margin-bottom: 3px; font-size: 14px; }
.alerts li.crit { border-left-color: var(--blood); }
.alerts li.crit b { color: var(--blood); }
.alerts li.warn { border-left-style: double; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; margin: 4px 0 8px; }
.tbl th { font-family: var(--serif); font-variant: small-caps; letter-spacing: .06em; text-align: left; border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); padding: 3px 6px; font-weight: 700; }
.tbl td { padding: 3px 6px; border-bottom: 1px dotted var(--faded); vertical-align: top; }
.tbl .r, .tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.tbl .sub { font-size: 12px; font-style: italic; color: var(--sepia); }
.tbl tr.crit td { color: var(--blood); font-weight: 600; }
.tbl tr.warn td { background: rgba(107,74,43,.10); }
.tbl.compact td { padding: 2px 4px; }
.pct { font-size: 12px; font-variant-numeric: tabular-nums; }

/* ---- Charts ---- */
svg.chart { width: 100%; height: auto; display: block; margin: 2px 0 6px; }
svg.chart .lbl { font-family: var(--text); font-size: 12.5px; fill: var(--ink); }
svg.chart .lbl.small { font-size: 11px; }
svg.chart .val { font-family: var(--serif); font-weight: 700; font-size: 12.5px; fill: var(--sepia); }
svg.meter { width: 120px; height: 12px; vertical-align: middle; }

/* ---- Notifications as telegram slips ---- */
.telegrams { position: fixed; top: 14px; right: 14px; z-index: 50; display: flex; flex-direction: column; gap: 8px; width: 290px; pointer-events: none; }
.telegram { background: var(--paper-light); border: 1px solid var(--ink); outline: 3px double var(--ink); outline-offset: -6px; padding: 10px 14px; box-shadow: 3px 4px 0 rgba(27,21,16,.35); animation: slip .35s ease-out; transform: rotate(-.4deg); }
.tg-head { font-variant: small-caps; letter-spacing: .18em; font-size: 11px; color: var(--sepia); border-bottom: 1px solid var(--ink); margin-bottom: 4px; }
.tg-body { font-family: var(--serif); font-size: 16px; }
.tg-fields { font-size: 12.5px; font-style: italic; margin-top: 2px; }
@keyframes slip { from { opacity: 0; transform: translateX(30px) rotate(1deg); } to { opacity: 1; transform: translateX(0) rotate(-.4deg); } }

#blazor-error-ui { display: none; } 
