/* ==========================================================================
   TopElectricSUV — Homepage redesign, "Modern Automotive Editorial"
   design-01/styles.css

   Single DOM, single stylesheet. Theme switching is done purely through the
   custom properties below ([data-theme="dark"]), never by duplicating
   components. No frameworks, no icon fonts; one web font (Plus Jakarta Sans).

   GeneratePress / GenerateBlocks mapping notes are inline as comments
   (GP = GeneratePress customizer setting, GB = GenerateBlocks block).
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Light theme (default) */
  --bg:        #ffffff;   /* page background */
  --bg-2:      #f5f7f9;   /* secondary background: bands, image placeholders */
  --surface:   #ffffff;   /* card background */
  --text:      #111827;   /* primary text */
  --muted:     #5b6470;   /* secondary text: dates, excerpts, bylines */
  --border:    #e2e6ea;   /* hairlines */
  --accent:    #0d47a1;   /* existing TopElectricSUV link blue */
  --accent-hover: #1e73be;/* existing GP accent blue */
  --accent-tint:  #e8f0fb;
  --ok:        #0f6a3a;   /* "We were there" / "We drove it" badges */
  --ok-tint:   #e3f6ea;
  --warn:      #a8203a;   /* "Exclusive rendering" badge */
  --warn-tint: #fde8ec;
  --share-bg:  #f7941d;   /* share prompt box (client PDF: contrasting orange) */
  --share-text:#1c2126;

  /* Header + footer "frame" — the current site uses a dark graphite nav and the
     only brand asset is a white wordmark, so the frame stays dark in light mode. */
  --frame:       #1c2126;
  --frame-2:     #262c33;
  --frame-text:  #ffffff;
  --frame-muted: #aab4c0;
  --frame-border:#333b44;

  /* Typography — Plus Jakarta Sans (Google Fonts, loaded in <head>), with a
     metric-matched local fallback so the swap does not shift layout. */
  --font-sans: "Plus Jakarta Sans", "Plus Jakarta Sans Fallback", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;

  /* Spacing scale */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px; --s-5: 24px;
  --s-6: 32px; --s-7: 48px; --s-8: 64px; --s-9: 96px;

  --radius: 4px;
  --container: 1280px;
  --gutter: 24px;
  --header-h: 60px;

  --shadow-sm: 0 1px 2px rgba(17, 24, 39, 0.06);
  --shadow-md: 0 8px 24px rgba(17, 24, 39, 0.12);
}

[data-theme="dark"] {
  --bg:        #0d1117;
  --bg-2:      #151b23;
  --surface:   #18212b;
  --text:      #f5f7fa;
  --muted:     #aab4c0;
  --border:    #2a3440;
  --accent:    #6ea8ff;   /* brand blue, lifted for AA contrast on dark */
  --accent-hover: #93c0ff;
  --accent-tint:  #16243a;
  --ok:        #6fd39a;
  --ok-tint:   #12301f;
  --warn:      #ff8fa3;
  --warn-tint: #3a1620;
  --share-bg:  #f7941d;
  --share-text:#1c2126;

  --frame:       #0a0e13;
  --frame-2:     #151b23;
  --frame-text:  #f5f7fa;
  --frame-muted: #aab4c0;
  --frame-border:#2a3440;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
}

/* No-JS fallback: honour the OS preference when the bootstrap script cannot run.
   (With JS, the <html data-theme> attribute is always set before first paint.) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #0d1117; --bg-2: #151b23; --surface: #18212b;
    --text: #f5f7fa; --muted: #aab4c0; --border: #2a3440;
    --accent: #6ea8ff; --accent-hover: #93c0ff; --accent-tint: #16243a;
    --frame: #0a0e13; --frame-2: #151b23; --frame-text: #f5f7fa;
    --frame-muted: #aab4c0; --frame-border: #2a3440;
  }
  :root:not([data-theme="light"]):not([data-theme="dark"]) .who__logo img { filter: none; }
}

/* Fallback face sized to Plus Jakarta Sans metrics (approximate, Arial-based):
   text set in the fallback occupies the same space, so the web-font swap is
   effectively CLS-free. */
@font-face {
  font-family: "Plus Jakarta Sans Fallback";
  src: local("Arial"), local("Helvetica Neue"), local("Roboto");
  size-adjust: 105%;
  ascent-override: 100%;
  descent-override: 28%;
  line-gap-override: 0%;
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 16px;
  color-scheme: light;
}
[data-theme="dark"] { color-scheme: dark; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; }
time { color: var(--muted); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  padding: 10px 14px; background: var(--accent); color: #fff; border-radius: var(--radius);
  font-weight: 600;
}
.skip-link:focus { top: 12px; color: #fff; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Reserved-ratio media boxes: every image slot has a fixed aspect ratio so the
   layout never shifts while images load (CLS). Maps to GB Image "aspect ratio". */
.ratio-16-9, .ratio-16-10, .ratio-4-3, .ratio-3-2 {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--bg-2);
  border-radius: var(--radius);
}
.ratio-16-9  { aspect-ratio: 16 / 9; }
.ratio-16-10 { aspect-ratio: 16 / 10; }
.ratio-4-3   { aspect-ratio: 4 / 3; }
.ratio-3-2   { aspect-ratio: 3 / 2; }
.ratio-16-9 img, .ratio-16-10 img, .ratio-4-3 img, .ratio-3-2 img {
  width: 100%; height: 100%; object-fit: cover;
}

