/* UI Kit local styles — page-level layout on top of colors_and_type.css
 * Default theme = dark (handelsavisen.no's default).
 */

body { color: var(--fg-1); }

/* Clip horizontally-overflowing children (absolutely-positioned mega dropdowns
 * extend past the viewport via left/right:-14px) so the document never widens
 * past 100vw — no stray horizontal scrollbar / right-edge clipping. Matches the
 * company-pages pattern; vertical scrolling is unaffected. */
html { overflow-x: hidden; }

/* Masthead nav dropdown (Macro / Geopolitics menus) — hidden until hover/focus */
.nav-has-menu:hover .nav-dropdown,
.nav-has-menu:focus-within .nav-dropdown { display: flex !important; }
.nav-dropdown a:hover { background: var(--bg-elev-2); color: var(--fg-1) !important; }

/* ---------- Mega menu — bold entry + one-line description, two columns ---------- */
.nav-dropdown.nav-mega {
  position: absolute; top: 100%; left: -14px; z-index: 120;
  display: none; grid-template-columns: 1fr 1fr; gap: 0;
  width: 560px; padding: 10px;
  background: var(--bg-elev-1); border: 1px solid var(--rule-strong);
  box-shadow: 0 18px 44px rgba(0,0,0,0.5);
}
.nav-has-menu:hover .nav-dropdown.nav-mega,
.nav-has-menu:focus-within .nav-dropdown.nav-mega { display: grid !important; }
.nav-mega.nav-mega-right { left: auto; right: -14px; }
.nav-mega.nav-mega-wide { grid-template-columns: 1fr 1fr 1fr; width: 760px; }
.nav-mega .nm-col { display: flex; flex-direction: column; min-width: 0; }
.nav-mega .nm-g { font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--brand-accent); padding: 10px 14px 4px; }
.nav-mega .nm-i { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 12px 14px; text-decoration: none; border-bottom: none !important; text-align: left; }
.nav-mega .nm-i:hover { background: var(--bg-elev-2); }
.nav-mega .nm-t { font-family: var(--font-sans); font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; color: var(--fg-1); line-height: 1.25; }
.nav-mega .nm-d { font-family: var(--font-sans); font-size: 11.5px; line-height: 1.4; color: var(--fg-3); white-space: normal; }
.nav-mega .nm-i:hover .nm-d { color: var(--fg-2); }

/* ---------- Nav zones — Newspaper ‖ Platform ‖ Data ---------- */
.nav-zone-rule { width: 1px; height: 18px; background: var(--rule-strong); flex-shrink: 0; margin: 0 6px; align-self: center; }
.nav-zone-label {
  font-family: var(--font-mono); font-size: 9px; font-weight: 700; letter-spacing: 0.13em;
  text-transform: uppercase; color: var(--fg-3); align-self: center; flex-shrink: 0;
  padding: 3px 0 !important; text-decoration: none;
}
a.nav-zone-label:hover, a.nav-zone-label.active { color: var(--brand-accent); background: transparent !important; }
.brand-product {
  font-family: var(--font-sans); font-size: 13px; font-weight: 500; letter-spacing: -0.01em;
  color: var(--fg-3); margin-left: 7px; padding-left: 9px; border-left: 1px solid var(--rule-strong);
  align-self: center;
}
.nav-mobile-zone {
  display: block; font-family: var(--font-mono); font-size: 9px; font-weight: 700;
  letter-spacing: 0.13em; text-transform: uppercase; color: var(--fg-3);
  padding: 14px 0 6px; border-bottom: 1px solid var(--rule); margin-bottom: 4px;
}

/* ---------- Live-tick price flash (design-system 600ms pulse) ---------- */
@keyframes ha-flash-up { 0% { background: color-mix(in oklab, var(--data-up) 26%, transparent); } 100% { background: transparent; } }
@keyframes ha-flash-dn { 0% { background: color-mix(in oklab, var(--data-down) 26%, transparent); } 100% { background: transparent; } }
.ha-flash-up { animation: ha-flash-up 600ms ease-out; }
.ha-flash-dn { animation: ha-flash-dn 600ms ease-out; }
@media (prefers-reduced-motion: reduce) { .ha-flash-up, .ha-flash-dn { animation: none; } }

