/* =============================================================
   BASE — reset, typography system, global elements.
   ============================================================= */

*, *::before, *::after { box-sizing: border-box; }

body.nav-locked { overflow: hidden; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-body-size);
  line-height: var(--leading-body);
  color: var(--text-body);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  /* Final safety net: article/comparison/review bodies come from the CMS
     rich-text editor, so a single unexpected paste (a wide table, a fixed-
     width embed, an un-wrapped code block) could otherwise force the
     whole page wider than the viewport and add a horizontal scrollbar to
     the entire site. This doesn't affect position:sticky (the sidebar), it
     only clips runaway horizontal overflow at the document level. */
  overflow-x: hidden;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

/* ---- Typography system ---- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--text-heading);
  line-height: var(--leading-heading);
  margin: 0 0 var(--s-4);
  letter-spacing: -0.015em;
  text-wrap: balance;
}
.t-display { font-size: var(--text-display); line-height: var(--leading-tight); font-weight: 700; }
h1, .t-h1 { font-size: var(--text-h1); font-weight: 700; }
h2, .t-h2 { font-size: var(--text-h2); font-weight: 600; }
h3, .t-h3 { font-size: var(--text-h3); font-weight: 600; }
h4, .t-h4 { font-size: var(--text-h4); font-weight: 600; }
h5, .t-h5 { font-size: var(--text-h5); font-weight: 600; }
h6, .t-h6 { font-size: var(--text-h6); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }

p { margin: 0 0 var(--s-4); }
.t-small { font-size: var(--text-small); }
.t-caption { font-size: var(--text-caption); color: var(--text-muted); }
.t-data { font-family: var(--font-data); font-size: var(--text-small); }
.t-muted { color: var(--text-muted); }

/* Editorial eyebrow — small labelled kicker above headings */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  font-family: var(--font-display);
  font-size: var(--text-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--color-accent);
  margin-bottom: var(--s-3);
}
.eyebrow::before {
  content: "";
  width: 20px; height: 2px;
  background: currentColor;
}
a.eyebrow:hover { color: var(--color-primary); text-decoration: none; }

a { color: var(--color-primary); text-decoration: none; transition: color var(--t-fast) var(--ease-out); }
a:hover { color: var(--color-primary-strong); text-decoration: underline; text-underline-offset: 3px; }

blockquote {
  margin: var(--s-5) 0;
  padding: var(--s-4) var(--s-5);
  border-left: 3px solid var(--color-accent);
  background: var(--surface-alt);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 1.125rem;
  color: var(--text-heading);
}

ul, ol { padding-left: 1.4em; margin: 0 0 var(--s-4); }
li { margin-bottom: var(--s-2); }

hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-6) 0; }

table { border-collapse: collapse; width: 100%; font-size: var(--text-small); }
th, td { text-align: left; padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--border); }
th { font-family: var(--font-display); font-weight: 600; color: var(--text-heading); font-size: var(--text-caption); text-transform: uppercase; letter-spacing: .05em; }

code { font-family: var(--font-data); font-size: .9em; background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: .1em .4em; }

::selection { background: var(--color-primary-soft); color: var(--color-primary-strong); }

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: var(--s-4); top: -100px;
  background: var(--surface); color: var(--text-heading);
  padding: var(--s-2) var(--s-4); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md); z-index: 200;
}
.skip-link:focus { top: var(--s-2); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  font-family: var(--font-display);
  font-size: var(--text-small);
  font-weight: 600;
  line-height: 1;
  padding: .85em 1.5em;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast) var(--ease-out),
              color var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out),
              transform var(--t-fast) var(--ease-out),
              box-shadow var(--t-fast) var(--ease-out);
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--color-primary); color: var(--text-invert); }
.btn--primary:hover { background: var(--color-primary-strong); color: var(--text-invert); box-shadow: var(--shadow-md); }

.btn--accent { background: var(--color-accent); color: #fff; }
.btn--accent:hover { background: var(--verdict-500); color: #fff; box-shadow: var(--shadow-md); }
[data-theme="dark"] .btn--accent { color: #06251A; }

.btn--ghost { background: transparent; color: var(--text-heading); border-color: var(--border-strong); }
.btn--ghost:hover { border-color: var(--text-heading); color: var(--text-heading); }

.btn--link { background: none; color: var(--color-primary); padding: 0; border: 0; }
.btn--lg { font-size: var(--text-h5); padding: 1em 1.8em; }
.btn--block { width: 100%; }

/* ---- Badges & tags ---- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35em;
  font-family: var(--font-display);
  font-size: var(--text-caption);
  font-weight: 600;
  padding: .35em .8em;
  border-radius: var(--radius-pill);
}
.badge--accent { background: var(--color-accent-soft); color: var(--color-accent); }
.badge--primary { background: var(--color-primary-soft); color: var(--color-primary); }
.badge--warning { background: var(--signal-amber-bg); color: var(--color-warning); }
.badge--pick { background: var(--color-accent); color: #fff; }
[data-theme="dark"] .badge--pick { color: #06251A; }

.tag {
  display: inline-block;
  font-size: var(--text-caption);
  color: var(--text-muted);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: .3em .9em;
  transition: border-color var(--t-fast) var(--ease-out), color var(--t-fast) var(--ease-out);
}
.tag:hover { border-color: var(--color-primary); color: var(--color-primary); text-decoration: none; }

/* ---- Forms ---- */
.field { margin-bottom: var(--s-4); }
.field label {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-caption);
  font-weight: 600;
  color: var(--text-heading);
  margin-bottom: var(--s-2);
}
.input, .select, .textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--text-small);
  color: var(--text-body);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: .75em 1em;
  transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-soft);
}
.textarea { min-height: 130px; resize: vertical; }
