/* ==========================================================================
   TopElectricSUV — Design 02 "Premium Automotive Magazine"
   design-02/styles.css

   Organisation
     1. Reset
     2. Variables
     3. Base
     4. Header
     5. Navigation
     6. Hero (cover story + entry row)
     7. Editorial sections
     8. Cards
     9. Sidebar
    10. Footer
    11. Dark mode
    12. Responsive

   One DOM, one stylesheet. No frameworks, no web fonts, no icon fonts.
   GP = GeneratePress, GB = GenerateBlocks mapping notes are inline.
   ========================================================================== */

/* ==========================================================================
   1. Reset
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; }
h1, h2, h3, h4, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; }

/* ==========================================================================
   2. Variables  (light theme is the default; dark overrides live in §11)
   ========================================================================== */
:root {
  --bg:        #f7f8fa;   /* page */
  --surface:   #ffffff;   /* cards, masthead, sidebar widgets */
  --surface-2: #eef1f4;   /* image placeholders, chips */
  --text:      #111318;
  --muted:     #68707b;
  --border:    #dde2e7;
  --accent:    #0d47a1;   /* existing TopElectricSUV link blue */
  --accent-2:  #1e73be;   /* existing GP accent (hover) */
  --accent-tint: #e8f0fb;

  /* Ink surfaces: nameplate, Hybrid band, footer. Dark in both themes. */
  --ink:        #111318;
  --ink-2:      #1a1f26;
  --ink-text:   #f4f7fa;
  --ink-muted:  #9da8b4;
  --ink-border: #2a323c;
  --ink-accent: #6ea8ff;

  --font-sans:  -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Charter, Georgia, "Times New Roman", "Noto Serif", serif;

  --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: 3px;
  --container: 1280px;
  --gutter: 24px;
  --masthead-h: 64px;
  --strip-h: 40px;
}

/* ==========================================================================
   3. Base
   ========================================================================== */
html {
  scroll-padding-top: calc(var(--masthead-h) + 16px);
  color-scheme: light;
}
body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  /* The only theme transition: page ground + ink. Nothing else animates. */
  transition: background-color .18s ease, color .18s ease;
}
a:hover { color: var(--accent); }
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; font-weight: 600; border-radius: var(--radius);
}
.skip-link:focus { top: 12px; color: #fff; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

/* Reserved-ratio image slots: no layout shift while images load.
   Maps to GB Image "aspect ratio" / object-fit cover. */
.ratio-21-9, .ratio-16-9, .ratio-16-10, .ratio-4-3, .ratio-3-2 {
  display: block; position: relative; overflow: hidden;
  background: var(--surface-2);
}
.ratio-21-9  { aspect-ratio: 21 / 9; }
.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; }
[class*="ratio-"] > img { width: 100%; height: 100%; object-fit: cover; }

/* Functional transitions only (colour), disabled for reduced motion. */
a, button { 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; }
}

/* Editorial type primitives */
.kicker {
  display: inline-block;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--accent); line-height: 1.2;
}
.kicker:hover { color: var(--accent-2); }
.kicker--muted { color: var(--muted); }
.kicker--light { color: #fff; }

.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); }

.more, .read-link {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.875rem; font-weight: 600; color: var(--accent); white-space: nowrap;
}
.more:hover, .read-link:hover { color: var(--accent-2); }
.read-link { margin-top: var(--s-2); }

/* Section header: kicker + serif title + hairline (GB Container flex + Headline) */
.sec-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: 1px solid var(--border);
}
.sec-head__kicker {
  display: block; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); margin-bottom: var(--s-1);
}
.sec-head__title { font-family: var(--font-serif); font-size: 1.875rem; font-weight: 700; line-height: 1.1; letter-spacing: -0.01em; }
.sec-head--center { justify-content: center; text-align: center; border-bottom: 0; }
.section-foot { margin-top: var(--s-5); text-align: right; }

/* ==========================================================================
   4. Header  (GP Header Element; masthead is sticky, strip scrolls away)
   ========================================================================== */
