/* KAM News Desk
   One family (Schibsted Grotesk, built for a news publisher), a cool
   reading sheet, and one bold device: the 30-day coverage strip. */

@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(fonts/schibsted-grotesk-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Schibsted Grotesk";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url(fonts/schibsted-grotesk-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ink: #152033;
  --ink-2: #445166;
  --ink-3: #667186;
  --canvas: #e9eef4;
  --sheet: #ffffff;
  --rule: #d5dde7;
  --rule-2: #e8edf3;
  --hover: #dfe6ef;
  --accent: #1b46c2;
  --accent-ink: #ffffff;
  --accent-soft: #e6ecfb;
  --retail: #c2336a;
  --enterprise: #2556d4;
  --aidc: #0a7f66;
  --channel: #8243c4;
  --extra-1: #a35c00;
  --extra-2: #4f6479;
  --seg: var(--accent);
  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --top: 60px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e5eaf1;
    --ink-2: #b2bccb;
    --ink-3: #8b96a8;
    --canvas: #0c131c;
    --sheet: #131c28;
    --rule: #263143;
    --rule-2: #1c2635;
    --hover: #1b2534;
    --accent: #8aa8ff;
    --accent-ink: #0c131c;
    --accent-soft: #1d2a44;
    --retail: #f27ba8;
    --enterprise: #82a5ff;
    --aidc: #4fcbaa;
    --channel: #c69ef3;
    --extra-1: #f0a85a;
    --extra-2: #9fb1c4;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--canvas);
  font-feature-settings: "tnum" 0;
}

button, input { font: inherit; color: inherit; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: absolute;
  left: 12px; top: -40px;
  background: var(--accent); color: var(--accent-ink);
  padding: 8px 12px; border-radius: 6px; z-index: 50;
}
.skip:focus { top: 10px; }

.seg-c0 { --seg: var(--retail); }
.seg-c1 { --seg: var(--enterprise); }
.seg-c2 { --seg: var(--aidc); }
.seg-c3 { --seg: var(--channel); }
.seg-c4 { --seg: var(--extra-1); }
.seg-c5 { --seg: var(--extra-2); }

/* ---------------------------------------------------------------- top bar */

.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--top);
  display: flex; align-items: center; gap: 20px;
  padding: 0 20px;
  background: var(--canvas);
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
  font-weight: 700; font-size: 17px; letter-spacing: -0.01em;
  white-space: nowrap;
  width: 260px; flex: none;
}
.brand img { border-radius: 6px; }

.search { flex: 1; max-width: 520px; }
.search input {
  width: 100%; height: 38px;
  padding: 0 14px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  background: var(--sheet);
}
.search input::placeholder { color: var(--ink-3); }

.top-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.updated { margin: 0 8px 0 0; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.updated.is-busy { color: var(--accent); }

.btn-quiet {
  height: 34px; padding: 0 12px;
  border: 0; border-radius: 7px;
  background: transparent; color: var(--ink-2);
  font-size: 14px; font-weight: 500; cursor: pointer;
}
.btn-quiet:hover { background: var(--hover); color: var(--ink); }
.btn-quiet:disabled { opacity: .55; cursor: default; }

.nav-toggle {
  display: none;
  height: 36px; padding: 0 12px;
  border: 1px solid var(--rule); border-radius: 8px;
  background: var(--sheet); font-weight: 600; font-size: 14px; cursor: pointer;
}

/* ---------------------------------------------------------------- layout */

.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: calc(100vh - var(--top));
}

.sidebar {
  position: sticky; top: var(--top);
  height: calc(100vh - var(--top));
  overflow-y: auto;
  padding: 18px 12px 40px;
  scrollbar-width: thin;
}

.sheet {
  background: var(--sheet);
  border-left: 1px solid var(--rule);
  padding: 32px clamp(20px, 4vw, 56px) 80px;
  min-width: 0;
}
.sheet > * { max-width: 860px; }

/* ---------------------------------------------------------------- sidebar */

.nav-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 60px 30px;
  align-items: center; gap: 10px;
  width: 100%;
  padding: 6px 10px;
  border-radius: 7px;
  text-decoration: none;
  color: var(--ink-2);
  font-size: 14px;
}
.nav-row:hover { background: var(--hover); color: var(--ink); }
.nav-row[aria-current="page"] {
  background: var(--sheet);
  color: var(--ink);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--seg);
}
.nav-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-row .count {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 13px; color: var(--ink-3);
}
.nav-row .count.is-hot { color: var(--ink); font-weight: 600; }
.nav-row svg { width: 60px; height: 14px; display: block; }

