/* SV.LV archive — single stylesheet, no frameworks, no web fonts.
   Look: a quiet trade-news site (warm paper, heavy sans headlines, square red section labels),
   with the old sv.lv navy kept for the logo. */
:root {
  --paper: #f5f1ec;
  --ink: #141210;
  --muted: #6e6a65;
  --line: rgba(20, 18, 16, .12);
  --card: #ebe6df;
  --red: #cc2200;
  --navy: #0a1a44;
  --link: #141210;
  --max: 1160px;
  --text: 720px;
  --sans: "Inter", "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --head: "Inter", "Segoe UI Variable Display", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --paper: #15140f; --ink: #f2eee8; --muted: #a29d96; --line: rgba(242, 238, 232, .14); --card: #201e19;
    --red: #ff5a3c; --navy: #a9c1f2; --link: #f2eee8; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 16px/1.6 var(--sans); }
a { color: var(--link); text-decoration-color: var(--line); text-underline-offset: 3px; }
a:hover { color: var(--red); text-decoration-color: currentColor; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--head); line-height: 1.05; }
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 900; letter-spacing: -.035em; margin: .15em 0 .35em; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.bar { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* Header: logo row, then a sticky row of sections */
.site-head > .bar { padding-top: 18px; padding-bottom: 14px; }
.logo { display: inline-flex; align-items: baseline; gap: 14px; flex-wrap: wrap; text-decoration: none; color: var(--ink); }
.logo b { font: 900 2rem/1 var(--head); letter-spacing: -.04em; color: var(--navy); }
.logo b::before { content: ""; display: inline-block; width: .52em; height: .52em; margin-right: .18em; background: var(--red); }
.logo span { font-size: .9rem; color: var(--muted); }
.logo:hover { color: var(--ink); }
.sections { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 94%, transparent);
  backdrop-filter: blur(6px); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.sections .bar { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.sections a { flex: 0 0 auto; padding: 11px 12px; font-size: .88rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.sections a:first-child { padding-left: 0; }
.sections a:hover { color: var(--ink); }
.sections a[aria-current] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--red); }
.sections .search-link { margin-left: auto; }
.sections .search-link::before { content: "⌕ "; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 28px 20px 64px; }

/* Labels, datelines, section headings */
.dateline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 0 0 .5em; font-size: .78rem; color: var(--muted); }
.dateline .chips { order: -1; }
.dateline > a { color: var(--muted); text-decoration: none; }
.chips { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.chip { display: inline-block; padding: 4px 9px; font: 900 .64rem/1.2 var(--sans); letter-spacing: .18em; text-transform: uppercase;
  text-decoration: none; color: #fff; background: var(--red); }
.chip:hover { color: #fff; background: var(--ink); }
.chip-photo, .chip-ser { background: var(--ink); color: var(--paper); }
.chip-photo:hover, .chip-ser:hover { background: var(--red); color: #fff; }
.chip-sub { background: transparent; color: var(--muted); box-shadow: inset 0 0 0 1px var(--line); }
.chip-sub:hover { background: transparent; color: var(--red); box-shadow: inset 0 0 0 1px currentColor; }
.rule { display: flex; align-items: baseline; gap: 10px; margin: 2.2em 0 .6em; padding-bottom: 10px; border-bottom: 1px solid var(--line);
  font: 600 .75rem var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.rule small { font-weight: 400; letter-spacing: 0; text-transform: none; }
.rule small a { color: var(--muted); }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 22px; font-size: .78rem; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--red); }
.crumbs b { color: var(--ink); font-weight: 600; }

/* Entry lists */
.entries { display: grid; }
.entry { display: grid; grid-template-columns: 200px 1fr; gap: 22px; padding: 20px 0; border-bottom: 1px solid var(--line); }
.entry.no-thumb { grid-template-columns: 1fr; }
.entry .thumb img { display: block; width: 200px; aspect-ratio: 3 / 2; object-fit: cover; background: var(--card); }
.entry h3 { margin: 0 0 .3em; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.entry h3 a { color: var(--ink); text-decoration: none; }
.entry h3 a:hover { color: var(--red); }
.lead-text { margin: 0; color: var(--muted); font-size: .95rem; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.counts { margin: .4em 0 0; font-size: .75rem; color: var(--muted); }
.counts:empty { display: none; }
.entries.compact .entry { padding: 12px 0; }
.entries.compact h3 { font-size: 1.05rem; font-weight: 700; }
.entries.compact .lead-text { display: none; }
.entry mark { background: #ffd970; color: #141210; padding: 0 1px; }
.entry .hit { margin: .3em 0 0; font-size: .88rem; color: var(--muted); }

/* Front page */
.front { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 48px; }
.front-side .rule:first-child, .front-side section:first-child .rule { margin-top: 0; }
.lead-story .lead-photo img { display: block; width: 100%; max-height: 540px; object-fit: cover; background: var(--card); }
.lead-story .dateline { margin-top: 16px; }
.lead-title { margin: .1em 0 .3em; font-size: clamp(1.9rem, 3.8vw, 3rem); font-weight: 900; letter-spacing: -.035em; }
.lead-title a { color: var(--ink); text-decoration: none; }
.lead-title a:hover { color: var(--red); }
.lead-story .lead-text { font-size: 1.12rem; -webkit-line-clamp: 4; }
.onthisday { margin-bottom: 36px; }
.onthisday .rule { margin-top: 0; }
.otd-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px 28px; }
.otd-item { display: grid; grid-template-columns: 72px 1fr; gap: 12px; align-items: start; text-decoration: none; color: var(--ink); padding: 4px 0; }
.otd-item img, .otd-item .ph { width: 72px; height: 54px; object-fit: cover; background: var(--card); }
.otd-item small { display: block; font-size: .72rem; color: var(--muted); }
.otd-item b { display: block; font: 700 .98rem/1.25 var(--head); letter-spacing: -.01em; }
.otd-item:hover b { color: var(--red); }
.strip { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.strip img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; background: var(--card); }
.side-list { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.side-list li { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid var(--line); }
.side-list a { text-decoration: none; font-weight: 600; }
.side-list small { color: var(--muted); }
.years-inline { display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; }
.stats-box { margin-top: 24px; padding: 14px 16px; background: var(--card); font-size: .85rem; }
.more-link { font-size: .9rem; font-weight: 600; }

/* Section / year pages */
.section-head { margin-bottom: 8px; }
.kicker { display: inline-block; margin: 0 0 6px; padding: 4px 9px; font: 900 .64rem/1.2 var(--sans); letter-spacing: .18em;
  text-transform: uppercase; color: #fff; background: var(--red); }
.standfirst { font-size: 1.15rem; line-height: 1.6; color: var(--muted); max-width: 44em; }
.jump { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .88rem; font-weight: 600; }
.jump a { text-decoration: none; color: var(--muted); }
.jump a:hover { color: var(--red); }
.years-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.years-table th, .years-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: right; }
.years-table th:first-child { text-align: left; font: 800 1.15rem var(--head); }
.years-table thead th { font-size: .7rem; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.bar-col { width: 30%; text-align: left !important; }
.meter { display: inline-block; height: 8px; background: var(--red); vertical-align: middle; }
.tag-cloud { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.tag-cloud a { font-weight: 600; text-decoration: none; }
.tag-cloud small { color: var(--muted); }

/* Story pages (gallery or article): one readable column */
.story { max-width: var(--text); margin: 0 auto; }
.meta { margin: 0; font-size: .85rem; color: var(--muted); }
.byline { font-weight: 600; color: var(--ink); }
.story .standfirst { margin-top: .6em; color: var(--muted); }
.body { overflow-wrap: anywhere; font-size: 1.05rem; line-height: 1.75; }
.body img { display: block; margin: 0 0 .4em; }
.body .bildearparakstu { float: right; max-width: 45%; margin: .3em 0 1em 1.4em; font: 700 .85rem/1.35 var(--head); }
.gallery { margin: 2em 0; }
/* Photos keep their own size; the caption sits under the photo, as wide as the photo, left-aligned. */
.gallery figure { width: fit-content; max-width: 100%; margin: 0 auto 36px; scroll-margin-top: 60px; }
.gallery img { display: block; max-height: 88vh; width: auto; background: var(--card); }
.gallery figcaption { width: 0; min-width: 100%; margin-top: 7px; font: 700 .875rem/1.35 var(--head); color: var(--ink); }
.gallery figure:target figcaption { color: var(--red); }
.keywords { font-size: .82rem; color: var(--muted); }
.keywords a { color: var(--muted); }
.notice { margin: 1.4em 0 0; padding: 12px 16px; border-left: 3px solid var(--red); background: var(--card); font-size: .92rem; }
.ai-note { margin: 1em 0 0; font-size: .82rem; font-style: italic; color: var(--muted); }
.small-note { font-size: .82rem; color: var(--muted); }

.comments { max-width: var(--text); margin: 3em auto 0; }
.comments h2 { font: 600 .75rem var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
  padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.comments h2 span { font-weight: 400; }
.comment { padding: 12px 0; border-bottom: 1px solid var(--line); }
.comment p { margin: .25em 0; overflow-wrap: anywhere; }
.comment .who { font-size: .85rem; }
.comment .who time { color: var(--muted); margin-left: 6px; }

.pager { max-width: var(--text); margin: 3.5em auto 0; display: flex; justify-content: space-between; gap: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.pager a { max-width: 48%; text-decoration: none; color: var(--ink); font: 800 1rem/1.3 var(--head); letter-spacing: -.01em; }
.pager a:hover { color: var(--red); }
.pager small { display: block; margin-bottom: 4px; font: 600 .7rem var(--sans); color: var(--muted); letter-spacing: .14em; text-transform: uppercase; }
.pager .next { text-align: right; margin-left: auto; }

/* Search */
.search-page { display: flex; flex-wrap: wrap; gap: 8px; margin: 1.2em 0; }
.search-page input { flex: 1 1 280px; padding: 12px 14px; font: 1.05rem var(--sans); border: 1px solid var(--ink); background: #fff; color: #141210; border-radius: 0; }
.search-page select { padding: 10px; font: .92rem var(--sans); border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 0; }
.search-page button, .more button { padding: 12px 22px; border: 0; background: var(--ink); color: var(--paper); font: 700 .92rem var(--sans); cursor: pointer; border-radius: 0; }
.search-page button:hover, .more button:hover { background: var(--red); color: #fff; }
.search-status { font-size: .92rem; color: var(--muted); }
.more { text-align: center; }

.footer { margin-top: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; line-height: 1.6; }
.footer .bar { padding-top: 24px; padding-bottom: 48px; }
.footer p { margin: 0 0 .8em; max-width: 62em; }
.footer a { color: var(--muted); }

@media (max-width: 900px) {
  .front { grid-template-columns: 1fr; gap: 8px; }
  .strip { grid-template-columns: repeat(4, 1fr); }
}
@media (max-width: 640px) {
  .bar, .wrap { padding-left: 16px; padding-right: 16px; }
  .logo b { font-size: 1.7rem; }
  .logo span { font-size: .8rem; }
  .entry { grid-template-columns: 104px 1fr; gap: 14px; padding: 16px 0; }
  .entry .thumb img { width: 104px; }
  .entry h3 { font-size: 1.1rem; }
  .lead-text { -webkit-line-clamp: 2; font-size: .9rem; }
  .body .bildearparakstu { float: none; max-width: 100%; margin: 0 0 1em; }
  .bar-col { display: none; }
  .years-table th, .years-table td { padding: 8px 4px; }
  .strip { grid-template-columns: repeat(3, 1fr); }
  .sections .search-link { margin-left: 0; }
}
