/* ============================================================
   VerdictDesk — Review Site UI  ·  Design System (v1)
   Built with frontend-design + tdd discipline.
   Signature: the "Score Ring" verdict gauge.
   Palette: warm paper + Verdict Teal + Signal Coral.
   Deliberately NOT: cream+serif+terracotta / near-black+acid /
   broadsheet hairlines.
   ============================================================ */

/* ---------- 1. TOKENS ---------- */
:root {
  /* Color — light (default) */
  --color-bg: #FBFAF7;          /* warm paper white, not cream */
  --color-surface: #FFFFFF;
  --color-surface-2: #F2F1EC;   /* faint warm gray */
  --color-ink: #16202B;         /* deep slate, not pure black */
  --color-ink-soft: #5A6B78;
  --color-line: #E4E2DA;
  --color-line-strong: #D2CFC4;

  --color-accent: #0B6B55;      /* Verdict Teal — trust / savings (deepened for AA white text) */
  --color-accent-ink: #0A5C49;
  --color-accent-tint: #E3F4EF;
  --color-highlight: #D8391B;   /* Signal Coral — deals / CTA (deepened for AA white text) */
  --color-highlight-ink: #9E2A12;
  --color-highlight-tint: #FBE6E0;
  --on-accent: #FFFFFF;         /* text color on accent/highlight fills */

  /* Semantic score tiers (ring + bars) */
  --score-excellent: #1F9D55;
  --score-good: #4FB477;
  --score-warn: #F2A900;
  --score-low: #F2683C;
  --score-bad: #E5484D;

  /* Typography */
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-body: 'Hanken Grotesk', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1.0625rem;   /* 17px body */
  --fs-md: 1.25rem;
  --fs-lg: 1.5rem;
  --fs-xl: 2rem;
  --fs-2xl: 2.75rem;
  --fs-3xl: 3.5rem;

  /* Spacing — 4px base */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --space-8: 4rem;
  --space-9: 6rem;

  /* Radius + shadow */
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(22,32,43,.06), 0 1px 3px rgba(22,32,43,.05);
  --shadow: 0 6px 18px rgba(22,32,43,.08), 0 2px 6px rgba(22,32,43,.05);
  --shadow-lg: 0 18px 48px rgba(22,32,43,.14);

  --maxw: 1200px;
  --header-h: 68px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --color-bg: #0E1419;
  --color-surface: #161F26;
  --color-surface-2: #1E2A33;
  --color-ink: #EAF0F2;
  --color-ink-soft: #9FB0BB;
  --color-line: #26333D;
  --color-line-strong: #34434F;

  --color-accent: #34D6B0;
  --color-accent-ink: #6FE3CB;
  --color-accent-tint: #103029;
  --color-highlight: #FF7A5C;
  --color-highlight-ink: #FFB39E;
  --color-highlight-tint: #2E1A14;
  --on-accent: #0E1419;

  --score-excellent: #34C46E;
  --score-good: #6FC994;
  --score-warn: #F7B73B;
  --score-low: #F5855C;
  --score-bad: #F26A6E;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.4);
  --shadow: 0 6px 18px rgba(0,0,0,.45);
  --shadow-lg: 0 18px 48px rgba(0,0,0,.6);
}

/* Dark-mode hardening: keep images from blinding users; force badges onto dark surface. */
[data-theme="dark"] img,
[data-theme="dark"] video,
[data-theme="dark"] .article-hero img,
[data-theme="dark"] .hero__media img { filter: brightness(.88) contrast(.95); }
[data-theme="dark"] .verdict__badge,
[data-theme="dark"] .hero__badge { background: var(--color-surface-2); color: var(--color-ink); }

/* ---------- 2. RESET / BASE ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--color-ink);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
main { flex: 1; min-width: 0; width: 100%; }
a { color: var(--color-accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: var(--heading-weight); line-height: 1.12; margin: 0 0 var(--space-3); letter-spacing: -0.01em; }
p { margin: 0 0 var(--space-4); }
button { font-family: inherit; cursor: pointer; }

/* Accessibility floor */
.skip-link {
  position: absolute; left: var(--space-3); top: -48px;
  background: var(--color-ink); color: var(--color-bg);
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-sm);
  z-index: 200; transition: top .2s ease;
}
.skip-link:focus { top: var(--space-3); color: var(--color-bg); text-decoration: none; }
:focus-visible { outline: 3px solid var(--color-highlight); outline-offset: 2px; border-radius: 3px; }

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

