/* 247SimpleTests — "the study room" aesthetic
   Warm paper-cream, Fraunces display, Public Sans body, ink-blue accent. */

:root {
  --paper: #faf6ef;
  --paper-rule: #ece5d4;
  --ink: #1a2238;
  --ink-soft: #34405e;
  --ink-faded: #6a7390;
  --accent: #1e3a8a;
  --accent-hover: #15296b;
  --correct: #2e7d4a;
  --correct-bg: #e8f3ec;
  --incorrect: #b3261e;
  --incorrect-bg: #fbeaea;
  --highlight: #c4a951;
  --highlight-soft: #f7eed0;
  --shadow: 0 1px 2px rgba(26,34,56,0.05), 0 4px 12px rgba(26,34,56,0.04);
  --shadow-card: 0 1px 0 rgba(26,34,56,0.06), 0 8px 24px rgba(26,34,56,0.07);
  --radius: 10px;
  --radius-sm: 6px;
  --max-width: 1100px;
  --max-text: 720px;
  --grid-line: rgba(26,34,56,0.05);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: -1px -1px;
  font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.5em 0;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 1em 0; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  transition: color 0.15s;
}
a:hover { color: var(--accent-hover); }

/* ===== Layout ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.text-content {
  max-width: var(--max-text);
}

/* ===== Header ===== */
.site-header {
  background-color: var(--paper);
  border-bottom: 1px solid var(--paper-rule);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(6px);
  background-color: rgba(250, 246, 239, 0.95);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.brand {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 1.4rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand span { color: var(--accent); font-style: italic; }
.brand-mark {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent);
  margin-right: 0.4em;
  vertical-align: 2px;
  border-radius: 1px;
}
.nav { display: flex; gap: 1.5rem; align-items: center; }
.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav a:hover { color: var(--accent); }
@media (max-width: 720px) {
  .nav { gap: 0.85rem; font-size: 0.85rem; }
  .nav a:not(.cta) { display: none; }
}

.nav .cta {
  background-color: var(--ink);
  color: var(--paper);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.15s;
}
.nav .cta:hover { background-color: var(--accent); }

/* ===== Hero / Page Header ===== */
.page-hero {
  padding: 3.5rem 0 2.5rem;
  border-bottom: 1px solid var(--paper-rule);
  position: relative;
}
.page-hero .eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.7rem;
}
.page-hero h1 { margin-bottom: 0.4em; }
.page-hero .lede {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: var(--max-text);
}

.hero-stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  background: var(--highlight-soft);
  color: var(--ink);
  border: 1px solid var(--highlight);
  padding: 0.3rem 0.7rem;
  border-radius: 99px;
  margin-top: 0.8rem;
}

/* ===== Section ===== */
section { padding: 3rem 0; }
section h2 { margin-bottom: 1.5rem; }
section h2 .accent-rule {
  display: inline-block;
  width: 28px;
  height: 3px;
  background: var(--accent);
  vertical-align: middle;
  margin-right: 0.5rem;
  border-radius: 2px;
}

/* ===== Card grid ===== */
.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
  background: #fff;
  border: 1px solid var(--paper-rule);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
a.card:hover, a.card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: var(--ink-faded);
}
.card h3 { margin-bottom: 0.4rem; }
.card .card-meta {
  font-size: 0.85rem;
  color: var(--ink-faded);
  margin-top: auto;
  padding-top: 0.8rem;
}
.card .card-tag {
  display: inline-block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.state-grid {
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.5rem;
}
.state-grid .card {
  padding: 0.75rem 1rem;
  font-weight: 500;
  font-size: 0.95rem;
}

/* ===== Quiz ===== */
.quiz-app {
  background: #fff;
  border: 1px solid var(--paper-rule);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  margin: 1.5rem 0;
  overflow: hidden;
}

.quiz-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--paper-rule);
  background: var(--paper);
  font-size: 0.9rem;
}
.quiz-bar .quiz-progress {
  flex: 1;
  height: 4px;
  background: var(--paper-rule);
  border-radius: 99px;
  margin: 0 1rem;
  overflow: hidden;
}
.quiz-bar .quiz-progress-fill {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.3s ease;
}
.quiz-bar .timer {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: var(--ink-soft);
}
.quiz-bar .timer.warning { color: var(--incorrect); }