.masthead {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.masthead__inner { display: flex; align-items: stretch; gap: var(--s-5); height: var(--masthead-h); }

/* Nameplate: the brand asset is a white wordmark, so it sits on an ink block —
   a newspaper-style nameplate that also anchors the light masthead. */
.brand {
  display: flex; align-items: center; flex: none;
  /* padding: 0 var(--s-5); */
  /* background: var(--ink); */
}
.brand img { width: auto; height: 53px; }

.masthead__tools { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; flex: none; }
.tool {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--radius); color: var(--text);
}
.tool:hover { background: var(--surface-2); color: var(--text); }
.search-link { display: none; }

/* Inline search (desktop). Real WordPress GET form, no JS. */
.search { display: flex; align-items: center; height: 40px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); }
.search:focus-within { border-color: var(--accent); }
.search__input { width: 170px; height: 100%; padding: 0 0 0 16px; border: 0; background: transparent; color: var(--text); font-size: 0.875rem; outline: 0; }
.search__input::placeholder { color: var(--muted); }
.search__btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; color: var(--muted); }
.search__btn:hover { color: var(--accent); }

.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun  { display: none; }

/* ==========================================================================
   5. Navigation  (GP Primary Navigation + a second GB Container "strip")
   ========================================================================== */
.nav { display: flex; align-items: stretch; flex: 1 1 auto; min-width: 0; }
.nav__list { display: flex; align-items: stretch; gap: var(--s-1); }
.nav__list a {
  display: inline-flex; align-items: center; height: 100%; padding: 0 12px;
  font-size: 0.9375rem; font-weight: 600; letter-spacing: -0.005em; white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.nav__list a:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* Trending strip: subtle, one line, horizontally scrollable when it overflows. */
.strip { background: var(--surface); border-bottom: 1px solid var(--border); }
.strip__inner { display: flex; align-items: center; gap: var(--s-4); height: var(--strip-h); }
.strip__label {
  flex: none; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.strip__label::after { content: ""; display: inline-block; width: 1px; height: 14px; background: var(--border); margin-left: var(--s-4); vertical-align: -3px; }
.strip__list {
  display: flex; gap: var(--s-1); min-width: 0; overflow-x: auto;
  scrollbar-width: none; -ms-overflow-style: none;
}
.strip__list::-webkit-scrollbar { display: none; }
.strip__list a {
  display: inline-block; padding: 6px 10px; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 500; color: var(--text); white-space: nowrap;
}
.strip__list a:hover { background: var(--surface-2); color: var(--accent); }

/* ==========================================================================
   6. Hero — cover story + four entry points
   ========================================================================== */
.site-main { padding-block: var(--s-6) var(--s-8); }

.cover { padding-bottom: var(--s-7); border-bottom: 1px solid var(--border); }
.cover__story { background: var(--surface); border: 1px solid var(--border); }
.cover__media { border-bottom: 1px solid var(--border); }
.cover__text {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: var(--s-6) var(--s-7);
  padding: var(--s-6);
}
.cover__head { display: flex; flex-direction: column; gap: var(--s-3); }
.cover__tag {
  display: inline-flex; align-items: center; gap: var(--s-2); width: max-content;
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.cover__tag::before { content: ""; width: 20px; height: 2px; background: var(--accent); }
.cover__title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 1.2rem + 1.7vw, 2.625rem);
  font-weight: 700; line-height: 1.12; letter-spacing: -0.015em;
}
.cover__aside { display: flex; flex-direction: column; gap: var(--s-3); padding-left: var(--s-7); border-left: 1px solid var(--border); }
.cover__excerpt { font-size: 1.0625rem; line-height: 1.6; color: var(--muted); }

/* Four entry points: equal columns, hairline separators instead of boxes */
.entry {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--s-6) var(--s-5);
  margin-top: var(--s-6);
}
.entry > .card { padding-left: var(--s-5); border-left: 1px solid var(--border); }
.entry > .card:first-child { padding-left: 0; border-left: 0; }

/* ==========================================================================
   7. Editorial sections
   ========================================================================== */