/* ---------- Skeleton loading states ---------- */
.ha-skel { position: relative; overflow: hidden; background: var(--bg-elev-2); border-radius: 2px; color: transparent !important; }
.ha-skel::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, color-mix(in oklab, var(--fg-1) 7%, transparent), transparent); animation: ha-shimmer 1.2s infinite; }
@keyframes ha-shimmer { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@media (prefers-reduced-motion: reduce) { .ha-skel::after { animation: none; } }

/* nav overflow chevron — only ever shown at tablet widths via the media query below */
.nav-more { display: none; }

/* skip link — visually hidden until keyboard focus */
.skip-link { position: absolute; left: -9999px; top: 0; z-index: 999; background: var(--brand-accent); color: #0A0A0A; padding: 10px 16px; font-family: var(--font-sans); font-size: 13px; font-weight: 700; text-decoration: none; }
.skip-link:focus { left: 0; }

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Masthead ---------- */
.masthead {
  background: var(--bg-page);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 0;
  z-index: 30;
}
.masthead-inner {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 56px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand .h-mark {
  width: 24px; height: 24px;
  background: var(--fg-1);
  -webkit-mask: url(../../assets/logo-h-icon.png) center/contain no-repeat;
  mask: url(../../assets/logo-h-icon.png) center/contain no-repeat;
  display: block;
}
.brand-name {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--fg-1);
}
.nav {
  display: flex;
  gap: 22px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--fg-3);
}
.nav a {
  color: var(--fg-3);
  padding: 4px 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  position: relative;
  white-space: nowrap;
  letter-spacing: -0.005em;
}
.nav a:hover { color: var(--fg-1); text-decoration: none; }
.nav a.active { color: var(--fg-1); font-weight: 600; }
.nav a.active::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -19px;
  height: 2px;
  background: var(--fg-1);
}
.masthead-right {
  margin-left: auto;
  display: flex;
  gap: 10px;
  align-items: center;
}
.kbd-search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--fg-3);
  padding: 6px 10px;
  border: 1px solid var(--rule);
  border-radius: 4px;
  cursor: pointer;
  background: var(--bg-elev-1);
  transition: all 120ms var(--ease-std);
}
.kbd-search:hover { border-color: var(--rule-strong); color: var(--fg-1); }
.kbd-search .kbd {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--fg-3);
  border: 1px solid var(--rule);
  padding: 1px 5px;
  border-radius: 2px;
  background: var(--bg-page);
}
.btn-cta {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  background: var(--fg-1);
  color: var(--bg-page);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 120ms var(--ease-std);
  letter-spacing: -0.005em;
}
.btn-cta:hover { background: var(--color-gray-800); }

/* ---------- Ticker Tape ---------- */
.tape {
  background: var(--bg-page);
  color: var(--fg-1);
  overflow: hidden;
  border-bottom: 1px solid var(--rule);
}
.tape-track {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: crawl 60s linear infinite;
  will-change: transform;
}
.tape-track:hover { animation-play-state: paused; }
.tape-item {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 22px;
  border-right: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 500;
}
.tape-item .sym {
  font-family: var(--font-sans);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--fg-1);
}
.tape-item .up { color: var(--data-up); }
.tape-item .dn { color: var(--data-down); }
@keyframes crawl {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* Live status dot — used by [animation:"pulse ..."] across all pages.
   Subtle opacity breathe; honors reduced-motion via the global block. */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.4; }
}

/* ---------- Indicative ribbon ---------- */
/* WCAG: small status text needs brighter tones than the chart/fill colors.
   --color-*-a11y are per-theme text-safe variants (≥4.5:1 on their tinted bgs). */