/* Only functional transitions, and only where they are cheap (color/opacity). */
a, button, .icon-btn { transition: color .15s ease, background-color .15s ease, border-color .15s ease; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* --------------------------------------------------------------------------
   3. Shared editorial primitives
   -------------------------------------------------------------------------- */

/* Category eyebrow — maps to GB Headline (post terms) */
.cat {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  line-height: 1.2;
}
.cat:hover { color: var(--accent-hover); }
.cat--label { color: var(--muted); }

/* Meta row — maps to GB Headline (post date / author) */
.meta {
  display: flex; flex-wrap: wrap; gap: 0 var(--s-2);
  font-size: 0.8125rem; color: var(--muted); line-height: 1.4;
}
.meta__by::after { content: "\00b7"; margin-left: var(--s-2); }

/* "View all →" link */
.more-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.875rem; font-weight: 600; color: var(--accent);
  white-space: nowrap;
}
.more-link:hover { color: var(--accent-hover); }
.more-link svg { flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 40px; padding: 0 16px; border-radius: var(--radius);
  font-size: 0.9375rem; font-weight: 600; line-height: 1;
}
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-hover); color: #fff; }

/* Section header: title + rule + link — maps to GB Container (flex row) + Headline */
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4);
  padding-bottom: var(--s-3);
  margin-bottom: var(--s-5);
  border-bottom: 2px solid var(--text);
}
.section-title {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
}
.section-foot { margin-top: var(--s-5); text-align: right; }

/* Card (image top) — maps to Query Loop > GB Container + Image + Headline */
.card { display: flex; flex-direction: column; min-width: 0; }
.card__media { margin-bottom: var(--s-3); }
.card__body { display: flex; flex-direction: column; gap: var(--s-2); }
.card__title {
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}
.card__title a:hover { color: var(--accent); }
.card__excerpt {
  font-size: 0.9375rem; line-height: 1.5; color: var(--muted);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.card--lg .card__title { font-size: 1.375rem; line-height: 1.25; }
.card--lg .card__excerpt { -webkit-line-clamp: 3; font-size: 1rem; }

/* Horizontal list item (thumbnail left) — maps to Query Loop with a 2-col GB Grid */
.list--divided .li { padding: var(--s-4) 0; border-top: 1px solid var(--border); }
.list--divided .li:first-child { padding-top: 0; border-top: 0; }
.list--divided .li:last-child { padding-bottom: 0; }
.list--compact .li { padding: var(--s-3) 0; }
.li { display: flex; gap: var(--s-4); align-items: flex-start; }
.li__media { flex: 0 0 120px; width: 120px; }
.li__body { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.li__title { font-size: 0.9375rem; font-weight: 600; line-height: 1.35; }
.li time { font-size: 0.8125rem; }

/* Responsive grids — maps to GB Grid */
.grid { display: grid; gap: var(--s-6) var(--s-5); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* --------------------------------------------------------------------------
   4. Header  (GP: Site Header, Primary Navigation, Sticky navigation)
   -------------------------------------------------------------------------- */
/* Not sticky: anchor ad units load at the top of the viewport and must not be
   covered. GP's native Sticky Navigation ("hide when scrolling down", reveal on
   scroll up) is kept as-is in the customizer; nothing custom here. */
.site-header {
  position: relative; z-index: 50;
  background: var(--frame);
  color: var(--frame-text);
  border-bottom: 1px solid var(--frame-border);
}
.header__inner {
  display: flex; align-items: center; gap: var(--s-5);
  height: var(--header-h);
}
.brand { display: flex; align-items: center; flex: none; }
.brand img { width: auto; height: 50px; }

/* Primary navigation */
.nav { flex: 1 1 auto; min-width: 0; }
.nav__list { display: flex; align-items: center; gap: var(--s-1); }
.nav__list > li { position: relative; }
.nav__list > li > a,
.nav__more-btn {
  display: inline-flex; align-items: center; gap: 4px;
  height: 36px; padding: 0 12px;
  font-size: 0.9375rem; font-weight: 500;
  color: var(--frame-text);
  border-radius: var(--radius);
  white-space: nowrap;
}
.nav__list > li > a:hover,
.nav__more-btn:hover,
.nav__more-btn[aria-expanded="true"] { background: var(--frame-2); color: var(--frame-text); }

/* "More" dropdown — a single-level list, not a mega menu */
.nav__sub {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
  min-width: 220px; padding: 6px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 6px;
  box-shadow: var(--shadow-md);
  display: none;
}
.nav__more.is-open .nav__sub { display: block; }
.nav__sub a { display: block; padding: 9px 12px; border-radius: var(--radius); font-size: 0.9375rem; font-weight: 500; }
.nav__sub a:hover { background: var(--bg-2); color: var(--accent); }

/* Icon buttons: search, theme, hamburger */
.header__actions { display: flex; align-items: center; gap: 2px; margin-left: auto; flex: none; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius);
  color: var(--frame-text);
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { background: var(--frame-2); color: var(--frame-text); }
.icon-btn svg { display: block; }

/* Theme toggle shows the icon of the theme you would switch TO */
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }

.nav-toggle { display: none; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-menu  { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

/* Search bar drops below the header when opened */
.search-bar { border-top: 1px solid var(--frame-border); background: var(--frame); }
.search-form { display: flex; gap: var(--s-2); padding-block: var(--s-3); }
.search-form input,
.footer__search input {
  flex: 1 1 auto; min-width: 0; height: 40px; padding: 0 14px;
  border: 1px solid var(--frame-border); border-radius: var(--radius);
  background: var(--frame-2); color: var(--frame-text);
}
.search-form input::placeholder, .footer__search input::placeholder { color: var(--frame-muted); }
.search-form input:focus, .footer__search input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }

/* --------------------------------------------------------------------------
   5. Layout shell
   -------------------------------------------------------------------------- */
.site-main { padding-block: var(--s-6) var(--s-8); }

/* Main + sidebar — maps to GP "Right sidebar" layout (content 1fr / sidebar 300px)
   or a 2-column GB Grid. */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: var(--s-8) var(--s-7);
  align-items: start;
}
.main-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--s-7);
  row-gap: var(--s-8);
  min-width: 0;
}
.main-col > .section { grid-column: 1 / -1; min-width: 0; }
.main-col > .section--phevs   { grid-column: 1 / 2; }
.main-col > .section--reviews { grid-column: 2 / 3; }

