/* ============================================================
   PAGES — styles for every generated page (pages/*.js) plus the
   shared site-link footer and feature-card links on the homepage.
   Builds on variables.css + base.css; brand colors come from tokens.
   ============================================================ */

/* ── Layout helpers ─────────────────────────────────────────── */
.rt-container-narrow { max-width: 860px; }
.rt-center { text-align: center; }
.rt-center-row { justify-content: center; }

.rt-hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* ── Page hero ──────────────────────────────────────────────── */
.rt-page-hero {
  padding: calc(76px + 72px) 0 72px;
}

.rt-page-hero-inner { max-width: 860px; }

.rt-breadcrumb {
  display: flex;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: rgba(251, 249, 255, 0.55);
  margin-bottom: 22px;
}
.rt-breadcrumb a { color: rgba(251, 249, 255, 0.75); text-decoration: none; }
.rt-breadcrumb a:hover { color: var(--gold); }

.rt-page-title {
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  margin-bottom: 18px;
}

.rt-page-lede {
  font-size: clamp(16px, 1.6vw, 18px);
  line-height: 1.65;
  color: rgba(251, 249, 255, 0.78);
  max-width: 720px;
}

/* ── Sections ───────────────────────────────────────────────── */
.rt-page-section { padding: 80px 0; }
.rt-tone-light { background: var(--paper); }
.rt-tone-tint { background: #F6F0FF; }
.rt-tone-dark {
  background: linear-gradient(160deg, var(--ink-deep) 0%, var(--ink) 55%, #240f3e 100%);
  color: var(--paper);
}
.rt-tone-dark .rt-eyebrow { color: var(--gold); }
.rt-tone-dark .rt-section-sub { color: rgba(251, 249, 255, 0.72); }

.rt-page-section-head { margin-bottom: 36px; }
.rt-page-section-head .rt-section-sub { max-width: 680px; }
.rt-related .rt-page-section-head,
.rt-cta-band .rt-page-section-head { text-align: center; }

/* ── Prose ──────────────────────────────────────────────────── */
.rt-prose { font-size: 16px; line-height: 1.75; color: rgba(27, 16, 48, 0.82); }
.rt-tone-dark .rt-prose { color: rgba(251, 249, 255, 0.82); }
.rt-prose > * + * { margin-top: 16px; }
.rt-prose h3 { font-size: 21px; margin-top: 32px; color: var(--ink); }
.rt-tone-dark .rt-prose h3 { color: var(--paper); }
.rt-prose ul, .rt-prose ol { padding-left: 22px; }
.rt-prose li + li { margin-top: 8px; }
.rt-prose a { color: var(--violet); font-weight: 600; }
.rt-tone-dark .rt-prose a { color: var(--gold); }
.rt-prose strong { color: var(--ink); }
.rt-tone-dark .rt-prose strong { color: var(--paper); }

/* ── Cards ──────────────────────────────────────────────────── */
.rt-cards { display: grid; gap: 18px; }
.rt-cards-2 { grid-template-columns: repeat(2, 1fr); }
.rt-cards-3 { grid-template-columns: repeat(3, 1fr); }
.rt-cards-4 { grid-template-columns: repeat(4, 1fr); }

.rt-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
  color: var(--ink);
  text-decoration: none;
}
.rt-card h3 { font-family: var(--font-body); font-size: 16.5px; font-weight: 700; }
.rt-card p { font-size: 14px; line-height: 1.6; color: rgba(27, 16, 48, 0.68); }
.rt-card-tag {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--violet-deep);
  background: var(--lavender);
  padding: 4px 10px;
  border-radius: 999px;
}
.rt-card-link { transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease; }
.rt-card-link:hover {
  border-color: var(--gold);
  box-shadow: 0 12px 30px -18px rgba(27, 16, 48, 0.4);
  transform: translateY(-2px);
}
.rt-card-more { margin-top: auto; font-size: 13.5px; font-weight: 700; color: var(--violet); }