:root { --color-red-a11y: #FCA5A5; --color-amber-a11y: #FCD34D; --color-green-a11y: #30D158; }
html.theme-light { --color-red-a11y: #B91C1C; --color-amber-a11y: #92600A; --color-green-a11y: #15803D; }
.ribbon {
  background: var(--color-amber-light);
  color: var(--color-amber-a11y);
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 0;
  text-align: center;
  border-bottom: 1px solid var(--rule);
}

/* ---------- Eyebrow / Meta / Pill ---------- */
.eyebrow {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.eyebrow.red    { color: var(--color-red); }
.eyebrow.amber  { color: var(--color-amber); }
.eyebrow.bright { color: var(--fg-1); }

.meta {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--fg-3);
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}
.meta .dot::before { content: "·"; padding: 0 2px; }

.pill {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-elev-2);
  color: var(--fg-2);
  line-height: 1.4;
}
.pill.live  { background: var(--color-red-light); color: var(--color-red-a11y); }
.pill.amber { background: var(--color-amber-light); color: var(--color-amber-a11y); }
.pill.info  { background: var(--color-blue-light); color: var(--color-blue); }
.pill.up    { background: var(--color-green-light); color: var(--color-green); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.pill.down  { background: var(--color-red-light); color: var(--color-red-a11y); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.pill .dot  { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }

/* ---------- Section head ---------- */
.section-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 2px solid var(--fg-1);
  padding-bottom: 10px;
  margin-top: 56px;
  margin-bottom: 20px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-feature-settings: var(--feat-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.0152em;
  margin: 0;
  color: var(--fg-1);
}
.section-head a {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  color: var(--fg-3);
  letter-spacing: -0.005em;
}
.section-head a:hover { color: var(--fg-1); }

/* ---------- Lead story ---------- */
.lead {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 24px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--rule);
}.lead-image {
  width: 100%;
  aspect-ratio: 21/9;
  background:
    radial-gradient(900px 320px at 30% 80%, rgba(245, 158, 11, 0.12), transparent 60%),
    linear-gradient(135deg, var(--bg-elev-2) 0%, var(--bg-page) 70%, var(--bg-elev-2) 100%);
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 16px;
  color: var(--fg-4);
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--rule);
}
.lead-image::after {
  content: "";
  position: absolute; inset: 0;
  background: repeating-linear-gradient(45deg, rgba(255,255,255,0.015) 0 2px, transparent 2px 14px);
  pointer-events: none;
}
.lead-meta-tag { position: relative; z-index: 2; }
.lead-body {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 56px;
  align-items: start;
}
.lead-headline {
  font-family: var(--font-display);
  font-feature-settings: var(--feat-display);
  font-size: 60px;
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.024em;
  margin: 0;
  color: var(--fg-1);
  text-wrap: pretty;
}
.lead-headline a { color: inherit; }
.lead-headline a:hover { color: var(--fg-2); text-decoration: none; }
.lead-side {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  color: var(--fg-2);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 6px;
}

/* ---------- Secondary stories ---------- */
.secondary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 36px;
  padding: 32px 0;
  border-bottom: 1px solid var(--rule);
}
.story {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.story-image {
  width: 100%;
  aspect-ratio: 16/10;
  background: linear-gradient(135deg, var(--bg-elev-2), var(--bg-page));
  border: 1px solid var(--rule);
  position: relative;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  color: var(--fg-4);
  font-family: var(--font-sans);
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 600;
}
.story-image.warm  { background: linear-gradient(135deg, #2b2014, var(--bg-page)); }
.story-image.cool  { background: linear-gradient(135deg, #142436, var(--bg-page)); }
.story-image.green { background: linear-gradient(135deg, #143626, var(--bg-page)); }
.story h3 {
  font-family: var(--font-display);
  font-feature-settings: var(--feat-display);
  font-size: 26px;
  line-height: 1.10;
  font-weight: 800;
  letter-spacing: -0.013em;
  margin: 0;
  color: var(--fg-1);
  text-wrap: pretty;
}
.story h3 a { color: inherit; }
.story h3 a:hover { color: var(--fg-2); text-decoration: none; }
.story p {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg-2);
  margin: 0;
  max-width: 50ch;
}

/* ---------- Ranked list ---------- */
.ranked {
  list-style: none;
  padding: 0;
  margin: 0;
}
.ranked li {
  display: grid;
  grid-template-columns: 44px 1fr 200px;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
.ranked li:first-child { border-top: 1px solid var(--rule); }
.ranked-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 14px;
  color: var(--fg-3);
  padding-top: 4px;
}
.ranked-body { display: flex; flex-direction: column; gap: 8px; }
.ranked-body .eyebrow { font-size: 10px; }
.ranked-body h4 {
  font-family: var(--font-display);
  font-feature-settings: var(--feat-display);
  font-size: 20px;
  line-height: 1.20;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--fg-1);
}
.ranked-body h4 a { color: inherit; }
.ranked-body h4 a:hover { color: var(--fg-2); text-decoration: none; }
.ranked-body p {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-2);
  margin: 0;
  max-width: 65ch;
}
.ranked-meta {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--fg-3);
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: right;
}

/* ---------- Sagas grid ---------- */
.sagas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0;
  border-top: 2px solid var(--fg-1);
}
.saga {
  padding: 22px 24px 24px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-page);
  transition: background 200ms var(--ease-std);
  color: inherit;
  text-decoration: none;
}
.saga:hover { background: var(--bg-elev-1); text-decoration: none; }
.saga:nth-child(4n) { border-right: none; }
.saga-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.saga h4 {
  font-family: var(--font-display);
  font-feature-settings: var(--feat-display);
  font-size: 22px;
  line-height: 1.15;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--fg-1);
}
.saga p {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.5;
  color: var(--fg-2);
  margin: 0;
}
.entity-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.entity-tag {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 500;
  padding: 3px 7px;
  background: var(--bg-elev-2);
  color: var(--fg-2);
  border-radius: 4px;
}