/* --------------------------------------------------------------------------
   6. Lead story card + badges + boxed cards  (client-approved PDF layout)
   -------------------------------------------------------------------------- */
/* Badges: driven by existing tags/categories ("We were there", "Exclusive
   rendering", "We drove it", category). Maps to GB Headline (post terms). */
.badges { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 8px; border-radius: 3px;
  font-size: 0.625rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; line-height: 1.2;
  white-space: nowrap;
}
.badge--seen, .badge--drove { background: var(--ok-tint); color: var(--ok); }
.badge--render { background: var(--warn-tint); color: var(--warn); }
.badge--cat { background: var(--accent-tint); color: var(--accent); }
.badge--outline { border: 1px solid var(--border); color: var(--muted); }
.badge--pinned { background: var(--text); color: var(--bg); }
a.badge:hover { text-decoration: underline; text-underline-offset: 2px; }

/* Lead story: image left, text right, on a bordered surface (GB Grid 55/45 + Query Loop, 1 post) */
.lead {
  display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); column-gap: var(--s-6);
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
.lead__media { border-radius: 0; height: 100%; }
.lead__media img { position: absolute; inset: 0; }
.lead__body { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-6) var(--s-6) var(--s-5) 0; min-width: 0; }
.lead__title { font-size: clamp(1.375rem, 1rem + 1.1vw, 1.75rem); font-weight: 800; line-height: 1.2; letter-spacing: -0.015em; }
.lead__title a, .byline__name { color: var(--text); }
.lead__title a:hover, .byline__name:hover { color: var(--accent); }
.lead__excerpt {
  font-size: 1rem; line-height: 1.55; color: var(--muted);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.lead .byline, .lead .meta { margin-top: auto; padding-top: var(--s-3); border-top: 1px solid var(--border); }

/* Byline (author avatar + name + date/read time) */
.byline { display: flex; align-items: center; gap: var(--s-3); }
.byline__avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: none; }
.byline__name { display: block; font-size: 0.9375rem; font-weight: 700; line-height: 1.3; }
.byline__meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); font-size: 0.8125rem; color: var(--muted); }
.byline__meta > * + *::before { content: "\00b7"; margin-right: var(--s-2); }

/* Boxed card (Latest): surface + border, padded body, author/date footer */
.card--boxed { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.card--boxed .card__media { border-radius: 0; margin-bottom: 0; }
.card--boxed .card__body { padding: var(--s-4); flex: 1 1 auto; }
.card--boxed .card__title { font-size: 1.0625rem; }
.card--boxed .card__foot {
  display: flex; justify-content: space-between; gap: var(--s-3); margin-top: auto; padding-top: var(--s-3);
  border-top: 1px solid var(--border); font-size: 0.8125rem; color: var(--muted);
}
.card__author { font-weight: 600; color: var(--text); }

/* --------------------------------------------------------------------------
   7. Section 3 — First Look Review
   -------------------------------------------------------------------------- */
.firstlook {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
  gap: var(--s-6);
  align-items: start;
}
.firstlook .li__media { flex-basis: 180px; width: 180px; }
.firstlook__list .li__title { font-size: 1.0625rem; }
.firstlook__list .li { align-items: center; }

/* --------------------------------------------------------------------------
   8. Section 4 — Editor's Picks
   -------------------------------------------------------------------------- */
.picks .card__title { font-size: 1.125rem; }

/* --------------------------------------------------------------------------
   9. Section 5 — Hybrid Cars band (tinted, intro column + 3 cards)
   -------------------------------------------------------------------------- */
.band {
  display: grid; gap: var(--s-5);
  /* Slightly wider than the text columns either side of it, so the tinted band reads as a break */
  margin-inline: calc(var(--s-5) * -1);
  padding: var(--s-5) var(--s-6) var(--s-6);
  background: var(--bg-2);
  border-radius: 6px;
}
.band__intro {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4);
  padding-bottom: var(--s-3); border-bottom: 2px solid var(--text);
}
.band__desc { font-size: 0.9375rem; line-height: 1.55; color: var(--muted); }
.band__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-5) var(--s-4); }
.band__grid .card__title { font-size: 0.9375rem; }
.band__grid .card__media { background: var(--surface); }

/* --------------------------------------------------------------------------
   10. Section 6 — Reviews (large horizontal cards) + PHEVs (list)
   -------------------------------------------------------------------------- */
.reviews { display: flex; flex-direction: column; }
.review {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: var(--s-4);
  padding: var(--s-5) 0;
  border-top: 1px solid var(--border);
}
.review:first-child { padding-top: 0; border-top: 0; }
.review:last-child { padding-bottom: 0; }
.review__body { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.review__title { font-size: 1.125rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.01em; }
.review__summary {
  font-size: 0.9375rem; color: var(--muted); line-height: 1.5;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}

/* PHEV list: thumbnails match the Reviews media width */
.section--phevs .li__media { flex-basis: 200px; width: 200px; }
.section--phevs .li { align-items: center; }
.section--phevs .li__title { font-size: 1.0625rem; }

/* --------------------------------------------------------------------------
   11. Sidebar widgets
   -------------------------------------------------------------------------- */
.sidebar { display: flex; flex-direction: column; gap: var(--s-5); min-width: 0; }
/* The whole sidebar is short (two widgets) so it sticks as one block. The top
   offset leaves room for GP's reveal-on-scroll-up navigation. */
.sidebar--sticky { position: sticky; top: calc(var(--header-h) + var(--s-5)); }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; padding: var(--s-5); }
.widget__title--bar {
  margin: calc(var(--s-5) * -1) calc(var(--s-5) * -1) var(--s-4);
  padding: var(--s-3) var(--s-5); border-radius: 5px 5px 0 0; border-bottom: 0;
  background: var(--frame); color: var(--frame-text);
}
.who { display: flex; flex-direction: column; gap: var(--s-3); }
/* Full-width logo, no plate. The brand asset is a white wordmark, so it is
   inverted to ink on the light card and shown as-is on the dark card. */