/* Layout helpers */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--space-5); }
.eyebrow {
  font-size: var(--fs-small); font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--color-accent-ink);
  display: inline-flex; align-items: center; gap: var(--space-2);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--color-accent); display: inline-block; }

/* ---------- 3. BUTTONS ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font-weight: 700; font-size: var(--fs-sm); line-height: 1;
  padding: 0.85em 1.4em; border-radius: 999px; border: 2px solid transparent;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); }
.btn--primary { background: var(--color-highlight); color: var(--on-accent); box-shadow: 0 8px 20px rgba(216,57,27,.28); }
.btn--primary:hover { box-shadow: 0 12px 26px rgba(216,57,27,.4); }
.btn--accent { background: var(--color-accent); color: var(--on-accent); box-shadow: 0 8px 20px rgba(11,107,85,.25); }
.btn--ghost { background: transparent; color: var(--color-ink); border-color: var(--color-line-strong); }
.btn--ghost:hover { border-color: var(--color-ink); }

/* ---------- 4. HEADER / NAV ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--color-bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--color-line);
}
.nav { display: flex; align-items: center; gap: var(--space-5); height: var(--header-h); }
.brand { display: flex; align-items: center; gap: var(--space-2); font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--color-ink); }
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center;
  background: var(--color-accent); color: #fff; font-weight: 700; font-size: .9rem;
}
.brand__mark::after { content: "✓"; }
.nav__links { display: flex; gap: var(--space-4); list-style: none; margin: 0; padding: 0; margin-left: var(--space-4); }
.nav__links a { color: var(--color-ink); font-weight: 600; font-size: var(--fs-sm); padding: var(--space-2) 0; position: relative; }
.nav__links a::after { content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0; background: var(--color-accent); transition: width .2s ease; }
.nav__links a:hover::after { width: 100%; text-decoration: none; }
.nav__tools { margin-left: auto; display: flex; align-items: center; gap: var(--space-3); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--color-line);
  background: var(--color-surface); color: var(--color-ink); display: grid; place-items: center; font-size: 1.05rem;
  transition: border-color .2s ease, background-color .2s ease, color .2s ease, box-shadow .2s ease;
}
[data-theme="dark"] #theme-toggle {
  background: var(--color-surface-2);
  border-color: var(--color-accent);
  box-shadow: 0 0 0 1px var(--color-accent-tint), 0 0 12px rgba(52, 214, 176, .18);
}
.icon-btn:hover { border-color: var(--color-ink); }
.nav__toggle { display: none; }

/* ---------- 5. SCORE RING (signature) ---------- */
.score-ring {
  --pct: 0; --ring-color: var(--score-good);
  position: relative; width: 84px; height: 84px; flex: none;
}
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring .sr-track { fill: none; stroke: var(--color-line); stroke-width: 9; }
.score-ring .sr-fill {
  fill: none; stroke: var(--ring-color); stroke-width: 9; stroke-linecap: round;
  stroke-dasharray: 276.46; stroke-dashoffset: calc(276.46 - (276.46 * var(--pct) / 100));
  transition: stroke-dashoffset 1.1s cubic-bezier(.2,.8,.2,1);
}
.score-ring__num {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-body); font-weight: 800; font-size: 1.5rem;
  font-variant-numeric: tabular-nums; color: var(--color-ink);
}
.score-ring__num small { font-size: .7rem; font-weight: 600; color: var(--color-ink-soft); margin-left: 1px; }
.score-ring--excellent { --ring-color: var(--score-excellent); }
.score-ring--good { --ring-color: var(--score-good); }
.score-ring--warn { --ring-color: var(--score-warn); }
.score-ring--low { --ring-color: var(--score-low); }
.score-ring--bad { --ring-color: var(--score-bad); }
.score-ring--lg { width: 120px; height: 120px; }
.score-ring--lg .score-ring__num { font-size: 2.2rem; }
.score-ring--sm { width: 60px; height: 60px; }
.score-ring--sm .score-ring__num { font-size: 1.1rem; }

