/* ukenummerkalender.no — "Trykt almanakk" (printed Norwegian wall-almanac)
   Two-ink riso palette, Fraunces display serif, hairline rules, paper grain.
   Signature: giant serif week number + a ruled "uke N av 53" year meter. */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(/static/fonts/fraunces.woff2) format('woff2');
}

:root {
  --paper:     #F2ECDD;   /* newsprint */
  --paper-2:   #ECE4D0;
  --panel:     #E9E0C9;
  --ink:       #201A17;
  --ink-soft:  #6E6252;
  --line:      #D3C6A9;   /* warm hairline */
  --line-2:    #C2B291;
  --red:       #C0392B;   /* riso red — røde dager */
  --red-soft:  #F3E2D6;
  --blue:      #2C5AA0;   /* riso blue — ukenummer */
  --blue-deep: #234a86;
  --blue-soft: #E2E4D9;

  --serif: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans:  ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
           "Helvetica Neue", Arial, sans-serif;

  --maxw: 1080px;
  --radius: 3px;
  --num-wonk: "opsz" 144, "wght" 800, "SOFT" 0, "WONK" 1;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:     #191410;
    --paper-2:   #201A15;
    --panel:     #241D16;
    --ink:       #EFE7D6;
    --ink-soft:  #A99A82;
    --line:      #3A2F23;
    --line-2:    #4A3D2E;
    --red:       #E0765F;
    --red-soft:  #2E1D18;
    --blue:      #8FB2DE;
    --blue-deep: #A9C6E8;
    --blue-soft: #22201A;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}

/* paper grain overlay — subtle newsprint tooth */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 9999; pointer-events: none;
  opacity: .05; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { body::after { mix-blend-mode: screen; opacity: .04; } }

a { color: var(--blue-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; position: relative; }

/* ---- header: masthead with double rule ---- */
.site-head {
  border-bottom: 3px double var(--ink);
  background: var(--paper);
  position: sticky; top: 0; z-index: 20;
}
.site-head .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 62px; flex-wrap: wrap;
}
.brand {
  font-family: var(--serif); font-weight: 800; font-size: 1.28rem;
  letter-spacing: -.01em; color: var(--ink);
  display: inline-flex; align-items: center; gap: .5em;
  font-variation-settings: "opsz" 40, "wght" 800, "WONK" 1;
}
.brand:hover { text-decoration: none; }
.brandmark { flex: none; display: block; }
.brand .wm { display: inline-flex; align-items: baseline; }
.brand b { color: var(--blue-deep); font-weight: 800; }
.brand .dot { color: var(--red); }
.nav { display: flex; gap: 2px; flex-wrap: wrap; }
.nav a {
  color: var(--ink-soft); font-weight: 600; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .07em;
  padding: 6px 10px; border-radius: 2px;
}
.nav a:hover { color: var(--ink); background: var(--panel); text-decoration: none; }
.nav a[aria-current="page"] { color: var(--red); box-shadow: inset 0 -2px 0 var(--red); }

/* ---- hero: the poster ---- */
.hero { padding: 40px 0 20px; }
.eyebrow {
  font-family: var(--sans); font-weight: 700; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .28em; color: var(--red);
  margin: 0 0 6px;
}
.weekbig {
  font-family: var(--serif);
  font-variation-settings: var(--num-wonk);
  font-weight: 800; letter-spacing: -.02em; line-height: .8;
  font-size: clamp(6rem, 30vw, 15rem); margin: 0; color: var(--ink);
}
.weekbig .u {
  display: block; font-family: var(--sans); font-size: clamp(1rem, 4vw, 1.6rem);
  font-weight: 800; letter-spacing: .42em; text-transform: uppercase;
  color: var(--ink); margin-bottom: .12em;
}
.hero .sub { font-family: var(--serif); font-size: clamp(1.15rem,2.6vw,1.5rem);
  color: var(--ink); margin: 16px 0 0; font-variation-settings: "opsz" 40, "wght" 500; }
.hero .sub .rng { color: var(--red); font-weight: 700; }

.hero-grid {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,320px);
  gap: 40px; align-items: end;
}
@media (max-width: 760px) { .hero-grid { grid-template-columns: 1fr; gap: 24px; } }