.who__logo { display: block; width: 100%; }
.who__logo img { width: 100%; max-width: 260px; height: auto; filter: invert(1); }
[data-theme="dark"] .who__logo img { filter: none; }
.who p { font-size: 0.9375rem; line-height: 1.55; color: var(--muted); }
.btn--sm { height: 36px; padding: 0 14px; font-size: 0.875rem; width: max-content; }
.btn--ghost { border: 1px solid var(--border); color: var(--text); gap: 8px; height: 38px; font-size: 0.875rem; }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.widget__title {
  font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  padding-bottom: var(--s-3); margin-bottom: var(--s-4);
  border-bottom: 2px solid var(--text);
}
.widget__more { display: inline-flex; margin-top: var(--s-4); }

/* Ranked list — numbered, text only (cheap and fast) */
.ranked { counter-reset: rank; }
/* Thumbnail with the rank number badged on its bottom-right corner + title
   (GB Query Loop: featured image, title; number via CSS counter) */
.ranked__item {
  counter-increment: rank;
  display: grid; grid-template-columns: 104px minmax(0, 1fr); gap: 0 var(--s-3); align-items: center;
  padding: var(--s-3) 0; border-top: 1px solid var(--border);
}
.ranked__item:first-child { padding-top: 0; border-top: 0; }
.ranked__thumb { width: 104px; border-radius: 4px; overflow: visible; }
.ranked__thumb img { border-radius: 4px; }
/* Big rank numeral overlapping the thumbnail's bottom-right corner, outlined in the
   card colour so it stays legible over any photo */
.ranked__thumb::after {
  content: counter(rank);
  position: absolute; left: -2px; bottom: -4px; z-index: 1;
  font-size: 1.25rem; font-weight: 800; line-height: 1; letter-spacing: -0.03em;
  color: var(--accent);
  -webkit-text-stroke: 6px var(--surface); paint-order: stroke fill;
}
.ranked__title { font-size: 0.9375rem; font-weight: 600; line-height: 1.35; }

/* Browse by brand — widget button, chosen state, and the modal picker */
.brandpick__btn, .brandpick__chosen {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  width: 100%; min-height: 48px; padding: 6px 8px 6px 14px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--text);
}
.brandpick__btn { cursor: pointer; font: inherit; font-size: 0.9375rem; font-weight: 600; }
.brandpick__btn:hover { border-color: var(--accent); color: var(--accent); }
.brandpick__btn:focus-visible, .brandpick__change:focus-visible, .brand-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.brandpick.is-selected .brandpick__btn { display: none; }
.brandpick__chosen { padding-left: 14px; }
.brandpick__chosen[hidden] { display: none; }
.brandpick__link { display: inline-flex; align-items: center; gap: var(--s-3); min-width: 0; color: var(--text); }
.brandpick__link:hover .brandpick__name { color: var(--accent); }
.brandpick__name { font-size: 0.9375rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brandpick__change {
  flex: none; height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
  background: var(--surface); color: var(--accent); font: inherit; font-size: 0.8125rem; font-weight: 700;
}
.brandpick__change:hover { border-color: var(--accent); background: var(--accent); color: #fff; }

/* Modal picker (native <dialog>) */
.brands {
  width: min(720px, calc(100% - 32px)); max-height: min(80dvh, 80vh, 720px);
  padding: 0; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-md);
}
/* Only the grid scrolls: the dialog is a fixed-height flex column (header + filter stay put). */
.brands[open] { display: flex; flex-direction: column; overflow: hidden; }
.brands__head, .brands__filter, .brands__empty { flex: none; }
#brand-dialog{overflow-y:hidden}
.brands::backdrop { background: rgba(10, 14, 19, 0.62); backdrop-filter: blur(3px); }
/* Opening the modal locks the page scroll (see script.js, which also compensates for the
   scrollbar width) so the page cannot move sideways or scroll behind the dialog. */
html.has-modal { overflow: hidden; }
html.has-menu { overflow: hidden; }
/* Dark mode: lift the panel off the dimmed page (lighter surface, visible edge, stronger shadow, darker backdrop) */
[data-theme="dark"] .brands { background: #1f2a36; border-color: #3d4b5c; box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.06); }
[data-theme="dark"] .brands::backdrop { background: rgba(0, 0, 0, 0.8); }
[data-theme="dark"] .brands__filter { background: #141c25; }
[data-theme="dark"] .brand-tile { background: #141c25; border-color: #34414f; }
[data-theme="dark"] .brand-tile:hover { border-color: var(--accent); }
.brands__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-4) var(--s-3) var(--s-5); border-bottom: 1px solid var(--border); }
.brands__title { font-size: 1.125rem; font-weight: 800; letter-spacing: -0.01em; }
.icon-btn--ink { color: var(--text); }
.icon-btn--ink:hover { background: var(--bg-2); color: var(--text); }
.brands__filter { display: flex; align-items: center; gap: var(--s-2); margin: var(--s-4) var(--s-5) 0; padding: 0 12px; height: 42px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); color: var(--muted); }
.brands__filter:focus-within { border-color: var(--accent); color: var(--accent); }
.brands__filter input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 0.9375rem; }
.brands__filter input:focus { outline: none; }
.brands__grid {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s-2);
  padding: var(--s-4) var(--s-5) var(--s-5); flex: 1 1 auto; min-height: 0; overflow-y: auto;
  overscroll-behavior: contain;
}
.brand-tile {
  display: flex; align-items: center; width: 100%; min-height: 42px; padding: 6px 12px;
  border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer;
  background: var(--bg); color: var(--text); font: inherit; font-size: 0.875rem; font-weight: 600; text-align: left;
}
.brand-tile:hover { border-color: var(--accent); color: var(--accent); }
.brand-tile.is-current { border-color: var(--accent); background: var(--accent-tint); }
.brand-tile__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brands__grid li[hidden] { display: none; }
.brands__empty { padding: 0 var(--s-5) var(--s-5); font-size: 0.9375rem; color: var(--muted); }

