/* ============================================================
   Research Hub + Articles — BOOST LSAT
   Uses boost-base.css for tokens, resets, and theming.
   ============================================================ */

/* ── Navbar ── */
#navToggle {
  display: none;
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: var(--space-1);
  width: 36px;
  height: 36px;
  padding: var(--space-1);
  cursor: pointer;
  border: thin solid var(--border-1);
  border-radius: var(--radius-md);
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-2);
  border-radius: 1px;
}

.navbar {
  position: sticky; top: 0; z-index: var(--z-fixed);
  background: var(--surface-0);
  border-bottom: thin solid var(--border-1);
}
.navbar-inner {
  max-width: 1200px; margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: var(--space-4);
}
.navbar-brand {
  justify-self: start;
  font-family: var(--font-heading); font-weight: var(--weight-extrabold); font-size: var(--text-lg);
  color: var(--text-1); text-decoration: none; letter-spacing: var(--tracking-tight);
}
.navbar-links {
  grid-column: 2;
  justify-self: center;
  display: flex; gap: var(--space-6); align-items: center;
}
.nav-auth-link { display: none; }
.nav-link {
  color: var(--text-2); text-decoration: none; font-size: var(--text-sm); font-weight: var(--weight-medium);
  transition: color var(--duration-normal) var(--ease-out-expo);
}
.nav-link:hover { color: var(--text-1); }
.nav-link.active { color: var(--color-primary); font-weight: var(--weight-semibold); }
.nav-link:focus-visible,
.theme-toggle:focus-visible,
.btn:focus-visible,
.back-link:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
.theme-toggle {
  background: none; border: 1px solid var(--border-1); border-radius: var(--radius-md);
  color: var(--text-3); cursor: pointer; padding: var(--space-2); display: flex; align-items: center;
  transition: border-color var(--duration-normal) var(--ease-out-expo), color var(--duration-normal) var(--ease-out-expo);
}
.theme-toggle:hover { border-color: var(--border-2); color: var(--text-1); }

.navbar-actions {
  grid-column: 3;
  justify-self: end;
  display: flex; align-items: center; gap: var(--space-3);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
  font-family: var(--font-body); font-size: var(--text-sm); font-weight: var(--weight-semibold);
  text-decoration: none; cursor: pointer; border: none;
  transition: transform var(--duration-fast) var(--ease-out-expo),
              background-color var(--duration-fast) var(--ease-out-expo),
              border-color var(--duration-fast) var(--ease-out-expo),
              color var(--duration-fast) var(--ease-out-expo);
}
.btn-cta {
  background: var(--color-cta); color: var(--text-1);
}
.btn-cta:hover {
  background: var(--color-cta-hover); transform: translateY(-1px);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-1);
  color: var(--text-2);
}
.btn-ghost:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

/* ── Page ── */
.page-inner {
  max-width: 1200px; margin: 0 auto;
  padding: var(--space-12) var(--space-6) var(--space-16);
}

.page-kicker {
  font-size: var(--text-xs); font-weight: var(--weight-semibold); letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--color-primary); margin-bottom: var(--space-3);
}

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem); font-weight: var(--weight-extrabold);
  letter-spacing: -0.03em; line-height: var(--leading-tight); margin-bottom: var(--space-4);
}

.page-subtitle {
  font-size: var(--text-lg); color: var(--text-2);
  max-width: 600px; line-height: var(--leading-relaxed); margin-bottom: var(--space-12);
}

.research-page-header {
  display: grid;
  gap: var(--space-4);
  align-items: start;
  margin-bottom: var(--space-10);
}

.research-page-header .page-kicker,
.research-page-header .page-title,
.research-page-header .page-subtitle {
  margin-bottom: 0;
}

.research-source-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  max-width: 720px;
  margin: var(--space-1) 0 0;
  color: var(--text-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  line-height: var(--leading-normal);
  overflow-wrap: anywhere;
}

.research-source-note a {
  color: var(--color-primary);
  font-weight: var(--weight-semibold);
  text-decoration: none;
}

.research-source-note a:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.research-stat-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  max-width: 880px;
  margin-top: var(--space-2);
}

.research-stat-chip {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: var(--space-1) var(--space-3);
  border: thin solid var(--border-1);
  border-radius: var(--radius-full);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  font-variant-numeric: tabular-nums;
  line-height: var(--leading-normal);
}

.research-stat-chip strong {
  color: var(--color-primary);
  font-weight: var(--weight-extrabold);
}