/* year-progress meter — the signature */
.meter { margin: 22px 0 0; max-width: 560px; }
.meter .cap {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--sans); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--ink-soft); margin-bottom: 7px;
}
.meter .cap b { color: var(--blue-deep); font-weight: 800; }
.meter .track {
  position: relative; height: 12px; border: 1.5px solid var(--ink);
  background: repeating-linear-gradient(90deg, transparent 0, transparent calc((100% / 53) - 1px),
    var(--line) calc((100% / 53) - 1px), var(--line) calc(100% / 53));
}
.meter .fill { position: absolute; inset: 0 auto 0 0; background: var(--blue);
  border-right: 2px solid var(--red); }

/* fact cards — framed like almanac boxes */
.facts { display: grid; gap: 0; border: 1.5px solid var(--ink); background: var(--paper); }
.fact { padding: 13px 16px; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact .k { font-family: var(--sans); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .12em; color: var(--ink-soft); font-weight: 700; }
.fact .v { font-family: var(--serif); font-size: 1.35rem; font-weight: 700; margin-top: 2px;
  font-variation-settings: "opsz" 40, "wght" 640; }
.fact .v.red { color: var(--red); }

/* ---- year strip ---- */
.yearstrip { display: flex; flex-wrap: wrap; gap: 0; margin: 8px 0 4px;
  border: 1.5px solid var(--ink); width: max-content; max-width: 100%; }
.yearstrip a, .yearstrip span {
  padding: 7px 15px; font-family: var(--serif); font-weight: 600; font-size: 1rem;
  color: var(--ink-soft); border-right: 1px solid var(--line);
}
.yearstrip a:last-child, .yearstrip span:last-child { border-right: 0; }
.yearstrip a:hover { color: var(--paper); background: var(--blue); text-decoration: none; }
.yearstrip .cur { background: var(--ink); color: var(--paper); }

/* ---- sections ---- */
section.block { padding: 30px 0; border-top: 3px double var(--ink); margin-top: 6px; }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(2.1rem, 5.5vw, 3rem); margin: 0 0 .3em; line-height: 1.05;
  font-variation-settings: "opsz" 144, "wght" 800, "WONK" 1; }
h2 { font-size: 1.7rem; margin: 0 0 .6em; font-variation-settings: "opsz" 80, "wght" 700; }
.lead { font-family: var(--serif); font-size: 1.2rem; color: var(--ink); max-width: 60ch;
  font-variation-settings: "opsz" 40, "wght" 460; }
.crumbs { font-family: var(--sans); font-size: .78rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink-soft); margin: 22px 0 6px; }
.crumbs a { color: var(--ink-soft); }
.crumbs b { color: var(--red); }

/* ---- month calendars ---- */
.months { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.month { border: 1.5px solid var(--ink); background: var(--paper); border-radius: var(--radius); }
.month h3 {
  margin: 0; padding: 11px 14px 9px; font-size: 1.5rem; text-transform: capitalize;
  border-bottom: 2px solid var(--ink); display: flex; justify-content: space-between;
  align-items: baseline; font-variation-settings: "opsz" 90, "wght" 700, "WONK" 1;
}
.month h3 a { color: var(--ink); }
.month h3 a:hover { color: var(--blue-deep); }
.month h3 .yr { font-family: var(--sans); color: var(--ink-soft); font-weight: 700; font-size: .74rem;
  letter-spacing: .1em; }
.month.current { border-color: var(--red); box-shadow: 4px 4px 0 var(--red); }
.month.current h3 { border-bottom-color: var(--red); color: var(--red); }
.month h3 .yr.now { font-family: var(--sans); color: var(--paper); background: var(--red);
  font-weight: 800; font-size: .66rem; text-transform: uppercase; letter-spacing: .08em;
  padding: 3px 9px; border-radius: 2px; }

table.cal { width: 100%; border-collapse: collapse; font-family: var(--sans); font-size: .95rem; }
table.cal th, table.cal td { text-align: center; padding: 6px 0; }
table.cal thead th { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-soft); font-weight: 700; padding: 9px 0 4px; border-bottom: 1px solid var(--line); }
table.cal .wk { color: var(--blue); font-weight: 800; font-size: .78rem;
  border-right: 1px solid var(--line); width: 2.4em; }