/* --------------------------------------------------------------------------
   12. Footer  (GP Footer widgets, dark in both themes)
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--frame);
  color: var(--frame-muted);
  border-top: 1px solid var(--frame-border);
  font-size: 0.9375rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: var(--s-6) var(--s-7);
  padding-block: var(--s-7);
}
.footer__brand img { width: auto; height: 32px; margin-bottom: var(--s-4); }
.footer__brand p { line-height: 1.55; max-width: 44ch; }
.social { display: flex; gap: var(--s-2); margin-top: var(--s-4); }
.social a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: var(--radius);
  border: 1px solid var(--frame-border); color: var(--frame-text);
}
.social a:hover { border-color: var(--frame-text); color: var(--frame-text); }
.footer__title {
  font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--frame-text); margin-bottom: var(--s-3);
}
.footer__col li { padding: 4px 0; }
.footer__col a { color: var(--frame-muted); }
.footer__col a:hover { color: var(--frame-text); }
.footer__search { display: flex; gap: var(--s-2); }
.footer__note { margin-top: var(--s-3); font-size: 0.8125rem; line-height: 1.45; }
.footer__bottom {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap;
  padding-block: var(--s-4);
  border-top: 1px solid var(--frame-border);
  font-size: 0.8125rem;
}
.to-top { display: inline-flex; align-items: center; gap: 6px; color: var(--frame-text); font-weight: 600; }


/* --------------------------------------------------------------------------
   13. Post page  (GP Single: content + right sidebar; GB Containers for insets)
   -------------------------------------------------------------------------- */
.site-main--post { padding-top: var(--s-4); }
.crumbs { font-size: 0.8125rem; color: var(--muted); margin-bottom: var(--s-4); }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-1) 0; }
/* Double-angle separator, a step larger than the crumb text */
.crumbs li + li::before { content: "\00bb"; margin: 0 var(--s-2); font-size: 1.125rem; line-height: 1; color: var(--muted); }
.crumbs li[aria-current] { color: var(--text); font-weight: 600; }

/* Ad slots: fixed reserved height so nothing shifts when the ad renders (CLS).
   A small "Ad" pill sits in the top-right corner of the unit (Google-style);
   the unit itself is deliberately NOT themed: ads are third-party creatives, so
   the placeholder is a neutral hatched grey that reads as "ad", not as a panel. */