/* ---------- 6. HERO ---------- */
.hero { padding: var(--space-8) 0 var(--space-7); }
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: var(--space-7); align-items: center; }
.hero__title { font-size: var(--fs-display); margin: var(--space-3) 0 var(--space-4); }
.hero__dek { font-size: var(--fs-md); color: var(--color-ink-soft); max-width: 46ch; }
.hero__meta { display: flex; align-items: center; gap: var(--space-4); margin: var(--space-5) 0; }
.hero__cta { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.hero__media { position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); aspect-ratio: 4/3; background: var(--color-surface-2); }
.hero__media img { width: 100%; height: 100%; object-fit: cover; }
.hero__badge {
  position: absolute; top: var(--space-4); left: var(--space-4);
  background: var(--color-highlight); color: var(--on-accent); font-weight: 800; font-size: var(--fs-xs);
  letter-spacing: .1em; text-transform: uppercase; padding: var(--space-2) var(--space-3); border-radius: 999px;
  box-shadow: 0 6px 16px rgba(216,57,27,.4);
}

/* ---------- 7. RAIL (top picks) ---------- */
.section { padding: var(--space-section) 0; }
.section__head { display: flex; align-items: end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
.section__title { font-size: var(--fs-heading); }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: var(--space-4); overflow-x: auto; padding-bottom: var(--space-3); scroll-snap-type: x mandatory; min-width: 0; width: 100%; }
.rail > * { scroll-snap-align: start; }

/* ---------- 8. CARDS ---------- */
.card {
  background: var(--color-surface); border: var(--card-border);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--color-line-strong); }
.pick-card { display: flex; flex-direction: column; }
.pick-card__media { aspect-ratio: 16/10; background: var(--color-surface-2); overflow: hidden; }
.pick-card__media img { width: 100%; height: 100%; object-fit: cover; }
.pick-card__body { padding: var(--space-card); display: flex; flex-direction: column; gap: var(--space-2); flex: 1; }
.pick-card__row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); }
.pick-card__title { font-family: var(--font-display); font-size: var(--fs-heading); margin: 0; }
.pick-card__verdict { color: var(--color-ink-soft); font-size: var(--fs-sm); }

.review-card { display: flex; flex-direction: column; }
.review-card__media { aspect-ratio: 16/9; background: var(--color-surface-2); overflow: hidden; position: relative; }
.review-card__media img { width: 100%; height: 100%; object-fit: cover; }
.review-card__body { padding: var(--space-card); display: flex; flex-direction: column; gap: var(--space-2); }
.review-card__cat { font-size: var(--fs-small); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--color-accent-ink); }
.review-card__title { font-family: var(--font-display); font-size: var(--fs-heading); margin: 0; line-height: 1.2; }
.review-card__verdict { color: var(--color-ink-soft); font-size: var(--fs-sm); }
.review-card__foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: var(--space-3); }
.text-link { font-weight: 700; font-size: var(--fs-small); color: var(--color-accent-ink); }
.text-link:hover { gap: var(--space-2); }

/* ---------- 9. HOW WE TEST + NEWSLETTER ---------- */
.trust-band { background: var(--color-surface-2); border-radius: var(--radius-lg); padding: var(--space-6); }
.trust-band__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-5); margin-top: var(--space-5); }
.trust-item { display: flex; gap: var(--space-3); align-items: flex-start; }
.trust-item__icon { width: 44px; height: 44px; flex: none; border-radius: 12px; background: var(--color-accent-tint); color: var(--color-accent-ink); display: grid; place-items: center; font-size: 1.3rem; }
.trust-item h4 { font-family: var(--font-body); font-size: var(--fs-sm); font-weight: 700; margin: 0 0 2px; }
.trust-item p { font-size: var(--fs-sm); color: var(--color-ink-soft); margin: 0; }