.section { padding-top: var(--s-8); }

/* --- Latest: numbered horizontal index ------------------------------------ */
.index {
  counter-reset: idx;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--s-5);
}
.index__item {
  counter-increment: idx;
  display: grid; grid-template-columns: 1fr; gap: var(--s-3);
  padding-top: var(--s-4); border-top: 2px solid var(--text);
}
.index__num::before {
  content: counter(idx, decimal-leading-zero);
  font-family: var(--font-serif); font-size: 1.75rem; font-weight: 700; line-height: 1; color: var(--text);
  letter-spacing: -0.02em;
}
.index__body { display: flex; flex-direction: column; gap: var(--s-1); }
.index__title { font-size: 0.9375rem; font-weight: 700; line-height: 1.35; letter-spacing: -0.005em; }
.index__body time { font-size: 0.75rem; }

/* --- Editor's Picks: 60/40 asymmetric, text over image ------------------ */
.picks {
  display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  grid-template-rows: 1fr 1fr;
  gap: var(--s-4);
}
.tile { position: relative; overflow: hidden; background: var(--ink); min-height: 0; }
.tile--lg { grid-row: 1 / 3; }
.tile:not(.tile--lg) .tile__media { position: absolute; inset: 0; }
.tile:not(.tile--lg) .tile__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* Legibility scrim: a single flat-to-transparent overlay, no blur. */
.tile__text {
  position: absolute; inset: auto 0 0 0;
  display: flex; flex-direction: column; gap: var(--s-2);
  padding: var(--s-7) var(--s-5) var(--s-5);
  background: linear-gradient(to top, rgba(8, 10, 14, .88) 0%, rgba(8, 10, 14, .55) 55%, rgba(8, 10, 14, 0) 100%);
  color: #fff;
}
.tile__title { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.tile--lg .tile__title { font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem); }
.tile__title a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.tile__excerpt { font-size: 0.9375rem; line-height: 1.5; color: rgba(255,255,255,.82); max-width: 56ch; }
.tile time { color: rgba(255,255,255,.7); font-size: 0.8125rem; }

/* --- First Look Review: vertical label | image | text -------------------- */
.fl {
  display: grid; grid-template-columns: 48px minmax(0, 1.3fr) minmax(0, 1fr);
  gap: var(--s-6);
  background: var(--surface); border: 1px solid var(--border);
  padding: var(--s-6);
}
.fl__label {
  writing-mode: vertical-rl; transform: rotate(180deg);
  justify-self: center; align-self: end;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase; color: var(--muted);
  border-right: 2px solid var(--accent); padding-right: var(--s-2);
  white-space: nowrap;
}
.fl__text { display: flex; flex-direction: column; gap: var(--s-3); justify-content: center; }
.fl__title { font-family: var(--font-serif); font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2.125rem); font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }
.fl__summary { font-size: 1rem; line-height: 1.6; color: var(--muted); }
.fl__related { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-5); margin-top: var(--s-6); }

/* --- Hybrid Cars: dark editorial band (ink tokens scoped to this section) - */
.band {
  --surface: var(--ink-2);
  --surface-2: #232a33;
  --text: var(--ink-text);
  --muted: var(--ink-muted);
  --border: var(--ink-border);
  --accent: var(--ink-accent);
  --accent-2: #93c0ff;
  background: var(--ink);
  color: var(--text);
  margin-top: var(--s-8);
  padding-block: var(--s-7) var(--s-8);
}
.band .sec-head__title { color: var(--text); }
.band__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: var(--s-7); }
.band .rows .row { border-color: var(--border); }

/* --- Reviews: alternating emphasis on a 12-col grid ---------------------- */
/* Review index: one review per row, hairline-separated. Emphasis alternates —
   "wide" rows carry a larger image on the right and a bigger serif headline,
   the others a smaller image on the left. CSS Grid, no masonry. */