.ad-slot { display: block; }
.ad-slot__unit {
  position: relative; display: grid; place-items: center;
  background-color: #e6e6e6;
  background-image: repeating-linear-gradient(135deg, rgba(0, 0, 0, 0.06) 0 8px, transparent 8px 16px);
  border: 1px solid #c9c9c9; border-radius: 2px;
}
.ad-slot__badge {
  position: absolute; top: 6px; right: 6px;
  padding: 2px 7px; border-radius: 999px; background: rgba(255, 255, 255, 0.92); color: #5f6368;
  font-size: 0.625rem; font-weight: 700; letter-spacing: 0.04em; line-height: 1.4; text-transform: uppercase;
  border: 1px solid rgba(0, 0, 0, 0.12); pointer-events: none;
}
.ad-slot__hint {
  padding: 4px 10px; border-radius: 3px; background: #fff; color: #6b6b6b;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: 0.02em; line-height: 1.4; text-align: center;
}
[data-theme="dark"] .ad-slot__unit { background-color: #3a3a3a; background-image: repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0 8px, transparent 8px 16px); border-color: #555; }
[data-theme="dark"] .ad-slot__badge { background: rgba(0, 0, 0, 0.6); color: #cfcfcf; border-color: rgba(255, 255, 255, 0.15); }
[data-theme="dark"] .ad-slot__hint { background: #1f1f1f; color: #b3b3b3; }
.ad-slot--leader { margin-bottom: var(--s-6); }
.ad-slot--leader .ad-slot__unit { min-height: 90px; }
.ad-slot--inline { margin: var(--s-6) 0; }
.ad-slot--inline .ad-slot__unit { min-height: 250px; }

.layout--post { gap: var(--s-8) var(--s-8); }
.post { min-width: 0; }
.post__head { display: flex; flex-direction: column; gap: var(--s-4); margin-bottom: var(--s-5); }
.post__title { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
.post .byline__avatar { width: 48px; height: 48px; }

.keypoints {
  display: grid; gap: var(--s-2);
  margin: 0 0 var(--s-6);
  padding: var(--s-4) var(--s-5); border-left: 3px solid var(--accent);
  background: var(--bg-2); border-radius: 0 6px 6px 0;
  font-size: 0.9375rem; line-height: 1.5;
}
.keypoints li { position: relative; padding-left: var(--s-4); }
.keypoints li::before { content: ""; position: absolute; left: 0; top: 0.6em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.post-figure { margin: var(--s-6) 0; }
.post-figure--hero { margin-top: 0; margin-bottom: var(--s-5); }
.post-figure .ratio-16-9 { border-radius: 6px; }
.post-figure figcaption { margin-top: var(--s-2); font-size: 0.9375rem; line-height: 1.5; color: var(--text); }

.entry-content { font-size: 1.0625rem; line-height: 1.7; }
.entry-content > p, .entry-content > h2, .entry-content > h3, .entry-content .pull, .entry-content .inset { max-width: 72ch; }
.entry-content p + p { margin-top: var(--s-4); }
.entry-content h2 {
  font-size: 1.5rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.015em;
  margin: var(--s-7) 0 var(--s-3); padding-top: var(--s-5); border-top: 1px solid var(--border);
}
.entry-content h3 { font-size: 1.125rem; font-weight: 700; line-height: 1.3; margin: var(--s-5) 0 var(--s-2); }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--border); }
.entry-content a:hover { text-decoration-color: currentColor; }
/* "Update:" box — WordPress custom field, shown only when filled in */
.update-note { padding: var(--s-3) var(--s-4); background: var(--accent-tint); border-radius: 4px; font-size: 0.9375rem; }
.update-note strong { color: var(--accent); }

.pull { margin: var(--s-5) 0; padding: var(--s-2) 0 var(--s-2) var(--s-5); border-left: 3px solid var(--accent); }
.pull p { font-size: 1.125rem; line-height: 1.55; font-weight: 500; }
.pull cite { display: block; margin-top: var(--s-4); font-size: 0.9375rem; font-style: normal; color: var(--muted); }

.inset { margin: var(--s-6) 0; padding: var(--s-4) var(--s-5); background: var(--bg-2); border-radius: 6px; }
.inset__title { font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--s-2); }
.inset li { padding: 6px 0; font-size: 0.9375rem; font-weight: 600; line-height: 1.4; }
.inset li + li { border-top: 1px solid var(--border); }
.inset a { text-decoration: none; color: var(--text); }
.inset a:hover { color: var(--accent); }
/* In-body related: 2 posts from the post's category, small thumbnail before each title */
.inset__item { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) 0; }
.inset__item + .inset__item { border-top: 1px solid var(--border); }
.inset__thumb { flex: 0 0 180px; width: 180px; border-radius: 4px; }
.inset__link { font-size: 1.0625rem; font-weight: 700; line-height: 1.4; min-width: 0; }

/* Share prompt: one sentence in a contrasting box + "Copy link" button (no social buttons) */
.share {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-3) var(--s-5);
  margin-top: var(--s-7); padding: var(--s-5) var(--s-6); background: var(--share-bg); color: var(--share-text); border-radius: 6px;
}
.share__line { flex: 1 1 360px; font-size: 1.125rem; font-weight: 700; line-height: 1.45; letter-spacing: -0.01em; }
/* The button sits on the fixed orange box, so its colours are fixed too (not theme tokens). */
.share__copy {
  display: inline-flex; align-items: center; gap: 8px; flex: none;
  height: 42px; padding: 0 18px; border: 2px solid var(--share-text); border-radius: var(--radius); cursor: pointer;
  background: var(--share-text); color: #fff; font: inherit; font-size: 0.9375rem; font-weight: 700; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease, border-color .15s ease;
  min-width: 194px; justify-content: center;
}
.share__copy:hover { background: #fff; color: var(--share-text); }
.share__copy:active { background: #fff3e6; }
.share__copy:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.share__ico--check { display: none; }
/* "Link copied": white pill, green check + text */
.share__copy.is-copied { background: #fff; color: #0f6a3a; border-color: #fff; }
.share__copy.is-copied .share__ico--link { display: none; }
.share__copy.is-copied .share__ico--check { display: block; }

/* "Up next": the next post, large image + large title, whole card one link */
.next { margin-top: var(--s-6); }
.next .widget__title { margin-bottom: var(--s-4); }
.next__card {
  display: block; color: var(--text); text-decoration: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow: hidden;
}
.next__media { border-radius: 0; }
.next__body { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-5) var(--s-6) var(--s-6); }
.next__title { display: block; font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
.next__card:hover .next__title { color: var(--accent); }
.next__excerpt { display: block; font-size: 1rem; line-height: 1.55; color: var(--muted); }
.next__meta { display: block; font-size: 0.8125rem; color: var(--muted); }

.post__foot { margin-top: var(--s-7); display: grid; gap: var(--s-5); }
.terms { display: flex; flex-wrap: wrap; gap: var(--s-3) var(--s-5); font-size: 0.8125rem; }
.terms__group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); color: var(--muted); }
.terms__group a { padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; font-weight: 600; color: var(--text); }
.terms__group a:hover { border-color: var(--accent); color: var(--accent); }

.author-box { display: grid; grid-template-columns: 80px minmax(0, 1fr); gap: var(--s-4); padding: var(--s-5); border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.author-box img { border-radius: 50%; }
.author-box__name { font-size: 1.125rem; font-weight: 800; }
.author-box__role { font-size: 0.8125rem; color: var(--muted); margin: 2px 0 var(--s-2); }
.author-box__bio { font-size: 0.9375rem; line-height: 1.55; color: var(--muted); margin-bottom: var(--s-2); }

.newsletter {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-4) var(--s-6); align-items: center;
  margin-top: var(--s-7); padding: var(--s-5) var(--s-6); border-radius: 6px;
  background: var(--frame); color: var(--frame-text);
}
.newsletter__title { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
.newsletter p { font-size: 0.9375rem; color: var(--frame-muted); margin-top: 4px; }
.newsletter__form { display: flex; gap: var(--s-2); }
.newsletter__form input {
  flex: 1 1 auto; min-width: 0; height: 40px; padding: 0 14px;
  border: 1px solid var(--frame-border); border-radius: var(--radius); background: var(--frame-2); color: var(--frame-text);
}
.newsletter__form input::placeholder { color: var(--frame-muted); }

.related { margin-top: var(--s-7); }
.related .widget__title { margin-bottom: var(--s-4); }
.related .li { align-items: center; }
.related .li__media { flex-basis: 220px; width: 220px; }
.related .li__title { font-size: 1.125rem; font-weight: 700; }
.li--text { flex-direction: column; gap: var(--s-1); }
.li--text .meta { font-size: 0.8125rem; }
.meta__dot { color: var(--muted); }


/* --------------------------------------------------------------------------
   13a. Archive templates — category / tag, author, search results
        (GP: archive layouts; GP Premium Blog "featured first post" = .lead)
   -------------------------------------------------------------------------- */
.site-main--archive { padding-top: var(--s-4); }
.archive-col { display: flex; flex-direction: column; gap: var(--s-7); min-width: 0; }
.archive-col .section-head { margin-bottom: var(--s-4); }

.archive-head { max-width: 72ch; margin-bottom: var(--s-6); }
.archive-head__kicker { font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); margin-bottom: var(--s-2); }
.archive-head__title { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem); font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
.archive-head__desc { margin-top: var(--s-3); font-size: 1.0625rem; line-height: 1.6; color: var(--muted); }

/* Author masthead: dark "frame" band (same graphite as header/footer in both
   themes), square portrait, big name, facts list. Reads as a byline page, not a
   generic profile card. */
.author-mast {
  display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: var(--s-6); align-items: start;
  padding: var(--s-6); border-radius: 6px; background: var(--frame-2); color: var(--frame-text);
}
.author-mast__photo { width: 160px; height: 160px; border-radius: 8px; object-fit: cover; }
.author-mast__kicker { font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--frame-muted); }
.author-mast__name { margin-top: var(--s-1); font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.5rem); font-weight: 800; line-height: 1.1; letter-spacing: -0.02em; }
.author-mast__bio { margin-top: var(--s-3); max-width: 64ch; font-size: 1rem; line-height: 1.6; color: var(--frame-muted); }
.author-mast__facts {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-4);
  margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--frame-border);
}
.author-mast__facts dt { font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--frame-muted); }
.author-mast__facts dd { margin: 2px 0 0; font-size: 0.9375rem; font-weight: 700; }
.author-mast__links { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-5); }
.btn--ghost-dark { border-color: var(--frame-border); color: var(--frame-text); }
.btn--ghost-dark:hover { border-color: var(--frame-text); color: var(--frame-text); background: var(--frame-2); }