/* ---------- Today's Brief ---------- */
.brief {
  background: var(--bg-elev-1);
  border: 1px solid var(--rule);
  padding: 26px 28px;
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.brief-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 14px;
}
.brief-head h2 {
  font-family: var(--font-display);
  font-feature-settings: var(--feat-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.013em;
  margin: 0;
  color: var(--fg-1);
}
.brief-head .date {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--fg-3);
}
.brief ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.brief li {
  display: flex;
  gap: 12px;
  align-items: baseline;
}
.brief li::before {
  content: "▍";
  color: var(--brand-accent);
  font-size: 14px;
  line-height: 1;
}
.brief li a {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.4;
  color: var(--fg-1);
  font-weight: 500;
  letter-spacing: -0.010em;
}
.brief li a:hover { color: var(--fg-2); text-decoration: none; }
.brief li .tag {
  font-family: var(--font-sans);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin-right: 4px;
}
.brief-footer {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--fg-3);
  border-top: 1px solid var(--rule);
  padding-top: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 600;
}

/* ---------- Three-column sidebar ---------- */
.three-col {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  border-top: 2px solid var(--fg-1);
  margin-top: 56px;
}
.three-col-col {
  padding: 22px 24px 28px;
  border-right: 1px solid var(--rule);
}
.three-col-col:last-child { border-right: none; }
.three-col-col h3 {
  font-family: var(--font-display);
  font-feature-settings: var(--feat-display);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.013em;
  margin: 0 0 4px;
  color: var(--fg-1);
}
.three-col-col .sub {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--fg-3);
  letter-spacing: 0.10em;
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.three-col-col .sub .live-dot {
  width: 6px; height: 6px; border-radius: 999px; background: var(--color-red);
  animation: pulse 1.4s ease-in-out infinite;
}
.quote-row {
  display: grid;
  grid-template-columns: 1fr 80px 70px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  gap: 8px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--fg-1);
}
.quote-row .qname {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.3;
  font-weight: 500;
  color: var(--fg-1);
}
.quote-row .qsym {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--brand-accent);
  display: block;
  margin-top: 1px;
}
.quote-row .qprice { text-align: right; font-weight: 600; }
.quote-row .qdelta { text-align: right; font-weight: 600; font-size: 12px; }
.quote-row.up   .qdelta { color: var(--data-up); }
.quote-row.dn   .qdelta { color: var(--data-down); }
.quote-row.flat .qdelta { color: var(--data-flat); }

.most-read { list-style: none; padding: 0; margin: 0; }
.most-read li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
  align-items: baseline;
}
.most-read li:last-child { border-bottom: none; }
.most-read li .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  color: var(--fg-3);
}
.most-read li a {
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.35;
  font-weight: 500;
  color: var(--fg-1);
  letter-spacing: -0.010em;
}
.most-read li a:hover { color: var(--fg-2); text-decoration: none; }

/* ---------- Footer ---------- */
footer.foot {
  background: var(--bg-page);
  border-top: 2px solid var(--fg-1);
  margin-top: 72px;
  padding: 44px 0 32px;
  font-family: var(--font-sans);
}
.foot-cols {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--rule);
}
.foot-col h5 {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--fg-3);
  margin: 0 0 14px;
}
.foot-col a {
  display: block;
  font-size: 14px;
  color: var(--fg-1);
  padding: 5px 0;
  letter-spacing: -0.010em;
}
.foot-col a:hover { color: var(--fg-2); text-decoration: none; }
.foot-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 24px;
  font-size: 12px;
  color: var(--fg-3);
  gap: 16px;
}