/* ── Featured Research Cards ── */
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(420px, 1fr));
  gap: var(--space-8);
}

.research-card {
  display: flex; flex-direction: column;
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  text-decoration: none; color: inherit;
  transition: box-shadow var(--duration-normal) var(--ease-out-expo),
              border-color var(--duration-normal) var(--ease-out-expo);
}

.research-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--border-2);
}

.research-card__section {
  font-size: var(--text-xs); font-weight: var(--weight-bold); letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--color-primary); margin-bottom: var(--space-4);
}

.research-card__title {
  font-family: var(--font-heading); font-size: var(--text-xl); font-weight: var(--weight-bold);
  letter-spacing: -0.02em; margin-bottom: var(--space-4); line-height: var(--leading-snug);
}

.research-card__desc {
  font-size: var(--text-base); color: var(--text-2); line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6); flex: 1;
}

.research-card__stats {
  display: flex; flex-wrap: wrap; gap: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-1);
}

.research-card__stat {
  font-size: var(--text-xs); color: var(--text-3); font-weight: var(--weight-medium);
  font-variant-numeric: tabular-nums;
}

.research-card__stat strong {
  color: var(--text-2); font-weight: var(--weight-bold);
}

.research-card__link {
  display: inline-flex; align-items: center; gap: var(--space-1);
  font-size: var(--text-sm); font-weight: var(--weight-semibold); color: var(--color-primary);
  margin-top: var(--space-4);
}

/* ── Blog Section ── */
.blog-section-heading {
  font-family: var(--font-heading);
  font-size: var(--text-xl); font-weight: var(--weight-bold);
  letter-spacing: -0.02em;
  margin-top: var(--space-16); margin-bottom: var(--space-8);
  padding-top: var(--space-8);
  border-top: 1px solid var(--border-1);
}

.blog-grid {
  display: flex; flex-direction: column; gap: var(--space-4);
}

.blog-card {
  display: block;
  padding: var(--space-6) var(--space-8);
  background: var(--surface-1);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  text-decoration: none; color: inherit;
  transition: box-shadow var(--duration-normal) var(--ease-out-expo),
              border-color var(--duration-normal) var(--ease-out-expo);
}

.blog-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-2);
}

.blog-card__meta {
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.blog-card__section {
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--color-primary);
}

.blog-card__date {
  font-size: var(--text-xs); color: var(--text-3); font-weight: var(--weight-medium);
}

.blog-card__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg); font-weight: var(--weight-bold);
  letter-spacing: -0.01em; margin-bottom: var(--space-2);
  line-height: var(--leading-snug);
}

.blog-card__desc {
  font-size: var(--text-sm); color: var(--text-2);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-3);
  max-width: 65ch;
}

.blog-card__link {
  font-size: var(--text-sm); font-weight: var(--weight-semibold);
  color: var(--color-primary);
}

/* ── Back Link ── */
.back-link {
  display: inline-flex; align-items: center; gap: var(--space-2);
  font-size: var(--text-sm); font-weight: var(--weight-medium); color: var(--text-3);
  text-decoration: none; margin-bottom: var(--space-6);
  transition: color var(--duration-normal) var(--ease-out-expo);
}
.back-link:hover { color: var(--color-primary); }

/* ── Article Reader ── */
.article-reader {
  --article-measure: 42rem;
  width: 100%;
  max-width: calc(var(--article-measure) + var(--space-12));
  margin: 0 auto;
  padding: var(--space-10) var(--space-6) var(--space-16);
  overflow-wrap: break-word;
}

.background-guide-reader {
  max-width: min(1120px, 100%);
}

.article-loading {
  display: grid;
  justify-items: center;
  align-content: center;
  min-height: 40vh;
  text-align: center;
  padding: var(--space-16) 0;
  color: var(--text-3);
}
.article-loading-spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border-1); border-top-color: var(--color-primary);
  border-radius: 50%; animation: spin 0.8s linear infinite;
  margin: 0 auto var(--space-4);
}
@keyframes spin { to { transform: rotate(360deg); } }

.article-error {
  max-width: 560px;
  margin: var(--space-12) auto;
  padding: var(--space-10) var(--space-6);
  text-align: center;
  border: thin solid var(--border-1);
  border-radius: var(--radius-lg);
  background: var(--surface-1);
}
.article-error h1 {
  font-family: var(--font-heading); font-size: var(--text-2xl);
  font-weight: var(--weight-bold); margin-bottom: var(--space-4);
}
.article-error p {
  color: var(--text-2); margin-bottom: var(--space-8);
}