.rev-grid { display: grid; grid-template-columns: 1fr; }
.rev {
  display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: var(--s-6);
  align-items: start; padding: var(--s-5) 0; border-top: 1px solid var(--border); min-width: 0;
}
.rev:first-child { padding-top: 0; border-top: 0; }
.rev--wide { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.rev--wide .rev__media { order: 2; }
.rev__body { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.rev__title { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 700; line-height: 1.2; }
.rev--wide .rev__title { font-size: clamp(1.375rem, 1rem + 1vw, 1.75rem); }
.rev__summary {
  font-size: 0.9375rem; line-height: 1.5; color: var(--muted);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}

/* Reviews + sidebar layout (GB Grid 8/4) */
.split { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: var(--s-7); align-items: start; }

/* --- PHEVs + Featured: two editorial columns (GB Grid 5/7) --------------- */
.duo { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: var(--s-7); align-items: start; }
.feat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s-6); align-items: start; }
.feat__pair { display: grid; gap: var(--s-5); }
.feat__pair .card { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--s-4); align-items: start; }
.feat__pair .card__media { margin: 0; }
.feat__pair .card:last-child { padding-top: var(--s-5); border-top: 1px solid var(--border); }
.feat__lead .card__title--lg { font-size: 1.375rem; }

/* --- Explore: compact category grid -------------------------------------- */
.explore {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px; background: var(--border); border: 1px solid var(--border);
}
.explore__item {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto;
  gap: var(--s-1) var(--s-3); align-items: start;
  height: 100%; padding: var(--s-5);
  background: var(--surface);
}
.explore__item:hover { background: var(--accent-tint); color: var(--text); }
.explore__title { font-family: var(--font-serif); font-size: 1.125rem; font-weight: 700; line-height: 1.2; }
.explore__desc { grid-column: 1; font-size: 0.8125rem; line-height: 1.45; color: var(--muted); }
.explore__arrow { grid-column: 2; grid-row: 1 / 3; color: var(--muted); }
.explore__item:hover .explore__arrow, .explore__item:hover .explore__title { color: var(--accent); }

/* ==========================================================================
   8. Cards  (Query Loop item = GB Container + Image + Headline + Headline(meta))
   ========================================================================== */
.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: 1rem; font-weight: 700; line-height: 1.3; letter-spacing: -0.005em; }
.card__title--lg { font-family: var(--font-serif); font-size: 1.5rem; line-height: 1.2; }
.card__title--xl { font-family: var(--font-serif); font-size: clamp(1.5rem, 1.1rem + 1.2vw, 2rem); line-height: 1.15; }
.card__excerpt {
  font-size: 0.9375rem; line-height: 1.5; color: var(--muted);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.card--feature .card__excerpt { font-size: 1rem; }

/* Thumb-left rows */
.rows .row { display: flex; gap: var(--s-4); align-items: flex-start; padding: var(--s-4) 0; border-top: 1px solid var(--border); }
.rows .row:first-child { padding-top: 0; border-top: 0; }
.rows .row:last-child { padding-bottom: 0; }
.rows--roomy .row { padding: var(--s-5) 0; }
.row__media { flex: 0 0 120px; width: 120px; }
.row__body { display: flex; flex-direction: column; gap: var(--s-1); min-width: 0; }
.row__title { font-size: 0.9375rem; font-weight: 700; line-height: 1.35; }
.row__body time { font-size: 0.8125rem; }

/* ==========================================================================
   9. Sidebar  (contextual: beside Reviews only)
   ========================================================================== */
.sidebar { display: flex; flex-direction: column; gap: var(--s-6); padding-top: var(--s-8); min-width: 0; }
.widget { background: var(--surface); border: 1px solid var(--border); padding: var(--s-5); }
.widget__title {
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
  padding-bottom: var(--s-3); margin-bottom: var(--s-4); border-bottom: 1px solid var(--border);
}
.ranked { counter-reset: rank; }
.ranked__item { counter-increment: rank; display: flex; gap: var(--s-3); padding: var(--s-3) 0; border-top: 1px solid var(--border); }
.ranked__item:first-child { padding-top: 0; border-top: 0; }
.ranked__item:last-child { padding-bottom: 0; }
.ranked__item::before {
  content: counter(rank);
  flex: none; width: 24px; font-family: var(--font-serif); font-size: 1.25rem; font-weight: 700; line-height: 1.1; color: var(--accent);
}
.ranked__title { font-size: 0.9375rem; font-weight: 600; line-height: 1.35; }
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chip { display: inline-block; padding: 6px 11px; font-size: 0.8125rem; font-weight: 600; border: 1px solid var(--border); border-radius: 999px; color: var(--text); }
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-tint); }