.newsletter { background: linear-gradient(120deg, var(--color-accent), var(--color-accent-ink)); color: #fff; border-radius: var(--radius-lg); padding: var(--space-7); display: grid; grid-template-columns: 1.1fr .9fr; gap: var(--space-6); align-items: center; }
.newsletter h2 { color: #fff; font-size: var(--fs-xl); }
.newsletter p { color: rgba(255,255,255,.85); }
.newsletter__form { display: flex; gap: var(--space-2); }
.newsletter__form input { flex: 1; padding: 0.85em 1.1em; border-radius: 999px; border: none; font-size: var(--fs-sm); }
.newsletter__form .btn--primary { background: #fff; color: var(--color-accent-ink); box-shadow: none; }

/* ---------- 10. FOOTER ---------- */
.site-footer { width: 100%; flex-shrink: 0; background: var(--color-surface-2); border-top: 1px solid var(--color-line); margin-top: var(--space-8); padding: var(--space-7) 0 var(--space-5); }
.footer__grid { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: var(--space-5); }
.footer__col h4 { font-family: var(--font-body); font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .08em; color: var(--color-ink-soft); margin: 0 0 var(--space-3); }
.footer__col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.footer__col a { color: var(--color-ink); font-size: var(--fs-sm); }
.footer__bottom { display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--color-line); font-size: var(--fs-xs); color: var(--color-ink-soft); }

/* ---------- 11. REVIEW ARTICLE PAGE ---------- */
.breadcrumb { font-size: var(--fs-sm); color: var(--color-ink-soft); padding: var(--space-4) 0 0; }
.breadcrumb a { color: var(--color-ink-soft); }
.article-head { padding: var(--space-4) 0 var(--space-5); max-width: 820px; }
.article-head h1 { font-size: var(--fs-display); margin: var(--space-3) 0; }
.article-head__dek { font-size: var(--fs-lg); color: var(--color-ink-soft); }
.byline { display: flex; align-items: center; gap: var(--space-3); font-size: var(--fs-sm); color: var(--color-ink-soft); flex-wrap: wrap; }
.byline__avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--color-accent-tint); color: var(--color-accent-ink); display: grid; place-items: center; font-weight: 800; }
.article-hero { border-radius: var(--radius-lg); overflow: hidden; aspect-ratio: 21/9; background: var(--color-surface-2); margin-bottom: var(--space-6); }
.article-hero img { width: 100%; height: 100%; object-fit: cover; }

.search-form { display: inline-flex; align-items: center; gap: var(--space-2); margin: 0; }
.search-form input[type="search"] {
  width: clamp(120px, 30vw, 220px);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  border: 1px solid var(--color-line);
  background: var(--color-surface);
  color: var(--color-ink);
  font: inherit;
}
.search-form input[type="search"]::placeholder { color: var(--color-ink-soft); }
.search-form button { padding: var(--space-2) var(--space-3); font-size: var(--fs-sm); }

.review-hero { margin: var(--space-5) 0; }
.review-hero img { width: 100%; border-radius: var(--radius-lg); display: block; }

/* Verdict box */
.verdict {
  display: grid; grid-template-columns: 220px 1fr; gap: var(--space-6);
  background: var(--color-surface); border: var(--card-border);
  border-radius: var(--radius-lg); padding: var(--space-6); box-shadow: var(--shadow);
  margin: var(--space-6) 0;
}
.verdict__left { display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center; border-right: 1px solid var(--color-line); padding-right: var(--space-5); min-width: 0; }
.verdict__right { min-width: 0; }
.verdict__badge { background: var(--color-highlight-tint); color: var(--color-highlight-ink); font-weight: 800; font-size: var(--fs-xs); letter-spacing: .08em; text-transform: uppercase; padding: var(--space-2) var(--space-3); border-radius: 999px; }
.verdict__score-label { font-size: var(--fs-xs); color: var(--color-ink-soft); text-transform: uppercase; letter-spacing: .1em; }
.verdict__summary { font-size: var(--fs-md); overflow-wrap: break-word; }
.proscons { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-5); margin: var(--space-4) 0; }
.proscons h4 { font-family: var(--font-body); font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--color-ink-soft); margin: 0 0 var(--space-2); }
.proscons ul { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--space-2); }
.proscons li { display: flex; gap: var(--space-2); font-size: var(--fs-sm); align-items: start; }
.proscons .ico { font-weight: 800; }
.proscons .pro .ico { color: var(--score-good); }
.proscons .con .ico { color: var(--score-bad); }
.tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-3) 0; }
.tag { background: var(--color-accent-tint); color: var(--color-accent-ink); font-size: var(--fs-xs); font-weight: 700; padding: var(--space-1) var(--space-3); border-radius: 999px; }