table.cal .wk a { color: var(--blue-deep); }
table.cal thead th.wk { color: var(--blue); }
table.cal td.day a { display: block; color: var(--ink); border-radius: 2px; padding: 3px 0; }
table.cal td.day a:hover { background: var(--ink); color: var(--paper); text-decoration: none; }
table.cal td.red a, table.cal td.sun a { color: var(--red); font-weight: 700; }
table.cal td.today a { background: var(--red); color: var(--paper); font-weight: 800; }
table.cal td.muted { color: var(--line-2); }

/* week detail cards */
.weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 0;
  border: 1.5px solid var(--ink); }
@media (max-width: 760px) { .weekdays { grid-template-columns: 1fr 1fr; } }
.dcard { padding: 12px; background: var(--paper); min-height: 112px;
  border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dcard.red { background: var(--red-soft); }
.dcard.today { background: var(--ink); color: var(--paper); }
.dcard.today .wd, .dcard.today .nm { color: var(--paper); opacity: .8; }
.dcard .wd { font-family: var(--sans); font-size: .74rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-soft); font-weight: 700; }
.dcard .dn { font-family: var(--serif); font-size: 2rem; font-weight: 800; line-height: 1;
  margin: 4px 0; font-variation-settings: "opsz" 90, "wght" 780; }
.dcard.red .dn { color: var(--red); }
.dcard.today .dn a { color: var(--paper); }
.dcard .nm { font-size: .82rem; color: var(--ink-soft); }
.dcard .hol { font-size: .82rem; color: var(--red); font-weight: 700; margin-top: 3px; }
.dcard.today .hol { color: var(--paper); }

/* data tables */
.datatable { width: 100%; border-collapse: collapse; border: 1.5px solid var(--ink); }
.datatable th, .datatable td { text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.datatable thead th { font-family: var(--sans); font-size: .72rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink-soft); border-bottom: 2px solid var(--ink); }
.datatable tbody tr:hover { background: var(--panel); }
.datatable td:first-child { font-family: var(--serif); font-variation-settings: "opsz" 30, "wght" 560; }
.datatable .rd td:nth-child(2) { color: var(--red); font-weight: 700; }
.pill { display: inline-block; font-family: var(--sans); font-size: .74rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .06em; padding: 3px 10px; border: 1.5px solid var(--blue);
  color: var(--blue-deep); border-radius: 2px; }
.pill.red { border-color: var(--red); color: var(--red); }

/* prev/next */
.pager { display: flex; justify-content: space-between; gap: 12px; margin: 24px 0; }
.pager a { border: 1.5px solid var(--ink); padding: 10px 18px; font-family: var(--serif);
  font-weight: 600; color: var(--ink); background: var(--paper); border-radius: var(--radius); }
.pager a:hover { background: var(--ink); color: var(--paper); text-decoration: none; }

/* ad slot — framed classified box */
.ad { margin: 26px auto; max-width: 970px; min-height: 100px;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--ink); border-radius: 0; color: var(--ink-soft);
  font-family: var(--sans); font-size: .72rem; letter-spacing: .3em; text-transform: uppercase;
  background: var(--paper);
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px var(--line); }
.ad.rect { min-height: 250px; }

/* search */
.searchbar { display: flex; gap: 0; margin: 18px 0; max-width: 460px; border: 1.5px solid var(--ink); }
.searchbar input { flex: 1; padding: 11px 14px; border: 0; font-size: 1rem;
  font-family: var(--serif); background: var(--paper); color: var(--ink); }
.searchbar input:focus { outline: none; }
.searchbar button { padding: 11px 20px; border: 0; border-left: 1.5px solid var(--ink);
  background: var(--red); color: var(--paper); font-family: var(--sans); font-weight: 800;
  font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; cursor: pointer; }
.searchbar button:hover { background: var(--ink); }

/* quick links */
.links { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px,1fr)); gap: 14px; margin-top: 6px; }
.links a { border: 1.5px solid var(--ink); padding: 16px; color: var(--ink); background: var(--paper);
  font-family: var(--serif); font-weight: 700; font-size: 1.15rem; border-radius: var(--radius);
  font-variation-settings: "opsz" 50, "wght" 680; transition: transform .12s ease, box-shadow .12s ease; }