.nav-all { font-weight: 600; color: var(--ink); margin-bottom: 14px; }

.nav-seg { margin-bottom: 18px; }
.nav-seg-head {
  font-weight: 700; color: var(--ink); font-size: 14px;
  padding-top: 8px; padding-bottom: 8px;
}
.nav-seg-head .name { display: flex; align-items: center; gap: 8px; }
.nav-seg-head .name::before {
  content: ""; width: 9px; height: 9px; border-radius: 2px;
  background: var(--seg); flex: none;
}
.nav-seg ul { list-style: none; margin: 0; padding: 0 0 0 17px; }

/* strips: bars inside the selected window take the segment colour */
.strip rect { fill: var(--rule); }
.strip rect.in { fill: var(--seg); }
.strip rect.empty { fill: var(--rule-2); }
.nav-row:not([aria-current="page"]) .strip rect.in { opacity: .8; }

/* ---------------------------------------------------------------- scope header */

.scope { margin-bottom: 22px; }
.crumb { margin: 0 0 4px; font-size: 14px; color: var(--ink-3); min-height: 21px; }
.crumb a { color: var(--seg); font-weight: 600; text-decoration: none; }
.crumb a:hover { text-decoration: underline; }

.scope h1 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  font-weight: 700;
}
.summary { margin: 8px 0 0; font-size: 16px; color: var(--ink-2); max-width: 64ch; }
.summary strong { color: var(--ink); font-weight: 600; }

.pulse { margin: 22px 0 0; }
.pulse svg { width: 100%; height: 64px; display: block; }
.pulse figcaption {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 6px; font-size: 12.5px; color: var(--ink-3);
}
.pulse figcaption #pulseNote { color: var(--ink-2); text-align: center; }
.pulse rect { shape-rendering: crispEdges; }

.tracked { margin: 14px 0 0; font-size: 13px; color: var(--ink-3); }
.tracked code { font-family: inherit; color: var(--ink-2); }

.notice {
  margin: 14px 0 0; padding: 10px 14px;
  border-radius: 8px;
  background: var(--accent-soft); color: var(--ink);
  font-size: 14px;
}

/* ---------------------------------------------------------------- controls */

.controls {
  position: sticky; top: var(--top); z-index: 10;
  background: var(--sheet);
  padding: 12px 0;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center;
}

.windows {
  display: inline-flex;
  padding: 3px;
  background: var(--canvas);
  border-radius: 9px;
}
.windows button {
  border: 0; background: transparent;
  height: 32px; padding: 0 13px;
  border-radius: 7px;
  font-size: 14px; font-weight: 500; color: var(--ink-2);
  cursor: pointer; white-space: nowrap;
}
.windows button:hover { color: var(--ink); }
.windows button[aria-pressed="true"] {
  background: var(--sheet); color: var(--ink); font-weight: 600;
  box-shadow: 0 1px 2px rgba(21, 32, 51, .12), 0 0 0 1px var(--rule);
}

.topics { display: flex; flex-wrap: wrap; gap: 6px; }
.topics button {
  height: 30px; padding: 0 11px;
  border: 1px solid var(--rule); border-radius: 15px;
  background: var(--sheet);
  font-size: 13px; color: var(--ink-2); cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.topics button:hover { border-color: var(--ink-3); color: var(--ink); }
.topics button[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--sheet); }
.topics button .n { margin-left: 5px; opacity: .7; }
.topics button:disabled { opacity: .45; cursor: default; }

/* ---------------------------------------------------------------- movers */

.movers { margin: 18px 0 8px; }
.movers h2 { margin: 0 0 10px; font-size: 15px; font-weight: 600; }
.movers ol {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 2px 16px;
}
.movers a {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto;
  column-gap: 10px;
  padding: 8px 10px; margin: 0 -10px;
  border-radius: 7px; text-decoration: none;
}
.movers a:hover { background: var(--canvas); }
.movers .name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.movers .n { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; text-align: right; }
.movers .seg-name { font-size: 12.5px; color: var(--seg); }
.movers svg { width: 60px; height: 14px; align-self: center; grid-row: 2; grid-column: 2; }

/* ---------------------------------------------------------------- feed */

.day { margin-top: 10px; }
.day-head {
  position: sticky; top: calc(var(--top) + var(--controls-h, 58px)); z-index: 5;
  margin: 0;
  padding: 14px 0 8px;
  background: var(--sheet);
  font-size: 14px; font-weight: 700;
  display: flex; align-items: baseline; gap: 10px;
}
.day-head .n { font-weight: 400; color: var(--ink-3); font-size: 13px; font-variant-numeric: tabular-nums; }