.toc { background: var(--color-surface-2); border-radius: var(--radius); padding: var(--space-4) var(--space-5); margin: var(--space-5) 0; }
.toc h4 { font-family: var(--font-body); font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--color-ink-soft); margin: 0 0 var(--space-2); }
.toc ol { margin: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.toc a { color: var(--color-ink); font-size: var(--fs-sm); }

/* Related */
.related { padding: var(--space-6) 0; }

/* ============================================================
   12. .aim-review-content — styles AIOMagen-generated articles
   (continuity with the mu-plugin component library)
   ============================================================ */
.aim-review-content { font-size: var(--fs-base); overflow-wrap: break-word; word-break: break-word; }
.aim-review-content h2 { font-size: var(--fs-xl); margin-top: var(--space-6); padding-top: var(--space-4); border-top: 3px solid var(--color-accent); }
.aim-review-content h3 { font-size: var(--fs-lg); margin-top: var(--space-5); }
.aim-review-content ul, .aim-review-content ol { padding-left: 1.3em; }
.aim-review-content li { margin-bottom: var(--space-2); }
.aim-review-content li::marker { color: var(--color-accent); }

/* Tables */
.aim-review-content table { width: 100%; table-layout: fixed; border-collapse: collapse; margin: var(--space-5) 0; font-size: var(--fs-sm); background: var(--color-surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.aim-review-content th { background: var(--color-accent); color: var(--on-accent); text-align: left; padding: var(--space-3) var(--space-4); font-weight: 700; }
.aim-review-content td { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--color-line); }
.aim-review-content tbody tr:nth-child(even) { background: var(--color-surface-2); }
.aim-review-content tbody tr:hover { background: var(--color-accent-tint); }
.table-wrap { overflow-x: auto; max-width: 100%; min-width: 0; }

/* Score bars (Score Dimensions) */
.aim-score-row { display: grid; grid-template-columns: 160px 1fr 56px; gap: var(--space-3); align-items: center; margin: var(--space-2) 0; }
.aim-score-row__label { font-weight: 600; font-size: var(--fs-sm); }
.aim-score-bar { height: 12px; border-radius: 999px; background: var(--color-surface-2); overflow: hidden; }
.aim-score-bar__fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--score-good), var(--score-excellent)); position: relative; }
.aim-score-bar__fill::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent); transform: translateX(-100%); animation: shine 2.4s infinite; }
.aim-score-row__val { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; font-size: var(--fs-sm); }

/* Stars */
.aim-stars { color: var(--score-warn); letter-spacing: 2px; font-size: 1.1rem; }
.aim-star-empty { color: var(--color-line-strong); }