.links a:hover { text-decoration: none; transform: translate(-2px,-2px); box-shadow: 4px 4px 0 var(--blue); }
.links a span { display: block; font-family: var(--sans); font-weight: 500; font-size: .84rem;
  color: var(--ink-soft); margin-top: 4px; }

.prose { font-family: var(--serif); font-variation-settings: "opsz" 24, "wght" 440; }
.prose p { max-width: 66ch; font-size: 1.1rem; }
.prose h2 { margin-top: 1.4em; }
.prose ul { max-width: 64ch; }

/* ---- footer ---- */
.site-foot { margin-top: 44px; border-top: 3px double var(--ink); background: var(--paper-2);
  color: var(--ink-soft); font-size: .92rem; }
.site-foot .wrap { padding: 32px 20px; display: flex; flex-wrap: wrap; gap: 26px; justify-content: space-between; }
.site-foot a { color: var(--ink-soft); }
.site-foot a:hover { color: var(--red); }
.site-foot .cols { display: flex; gap: 44px; flex-wrap: wrap; }
.site-foot h4 { font-family: var(--sans); color: var(--ink); font-size: .74rem; text-transform: uppercase;
  letter-spacing: .12em; margin: 0 0 8px; }
.site-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
/* hidden owner entrypoint: looks exactly like the surrounding footer text */
.site-foot .plainlink, .site-foot .plainlink:hover { color: inherit; text-decoration: none; cursor: text; }

/* ---- stats dashboard: chart + top pages ---- */
.chartlegend { display: flex; gap: 18px; margin: 6px 0 10px; font-family: var(--sans); font-size: .82rem; color: var(--ink-soft); }
.chartlegend .lg { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; }
.chartlegend .sw { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.chartwrap { border: 1.5px solid var(--ink); padding: 12px 10px 6px; background: var(--paper); }
.statchart { width: 100%; height: auto; display: block; }
.statchart g:hover rect { opacity: .82; }
.toppages .barcell { position: relative; text-align: right; min-width: 130px; }
.toppages .pbar { position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  height: 60%; background: var(--blue-soft); border-radius: 2px; z-index: 0; }
.toppages .pnum { position: relative; z-index: 1; font-family: var(--serif); font-weight: 700; }
.toppages td:first-child { font-family: ui-monospace, Menlo, monospace; font-size: .9rem; }

/* ---- homepage weather widget ---- */
.wxwidget .wxgeo { border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink);
  font-family: var(--sans); font-weight: 700; font-size: .84rem; padding: 7px 12px;
  border-radius: 3px; cursor: pointer; }
.wxwidget .wxgeo:hover { background: var(--ink); color: var(--paper); }
.wxwidget .wxpick { font-size: .84rem; color: var(--ink-soft); margin-left: 4px; }
.wxwidget .wxload { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-top: 2px; }
.wxwidget .wxload:hover { text-decoration: none; }
.wxwidget .wxbig { font-family: var(--serif); font-weight: 800; font-size: 1.7rem; line-height: 1;
  color: var(--ink); font-variation-settings: "opsz" 60, "wght" 720; }
.wxwidget .wxplace { font-size: .88rem; color: var(--ink-soft); }
.wxwidget .wxchange { display: inline-block; margin-top: 6px; border: 0; background: none; padding: 0;
  font-family: var(--sans); font-size: .74rem; color: var(--red); font-weight: 700; cursor: pointer;
  text-transform: uppercase; letter-spacing: .05em; }
.wxwidget .wxchange:hover { text-decoration: underline; }

/* ---- steder index ---- */
.stedgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 14px; }
.stedlenke { display: block; padding: 5px 0; color: var(--ink); border-bottom: 1px solid var(--line); font-size: .98rem; }
.stedlenke:hover { color: var(--blue-deep); text-decoration: none; }
.sfylke h2 { border-bottom: 2px solid var(--ink); padding-bottom: 6px; }

/* ---- weather ---- */
.wxnow { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: 6px; }
.wxemoji { font-size: clamp(3rem, 10vw, 5rem); line-height: 1; }
.wxtemp { font-family: var(--serif); font-weight: 800; font-size: clamp(3.5rem, 13vw, 6rem);
  line-height: 1; letter-spacing: -.03em; font-variation-settings: "opsz" 144, "wght" 820; }