/* ==========================================================================
   10. Footer  (GP Footer Element; ink surface in both themes)
   ========================================================================== */
.site-footer { background: var(--ink); color: var(--ink-muted); font-size: 0.9375rem; }
.footer__top {
  display: grid; grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: var(--s-6) var(--s-7);
  padding-block: var(--s-8) var(--s-7);
}
.footer__brand img { width: auto; height: 44px; margin-bottom: var(--s-5); }
.footer__brand p { line-height: 1.6; max-width: 46ch; }
.social { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-top: var(--s-5); }
.social a {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 8px 12px; border: 1px solid var(--ink-border); border-radius: 999px;
  font-size: 0.8125rem; font-weight: 600; color: var(--ink-text);
}
.social a:hover { border-color: var(--ink-text); color: var(--ink-text); }
.footer__title {
  font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink-text); margin-bottom: var(--s-4);
}
.footer__col li { padding: 5px 0; }
.footer__col a { color: var(--ink-muted); }
.footer__col a:hover { color: var(--ink-text); }
.footer__search { display: flex; height: 42px; border: 1px solid var(--ink-border); border-radius: 999px; overflow: hidden; }
.footer__search input { flex: 1 1 auto; min-width: 0; padding: 0 16px; border: 0; background: transparent; color: var(--ink-text); outline: 0; }
.footer__search input::placeholder { color: var(--ink-muted); }
.footer__search button { display: inline-flex; align-items: center; justify-content: center; width: 44px; color: var(--ink-text); background: var(--ink-2); }
.footer__search button:hover { background: var(--ink-accent); color: #fff; }
.footer__search:focus-within { border-color: var(--ink-accent); }
.footer__note { margin-top: var(--s-3); font-size: 0.8125rem; line-height: 1.5; }
.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(--ink-border); font-size: 0.8125rem;
}
.to-top { color: var(--ink-text); font-weight: 600; }

/* ==========================================================================
   11. Dark mode  (tokens only — no duplicated markup)
   ========================================================================== */