/* Tip boxes */
.aim-tip-box { border-left: 4px solid var(--color-accent); background: var(--color-accent-tint); padding: var(--space-3) var(--space-4); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; margin: var(--space-4) 0; }
.aim-tip-box h4 { font-family: var(--font-body); margin: 0 0 4px; font-size: var(--fs-sm); color: var(--color-accent-ink); }
.aim-tip-box--warning { border-color: var(--score-warn); background: #FFF6E0; }
.aim-tip-box--warning h4 { color: #8a6400; }

/* User review cards */
.aim-review-card { border-left: 4px solid var(--color-accent); background: var(--color-surface); padding: var(--space-4); border-radius: 0 var(--radius) var(--radius) 0; margin: var(--space-3) 0; box-shadow: var(--shadow-sm); }
.aim-review-card__head { display: flex; align-items: center; gap: var(--space-2); margin-bottom: var(--space-2); }
.aim-review-card__name { font-weight: 800; }
.aim-review-card__role { color: var(--color-ink-soft); font-size: var(--fs-xs); }
.aim-verified { background: var(--color-accent-tint); color: var(--color-accent-ink); font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .06em; }

/* CTA button inside articles */
.aim-cta-btn { display: inline-flex; align-items: center; gap: var(--space-2); background: var(--color-highlight); color: var(--on-accent); font-weight: 800; padding: var(--space-3) var(--space-5); border-radius: 999px; box-shadow: 0 10px 24px rgba(216,57,27,.3); transition: transform .15s ease, box-shadow .15s ease; margin: var(--space-4) 0; }
.aim-cta-btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 14px 30px rgba(255,90,60,.42); }

/* Disclaimer */
.aim-disclaimer { border: 1px dashed var(--color-line-strong); border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); font-size: var(--fs-sm); color: var(--color-ink-soft); margin: var(--space-5) 0; }

@keyframes shine { to { transform: translateX(100%); } }

/* ---------- 16. LISTING GRID (category / tags pages) ---------- */
.listing-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-gap);
  margin: var(--space-5) 0 var(--space-7);
}
.listing-grid .review-card { width: 100%; }
.page-head { padding: var(--space-6) 0 var(--space-2); max-width: none; }
.page-head h1 { font-size: var(--fs-display); margin: var(--space-2) 0 var(--space-3); }
.page-head p { color: var(--color-ink-soft); max-width: 60ch; font-size: var(--fs-md); }
.chip-row { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0 var(--space-5); }
.chip {
  display: inline-flex; align-items: center; gap: var(--space-2);
  background: var(--color-surface); border: 1px solid var(--color-line);
  color: var(--color-ink); font-size: var(--fs-small); font-weight: 600;
  padding: var(--space-2) var(--space-3); border-radius: 999px;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.chip:hover { text-decoration: none; border-color: var(--color-accent); color: var(--color-accent-ink); }
.chip--active { background: var(--color-accent); border-color: var(--color-accent); color: var(--on-accent); }
.chip--active:hover { color: var(--on-accent); }

/* ---------- 17. THEME LAYOUT ENGINE (driven by themes.css) ----------
   Themes switch via <html data-style="KEY">. This section provides the
   structural primitives (layout wrapper, sidebar, scorebox with 4 score
   forms, comparison area with 3 forms) that per-theme rules reveal/hide. */
.layout { display: grid; gap: var(--space-6); align-items: start; }
.layout__main { min-width: 0; }
.sidebar { min-width: 0; }
.sidebar__block { background: var(--color-surface-2); border: var(--card-border); border-radius: var(--radius); padding: var(--space-card); margin-bottom: var(--space-4); }
.sidebar__block h4 { font-family: var(--font-body); font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--color-ink-soft); margin: 0 0 var(--space-3); }
.sidebar__list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.sidebar__list a { color: var(--color-ink); font-size: var(--fs-sm); font-weight: 600; }
.sidebar__list a:hover { color: var(--color-accent-ink); }

/* Scorebox: holds 4 score forms; each theme reveals exactly one. */
.scorebox { display: inline-flex; align-items: center; }
.score { display: none; align-items: center; }
.score--ring { display: inline-flex; } /* legacy signature stays visible by default */
.score--stars { gap: 2px; color: var(--score-warn); font-size: 1.05rem; }
.score--stars b { color: var(--color-ink); font-weight: 800; margin-left: 6px; font-variant-numeric: tabular-nums; }
.score--bar { gap: 8px; }
.score--bar i { width: 84px; height: 10px; border-radius: 999px; background: var(--color-surface-2); position: relative; overflow: hidden; display: inline-block; }
.score--bar i::after { content: ""; position: absolute; inset: 0; width: var(--v, 80%); background: linear-gradient(90deg, var(--score-good), var(--score-excellent)); }
.score--bar b { font-weight: 800; font-variant-numeric: tabular-nums; }
.score--number { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: var(--color-accent); align-items: baseline; }
.score--number small { font-size: .8rem; color: var(--color-ink-soft); margin-left: 2px; font-family: var(--font-body); }
.score--radar svg { width: 66px; height: 66px; display: block; }