/* ---------- Modal / scrim ---------- */
.scrim {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  animation: scrim-in 200ms var(--ease-std);
}
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--bg-elev-1);
  width: 440px;
  max-width: calc(100vw - 32px);
  padding: 28px;
  border: 1px solid var(--rule);
  border-radius: 8px;
  box-shadow: var(--shadow-popover);
  animation: modal-in 240ms var(--ease-out);
  display: flex; flex-direction: column; gap: 14px;
  position: relative;
  color: var(--fg-1);
}
@keyframes modal-in { from { transform: translateY(8px); opacity: 0 } to { transform: none; opacity: 1 } }
.modal h3 {
  font-family: var(--font-display);
  font-feature-settings: var(--feat-display);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.013em;
  margin: 0;
  color: var(--fg-1);
}
.modal p {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  color: var(--fg-2);
  margin: 0;
}
.modal .close {
  position: absolute;
  top: 12px; right: 14px;
  background: none; border: none; cursor: pointer;
  color: var(--fg-3); font-size: 22px; line-height: 1;
  font-family: var(--font-sans);
}
.modal .close:hover { color: var(--fg-1); }
.modal input {
  font-family: var(--font-sans);
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--rule-strong);
  background: var(--bg-page);
  border-radius: 4px;
  color: var(--fg-1);
  outline: none;
  width: 100%;
}
.modal input:focus { border-color: var(--fg-1); }
.modal label {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.modal .legal {
  font-size: 11px;
  color: var(--fg-3);
  line-height: 1.5;
}
.modal .ok {
  background: var(--fg-1); color: var(--bg-page);
  border: none; padding: 10px 14px;
  font-family: var(--font-sans);
  font-size: 13px; font-weight: 600;
  border-radius: 4px; cursor: pointer;
  letter-spacing: -0.005em;
}
.modal .ok:hover { background: var(--color-gray-800); }
.modal .success {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-sans); font-size: 14px;
  color: var(--data-up); font-weight: 500;
}

/* ============================================================
 * Markets — responsive reflow + reduced motion (Phase 3)
 * Inline grid styles are overridden with !important at breakpoints.
 * ============================================================ */
