/* Restkollen. Nordic: paper, ink, hairlines, one job per page.
   No frameworks, no webfonts, no tracking. */

:root {
  --paper: #fafaf7;
  --surface: #fafaf7;
  --ink: #16181a;
  --muted: #70757a;
  --faint: #9aa0a5;
  --hairline: #e6e4df;
  --accent: #16181a;          /* actions are ink, not color */
  --new: #9d2f1c;
  --back: #23663a;
  --changed: #8a6116;
  --warn-bg: #f6efdc;
  --max: 42rem;
}

* { box-sizing: border-box; margin: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  font-size: 1.0625rem;
  line-height: 1.6;
  font-feature-settings: "tnum";
}

html[data-lang="sv"] .en { display: none; }
html[data-lang="en"] .sv { display: none; }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }

a { color: var(--ink); text-underline-offset: 2px; }
a:hover { opacity: 0.7; }

/* ---------- header ---------- */
.site-header { padding: 1.4rem 0 0; }
.site-header .wrap {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.brand { text-decoration: none; }
.brand strong {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}
.brand .dot { color: var(--muted); }
.tagline { display: none; }
.lang-toggle {
  border: 0;
  background: none;
  padding: 0.2rem 0;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  cursor: pointer;
}
.lang-toggle:hover { color: var(--ink); }

/* ---------- stale-data banner ---------- */
.stale-banner {
  display: none;
  background: var(--warn-bg);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  margin-top: 1rem;
  padding: 0.6rem 0;
  font-size: 0.9rem;
}
.stale-banner.show { display: block; }

/* ---------- structure ---------- */
main { padding: 2.75rem 0 4rem; }

.today-date {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.4rem;
}
h1 {
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 2.25rem;
}
h2 {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 3rem 0 0.9rem;
}

/* ---------- home: today's changes ---------- */
.change-group {
  border-top: 1px solid var(--hairline);
  padding: 1.1rem 0 1.3rem;
}
.change-group > header {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
}
.change-count {
  font-size: 2.4rem;
  font-weight: 300;
  line-height: 1;
  min-width: 2.4rem;
  font-variant-numeric: tabular-nums;
}
.change-group.g-new .change-count { color: var(--new); }
.change-group.g-back .change-count { color: var(--back); }
.change-group.g-changed .change-count { color: var(--changed); }
.change-title { font-weight: 600; font-size: 1rem; }
.change-list { list-style: none; padding: 0; margin-top: 0.4rem; }
.change-list li {
  padding: 0.65rem 0;
  border-top: 1px solid var(--hairline);
  font-size: 0.95rem;
}
.change-list li:first-child { border-top: 0; }
.change-list .p-name { font-weight: 600; }
.change-list .p-meta { color: var(--muted); font-size: 0.85rem; }
.change-empty { color: var(--faint); font-size: 0.9rem; margin-top: 0.3rem; }

/* ---------- badges ---------- */
.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0 0.45rem;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  color: var(--muted);
  vertical-align: 0.1em;
}
.badge.b-upcoming { color: var(--changed); border-color: var(--changed); }
.badge.b-cessation { color: var(--muted); }

/* ---------- follow / RSS ---------- */
.follow {
  border-top: 1px solid var(--hairline);
  padding: 1.5rem 0;
  margin-top: 0.5rem;
}
.btn-rss {
  display: inline-block;
  background: var(--ink);
  color: var(--paper);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.65rem 1.2rem;
  border-radius: 4px;
}
.btn-rss:hover { opacity: 0.85; }
.btn-copy {
  border: 1px solid var(--hairline);
  background: none;
  border-radius: 4px;
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  cursor: pointer;
  color: var(--ink);
  margin-left: 0.4rem;
}
.btn-copy:hover { border-color: var(--ink); }
.follow .explainer {
  margin-top: 0.7rem;
  font-size: 0.875rem;
  color: var(--muted);
  max-width: 34rem;
}

/* ---------- search ---------- */
.search-box {
  width: 100%;
  padding: 0.7rem 0;
  font: inherit;
  font-size: 1.05rem;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  background: none;
  color: var(--ink);
}
.search-box::placeholder { color: var(--faint); }
.search-box:focus { outline: none; border-bottom-width: 2px; }
#search-results { margin-top: 0.8rem; }
#search-results .hint { color: var(--faint); font-size: 0.875rem; }

/* ---------- category index ---------- */
.cat-grid { list-style: none; padding: 0; }
.cat-card { border-top: 1px solid var(--hairline); }
.cat-card a.cat-link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  text-decoration: none;
  font-weight: 600;
}
.cat-card a.cat-link:hover { opacity: 0.7; }
.cat-card .cat-count {
  font-weight: 400;
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- category page ---------- */
.cat-desc { color: var(--muted); margin-bottom: 0.5rem; max-width: 36rem; }
.count-line {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1rem;
}

.shortage-list { list-style: none; padding: 0; margin-top: 0.5rem; }
.shortage-item { border-top: 1px solid var(--hairline); }
.shortage-item summary {
  list-style: none;
  cursor: pointer;
  padding: 0.8rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.1rem 1rem;
  align-items: baseline;
  justify-content: space-between;
}
.shortage-item summary::-webkit-details-marker { display: none; }
.shortage-item summary:hover .s-name { opacity: 0.7; }
.s-name { font-weight: 600; flex: 1 1 100%; }
.s-sub { color: var(--muted); font-size: 0.85rem; }
.s-back {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.s-back.missing { color: var(--faint); font-weight: 400; }
.s-detail {
  padding: 0 0 1rem;
  font-size: 0.9rem;
}
.s-detail dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.7rem;
}
.s-detail dd { color: var(--ink); }
.pkg { padding: 0.3rem 0; border-top: 1px dashed var(--hairline); }
.pkg:first-child { border-top: 0; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--hairline);
  margin-top: 3rem;
  padding: 1.75rem 0 3rem;
  font-size: 0.85rem;
  color: var(--muted);
}
.site-footer p { margin: 0.6rem 0; }
.site-footer a { color: var(--muted); }
.verified { color: var(--ink); }

.skip-link { position: absolute; left: -999px; }
.skip-link:focus {
  left: 0.5rem; top: 0.5rem;
  background: var(--paper);
  padding: 0.5rem;
  z-index: 10;
}