/* Comparison area: three forms, themes reveal one (table is default). */
.compare { margin: var(--space-6) 0; }
.compare--cards { display: none; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: var(--space-4); }
.compare-card { border: var(--card-border); border-radius: var(--radius); padding: var(--space-card); background: var(--color-surface); }
.compare-card h4 { margin: 0 0 var(--space-2); font-family: var(--font-display); }
.compare-card .ct-row { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-1) 0; font-size: var(--fs-sm); border-bottom: 1px solid var(--color-line); }
.compare-card .ct-row:last-child { border-bottom: none; }
.compare-card .ct-row span:last-child { font-weight: 700; }
.compare--accordion { display: none; }
.compare--accordion details { border: 1px solid var(--color-line); border-radius: var(--radius-sm); margin-bottom: var(--space-2); padding: var(--space-3) var(--space-4); background: var(--color-surface); }
.compare--accordion summary { font-weight: 700; cursor: pointer; }
.compare--accordion .ca-row { display: flex; justify-content: space-between; gap: var(--space-3); padding: var(--space-1) 0; font-size: var(--fs-sm); }
.compare--accordion .ca-row span:last-child { font-weight: 700; }

/* Style switcher (nav) */
.style-switch { position: relative; max-width: 200px; }
.style-switch select {
  appearance: none; -webkit-appearance: none; font-family: var(--font-body); font-weight: 600;
  font-size: var(--fs-sm); color: var(--color-ink); background: var(--color-surface);
  border: 1px solid var(--color-line-strong); border-radius: 999px; padding: 0.5em 2em 0.5em 1em; cursor: pointer; max-width: 200px;
}
.style-switch::after { content: "▾"; position: absolute; right: .8em; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--color-ink-soft); font-size: .8rem; }
.style-switch optgroup { font-weight: 700; }

/* Keep the full category nav hidden (hamburger only) well into desktop widths,
   because the long 8-link row + the wide style-switch select can overflow the
   header at tablet/desktop sizes. The 980px breakpoint below still handles the
   layout collapse; this one only governs the nav link visibility. */
@media (max-width: 1180px) {
  .nav__links { display: none; }
  .nav__toggle { display: grid; }
}

/* Mobile: collapse any sidebar / multi-column grid to a single column. */
@media (max-width: 980px) {
  .layout { grid-template-columns: 1fr !important; }
  .sidebar { order: 0 !important; }
}
@media (max-width: 640px) {
  .listing-grid { grid-template-columns: 1fr !important; column-count: 1 !important; display: grid !important; }
  .listing-grid > * { flex: 1 1 100% !important; }
  .review-card { flex-direction: column !important; }
  .review-card__media { flex: none !important; width: 100% !important; aspect-ratio: 16/9 !important; }
  .compare--cards { grid-template-columns: 1fr !important; }
}

/* ---------- 13. MOBILE NAV OPEN ---------- */
body.nav-open .nav__links {
  display: flex; position: absolute; top: var(--header-h); left: 0; right: 0;
  flex-direction: column; background: var(--color-surface); border-bottom: 1px solid var(--color-line);
  padding: var(--space-4) var(--space-5); gap: var(--space-3); margin: 0;
}