@media (max-width: 1100px) {
  .mk-grid-6 { grid-template-columns: repeat(3, 1fr) !important; }
  .mk-grid-4 { grid-template-columns: repeat(2, 1fr) !important; }
  .mk-grid-3 { grid-template-columns: 1fr 1fr !important; }
}
@media (max-width: 1000px) {
  .mk-main-grid { grid-template-columns: 1fr !important; }
  .mk-main-grid > .mk-main-col { border-right: none !important; }
  .mk-main-grid > .mk-rail { border-top: 1px solid var(--rule) !important; }
}
@media (max-width: 820px) {
  .mk-cross-today { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 760px) {
  .platform-strip { grid-template-columns: 1fr !important; }
  .platform-strip > a { border-right: none !important; border-bottom: 1px solid var(--rule) !important; }
  .mk-grid-6 { grid-template-columns: repeat(2, 1fr) !important; }
  .mk-grid-4 { grid-template-columns: 1fr 1fr !important; }
  .mk-grid-3 { grid-template-columns: 1fr !important; }
}
@media (max-width: 560px) {
  .mk-grid-6, .mk-grid-4, .mk-cross-today { grid-template-columns: 1fr !important; }
}

@media (prefers-reduced-motion: reduce) {
  .ticker { animation: none !important; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
 * Responsive — news & editorial pages (Q6: news responsive,
 * terminal desktop-only). News reaches phones; the dense
 * terminal/workspace declares a min-width instead.
 * ============================================================ */
/* Masthead: nav becomes a horizontally-scrollable section rail */
@media (max-width: 1080px) {
  .masthead-inner { gap: 14px; }
  .nav { gap: 16px; min-width: 0; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; -ms-overflow-style: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
  /* overflow affordance: fade the clipped edge(s) + chevron hint */
  .nav[data-fade-r] { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 36px), transparent); }
  .nav[data-fade-l] { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px); mask-image: linear-gradient(to right, transparent, #000 36px); }
  .nav[data-fade-l][data-fade-r] { -webkit-mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); mask-image: linear-gradient(to right, transparent, #000 36px, #000 calc(100% - 36px), transparent); }
  .nav-more { display: none; align-items: center; justify-content: center; flex-shrink: 0; width: 22px; height: 28px; margin-left: -8px; background: transparent; border: none; color: var(--fg-3); font-size: 15px; line-height: 1; cursor: pointer; padding: 0; }
  .nav[data-fade-r] + .nav-more { display: inline-flex; }
  .nav-more:hover { color: var(--fg-1); }
}
@media (max-width: 760px) {
  .kbd-search .kbd { display: none; }
  .kbd-search span:first-child { display: none; }
  .nav { display: none !important; }
  .nav-hamburger { display: inline-flex !important; }
  .lead-body { grid-template-columns: 1fr !important; gap: 18px !important; }
  .secondary-row { grid-template-columns: 1fr !important; gap: 28px !important; }
  .ranked li { grid-template-columns: 30px 1fr !important; }
  .ranked-meta { display: none !important; }
  .three-col { grid-template-columns: 1fr !important; }
  .foot-cols { grid-template-columns: 1fr 1fr !important; gap: 24px !important; }
  .quote-row { grid-template-columns: 1fr 64px 58px; }
}
@media (max-width: 520px) {
  .brand-name { font-size: 16px; }
  .foot-cols { grid-template-columns: 1fr !important; }
  .lead-headline { font-size: 34px !important; }
}

/* Mobile hamburger nav (shown only below 760px) */
.nav-hamburger {
  display: none;
  align-items: center; justify-content: center;
  width: 38px; height: 34px; flex-shrink: 0;
  background: transparent; border: 1px solid var(--rule-strong); border-radius: 4px;
  color: var(--fg-1); font-size: 16px; line-height: 1; cursor: pointer;
}
.nav-mobile { display: flex; flex-direction: column; border-top: 1px solid var(--rule); background: var(--bg-elev-1); }
.nav-mobile a {
  padding: 13px 20px; border-bottom: 1px solid var(--rule);
  color: var(--fg-1); text-decoration: none;
  font-family: var(--font-sans); font-size: 15px; font-weight: 600; letter-spacing: -0.01em;
}
.nav-mobile a.active { color: var(--brand-accent); }

/* Desktop-only notice for the trading terminal / workspace.
 * Hidden on desktop; shown as a banner below the min-width. */
.desktop-only-note { display: none; }
@media (max-width: 1000px) {
  .desktop-only-note {
    display: flex; align-items: center; gap: 10px;
    margin: 0; padding: 11px 18px;
    background: color-mix(in oklab, var(--brand-accent) 12%, var(--bg-elev-1));
    border-bottom: 1px solid var(--rule-strong);
    font-family: var(--font-sans); font-size: 12.5px; color: var(--fg-2); line-height: 1.4;
  }
  .desktop-only-note strong { color: var(--fg-1); font-weight: 700; }
  .desktop-only-note .dot { width: 7px; height: 7px; border-radius: 999px; background: var(--brand-accent); flex-shrink: 0; }
}

/* ============================================================
 * Accessibility — visible keyboard focus (audit #4)
 * Mouse users see nothing; keyboard users get a clear ring.
 * ============================================================ */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible,
[role="button"]:focus-visible,
[role="tab"]:focus-visible {
  outline: 2px solid var(--brand-accent, #F59E0B);
  outline-offset: 2px;
  border-radius: 2px;
}
/* Don't double-paint focus on mouse click in supporting browsers */
:focus:not(:focus-visible) { outline: none; }

/* Screen-reader-only utility (audit #4 · W4) */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

/* Skip-to-content link — visible only on keyboard focus (W4) */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 9999;
  transform: translateY(-200%);
  background: var(--fg-1); color: var(--bg-page);
  font-family: var(--font-sans); font-size: 13px; font-weight: 600;
  padding: 10px 16px; border-radius: 4px; text-decoration: none;
  transition: transform 160ms ease;
}
.skip-link:focus { transform: translateY(0); outline: 2px solid var(--brand-accent); outline-offset: 2px; }
#main-content:focus { outline: none; }

/* ---------- Note dock — interactive capture affordance ---------- */
body.ha-note-active [data-metric] {
  cursor: copy;
  box-shadow: inset 0 0 0 1px color-mix(in oklab, var(--brand-accent) 45%, transparent);
  border-radius: 2px;
  transition: background 120ms var(--ease-std);
}
body.ha-note-active [data-metric]:hover {
  background: color-mix(in oklab, var(--brand-accent) 16%, transparent);
}
body.ha-note-active::selection,
body.ha-note-active *::selection { background: color-mix(in oklab, var(--brand-accent) 35%, transparent); }

/* ---------- M7: dense-table mobile reflow ---------- */
@media (max-width: 640px) {
  .reflow-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .reflow-table tr { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 11px 12px; border-bottom: 1px solid var(--rule); }
  .reflow-table td { display: flex; justify-content: space-between; align-items: baseline; padding: 2px 0 !important; text-align: left !important; border: none !important; gap: 12px; }
  .reflow-table td::before { content: attr(data-label); font-family: var(--font-sans); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg-3); flex-shrink: 0; }
  .reflow-table td:first-child { font-weight: 700; margin-bottom: 4px; }
  .reflow-table td:first-child::before { content: ""; }
}

