/* Site chrome (#338): the design system's fonts and tokens, plus the navbar, phone menu and footer.
   Loaded on every page (base-head-styling.html), before review.css and the page-family sheets, so the chrome does
   not depend on body.rv. Git-tracked with the rest of banksite/review/ (SPEC §6). */

/* ---------- fonts (OFL, self-hosted: no fonts.googleapis.com) ---------- */
@font-face {
  font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("fonts/schibsted-grotesk-latin.ba4038fc5cb5.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;
}
@font-face {
  font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400 900; font-display: swap;
  src: url("fonts/schibsted-grotesk-latin-ext.65233324c912.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-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("fonts/ibm-plex-mono-400-latin.79936b18df9f.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 500; font-display: swap;
  src: url("fonts/ibm-plex-mono-500-latin.b1c8a895f5fd.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("fonts/ibm-plex-mono-600-latin.5a2ce7798732.woff2") format("woff2");
}

/* the site navbar's height (.fc-nav, fixed): sticky bars, the TOC and scroll padding hang off it. On :root so the
   html:has(...) scroll-padding rules can read it too */
:root { --hdr: 56px; }

/* ---------- tokens ----------
   .rv pages get the full system; on legacy pages (no body.rv) only the chrome uses it, light only:
   the dark sets below stay scoped to .rv, since legacy content cannot follow a theme switch. */
.rv, body:not(.rv) .fc-chrome {
  --paper: #f2f0e9; --card: #fbfaf6; --sunk: #e9e6dc;
  --ink: #121418; --ink-2: #3a3f46; --muted: #5d636b;  /* ≥4.5:1 on --sunk too (#646a72 was 4.37:1) */
  --line: #d8d4c8; --line-2: #c6c1b2;
  --ctl: #878377;  /* form-control boundaries: ≥3:1 on paper and card (WCAG 1.4.11); --line-2 is decorative only */
  --accent: #1d3bff; --accent-ink: #fff; --accent-soft: #e3e7ff;
  --pos: #0c7343;  /* AA on --pos-soft (4.9:1); the prototype's #0e7a48 is 4.49:1 */ --pos-soft: #dcefe4; --neg: #b8361b; --neg-soft: #f6e1da; --warn: #9a5d00;
  /* per-bank accent strip (progress bar, verdict edge, offers); a page can override it, e.g. bunq's rainbow.
     Ink by default: cobalt is the action colour, so a bank without brand colours gets no decorative cobalt */
  --brand: var(--ink);
  --sans: "Schibsted Grotesk", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  /* behind third-party logos (#346: the one definition). Most logos are dark artwork on transparency:
     --logo-plate is transparent in light and the light paper (#f2f0e9) in dark, with --logo-plate-pad around it;
     --logo-tile stays light in both themes, for logos on ink or tiled grounds (comparisons, guide's top row). */
  --logo-plate: transparent; --logo-plate-pad: 0; --logo-tile: #fbfaf6;
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .rv {
    --paper: #0f1114; --card: #171a1f; --sunk: #1d2127;
    --ink: #eceae4; --ink-2: #c9cbcf; --muted: #9aa0a8;
    --line: #2a2f36; --line-2: #3a4048; --ctl: #6b727c; --logo-plate: #f2f0e9; --logo-plate-pad: 4px 8px;
    --accent: #8193ff; --accent-ink: #0b0e1a; --accent-soft: #1d2342;
    --pos: #4fc48a; --pos-soft: #15281f; --neg: #ef7a5f; --neg-soft: #2d1913; --warn: #e3a54a;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] .rv {
  --paper: #0f1114; --card: #171a1f; --sunk: #1d2127;
  --ink: #eceae4; --ink-2: #c9cbcf; --muted: #9aa0a8;
  --line: #2a2f36; --line-2: #3a4048; --ctl: #6b727c; --logo-plate: #f2f0e9; --logo-plate-pad: 4px 8px;
  --accent: #8193ff; --accent-ink: #0b0e1a; --accent-soft: #1d2342;
  --pos: #4fc48a; --pos-soft: #15281f; --neg: #ef7a5f; --neg-soft: #2d1913; --warn: #e3a54a;
  color-scheme: dark;
}

/* ---------- chrome base ----------
   Legacy pages still load Bootstrap 4 and the bucket CSS, which style a, ul, h2, p and button (Open Sans, blue
   links, margins). Everything inside the chrome is reset here so it renders the same on every page. */
.fc-chrome {
  font: 400 15px/1.45 var(--sans); color: var(--ink);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
/* (0,1,1) on purpose: legacy element rules (a, li, b... in Open Sans) must lose, while every component rule below
   (.fc-chrome .x) still wins. Links in lists and paragraphs carry a class (fc-l): the bucket CSS underlines
   li > a:not([class]) and p > a:not([class]) dotted, with !important on hover. */
.fc-chrome ul { list-style: none; margin: 0; padding: 0; }
.fc-chrome :is(p, h2, li) { margin: 0; }
.fc-chrome :is(a, button, p, h2, ul, li, b, span) { font-family: var(--sans); letter-spacing: inherit; }
.fc-chrome .num { font-family: var(--mono); }
.fc-chrome a { color: inherit; text-decoration: none; border: 0; }
.fc-chrome a:hover { color: var(--accent); text-decoration: none; }
.fc-chrome button { font-size: inherit; line-height: inherit; color: inherit; background: none; border: 0; margin: 0; cursor: pointer; }
.fc-chrome :focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
.fc-chrome .num { font-feature-settings: "tnum"; letter-spacing: -.01em; }
.fc-chrome img { max-width: none; overflow: visible; }  /* undo the inline reset in base-head-styling */

.fc-skip {
  position: fixed; top: 8px; left: 16px; z-index: 500; padding: 10px 16px; border-radius: 999px;
  background: var(--ink); font-weight: 600; transform: translateY(-200%);
}
.fc-chrome.fc-skip, .fc-chrome.fc-skip:hover { color: var(--paper); }
.fc-skip:focus { transform: none; }

/* own logo: the navy wordmark on light grounds, the white one in the dark theme (never recoloured) */
.fc-brand { display: flex; align-items: center; flex: none; min-height: 44px; }
.fc-brand img { display: block; width: auto; height: 38px; }
.fc-chrome .fc-logo-dk { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .rv .fc-logo-lt { display: none; }
  :root:not([data-theme="light"]) .rv .fc-logo-dk { display: block; }
}
:root[data-theme="dark"] .rv .fc-logo-lt { display: none; }
:root[data-theme="dark"] .rv .fc-logo-dk { display: block; }

/* one measure for the chrome: the page's main.container (Bootstrap widths, 1240px from 1200px, 15px padding, 20px
   on phones), so the wordmark and the footer share the content's left edge */
.fc-nav-in, .fc-foot-in, .fc-foot-base { --fc-pad: 15px; box-sizing: border-box; width: 100%; margin-inline: auto; padding-inline: var(--fc-pad); }
@media (min-width: 576px) { .fc-nav-in, .fc-foot-in, .fc-foot-base { max-width: 540px; } }
@media (min-width: 768px) { .fc-nav-in, .fc-foot-in, .fc-foot-base { max-width: 720px; } }
@media (min-width: 992px) { .fc-nav-in, .fc-foot-in, .fc-foot-base { max-width: 960px; } }
@media (min-width: 1200px) { .fc-nav-in, .fc-foot-in, .fc-foot-base { max-width: 1240px; } }
@media (max-width: 600px) { .fc-nav-in, .fc-foot-in, .fc-foot-base { --fc-pad: 20px; } }

/* ---------- navbar ----------
   Always pinned (one behaviour site-wide): a paper strip with the sticky bars' 94% wash and blur, closed by a
   hairline. The reading-progress bar (.rv-progress, review.css) rides that hairline. */
.fc-nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300; height: var(--hdr);
  background: color-mix(in srgb, var(--paper) 94%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.fc-nav-in { display: flex; align-items: center; gap: clamp(16px, 3vw, 40px); height: 100%; }
.fc-nav-main, .fc-nav-main ul, .fc-nav-main li { display: flex; height: 100%; }
.fc-nav-main ul { gap: 4px; }
.fc-nav-main li { position: relative; }
.fc-chrome .fc-nav-link {
  position: relative; display: inline-flex; align-items: center; gap: 6px; padding: 0 12px;
  font-size: 15px; font-weight: 600; line-height: 1; letter-spacing: -.005em; color: var(--ink); white-space: nowrap;
}
.fc-chrome .fc-nav-link:hover, .fc-chrome .fc-nav-link[aria-expanded="true"] { color: var(--accent); }
/* current section: the 2px cobalt line the pinned strips use, sitting on the hairline */
.fc-nav-link[aria-current]::after, .fc-nav-link[data-current]::after {
  content: ""; position: absolute; left: 12px; right: 12px; bottom: -1px; height: 2px; background: var(--accent);
}
.fc-chev { transition: transform .15s; }
.fc-nav-link[aria-expanded="true"] .fc-chev { transform: rotate(180deg); }

/* Banks panel: a card under the bar, one row per segment with its review count from the database */
.fc-panel {
  position: absolute; top: calc(100% + 8px); left: 0; width: 400px; padding: 6px;
  background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r);
}
.fc-panel[hidden] { display: none; }
.fc-chrome .fc-panel-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 12px 14px; border-radius: 10px;
}
.fc-panel-row b { font-size: 16px; font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.fc-panel-row span { grid-column: 1; font-size: 14px; color: var(--ink-2); }
.fc-panel-row .fc-count { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 12px; font-weight: 500; color: var(--muted); }
.fc-chrome .fc-panel-row:hover { background: var(--sunk); }
.fc-panel-row:hover b, .fc-panel-row[aria-current] b { color: var(--accent); }

.fc-nav-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.fc-chrome .fc-theme {
  display: inline-grid; place-items: center; width: 38px; height: 38px; padding: 0;
  border: 1px solid var(--line-2); border-radius: 999px; color: var(--ink);
}
.fc-chrome .fc-theme:hover { border-color: var(--ink); }
.fc-theme svg { transition: transform .2s; }
.fc-theme[aria-pressed="true"] svg { transform: rotate(180deg); }
/* legacy pages can't follow a theme, and have no long-read progress */
body:not(.rv) .fc-chrome .fc-theme, body:not(.rv) .fc-nav .rv-progress { display: none; }
.fc-chrome .fc-menu-btn {
  display: none; align-items: center; gap: 8px; height: 38px; padding: 0 14px 0 12px;
  border: 1px solid var(--line-2); border-radius: 999px; font-size: 14px; font-weight: 600; color: var(--ink);
}
.fc-chrome .fc-menu-btn:hover { border-color: var(--ink); }

/* ---------- phone menu ----------
   An opaque full-height paper sheet (nothing shows through) with its own top row, so the focus trap holds every
   control. Rows are 60px. */
.fc-menu {
  position: fixed; inset: 0; z-index: 400; display: flex; flex-direction: column;
  background: var(--paper); overflow-y: auto; overscroll-behavior: contain;
  animation: fc-sheet .22s cubic-bezier(.2, .7, .2, 1);
}
.fc-menu[hidden] { display: none; }
@keyframes fc-sheet { from { opacity: 0; transform: translateY(-8px); } }
.fc-menu-top {
  display: flex; align-items: center; justify-content: space-between; flex: none;
  height: var(--hdr); padding: 0 20px; border-bottom: 1px solid var(--line);
}
.fc-menu .fc-menu-btn { display: inline-flex; }
.fc-menu-body { padding: 4px 20px 48px; }
.fc-chrome .fc-menu-list { margin-top: 20px; border-top: 1px solid var(--ink); }
.fc-menu-list > li { border-bottom: 1px solid var(--line); }
.fc-menu-list a { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.fc-menu-list b, .fc-chrome .fc-menu-g { font-size: 21px; font-weight: 750; letter-spacing: -.02em; }
.fc-menu-g { display: flex; align-items: center; min-height: 60px; }
/* the two bank segments sit under Banks: indented, one step smaller, hairline-separated */
.fc-chrome .fc-menu-sub { padding: 0 0 10px 16px; }
.fc-menu-sub li + li { border-top: 1px solid var(--line); }
.fc-menu-list .fc-menu-sub a { min-height: 52px; }
.fc-menu-list .fc-menu-sub b { font-size: 17px; font-weight: 600; letter-spacing: -.01em; }
.fc-menu-list a[aria-current] b { color: var(--accent); }
.fc-menu-list .fc-count { font-size: 12px; font-weight: 500; color: var(--muted); }
.fc-menu-more { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; margin-top: 28px; }
.fc-chrome .fc-menu-more a { display: flex; align-items: center; min-height: 44px; font-size: 16px; color: var(--ink-2); }
.fc-chrome .fc-menu-more a:hover { color: var(--accent); }
html.fc-menu-open { overflow: hidden; }

@media (max-width: 760px) {
  .fc-nav-main { display: none; }
  .fc-nav .fc-menu-btn { display: inline-flex; }
}

/* ---------- footer ----------
   Opens on an ink rule; the lead says what the site is and how it makes money before any links. Link columns are
   ruled lists (the contacts/about pattern); "Latest guides" comes from the database. */
.fc-foot { border-top: 1px solid var(--ink); background: var(--paper); }
.fc-foot-in {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 96px);
  padding-block: 48px 56px;
}
.fc-foot .fc-brand img { height: 42px; }
.fc-foot-claim {
  max-width: 24ch; text-wrap: balance;
  font-size: clamp(22px, 2.4vw, 28px); font-weight: 750; line-height: 1.12; letter-spacing: -.025em;
}
.fc-chrome .fc-foot-claim { margin: 22px 0 14px; }
.fc-foot-disc { max-width: 52ch; font-size: 14px; line-height: 1.55; color: var(--muted); }
.fc-chrome .fc-foot-disc a { color: var(--ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; white-space: nowrap; }
.fc-chrome .fc-foot-disc a:hover { color: var(--accent); }
.fc-foot-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; align-items: start; }
.fc-chrome .fc-foot-h { margin: 0 0 10px; font-size: 14px; font-weight: 600; line-height: 1.3; letter-spacing: -.005em; color: var(--muted); }
.fc-foot-cols ul { border-top: 1px solid var(--line); }
.fc-foot-cols li { border-bottom: 1px solid var(--line); }
.fc-chrome .fc-foot-cols :is(a, .fc-foot-cookies) {
  display: block; width: 100%; padding: 10px 0; text-align: left; font-size: 15px; line-height: 1.35; color: var(--ink);
}
.fc-chrome .fc-foot-cols :is(a, .fc-foot-cookies):hover { color: var(--accent); }
.fc-chrome .fc-foot-guides a:not(.fc-foot-all) { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.fc-chrome .fc-foot-all { font-weight: 600; }
.fc-foot-base {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px;
  padding-block: 18px 28px; /* the rule spans the text column only, not the side padding */
  background: linear-gradient(var(--line), var(--line)) no-repeat center top / calc(100% - 2 * var(--fc-pad)) 1px;
  font-size: 13px; color: var(--muted);
}
.fc-social { display: flex; gap: 6px; }
.fc-chrome .fc-social a {
  display: grid; place-items: center; width: 32px; height: 32px; border: 1px solid var(--line-2); border-radius: 50%; color: var(--ink-2);
}
.fc-chrome .fc-social a:hover { border-color: var(--ink); color: var(--ink); }
.fc-social svg { display: block; }

@media (max-width: 980px) {
  .fc-foot-in { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .fc-foot-in { padding-block: 40px 44px; }
  .fc-foot-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 20px; }
  .fc-foot-guides { grid-column: 1 / -1; order: -1; }
}

/* touch: 44px hit areas */
@media (pointer: coarse) {
  .fc-chrome .fc-theme, .fc-chrome .fc-social a { width: 44px; height: 44px; }
  .fc-chrome .fc-menu-btn { height: 44px; }
  .fc-chrome .fc-foot-cols :is(a, .fc-foot-cookies) { padding-block: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .fc-menu { animation: none; }
  .fc-chev, .fc-theme svg { transition: none; }
}