/* ---------- 14. SCROLL REVEAL ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 15. RESPONSIVE ---------- */
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; }
  .newsletter { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
  .verdict { grid-template-columns: 1fr; }
  .verdict__left { border-right: none; border-bottom: 1px solid var(--color-line); padding-right: 0; padding-bottom: var(--space-4); }
  .trust-band__grid { grid-template-columns: 1fr; }
  /* Collapse the desktop nav into the hamburger menu earlier (tablet widths
     too), otherwise the 8 category links overflow the header and widen the
     whole page. */
  .nav__links { display: none; }
  .nav__toggle { display: grid; }
}
@media (max-width: 640px) {
  :root { --fs-3xl: 2.4rem; --fs-2xl: 2rem; --fs-xl: 1.6rem; }
  .wrap { padding-inline: var(--space-3); }
  /* Header must fit the narrowest phones (320px): shrink the brand, the
     icon buttons, and drop the search button so the menu toggle is never
     clipped or pushed off-screen. */
  .brand { font-size: 1rem; }
  .nav { gap: var(--space-2); }
  .icon-btn { width: 32px; height: 32px; font-size: .9rem; }
  .nav__tools { gap: var(--space-2); }
  /* The search button is no longer the first child (the style-switch sits
     first), so target it by its label instead of :first-child. */
  .nav__tools button[aria-label="Search"] { display: none; }
  /* Clamp the style switcher so the header never exceeds the narrowest
     phones (320px) even with brand + dark toggle + menu toggle. */
  .style-switch { max-width: 100px; }
  .style-switch select { width: 100px; max-width: 100px; font-size: .72rem; padding: .35em 1.6em .35em .6em; }
  .section__head { flex-direction: column; align-items: flex-start; }
  .proscons { grid-template-columns: 1fr; }
  /* Review page: verdict box stacks and the large score ring shrinks so
     nothing is pushed past the viewport edge on phones. */
  .verdict { grid-template-columns: 1fr; gap: var(--space-4); padding: var(--space-4); }
  .verdict__left { border-right: none; border-bottom: 1px solid var(--color-line); padding-right: 0; padding-bottom: var(--space-4); }
  .score-ring--lg { width: 96px; height: 96px; }
  .score-ring--lg .score-ring__num { font-size: 1.7rem; }
  .article-head h1 { font-size: var(--fs-xl); }
  /* Tables: cells wrap long words so wide comparison tables fit the screen
     (table-layout: fixed is now set at the base rule for every breakpoint). */
  .aim-review-content th, .aim-review-content td { word-break: break-word; overflow-wrap: anywhere; padding: var(--space-2) var(--space-3); font-size: var(--fs-xs); }
  /* Related-products rail: stack vertically on phones so there is no
     horizontal dragging at all on mobile. */
  .rail { grid-auto-flow: row; grid-template-columns: 1fr; overflow-x: visible; }
  .aim-review-content h2, .aim-review-content h3, .aim-review-content p, .verdict__summary, .article-head h1 { overflow-wrap: break-word; word-break: break-word; }
  .verdict { min-width: 0; }
  .proscons > div { min-width: 0; }
  .article-hero img { max-width: 100%; }
  .listing-grid { grid-template-columns: 1fr; }
  .footer__grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-4); }
  .footer__col:first-child { grid-column: 1 / -1; }
  .footer__col:nth-child(4) { grid-column: 1 / -1; }
  .footer__col h4 { margin: 0 0 var(--space-2); }
  .footer__bottom { flex-direction: row; flex-wrap: wrap; justify-content: space-between; text-align: left; gap: var(--space-3); padding-top: var(--space-3); }
  .site-footer { padding: var(--space-6) 0 var(--space-4); margin-top: var(--space-6); border-top: 2px solid var(--color-line); }
  .newsletter__form { flex-direction: column; }
  .newsletter__form .btn--primary { width: 100%; }
  .aim-score-row { grid-template-columns: 96px 1fr 44px; gap: var(--space-2); }
}

/* Ultra-narrow phones (320–400px): the brand + switcher + two toggles must
   still fit. Shrink the brand and the style-switch a touch more so the header
   never exceeds the viewport on the smallest devices. */
@media (max-width: 400px) {
  .brand { font-size: .82rem; }
  .nav { gap: 6px; }
  .style-switch { max-width: 84px; }
  .style-switch select { width: 84px; max-width: 84px; font-size: .68rem; padding: .3em 1.4em .3em .5em; }
  .icon-btn { width: 30px; height: 30px; }
}

/* ---------- 16. REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
  .score-ring .sr-fill { transition: none; }
}