.article-header {
  max-width: var(--article-measure);
  margin-inline: auto;
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--border-1);
}

.article-kicker {
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  text-transform: uppercase; letter-spacing: var(--tracking-widest);
  color: var(--color-primary); margin-bottom: var(--space-3);
}

.article-title {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  font-weight: var(--weight-extrabold);
  letter-spacing: var(--tracking-tight); line-height: var(--leading-tight);
  margin-bottom: var(--space-4);
  text-wrap: balance;
}

.article-subtitle {
  font-size: var(--text-lg); color: var(--text-2);
  line-height: var(--leading-relaxed); max-width: var(--article-measure);
  text-wrap: pretty;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-4);
  font-size: var(--text-xs); color: var(--text-3);
  font-weight: var(--weight-medium); letter-spacing: var(--tracking-wide);
  line-height: var(--leading-normal);
  overflow-wrap: anywhere;
}

.article-meta span {
  display: inline-flex;
  align-items: center;
}

.article-meta span + span::before {
  content: "";
  width: 3px;
  height: 3px;
  margin-right: var(--space-2);
  border-radius: var(--radius-full);
  background: var(--border-3);
}

.article-cite {
  width: 100%;
  max-width: var(--article-measure);
  margin-top: var(--space-5);
  padding: var(--space-4);
  border: thin solid var(--border-1);
  border-radius: var(--radius-md);
  background: var(--surface-1);
  color: var(--text-2);
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  overflow-wrap: anywhere;
}

.article-body {
  min-width: 0;
  max-width: var(--article-measure);
  margin-inline: auto;
  overflow-x: auto;
}

.background-guide-intro {
  max-width: 720px;
  margin-top: var(--space-8);
  margin-bottom: var(--space-8);
}

.background-guide-intro p {
  font-size: var(--text-base);
  line-height: 1.75;
  color: var(--text-2);
  max-width: 64ch;
  margin-bottom: var(--space-4);
}

.background-guide-toc,
.background-guide-section {
  max-width: 920px;
}

.background-guide-toc[hidden],
.background-guide-section[hidden] {
  display: none;
}

.background-guide-toc {
  display: grid;
  gap: var(--space-6);
}

.background-guide-toc__header {
  max-width: 680px;
}

.background-guide-toc__label {
  margin-bottom: var(--space-2);
  color: var(--text-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

.background-guide-toc__title {
  margin-bottom: var(--space-2);
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-tight);
}

.background-guide-toc__desc {
  color: var(--text-2);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
}

.background-guide-toc__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-4);
}

.background-guide-toc-card {
  display: grid;
  gap: var(--space-3);
  align-content: start;
  padding: var(--space-5);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  background: var(--surface-1);
}

.background-guide-toc-card__title {
  color: var(--text-1);
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  line-height: var(--leading-snug);
  text-decoration: none;
}

.background-guide-toc-card__title:hover,
.background-guide-toc-link:hover {
  color: var(--color-primary);
}

.background-guide-toc-card__children {
  display: grid;
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.background-guide-toc-link {
  color: var(--text-2);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  text-decoration: none;
  overflow-wrap: anywhere;
}

.background-guide-section__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-4);
  border-bottom: thin solid var(--border-1);
}

