/* ==========================================================================
   Switching Guides — shared stylesheet
   Used by the landing page and every guide page.
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --bg-sunken: #eef0f3;
  --text: #1c1f24;
  --text-muted: #5c636e;
  --border: #d9dde3;
  --accent: #1f5fa9;
  --accent-soft: #e8f0fa;
  --warn-bg: #fff8e6;
  --warn-border: #e8c874;

  --band-top: #f5dada;
  --band-mid: #f7ecd0;
  --band-base: #d9ead9;

  --maxw: 68rem;
  --radius: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181d;
    --bg-alt: #1c2027;
    --bg-sunken: #23282f;
    --text: #e6e8ec;
    --text-muted: #a3abb7;
    --border: #333a44;
    --accent: #7ab3f0;
    --accent-soft: #1e2a38;
    --warn-bg: #2a2417;
    --warn-border: #6b5827;

    --band-top: #4d3030;
    --band-mid: #4a3f28;
    --band-base: #2b4433;
  }
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

/* ---------- Layout ---------- */

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.75rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.site-title {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

.site-title a {
  color: var(--text);
  text-decoration: none;
}

.site-tagline {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

main {
  padding: 2.25rem 0 3rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0 2.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ---------- Typography ---------- */

h1 {
  font-size: 2rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.75rem;
}

h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin: 2.5rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border);
}

h3 {
  font-size: 1.05rem;
  margin: 1.75rem 0 0.5rem;
}

p {
  margin: 0 0 1rem;
}

.intro {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 46rem;
}

a {
  color: var(--accent);
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.1em 0.4em;
  white-space: nowrap;
}

code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-sunken);
  border-radius: 4px;
  padding: 0.1em 0.35em;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 1rem;
}

.meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}

/* ---------- Search / filter ---------- */

.filter {
  margin: 1.75rem 0 1rem;
}

.filter label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.filter input {
  width: 100%;
  max-width: 26rem;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.5rem 0.7rem;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.filter input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.filter-count {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0.4rem 0 0;
}

/* ---------- Comparison tables ---------- */

.table-scroll {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 0 1.5rem;
}

table.compare {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 40rem;
}

table.compare caption {
  text-align: left;
  font-size: 0.85rem;
  color: var(--text-muted);
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-alt);
}

table.compare th,
table.compare td {
  text-align: left;
  vertical-align: top;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

table.compare thead th {
  position: sticky;
  top: 0;
  background: var(--accent-soft);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border);
}

table.compare tbody tr:nth-child(even) {
  background: var(--bg-alt);
}

table.compare tbody tr:last-child td {
  border-bottom: 0;
}

table.compare th[scope="row"] {
  font-weight: 600;
  width: 44%;
}

table.compare td {
  width: 56%;
}

/* Three-column variant: a narrow label column plus two content columns. */
table.compare.cols-3 th[scope="row"] {
  width: 20%;
}

table.compare.cols-3 td {
  width: auto;
}

table.compare.cols-3 td:first-of-type {
  width: 18%;
  white-space: nowrap;
}

tr[hidden] {
  display: none;
}

.no-results {
  padding: 1rem 0.85rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* ---------- Pyramid diagram ---------- */

.diagram {
  margin: 1.5rem 0 2rem;
  padding: 1.25rem 1rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
}

.diagram svg {
  display: block;
  width: 100%;
  height: auto;
  max-width: 40rem;
  margin: 0 auto;
}

.diagram figcaption {
  max-width: 40rem;
  margin: 0.5rem auto 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

.diagram .band-label {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  fill: var(--text);
}

.diagram .band-sub {
  font-family: var(--font-sans);
  font-size: 12px;
  fill: var(--text-muted);
}

.diagram .axis-note {
  font-family: var(--font-sans);
  font-size: 11.5px;
  fill: var(--text-muted);
}

.diagram .band {
  stroke: var(--border);
  stroke-width: 1.5;
}

.diagram .band-top {
  fill: var(--band-top);
}

.diagram .band-mid {
  fill: var(--band-mid);
}

.diagram .band-base {
  fill: var(--band-base);
}

/* ---------- Callouts ---------- */

.callout {
  background: var(--warn-bg);
  border: 1px solid var(--warn-border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin: 1.5rem 0;
}

.callout h3 {
  margin-top: 0;
}

.callout ul {
  margin: 0;
  padding-left: 1.2rem;
}

.callout li {
  margin-bottom: 0.6rem;
}

.callout li:last-child {
  margin-bottom: 0;
}

/* ---------- Guide index cards ---------- */

.guide-grid {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
}

.guide-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  background: var(--bg);
}

.guide-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.guide-card h3 a {
  text-decoration: none;
}

.guide-card h3 a:hover {
  text-decoration: underline;
}

.guide-card p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.guide-card.is-planned {
  background: var(--bg-alt);
  border-style: dashed;
}

.guide-card.is-planned h3 {
  color: var(--text-muted);
  font-weight: 600;
}

.badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  background: var(--bg-sunken);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.05rem 0.5rem;
  vertical-align: 0.15em;
  margin-left: 0.4rem;
}

/* ---------- Prev/next & responsive ---------- */

.backlink {
  display: inline-block;
  margin-top: 2rem;
  font-size: 0.9rem;
}

@media (max-width: 40rem) {
  body {
    font-size: 16px;
  }

  h1 {
    font-size: 1.6rem;
  }

  table.compare {
    min-width: 34rem;
    font-size: 0.9rem;
  }
}

@media print {
  .filter,
  .site-footer,
  .backlink {
    display: none;
  }

  .table-scroll {
    overflow: visible;
  }
}