/* Search results header: query + large form */
.search-head { margin-bottom: var(--s-6); }
.search-head__form { display: flex; gap: var(--s-2); max-width: 640px; margin-top: var(--s-4); }
.search-head__form input {
  flex: 1 1 auto; min-width: 0; height: 48px; padding: 0 16px; font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); color: var(--text);
}
.search-head__form input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: transparent; }
.search-head__form .btn { height: 48px; gap: 8px; }
.search-head__count { margin-top: var(--s-3); font-size: 0.875rem; color: var(--muted); }

/* Results list: thumbnail + title + excerpt + meta */
.results { display: flex; flex-direction: column; }
.result { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: var(--s-5); padding: var(--s-5) 0; border-top: 1px solid var(--border); }
.result:first-child { padding-top: 0; border-top: 0; }
.result__body { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.result__title { font-size: 1.25rem; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; }
.result__title a { color: var(--text); }
.result__title a:hover { color: var(--accent); }
.result__excerpt { font-size: 0.9375rem; line-height: 1.55; color: var(--muted); }
.search-tip { padding: var(--s-4) var(--s-5); background: var(--bg-2); border-radius: 6px; font-size: 0.9375rem; line-height: 1.55; color: var(--muted); }
.search-tip a { color: var(--accent); font-weight: 600; }

/* Numbered pagination (GP: "Numbered" pagination style) */
.pagination { display: flex; align-items: center; justify-content: center; gap: var(--s-4); padding-top: var(--s-5); border-top: 1px solid var(--border); font-size: 0.875rem; font-weight: 600; }
.pagination__pages { display: flex; gap: var(--s-1); }
.pagination__num, .pagination__dots { display: inline-flex; align-items: center; justify-content: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: var(--radius); color: var(--text); }
.pagination__num:hover { background: var(--bg-2); }
.pagination__num.is-current { background: var(--border); color: var(--text); }
.pagination__prev, .pagination__next { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
.pagination__prev.is-disabled { color: var(--muted); opacity: 0.5; }

/* ==========================================================================
   14. Responsive — genuine reflow, not scaling
   Breakpoints: 1279 (compact desktop) / 1023 (tablet) / 767 (large phone) / 479
   ========================================================================== */

/* ---- ≤1279: compact desktop (1024–1279) ---- */
@media (max-width: 1279px) {
  .layout { grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s-8) var(--s-6); }
  .main-col { column-gap: var(--s-6); }
  .nav__list > li > a, .nav__more-btn { padding: 0 9px; font-size: 0.875rem; }
  .band { margin-inline: 0; padding: var(--s-5); }
}

/* ---- ≤1024: tablet layout (sidebar drops below main; 1024 is treated as tablet) ---- */
@media (max-width: 1024px) {
  /* Sidebar moves below the main content and becomes a 2-column widget grid */
  .layout { grid-template-columns: 1fr; }
  .sidebar {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start;
    gap: var(--s-6);
    padding-top: var(--s-7); border-top: 1px solid var(--border);
  }
  .sidebar--sticky { position: static; }

  /* Main column: single column; Reviews/PHEVs stack; mobile priority order */
  .main-col { grid-template-columns: 1fr; row-gap: var(--s-7); }
  .main-col > .section--reviews, .main-col > .section--phevs { grid-column: 1 / -1; }
  .section--lead      { order: 0; }
  .section--latest    { order: 1; }
  .section--firstlook { order: 2; }
  .section--picks     { order: 3; }
  .section--phevs     { order: 4; }
  .section--hybrid    { order: 5; }
  .section--reviews   { order: 6; }

  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .picks.grid--3, .band__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .firstlook { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); }
  .firstlook .li__media { flex-basis: 140px; width: 140px; }
  .band__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; }
}