.background-guide-section__label {
  color: var(--text-3);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

.background-guide h2,
.background-guide h3 {
  scroll-margin-top: var(--space-8);
}

/* ── Prose (markdown article body) ── */
.prose h2 {
  font-family: var(--font-heading);
  font-size: var(--text-xl); font-weight: var(--weight-bold);
  letter-spacing: -0.02em; margin-top: var(--space-10); margin-bottom: var(--space-4);
  line-height: var(--leading-tight);
  text-wrap: balance;
}

.prose h3 {
  font-family: var(--font-heading);
  font-size: var(--text-lg); font-weight: var(--weight-semibold);
  letter-spacing: -0.01em; margin-top: var(--space-8); margin-bottom: var(--space-3);
  line-height: var(--leading-snug);
  text-wrap: balance;
}

.prose h4 {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
  margin-top: var(--space-5);
  margin-bottom: var(--space-3);
  line-height: var(--leading-snug);
}

.prose h5 {
  font-family: var(--font-heading);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  letter-spacing: -0.01em;
  margin-top: var(--space-7);
  margin-bottom: var(--space-3);
}

.background-guide h3 + h4 {
  margin-top: var(--space-4);
}

.prose p {
  font-size: var(--text-base); color: var(--text-2);
  line-height: 1.7; margin-bottom: var(--space-4);
  max-width: var(--article-measure, 75ch);
  text-wrap: pretty;
}

.prose p strong { color: var(--text-1); font-weight: var(--weight-semibold); }

.prose a {
  color: var(--color-primary);
  text-decoration-thickness: from-font;
  text-underline-offset: 0.18em;
  overflow-wrap: anywhere;
}

.prose ul, .prose ol {
  margin: var(--space-4) 0;
  padding-left: var(--space-3);
  color: var(--text-2);
  max-width: var(--article-measure, 75ch);
}

.prose li {
  margin-bottom: var(--space-2);
  line-height: 1.6;
}

.prose blockquote {
  margin: var(--space-8) 0;
  padding: var(--space-4) var(--space-6);
  background: var(--surface-1);
  border: thin solid var(--border-1);
  border-radius: var(--radius-md);
  color: var(--text-2); font-style: italic;
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  padding: 2px var(--space-2);
  border-radius: var(--radius-sm);
}

.prose pre {
  margin: var(--space-6) 0;
  padding: var(--space-4) var(--space-6);
  background: var(--surface-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

.prose pre code {
  background: none; padding: 0;
}

.prose img {
  max-width: 100%; height: auto;
  border-radius: var(--radius-md);
  margin: var(--space-6) 0;
}

.prose table {
  width: 100%; border-collapse: collapse; margin: var(--space-6) 0;
  font-variant-numeric: tabular-nums;
  min-width: min(620px, 100%);
}
.prose th {
  font-size: var(--text-xs); font-weight: var(--weight-semibold);
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-3); text-align: left;
  padding: var(--space-2) var(--space-4) var(--space-2) 0;
  border-bottom: 2px solid var(--text-1);
}
.prose td {
  font-size: var(--text-sm);
  padding: var(--space-3) var(--space-4) var(--space-3) 0;
  border-bottom: 1px solid var(--border-1);
  vertical-align: top;
}

.prose hr {
  border: none; border-top: 1px solid var(--border-1);
  margin: var(--space-10) 0;
}

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border-1);
  padding: var(--space-8) var(--space-6);
}
.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: var(--space-4);
}
.footer-brand {
  font-family: var(--font-heading); font-weight: var(--weight-extrabold);
  color: var(--text-1); font-size: var(--text-base);
}
.footer-links { display: flex; gap: var(--space-6); }
.footer-links a {
  color: var(--text-3); text-decoration: none; font-size: var(--text-sm);
  transition: color var(--duration-normal) var(--ease-out-expo);
}
.footer-links a:hover { color: var(--text-1); }
.footer-copy { font-size: var(--text-xs); color: var(--text-3); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .article-reader {
    padding: var(--space-8) var(--space-4) var(--space-12);
  }

  .article-header {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
  }

  .article-cite {
    padding: var(--space-3);
  }

  .background-guide-reader {
    padding-inline: var(--space-4);
  }

  .navbar-inner {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .hamburger {
    grid-column: 2;
    justify-self: end;
  }

  .navbar-actions {
    grid-column: 3;
  }

  .navbar-actions .btn {
    display: none;
  }

  .nav-auth-link {
    display: flex;
  }

  /* Override base display:flex so boost-base.css toggle works */
  .navbar-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-4) var(--space-6);
    background: var(--surface-0);
    border-bottom: 1px solid var(--border-1);
  }

  #navToggle:checked ~ .navbar-inner .navbar-links {
    display: flex;
  }
}

@media (max-width: 360px) {
  .navbar-inner {
    gap: var(--space-2);
    padding-inline: var(--space-3);
  }

  .navbar-actions {
    gap: var(--space-2);
  }

  .navbar-actions .btn {
    display: none !important;
  }

  .nav-auth-link {
    display: flex !important;
  }
}

@media (max-width: 600px) {
  .research-grid { grid-template-columns: 1fr; }

  .article-title {
    font-size: var(--text-xl);
  }

  .article-subtitle {
    font-size: var(--text-base);
  }

  .article-meta {
    display: block;
  }

  .article-meta span {
    display: inline;
  }

  .article-meta span + span::before {
    content: "·";
    display: inline;
    width: auto;
    height: auto;
    margin: 0 var(--space-1);
    border-radius: 0;
    background: transparent;
    color: var(--text-3);
  }
}