.rt-tone-dark .rt-card {
  background: rgba(251, 249, 255, 0.05);
  border-color: var(--line-dark);
  color: var(--paper);
}
.rt-tone-dark .rt-card p { color: rgba(251, 249, 255, 0.7); }

/* ── Steps ──────────────────────────────────────────────────── */
.rt-steps { list-style: none; counter-reset: step; display: grid; gap: 14px; }
.rt-steps li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  align-items: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 20px;
}
.rt-steps li::before {
  content: counter(step);
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-weight: 600;
  background: var(--ink);
  color: var(--gold);
}
.rt-steps h3 { font-family: var(--font-body); font-size: 16.5px; font-weight: 700; margin-bottom: 6px; }
.rt-steps p { font-size: 14.5px; line-height: 1.6; color: rgba(27, 16, 48, 0.72); }

/* ── Tables ─────────────────────────────────────────────────── */
.rt-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: #fff; }
.rt-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.rt-table:has(thead th:nth-child(3)) { min-width: 560px; }
.rt-table caption { text-align: left; padding: 14px 18px; font-weight: 700; }
.rt-table th, .rt-table td { text-align: left; padding: 13px 18px; border-top: 1px solid var(--line); vertical-align: top; line-height: 1.5; }
.rt-table thead th {
  border-top: none;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.rt-table tbody th { font-weight: 700; color: var(--ink); }
.rt-table td { color: rgba(27, 16, 48, 0.78); }

/* ── Checklist ──────────────────────────────────────────────── */
.rt-checks { list-style: none; display: grid; gap: 10px; }
.rt-checks li { position: relative; padding-left: 30px; line-height: 1.6; }
.rt-checks li::before {
  content: "";
  position: absolute;
  left: 0; top: 4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--lavender) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M7 12.5l3 3 7-7' stroke='%239400D3' stroke-width='2.4' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/14px no-repeat;
}

/* ── Callout ────────────────────────────────────────────────── */
.rt-callout {
  border-radius: var(--radius-md);
  padding: 18px 22px;
  font-size: 15px;
  line-height: 1.65;
  margin-top: 24px;
}
.rt-callout-info { background: var(--lavender); color: var(--ink); border-left: 4px solid var(--violet); }
.rt-callout-warn { background: #FFF6E5; color: #4a3200; border-left: 4px solid var(--gold); }
.rt-callout a { color: var(--violet); font-weight: 700; }

/* ── Split ──────────────────────────────────────────────────── */
.rt-split { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: start; }

/* ── FAQ ────────────────────────────────────────────────────── */
.rt-faq { display: grid; gap: 10px; }
.rt-faq-item {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 0 22px;
}
.rt-faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 18px 28px 18px 0;
  font-weight: 700;
  font-size: 15.5px;
  position: relative;
}
.rt-faq-item summary::-webkit-details-marker { display: none; }
.rt-faq-item summary::after {
  content: "+";
  position: absolute;
  right: 0; top: 50%;
  transform: translateY(-50%);
  font-size: 22px;
  font-weight: 500;
  color: var(--violet);
}
.rt-faq-item[open] summary::after { content: "–"; }
.rt-faq-answer { padding-bottom: 18px; font-size: 15px; line-height: 1.7; color: rgba(27, 16, 48, 0.78); }
.rt-faq-answer > * + * { margin-top: 10px; }
.rt-faq-answer a { color: var(--violet); font-weight: 600; }

/* ── CTA band ───────────────────────────────────────────────── */
.rt-cta-band { padding: 80px 0; }