.story {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0 15px;
  border-top: 1px solid var(--rule-2);
}
.story .when {
  font-size: 13px; color: var(--ink-3);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}
.story h3 {
  margin: 0;
  font-size: 17px; line-height: 1.38; font-weight: 600;
  letter-spacing: -0.005em;
  max-width: 70ch;
}
.story h3 a { text-decoration: none; }
.story h3 a:hover { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.story h3 a:visited { color: var(--ink-2); }
.story .new {
  display: inline-block;
  margin-right: 8px; padding: 1px 7px;
  border-radius: 4px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 11.5px; font-weight: 600; vertical-align: 2px;
}

.meta {
  margin: 6px 0 0;
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px;
  font-size: 13px; color: var(--ink-3);
}
.meta .source { color: var(--ink-2); font-weight: 500; }
.meta .acct {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-2); text-decoration: none; font-weight: 500;
}
.meta .acct::before { content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--seg); }
.meta .acct:hover { color: var(--seg); }
.meta .tag {
  padding: 0 7px; border-radius: 4px;
  background: var(--canvas); color: var(--ink-2);
  font-size: 12px; line-height: 20px;
}

.more { margin: 24px 0 0; }
.btn-line {
  height: 38px; padding: 0 16px;
  border: 1px solid var(--rule); border-radius: 8px;
  background: var(--sheet); font-weight: 600; font-size: 14px; cursor: pointer;
}
.btn-line:hover { border-color: var(--ink-3); }

.empty {
  margin: 40px 0; padding: 0;
  max-width: 52ch;
}
.empty h2 { margin: 0 0 6px; font-size: 18px; }
.empty p { margin: 0 0 14px; color: var(--ink-2); }

/* ---------------------------------------------------------------- login */

.login-page {
  min-height: 100vh;
  display: grid; place-items: center;
  padding: 24px;
}
.login {
  width: 100%; max-width: 400px;
  background: var(--sheet);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 32px 32px 28px;
}
.login-mark svg { width: 120px; height: 40px; display: block; margin-bottom: 22px; }
.bar-retail { fill: var(--retail); }
.bar-enterprise { fill: var(--enterprise); }
.bar-aidc { fill: var(--aidc); }
.bar-channel { fill: var(--channel); }
.login h1 { margin: 0 0 24px; font-size: 28px; letter-spacing: -0.02em; line-height: 1.15; }
.login label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.login input {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1px solid var(--rule); border-radius: 9px;
  background: var(--sheet); font-size: 17px; letter-spacing: .04em;
}
.login input[aria-invalid="true"] { border-color: var(--retail); }
.login-error { margin: 8px 0 0; color: var(--retail); font-size: 14px; }
.btn-primary {
  margin-top: 16px; width: 100%; height: 46px;
  border: 0; border-radius: 9px;
  background: var(--accent); color: var(--accent-ink);
  font-weight: 600; font-size: 15px; cursor: pointer;
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-primary:disabled { opacity: .7; cursor: default; }

/* ---------------------------------------------------------------- small screens */

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .nav-toggle { display: inline-block; }
  .brand { width: auto; }
  .brand span { display: none; }
  .updated { display: none; }

  .sidebar {
    position: fixed; z-index: 40;
    top: 0; left: 0; bottom: 0;
    height: 100%; width: min(320px, 86vw);
    background: var(--canvas);
    border-right: 1px solid var(--rule);
    transform: translateX(-102%);
    transition: transform .22s ease;
    padding-top: 20px;
  }
  .sidebar.open { transform: none; }
  .scrim {
    position: fixed; inset: 0; z-index: 35;
    background: rgba(12, 19, 28, .45);
  }
  .sheet { border-left: 0; padding-top: 24px; }
}

@media (max-width: 600px) {
  .topbar { gap: 10px; padding: 0 12px; }
  .brand { display: none; }
  .movers ol { grid-template-columns: 1fr 1fr; }
  .movers li:nth-child(n+5) { display: none; }
  .top-actions .btn-quiet { padding: 0 8px; }
  .story { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .story .when { padding: 0; }
  .story h3 { font-size: 16px; }
  .windows { width: 100%; }
  .windows button { flex: 1; padding: 0 6px; }
  .controls { position: static; }
  .day-head { top: var(--top); }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar { transition: none; }
}