.quiz-body { padding: 2rem 1.5rem; }
.quiz-question {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.4rem;
  line-height: 1.35;
  font-weight: 500;
  margin-bottom: 1.5rem;
  color: var(--ink);
}

.option-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.option {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  background: var(--paper);
  border: 1.5px solid var(--paper-rule);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s, background-color 0.15s;
  font-size: 1.02rem;
  line-height: 1.45;
}
.option:hover { border-color: var(--ink-faded); }
.option .option-letter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: 1.5px solid var(--ink-faded);
  border-radius: 50%;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--ink-soft);
  flex-shrink: 0;
}
.option.selected { border-color: var(--accent); background: #f0f4ff; }
.option.selected .option-letter { background: var(--accent); color: #fff; border-color: var(--accent); }
.option.correct-answer { border-color: var(--correct); background: var(--correct-bg); }
.option.correct-answer .option-letter { background: var(--correct); color: #fff; border-color: var(--correct); }
.option.wrong-answer { border-color: var(--incorrect); background: var(--incorrect-bg); }
.option.wrong-answer .option-letter { background: var(--incorrect); color: #fff; border-color: var(--incorrect); }
.option.disabled { cursor: default; }

.quiz-explanation {
  display: none;
  background: var(--paper);
  border-left: 3px solid var(--accent);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.96rem;
  line-height: 1.6;
}
.quiz-explanation.show { display: block; animation: fade-in 0.3s ease; }
.quiz-explanation h4 {
  margin: 0 0 0.4em 0;
  font-size: 1rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: 'Public Sans', sans-serif;
}
.quiz-explanation .source-cite {
  display: block;
  font-size: 0.83rem;
  color: var(--ink-faded);
  font-style: italic;
  margin-top: 0.7rem;
}
@keyframes fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.quiz-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--paper-rule);
  background: var(--paper);
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
  text-align: center;
}
.btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-accent { background: var(--accent); border-color: var(--accent); }
.btn-large { padding: 0.95rem 2rem; font-size: 1.05rem; }

/* ===== Quiz result screen ===== */
.quiz-result {
  text-align: center;
  padding: 2.5rem 1.5rem;
}
.result-score {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 4rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
  margin: 0.4em 0 0.2em;
}
.result-score.pass { color: var(--correct); }
.result-score.fail { color: var(--incorrect); }
.result-percent { font-size: 1.2rem; color: var(--ink-soft); margin-bottom: 1.5rem; }
.result-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  max-width: 600px;
  margin: 1.5rem auto;
}
.result-stat {
  padding: 1rem;
  background: var(--paper);
  border-radius: var(--radius-sm);
}
.result-stat .stat-num { font-family: 'Fraunces', Georgia, serif; font-size: 1.8rem; font-weight: 600; }
.result-stat .stat-label { font-size: 0.85rem; color: var(--ink-faded); text-transform: uppercase; letter-spacing: 0.1em; }
.result-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.result-review { text-align: left; margin-top: 2.5rem; }
.result-review h3 { margin-bottom: 1rem; }
.review-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--paper-rule);
}
.review-item:last-child { border-bottom: none; }
.review-item .review-q { font-weight: 500; margin-bottom: 0.4rem; }
.review-item .review-a { font-size: 0.9rem; color: var(--ink-soft); }
.review-item .review-mark { font-weight: 600; }
.review-item .review-mark.correct { color: var(--correct); }
.review-item .review-mark.incorrect { color: var(--incorrect); }

/* ===== Affiliate cards ===== */
.affiliate-block {
  margin: 3rem 0;
  padding: 1.75rem 0;
  border-top: 1px solid var(--paper-rule);
  border-bottom: 1px solid var(--paper-rule);
}
.affiliate-block .affiliate-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}
.affiliate-block .affiliate-header h3 {
  margin: 0;
  font-size: 1.1rem;
  font-family: 'Public Sans', sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.affiliate-disclosure {
  font-size: 0.78rem;
  color: var(--ink-faded);
  font-style: italic;
  margin-top: 0.8rem;
}
.affiliate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}
.affiliate-card {
  background: #fff;
  border: 1px solid var(--paper-rule);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.affiliate-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
  border-color: var(--ink-faded);
}
.affiliate-card .product-tag {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-faded);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.affiliate-card h4 {
  margin: 0 0 0.4em;
  font-family: 'Public Sans', sans-serif;
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.3;
}
.affiliate-card .product-desc {
  font-size: 0.88rem;
  color: var(--ink-soft);
  margin-bottom: 1rem;
  flex: 1;
}
.affiliate-card .product-cta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
}
.affiliate-card .product-cta::after { content: ' →'; }