[data-theme="dark"] {
  color-scheme: dark;
  --bg:        #0b0f14;
  --surface:   #121820;
  --surface-2: #18212b;   /* elevated surface */
  --text:      #f4f7fa;
  --muted:     #9da8b4;
  --border:    #29333e;
  --accent:    #6ea8ff;   /* brand blue lifted for AA contrast on dark */
  --accent-2:  #93c0ff;
  --accent-tint: #16243a;

  /* Ink surfaces are kept a step darker/lighter than the page so the
     nameplate, Hybrid band and footer still read as distinct blocks. */
  --ink:        #06090d;
  --ink-2:      #121820;
  --ink-border: #29333e;
}
/* [data-theme="dark"] .brand { border-right: 1px solid var(--border); } */
[data-theme="dark"] .band { --surface-2: #1f2933; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun  { display: block; }
[data-theme="light"] .brand img{filter: invert(0.9) brightness(1.2) contrast(1.2);}

/* No-JS fallback: follow the OS when the bootstrap script cannot run. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #0b0f14; --surface: #121820; --surface-2: #18212b;
    --text: #f4f7fa; --muted: #9da8b4; --border: #29333e;
    --accent: #6ea8ff; --accent-2: #93c0ff; --accent-tint: #16243a;
    --ink: #06090d; --ink-2: #121820; --ink-border: #29333e;
  }
}


/* ==========================================================================
   12. Responsive — the hierarchy reorganises, it does not just shrink
   ========================================================================== */

/* ---- ≤1279: compact desktop ---- */
@media (max-width: 1279px) {
  .nav__list a { padding: 0 9px; font-size: 0.875rem; }
  .search__input { width: 130px; }
  .cover__text { gap: var(--s-5) var(--s-6); padding: var(--s-5); }
  .cover__aside { padding-left: var(--s-6); }
  .split, .duo { gap: var(--s-6); }
}

/* ---- ≤1024: tablet ---- */
@media (max-width: 1024px) {
  :root { --masthead-h: 56px; }

  /* Masthead: inline search becomes an icon; nav stays inline until 860px */
  .masthead__inner { gap: var(--s-3); }
  .brand { padding: 0 var(--s-4); }
  .brand img { height: 26px; }
  .search { display: none; }
  .search-link { display: inline-flex; }
  .nav__list a { padding: 0 8px; font-size: 0.875rem; }
  .strip__inner { height: 36px; }

  .cover__text { grid-template-columns: 1fr; gap: var(--s-4); }
  .cover__aside { padding-left: 0; border-left: 0; }
  .entry { gap: var(--s-5) var(--s-4); }
  .entry > .card { padding-left: var(--s-4); }
  .entry .card__title { font-size: 0.9375rem; }

  /* Latest becomes a vertical list, two per row */
  .index { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s-6); }
  .index__item { grid-template-columns: 32px 120px minmax(0, 1fr); gap: var(--s-3); align-items: start; padding: var(--s-4) 0; border-top: 1px solid var(--border); }
  .index__item:nth-child(-n+2) { border-top: 2px solid var(--text); }
  .index__num::before { font-size: 1.375rem; }

  .picks { grid-template-columns: 1fr; grid-template-rows: auto; }
  .tile--lg { grid-row: auto; }
  .tile:not(.tile--lg) { aspect-ratio: 16 / 8; }

  .fl { grid-template-columns: 40px minmax(0, 1fr); gap: var(--s-5); padding: var(--s-5); }
  .fl__label { grid-row: 1 / 3; }
  .fl__text { padding-top: var(--s-2); }

  .band__grid { grid-template-columns: 1fr; gap: var(--s-6); }

  .split, .duo { grid-template-columns: 1fr; }
  .sidebar { padding-top: var(--s-7); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-5); }
  .sidebar .widget:first-child { grid-column: 1 / -1; }
  .sidebar .widget:first-child .card { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--s-4); }
  .sidebar .widget:first-child .card__media { margin: 0; }

  .rev, .rev--wide { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--s-5); }
  .rev--wide .rev__media { order: 0; }
  .rev--wide .rev__title { font-size: 1.375rem; }
  .feat { grid-template-columns: 1fr; }

  .explore { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer__brand { grid-column: 1 / -1; }

  /* Mobile/tablet editorial priority:
     Hero → Latest → First Look → Editor's Picks → Hybrid → Reviews → PHEVs → Featured → Explore */
  .site-main { display: flex; flex-direction: column; }
  .cover              { order: 1; }
  .section--latest    { order: 2; }
  .section--firstlook { order: 3; }
  .section--picks     { order: 4; }
  .section--hybrid    { order: 5; }
  .split              { order: 6; }
  .duo                { order: 7; }
  .section--explore   { order: 8; }
}

/* ---- ≤860: primary nav becomes a horizontally scrollable strip (no JS, no duplicate markup) ---- */
@media (max-width: 860px) {
  .masthead__inner { flex-wrap: wrap; height: auto; }
  .masthead__inner > .brand, .masthead__inner > .masthead__tools { height: var(--masthead-h); }
  .nav {
    position: relative; order: 10; flex: 1 0 100%;
    height: var(--strip-h); border-top: 1px solid var(--border);
    margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter);
  }
  /* Right-edge fade hints that the strip scrolls */
  .nav::after {
    content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 40px; pointer-events: none;
    background: linear-gradient(to right, transparent, var(--surface));
  }
  .nav__list { gap: 0; overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; }
  .nav__list::-webkit-scrollbar { display: none; }
  .nav__list a { height: var(--strip-h); padding: 0 14px 0 0; margin-right: 10px; }
  .strip__label { display: none; }
  .entry { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry > .card:nth-child(3) { padding-left: 0; border-left: 0; }
}