/* ---- ≤1023: tablet header (logo / search / theme / hamburger) ---- */
@media (max-width: 1023px) {
  :root { --header-h: 56px; }

  .nav-toggle { display: inline-flex; }
  /* While the menu is open the header pins to the top, so the logo and the close
     button stay visible even if the page was scrolled when it was opened. */
  html.has-menu .site-header { position: fixed; top: 0; left: 0; right: 0; }
  /* Full-screen menu: covers everything below the header and scrolls on its own. */
  .nav {
    display: none;
    position: fixed; left: 0; right: 0; top: var(--header-h); bottom: 0; z-index: 49;
    background: var(--frame);
    overflow-y: auto; overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  .nav.is-open { display: block; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 0; padding: var(--s-3) var(--gutter) var(--s-7); }
  .nav__list > li + li > a { border-top: 1px solid var(--frame-border); }
  .nav__list > li > a {
    width: 100%; height: auto; min-height: 52px; padding: var(--s-3); font-size: 1.0625rem; font-weight: 600;
    justify-content: flex-start;
  }
  /* Every link is listed flat — no "More" button to tap through. */
  .nav__more-btn { display: none; }
  .nav__sub {
    position: static; display: block; min-width: 0; padding: 0;
    background: transparent; color: var(--frame-text); border: 0; box-shadow: none;
  }
  .nav__sub li + li a, .nav__more .nav__sub > li:first-child a { border-top: 1px solid var(--frame-border); }
  .nav__sub a {
    display: flex; align-items: center; min-height: 52px; padding: var(--s-3); border-radius: var(--radius);
    color: var(--frame-text); font-size: 1.0625rem; font-weight: 600;
  }
  .nav__sub a:hover { background: var(--frame-2); color: var(--frame-text); }
}

/* ---- ≤767: large phone ---- */
@media (max-width: 767px) {
  :root { --gutter: 16px; }
  .site-main { padding-block: var(--s-5) var(--s-7); }

  .lead { grid-template-columns: 1fr; }
  .lead__media { aspect-ratio: 16 / 10; height: auto; }
  .lead__media img { position: static; }
  .lead__body { padding: var(--s-4); }
  .lead { column-gap: 0; }
  .lead__title { font-size: clamp(1.25rem, 1rem + 1.6vw, 1.5rem); }

  .layout { gap: var(--s-7); }
  .main-col { row-gap: var(--s-6); }
  .section-head { margin-bottom: var(--s-4); }
  .grid--3, .picks.grid--3 { grid-template-columns: 1fr; gap: var(--s-5); }
  .card--lg .card__title { font-size: 1.25rem; }

  .firstlook { grid-template-columns: 1fr; }

  .band { padding: var(--s-4); gap: var(--s-4); }
  .band__grid { grid-template-columns: 1fr; }

  .review { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--s-3); padding: var(--s-4) 0; }
  .section--phevs .li__media { flex-basis: 40%; width: 40%; }
  .related .li__media { flex-basis: 40%; width: 40%; }
  .review__title { font-size: 1rem; }
  .review__summary { -webkit-line-clamp: 2; font-size: 0.875rem; }

  .sidebar { grid-template-columns: 1fr; gap: var(--s-5); padding-top: var(--s-6); }
  .li__media { flex-basis: 104px; width: 104px; }

  .footer__grid { grid-template-columns: 1fr; gap: var(--s-5); padding-block: var(--s-6); }
  .footer__bottom { flex-direction: column; align-items: flex-start; }

  /* Post page */
  .ad-slot--leader .ad-slot__unit { min-height: 100px; }
  .post__title { font-size: clamp(1.5rem, 1.1rem + 2.2vw, 1.875rem); }
  .entry-content { font-size: 1.0625rem; }
  .entry-content > p { font-size: 1.125rem; line-height: 1.65; }
  .newsletter { grid-template-columns: 1fr; padding: var(--s-5) var(--s-4); }
  .author-box { grid-template-columns: 56px minmax(0, 1fr); }
  .author-box img { width: 56px; height: 56px; }
  .share { padding: var(--s-4) var(--s-5); }
  .share__line { flex-basis: 100%; font-size: 1rem; }
  .next__body { padding: var(--s-4) var(--s-4) var(--s-5); }
  .inset--thumbs { padding: var(--s-3) var(--s-4); }
  .inset__thumb { flex-basis: 40%; width: 40%; }
  .inset__link { font-size: 1rem; }

  /* Archive templates */
  .author-mast { grid-template-columns: 1fr; gap: var(--s-4); padding: var(--s-5) var(--s-4); }
  .author-mast__photo { width: 96px; height: 96px; }
  .author-mast__facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result { grid-template-columns: 112px minmax(0, 1fr); gap: var(--s-4); padding: var(--s-4) 0; }
  .result__title { font-size: 1.0625rem; }
  .result__excerpt { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-size: 0.875rem; }
  .pagination { flex-wrap: wrap; }
  .brands__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---- ≤479: small phone (390–479) ---- */
@media (max-width: 479px) {
  .brand img { height: 26px; }
  .header__actions { gap: 0; }
  .icon-btn { width: 38px; height: 38px; }
  .card__title { font-size: 1rem; }
  .review { grid-template-columns: 1fr; }
  .review__media { max-width: 100%; }
  .section--phevs .li { flex-direction: column; }
  .section--phevs .li__media { flex-basis: auto; width: 100%; }
  .review__summary { -webkit-line-clamp: 3; }
  .section-title { font-size: 1.25rem; }
}

/* Print: drop the frame chrome, keep the content */
@media print {
  .site-header, .site-footer, .skip-link { display: none; }
  .ratio-16-9, .ratio-16-10, .ratio-4-3, .ratio-3-2 { background: none; }
}