/* ===== Topic / FAQ blocks ===== */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.topic-pill {
  padding: 0.6rem 0.9rem;
  background: var(--paper);
  border: 1px solid var(--paper-rule);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.15s, background-color 0.15s;
}
.topic-pill:hover { border-color: var(--accent); background: #fff; }

.faq-item {
  border-bottom: 1px solid var(--paper-rule);
  padding: 1.25rem 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-item summary {
  font-weight: 500;
  cursor: pointer;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.15rem;
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.faq-item summary::after {
  content: '+';
  font-family: 'Public Sans', sans-serif;
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--accent);
  flex-shrink: 0;
  line-height: 1;
}
.faq-item[open] summary::after { content: '−'; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item p { margin-top: 0.75rem; color: var(--ink-soft); }

/* ===== Methodology / Editorial blocks ===== */
.editorial-stamp {
  background: #fff;
  border: 1px solid var(--paper-rule);
  border-left: 4px solid var(--highlight);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin: 2rem 0;
  font-size: 0.95rem;
}
.editorial-stamp .stamp-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 600;
  color: var(--highlight);
  margin-bottom: 0.4em;
  font-family: 'Public Sans', sans-serif;
}
.editorial-stamp h4 {
  margin: 0 0 0.5em;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.05rem;
}

/* ===== Footer ===== */
.site-footer {
  background: var(--ink);
  color: rgba(250,246,239,0.85);
  padding: 3rem 0 1.5rem;
  margin-top: 4rem;
}
.site-footer a {
  color: rgba(250,246,239,0.85);
  text-decoration: none;
}
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-cols {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}
@media (max-width: 720px) {
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
}
.footer-cols h5 {
  color: #fff;
  font-family: 'Public Sans', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.8rem;
}
.footer-cols ul { list-style: none; padding: 0; margin: 0; }
.footer-cols ul li { margin-bottom: 0.4rem; font-size: 0.93rem; }
.footer-brand {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 700;
  font-size: 1.3rem;
  color: #fff;
  margin-bottom: 0.5em;
  display: block;
}
.footer-blurb { font-size: 0.92rem; max-width: 32ch; line-height: 1.5; }
.footer-base {
  border-top: 1px solid rgba(250,246,239,0.12);
  padding-top: 1.25rem;
  font-size: 0.82rem;
  color: rgba(250,246,239,0.6);
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ===== Breadcrumbs ===== */
.breadcrumb {
  font-size: 0.85rem;
  color: var(--ink-faded);
  padding: 1rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }
.breadcrumb span.sep { color: var(--ink-faded); }

/* ===== Article / content typography ===== */
.prose {
  max-width: var(--max-text);
  font-size: 1.05rem;
  line-height: 1.7;
}
.prose p { margin: 0 0 1.1em; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.5em; }
.prose ul, .prose ol { padding-left: 1.5em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.4em; }
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.2em;
  font-style: italic;
  color: var(--ink-soft);
  margin: 1.5em 0;
}
.prose code {
  background: var(--paper);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.92em;
}

/* ===== Print ===== */
@media print {
  .site-header, .site-footer, .nav, .affiliate-block, .quiz-bar, .quiz-footer { display: none; }
  body { background: white; }
}

/* ===== Utility ===== */
.center { text-align: center; }
.muted { color: var(--ink-faded); }
.small { font-size: 0.85rem; }
.mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }

/* FAQ section (exam guides) */
.faq-item { padding: 1.25rem 0; border-bottom: 1px solid var(--paper-rule); }
.faq-item:last-child { border-bottom: none; }
.faq-q { font-size: 1.1rem; margin: 0 0 0.5rem; font-weight: 600; }
.faq-a { color: var(--ink-soft, #444); }
.faq-a p { margin: 0; }