.wxmeta { font-size: 1.05rem; color: var(--ink); line-height: 1.4; }
.hourly { display: flex; gap: 0; border: 1.5px solid var(--ink); overflow-x: auto; }
.hcol { flex: 0 0 auto; min-width: 62px; padding: 12px 6px; text-align: center;
  border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.hcol:last-child { border-right: 0; }
.hcol .ht { font-family: var(--sans); font-size: .74rem; font-weight: 700; color: var(--ink-soft); }
.hcol .he { font-size: 1.5rem; line-height: 1; }
.hcol .hn { font-family: var(--serif); font-weight: 700; font-size: 1.2rem; }
/* wind arrow: a rotated up-arrow (diagonal arrow glyphs are missing from many fonts) */
.warrow { display: inline-block; transform-origin: center; font-weight: 700; line-height: 1; }
.hcol .hwind { font-family: var(--sans); font-size: .7rem; color: var(--ink-soft); font-weight: 600; white-space: nowrap; }
.hcol .hwind small { font-size: .82em; opacity: .8; }
.hcol .hp { font-size: .68rem; color: var(--blue); font-weight: 700; }

/* ---- callout note ---- */
.note { border: 1.5px solid var(--red); border-left-width: 5px; background: var(--red-soft);
  padding: 12px 16px; margin: 18px 0; font-size: .96rem; color: var(--ink); border-radius: 2px; }

/* ---- print button + embed page ---- */
.printbtn { border: 1.5px solid var(--ink); background: var(--paper); color: var(--ink);
  font-family: var(--serif); font-weight: 700; font-size: 1rem; padding: 10px 16px;
  border-radius: var(--radius); cursor: pointer; }
.printbtn:hover { background: var(--ink); color: var(--paper); }
.embed-demo { display: flex; flex-wrap: wrap; gap: 26px; align-items: flex-start; margin-top: 12px; }
.embed-code { flex: 1; min-width: 260px; }
.embed-code pre, section.block pre { background: var(--ink); color: var(--paper); padding: 14px 16px;
  border-radius: var(--radius); overflow-x: auto; font-size: .86rem; line-height: 1.5; }
.embed-code pre code, section.block pre code { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.copybtn { margin-top: 10px; border: 1.5px solid var(--ink); background: var(--red); color: var(--paper);
  font-family: var(--sans); font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  font-size: .78rem; padding: 9px 16px; border-radius: 3px; cursor: pointer; }
.copybtn:hover { background: var(--ink); }

/* ---- print ---- */
@media print {
  .site-head, .site-foot, .ad, .noprint, .pager, .daytip, .crumbs, .yearstrip, .links { display: none !important; }
  body { background: #fff; color: #000; font-size: 12px; }
  body::after { display: none; }               /* paper grain off */
  .wrap { max-width: none; padding: 0; }
  section.block { border-top: 1px solid #000; padding: 12px 0; }
  .months { gap: 10px; }
  .month { break-inside: avoid; box-shadow: none; border-color: #000; }
  .month.current { box-shadow: none; }
  a { text-decoration: none; }   /* keep meaningful colors: red days red, week nos blue */
  h1 { font-size: 20px; }
}

/* ---- tool forms ---- */
.toolform { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end;
  border: 1.5px solid var(--ink); background: var(--paper); padding: 18px 20px; margin: 18px 0; }
.toolform label { display: flex; flex-direction: column; gap: 5px; font-family: var(--sans);
  font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ink-soft); font-weight: 700; }
.toolform input, .toolform select { font-family: var(--serif); font-size: 1.05rem;
  padding: 9px 12px; border: 1.5px solid var(--line-2); background: var(--paper); color: var(--ink);
  border-radius: 3px; min-width: 150px; }
.toolform input:focus, .toolform select:focus { outline: none; border-color: var(--blue); }
.toolform button { padding: 11px 22px; border: 0; background: var(--red); color: var(--paper);
  font-family: var(--sans); font-weight: 800; text-transform: uppercase; letter-spacing: .08em;
  font-size: .82rem; cursor: pointer; border-radius: 3px; }
.toolform button:hover { background: var(--ink); }

/* ---- live countdown boxes ---- */
.cdlive { display: flex; gap: 0; border: 1.5px solid var(--ink); width: max-content;
  max-width: 100%; margin-top: 20px; }
.cdbox { padding: 12px 22px; border-right: 1px solid var(--line); text-align: center; min-width: 80px; }
.cdbox:last-child { border-right: 0; }
.cdbox b { display: block; font-family: var(--serif); font-size: 2rem; line-height: 1;
  font-variation-settings: "opsz" 90, "wght" 780; }
.cdbox span { font-family: var(--sans); font-size: .68rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink-soft); font-weight: 700; }

/* ---- "På denne dagen" hover tooltip on calendar cells ---- */
table.cal td.day a[data-tip] { cursor: help; }
.daytip {
  position: absolute; z-index: 10000; max-width: 260px; pointer-events: none;
  background: var(--ink); color: var(--paper); border: 1.5px solid var(--ink);
  font-family: var(--sans); font-size: .85rem; line-height: 1.35;
  padding: 9px 12px; border-radius: 3px; display: none;
  box-shadow: 5px 5px 0 rgba(32,26,23,.18);
}
.daytip::after {  /* little pointer */
  content: ""; position: absolute; left: 50%; margin-left: -6px; bottom: -6px;
  border: 6px solid transparent; border-top-color: var(--ink); border-bottom: 0;
}
.daytip.below::after { bottom: auto; top: -6px; border-top: 0; border-bottom-color: var(--ink); }
.daytip b {
  display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .12em;
  color: var(--red); margin-bottom: 3px;
}
@media (prefers-color-scheme: dark) { .daytip b { color: var(--red); } }

/* ---- day facts (Fakta om dagen) ---- */
.factgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 0;
  border: 1.5px solid var(--ink); }
.factchip { padding: 13px 15px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; }
.factchip .fk { font-family: var(--sans); font-size: .7rem; text-transform: uppercase;
  letter-spacing: .11em; color: var(--ink-soft); font-weight: 700; }
.factchip .fv { font-family: var(--serif); font-size: 1.4rem; font-weight: 700; line-height: 1.15;
  margin-top: 3px; font-variation-settings: "opsz" 40, "wght" 660; }
.factchip .fsub { font-family: var(--sans); font-size: .78rem; color: var(--ink-soft); margin-top: 1px; }

/* ---- on this day (Denne dagen i historien) ---- */
.histcols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0;
  border: 1.5px solid var(--ink); }
@media (max-width: 760px) { .histcols { grid-template-columns: 1fr; } }
.histcol { padding: 16px 18px; border-right: 1px solid var(--line); }
.histcol:last-child { border-right: 0; }
@media (max-width: 760px) { .histcol { border-right: 0; border-bottom: 1px solid var(--line); } }
.histcol h3 { font-size: 1.15rem; margin: 0 0 10px; padding-bottom: 8px; border-bottom: 2px solid var(--ink);
  font-variation-settings: "opsz" 60, "wght" 700; }
.histlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.histlist li { font-size: .95rem; line-height: 1.45; padding-left: 3.4em; text-indent: -3.4em; }
.histlist .hy { display: inline-block; width: 3em; font-family: var(--serif); font-weight: 800;
  color: var(--blue); font-variation-settings: "wght" 800; text-indent: 0; }
.histcol details { margin-top: 10px; }
.histcol summary { font-family: var(--sans); font-size: .8rem; font-weight: 700; color: var(--red);
  cursor: pointer; text-transform: uppercase; letter-spacing: .05em; }
.histcol details[open] summary { margin-bottom: 9px; }
.histcol details .histlist { padding-top: 2px; }
.src { font-family: var(--sans); font-size: .82rem; color: var(--ink-soft); margin: 14px 0 0; }

:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }

/* motion: the week number is the answer — it shows instantly.
   Only the surrounding text rises subtly, and the meter fill sweeps in. */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes sweep { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hero .eyebrow { animation: rise .45s ease both; }
.hero .sub { animation: rise .5s .08s ease both; }
.hero .meter { animation: rise .5s .14s ease both; }
.hero .meter .fill { transform-origin: left; animation: sweep .7s .2s cubic-bezier(.2,.7,.2,1) both; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