/* ---- ≤767: phone ---- */
@media (max-width: 767px) {
  :root { --gutter: 16px; }
  .site-main { padding-block: var(--s-5) var(--s-7); }
  .section { padding-top: var(--s-7); }
  .sec-head { margin-bottom: var(--s-4); }
  .sec-head__title { font-size: 1.5rem; }

  .cover { padding-bottom: var(--s-6); }
  .cover__media { aspect-ratio: 16 / 10; }
  .cover__text { padding: var(--s-4); }
  .cover__title { font-size: clamp(1.5rem, 1.1rem + 2.2vw, 1.875rem); }
  .cover__excerpt { font-size: 1rem; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; }
  /* Entry points become compact thumb rows so Latest arrives within two screens */
  .entry { grid-template-columns: 1fr; gap: 0; margin-top: var(--s-5); }
  .entry > .card, .fl__related > .card {
    display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--s-4); align-items: start;
    padding: var(--s-4) 0 !important; border-left: 0 !important; border-top: 1px solid var(--border);
  }
  .entry > .card:first-child, .fl__related > .card:first-child { padding-top: 0 !important; border-top: 0; }
  .entry > .card .card__media, .fl__related > .card .card__media { margin: 0; aspect-ratio: 3 / 2; }
  .entry .card__title, .fl__related .card__title { font-size: 0.9375rem; }

  .index { grid-template-columns: 1fr; }
  .index__item { grid-template-columns: 28px 104px minmax(0, 1fr); }
  .index__item:nth-child(2) { border-top: 1px solid var(--border); }
  .index__title { font-size: 0.9375rem; }

  .tile:not(.tile--lg) { aspect-ratio: 16 / 10; }
  .tile__text { padding: var(--s-6) var(--s-4) var(--s-4); }
  .tile--lg .tile__excerpt { display: none; }

  .fl { grid-template-columns: 1fr; padding: var(--s-4); gap: var(--s-4); }
  .fl__label { writing-mode: horizontal-tb; transform: none; justify-self: start; align-self: auto; border-right: 0; padding-right: 0; border-left: 2px solid var(--accent); padding-left: var(--s-2); grid-row: auto; }
  .fl__related { grid-template-columns: 1fr; gap: 0; margin-top: var(--s-4); }

  .band { padding-block: var(--s-6) var(--s-7); margin-top: var(--s-7); }
  .rev, .rev--wide { grid-template-columns: 1fr; gap: var(--s-3); padding: var(--s-5) 0; }
  .rev--wide .rev__title { font-size: 1.25rem; }
  .rev__summary { -webkit-line-clamp: 2; }

  .sidebar { grid-template-columns: 1fr; padding-top: var(--s-6); }
  .row__media { flex-basis: 104px; width: 104px; }
  .feat__pair .card { grid-template-columns: 104px minmax(0, 1fr); }
  .explore { grid-template-columns: 1fr; }
  .explore__item { padding: var(--s-4); }
  .footer__top { grid-template-columns: 1fr; gap: var(--s-6); padding-block: var(--s-7) var(--s-6); }
  .footer__bottom { flex-direction: column; align-items: flex-start; }
}

/* ---- ≤479: small phone ---- */
@media (max-width: 479px) {
  .brand img { height: 24px; }
  .masthead__tools .tool { width: 38px; }
  .cover__title { font-size: clamp(1.375rem, 1rem + 2.4vw, 1.625rem); }
  .sidebar .widget:first-child .card { grid-template-columns: 1fr; }
  .sidebar .widget:first-child .card__media { margin-bottom: var(--s-3); }
  .tile__title { font-size: 1.125rem; }
  .tile--lg .tile__title { font-size: 1.375rem; }
}

@media print {
  .site-header, .site-footer, .skip-link { display: none; }
}
