/* ── Token alias (--r not defined in base.css) ───────────────── */
:root { --r: var(--r-md); }

/* ── Inner page layout ───────────────────────────────────────── */
.page {
  /* Use longhand so .container's horizontal padding: 0 var(--gutter) is not
     overridden (page.css loads after base.css, shorthand would win) */
  padding-top: 80px;
  padding-bottom: 120px;
}

.page__hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 72px;
}

.page__hero .eyebrow { margin-bottom: 16px; }
.page__hero h1 { margin-top: 0; font-size: clamp(2rem, 4vw, 3rem); }
.page__hero .page__meta {
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--muted-2);
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.page__meta-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  background: var(--line-2);
  flex-shrink: 0;
}

/* ── Prose ───────────────────────────────────────────────────── */
.prose {
  max-width: 72ch;
}

.prose h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 56px 0 16px;
  padding-top: 56px;
  border-top: 1px solid var(--line);
  color: var(--ink);
}
.prose h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }

.prose h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 28px 0 10px;
  color: var(--ink);
}

.prose p {
  font-size: 0.97rem;
  color: var(--muted);
  line-height: 1.75;
  margin: 0 0 16px;
}

.prose ul, .prose ol {
  padding-left: 1.4em;
  margin: 0 0 16px;
}

.prose li {
  font-size: 0.97rem;
  color: var(--muted);
  line-height: 1.75;
  margin-bottom: 6px;
}

.prose a {
  color: var(--mythic);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.prose a:hover { opacity: 0.8; }

.prose strong { color: var(--ink); font-weight: 600; }

.prose blockquote {
  margin: 24px 0;
  padding: 18px 24px;
  border-left: 3px solid var(--mythic);
  background: rgba(232, 116, 28, 0.05);
  border-radius: 0 var(--r) var(--r) 0;
}
.prose blockquote p { margin: 0; color: var(--ink); font-style: normal; }

/* ── Rights grid ─────────────────────────────────────────────── */
.rights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
  margin: 24px 0 32px;
}

.rights-card {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper-2);
}

.rights-card__icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--mythic-grad);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}
.rights-card__icon svg { color: #fff; }

.rights-card h4 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 6px;
}
.rights-card p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

/* ── Changelog entries ───────────────────────────────────────── */
.changelog__list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.changelog__list::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 0;
  width: 2px;
  background: var(--line);
}

.changelog__entry {
  position: relative;
  padding-left: 32px;
  padding-bottom: 56px;
}

.changelog__entry::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--line-2);
}
.changelog__entry--major::before {
  background: var(--mythic);
  border-color: var(--mythic);
}

.changelog__version {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.changelog__tag {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}
.changelog__badge {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--mythic-grad);
  color: #fff;
}

.changelog__date {
  font-size: 0.82rem;
  color: var(--muted-2);
  margin-bottom: 16px;
  display: block;
}

.changelog__entry h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 12px;
}

.changelog__items {
  list-style: none;
  padding: 0;
  margin: 0;
}

.changelog__items li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.93rem;
  color: var(--muted);
  line-height: 1.6;
  padding: 6px 0;
  border-bottom: 1px solid var(--line);
}
.changelog__items li:last-child { border-bottom: 0; }

.chg-pill {
  flex-shrink: 0;
  margin-top: 3px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
}
.chg-pill--new  { background: rgba(86, 194, 106, 0.15); color: #2a8a3e; }
.chg-pill--fix  { background: rgba(232, 116, 28, 0.12); color: #b85a0a; }
.chg-pill--imp  { background: rgba(66, 153, 225, 0.15); color: #2b6cb0; }
.chg-pill--sec  { background: rgba(159, 122, 234, 0.15); color: #6b46c1; }

/* ── Cookie table ────────────────────────────────────────────── */

/* Wrapper makes wide tables scroll horizontally on small screens
   instead of blowing out the layout */
.table-scroll {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 20px 0 28px;
  border-radius: var(--r);
  border: 1px solid var(--line);
}

.cookie-table {
  width: 100%;
  min-width: 520px; /* below this tables scroll rather than squish */
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 0; /* margin lives on .table-scroll now */
}
.cookie-table th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.cookie-table td {
  padding: 10px 14px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  line-height: 1.5;
}
.cookie-table tr:last-child td { border-bottom: 0; }
.cookie-table code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--paper-2);
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--ink);
}

/* ── Page layout grid (sidebar toc on wide) ──────────────────── */
.page__layout {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 80px;
  align-items: start;
}

.page__toc {
  position: sticky;
  top: 96px;
}

.page__toc h4 {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}

.page__toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
}

.page__toc ol li { counter-increment: toc; }

.page__toc a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.86rem;
  color: var(--muted);
  text-decoration: none;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  transition: color .2s;
}
.page__toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--muted-2);
  flex-shrink: 0;
}
.page__toc a:hover { color: var(--ink); }

@media (max-width: 900px) {
  .page__layout { grid-template-columns: 1fr; }
  .page__toc { display: none; }
}