/* ── Forms ──────────────────────────────────────────────────── */
.rt-form {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.rt-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.rt-field { display: flex; flex-direction: column; gap: 6px; }
.rt-field-full { grid-column: 1 / -1; }
.rt-field label { font-size: 13.5px; font-weight: 700; color: var(--ink); }
.rt-field label span { font-weight: 500; opacity: 0.55; }
.rt-field input, .rt-field select, .rt-field textarea {
  font: inherit;
  font-size: 15px;
  padding: 11px 14px;
  border: 1px solid rgba(27, 16, 48, 0.2);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
}
.rt-field input:focus, .rt-field select:focus, .rt-field textarea:focus {
  outline: 2px solid var(--violet);
  outline-offset: 1px;
  border-color: transparent;
}
.rt-form-note { font-size: 12.5px; color: rgba(27, 16, 48, 0.55); margin-top: 12px; }
.rt-form-status { font-size: 14px; font-weight: 700; margin-top: 12px; min-height: 1em; }
.rt-form-status.is-ok { color: #177a3d; }
.rt-form-status.is-error { color: #b42318; }
.rt-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── Navbar: list-style dropdown on subpages ────────────────── */
.rt-dropdown-panel--list { width: 280px; grid-template-columns: 1fr; }
.rt-nav-link[aria-current="page"], .rt-dropdown-panel a[aria-current="page"] { color: var(--gold); }

/* ── Footer: site link columns (all pages) ──────────────────── */
.rt-footer-grid--sub { grid-template-columns: 2fr 1fr; }
.rt-sitelinks {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 32px 0;
  margin-top: 32px;
  border-top: 1px solid color-mix(in srgb, currentColor 14%, transparent);
}
.rt-sitelinks h4 {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 12px;
}
.rt-sitelinks ul { list-style: none; display: grid; gap: 8px; }
.rt-sitelinks a { text-decoration: none; font-size: 14px; opacity: 0.85; }
.rt-sitelinks a:hover { opacity: 1; color: var(--gold); }

/* ── Homepage feature cards: link to deep pages ─────────────── */
.rt-feature-card-link {
  margin-top: auto;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--violet);
  text-decoration: none;
}
.rt-feature-card-link:hover { text-decoration: underline; }

/* ── Preview banner (draft pages only) ──────────────────────── */
.rt-preview-banner {
  position: fixed;
  bottom: 16px; left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  background: #b42318;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

/* ── Study plan tool ────────────────────────────────────────── */
.rt-planner {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.rt-planner-row { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.rt-planner-row .rt-field { flex: 1 1 200px; }
.rt-planner-out { margin-top: 24px; }
.rt-planner-out:empty { display: none; }
.rt-planner-summary { font-size: 16px; line-height: 1.6; margin-bottom: 16px; }
.rt-planner-summary strong { color: var(--violet-deep); }

/* ── Practice questions ─────────────────────────────────────── */
.rt-q {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px;
}
.rt-q + .rt-q { margin-top: 18px; }
.rt-q-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.rt-q-stem { font-size: 16px; line-height: 1.65; font-weight: 600; margin-bottom: 14px; }
.rt-q-options { padding-left: 22px; display: grid; gap: 8px; font-size: 15px; line-height: 1.55; }
.rt-q details { margin-top: 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.rt-q summary { cursor: pointer; font-weight: 700; color: var(--violet); }
.rt-q-answer { margin-top: 12px; font-size: 15px; line-height: 1.7; }
.rt-q-answer > * + * { margin-top: 8px; }
.rt-q-credit { font-size: 12.5px; color: rgba(27, 16, 48, 0.55); margin-top: 10px; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 980px) {
  .rt-cards-4 { grid-template-columns: repeat(2, 1fr); }
  .rt-cards-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 700px) {
  .rt-page-hero { padding: calc(76px + 44px) 0 52px; }
  .rt-page-section { padding: 56px 0; }
  .rt-cards-2, .rt-cards-3, .rt-cards-4 { grid-template-columns: 1fr; }
  .rt-split { grid-template-columns: 1fr; gap: 24px; }
  .rt-form-grid { grid-template-columns: 1fr; }
  .rt-form, .rt-planner { padding: 20px; }
  .rt-sitelinks { grid-template-columns: 1fr 1fr; }
  .rt-footer-grid--sub { grid-template-columns: 1fr; }
  .rt-hero-ctas .rt-btn { flex: 1 1 auto; }
}
