/*
 * The guide pages.
 *
 * Every colour here is a token from palette.css — same rule vault.css follows
 * and check:site enforces for both, because one `#1a20ee` typed in for speed
 * is a colour that never follows the palette again.
 *
 * These pages are a table with an argument around it, so the type is set for
 * reading a column of numbers: tabular figures throughout, and the earned
 * column carries the most weight because it is the only column the ranking is
 * actually sorted on.
 */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--color-paper);
  color: var(--color-slate);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
h1, h2 { margin: 0; font-weight: 700; text-wrap: balance; }
p { text-wrap: pretty; }

.mono { font-variant-numeric: tabular-nums; }
.max-6xl { max-width: 72rem; margin: 0 auto; padding-inline: 1.25rem; }
.max-5xl { max-width: 64rem; margin: 0 auto; padding-inline: 1.25rem; }

/* ---- header and footer, matching index.html's shell */
header.site {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-line-soft);
}
.site-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.85rem;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  text-decoration: none;
}
.mark {
  width: 0.85rem;
  height: 0.85rem;
  border-radius: 0.28rem;
  background: var(--color-action);
}
.site-nav { display: flex; align-items: center; gap: 1.25rem; }
.nav-link {
  color: var(--color-slate-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.nav-link:hover { color: var(--color-slate); }

footer.site {
  margin-top: 4rem;
  padding-block: 2rem;
  border-top: 1px solid var(--color-line-soft);
}
.foot-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--color-slate-faint);
}

/* ---- buttons, the same pill the rest of the site uses */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 999px;
  padding: 0.625rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn-action { background: var(--color-action); color: var(--color-paper); }
.btn-action:hover { background: var(--color-action-dark); }

/* ---- the page body */
.guide { padding-block: 2.5rem 1rem; }
.crumbs {
  font-size: 0.82rem;
  color: var(--color-slate-faint);
  margin-bottom: 1.25rem;
}
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--color-action); }

.guide h1 { font-size: clamp(1.9rem, 4vw, 2.6rem); line-height: 1.15; }
.guide .lede { font-size: 1.08rem; margin: 1rem 0 0; }
.guide .sub { color: var(--color-slate-soft); margin: 0.9rem 0 2rem; max-width: 62ch; }
.fine { font-size: 0.82rem; color: var(--color-slate-faint); }

/* The table scrolls rather than reflowing: these are five short columns that
   stop meaning anything once they wrap into each other. */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
  min-width: 34rem;
}
th {
  text-align: left;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-slate-faint);
  font-weight: 600;
  padding: 0 0.6rem 0.55rem;
  border-bottom: 1px solid var(--color-line-soft);
}
td {
  padding: 0.75rem 0.6rem;
  border-bottom: 1px solid var(--color-line-soft);
  vertical-align: top;
}
th.rank, td.rank { width: 2.2rem; color: var(--color-slate-faint); }
th.earn, td.earn { text-align: right; }
td.earn { font-weight: 700; }
tr.top td { background: var(--color-action-wash); }
tr.top td.earn { color: var(--color-action-dark); }

.card-name { font-weight: 600; }
.card-issuer { font-size: 0.8rem; color: var(--color-slate-soft); }
.card-note { font-size: 0.78rem; color: var(--color-slate-faint); margin-top: 0.15rem; }

.panel {
  margin-top: 2.5rem;
  padding: 1.5rem;
  border: 1px solid var(--color-line-soft);
  border-radius: 1.25rem;
  background: var(--color-paper-soft);
}
.panel h2 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.panel p { margin: 0 0 0.6rem; }
.panel p:last-child { margin-bottom: 0; }

.final-row {
  margin-top: 3rem;
  padding: 1.75rem;
  border-radius: 1.25rem;
  background: var(--color-paper-sunk);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.final-row h2 { font-size: 1.25rem; }
.final-row p { margin: 0.35rem 0 0; color: var(--color-slate-soft); }

/* ---- the hub */
.guide-list { list-style: none; margin: 2rem 0 0; padding: 0; }
.guide-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 0.85rem 0;
  border-top: 1px solid var(--color-line-soft);
}
.guide-list a { font-weight: 600; text-decoration: none; }
.guide-list a:hover { color: var(--color-action); }
.guide-list span { font-size: 0.85rem; color: var(--color-slate-faint); }

@media (max-width: 30rem) {
  .panel { padding: 1.1rem; }
  .final-row { padding: 1.25rem; }
}

/* ---------------------------------------------------------------- doc pages
 * /support, /terms and /privacy are Markdown, so unlike the guides their
 * markup is whatever the renderer emits — bare h2/h3/p/ul/table with no
 * classes to hang anything on. These rules style that, scoped to `.doc` so a
 * generated guide's own elements keep the rules above.
 */
.doc { max-width: 46rem; padding-bottom: 3.5rem; }
.doc h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); line-height: 1.15; margin-bottom: 0.75rem; }
.doc h2 {
  font-size: 1.25rem;
  margin: 2.4rem 0 0.75rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--color-line-soft);
}
.doc h3 { font-size: 1.02rem; font-weight: 600; margin: 1.6rem 0 0.5rem; }
.doc p, .doc li { line-height: 1.62; }
.doc p { margin: 0 0 1rem; }
.doc ul, .doc ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.doc li { margin-bottom: 0.45rem; }
.doc li > ul, .doc li > ol { margin: 0.45rem 0 0; }
.doc a { text-decoration: underline; text-decoration-color: var(--color-line-soft); text-underline-offset: 3px; }
.doc a:hover { color: var(--color-action); text-decoration-color: var(--color-action); }
.doc strong { font-weight: 600; }
.doc code {
  font-size: 0.88em;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--color-line-soft);
}
.doc blockquote {
  margin: 0 0 1rem;
  padding: 0.1rem 0 0.1rem 1rem;
  border-left: 3px solid var(--color-line-soft);
  color: var(--color-slate-soft);
}
/* The privacy policy's permissions table. Tables above are ranking tables and
 * assume the column classes the guide builder adds; this one has none. */
.doc table { margin-bottom: 1.25rem; }
.doc th, .doc td { text-align: left; vertical-align: top; }
.doc em { color: var(--color-slate-soft); }
