/* =============================================================================
   core.css — Shared CSS framework for all website containers.

   HOW IT WORKS:
     This file provides layout, components, and utilities using CSS custom
     properties for every visual token. Sites override tokens in theme.css —
     they do not touch this file.

   STRUCTURE:
     1.  Custom properties (tokens)
     2.  Reset / normalize
     3.  Base typography
     4.  Layout — .wrap, .section
     5.  Skip link
     6.  Site header & nav
     7.  Mobile menu
     8.  Hero
     9.  Cards
    10.  Article layout
    11.  Prose (article body)
    12.  Table of contents
    13.  FAQ accordion
    14.  Breadcrumb
    15.  Buttons
    16.  CTA band
    17.  Call bar (sticky mobile)
    18.  Site footer
    19.  Error page (404)
    20.  Utilities
    21.  Responsive overrides
   ============================================================================= */

/* ── 1. Custom properties ─────────────────────────────────────────────────── */
:root {
  /* Colours */
  --color-primary:        #1a56db;
  --color-primary-dark:   #1240a8;
  --color-primary-light:  #e8f0fd;
  --color-accent:         #f59e0b;
  --color-bg:             #ffffff;
  --color-bg-alt:         #f8f9fb;
  --color-text:           #111827;
  --color-text-muted:     #6b7280;
  --color-border:         #e5e7eb;
  --color-error:          #dc2626;

  /* Typography */
  --font-heading: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body:    system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono:    ui-monospace, 'Cascadia Code', 'Source Code Pro', monospace;

  /* Sizing */
  --max-width:      1200px;
  --max-width-text: 720px;
  --radius:         0.375rem;
  --radius-lg:      0.75rem;

  /* Spacing scale */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow:    0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);

  /* Transitions */
  --transition: 150ms ease;
}

/* ── 2. Reset / normalize ─────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, svg, video {
  display: block;
  max-width: 100%;
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover, a:focus-visible {
  color: var(--color-primary-dark);
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  line-height: 1.25;
  font-weight: 700;
  color: var(--color-text);
}

/* ── 3. Base typography ───────────────────────────────────────────────────── */
h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.4rem,  3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2vw, 1.5rem); }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

/* ── 4. Layout ────────────────────────────────────────────────────────────── */
.wrap {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.section {
  padding-block: var(--space-16);
}

.section--alt {
  background-color: var(--color-bg-alt);
}

.section__title {
  margin-bottom: var(--space-4);
}

.section__lead {
  color: var(--color-text-muted);
  font-size: 1.125rem;
  max-width: 60ch;
  margin-bottom: var(--space-10);
}

main {
  flex: 1;
}

/* ── 5. Skip link ─────────────────────────────────────────────────────────── */
.skip {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  z-index: 9999;
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  transition: top var(--transition);
}

.skip:focus {
  top: var(--space-2);
}

/* ── 6. Site header & nav ─────────────────────────────────────────────────── */
.site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding-block: var(--space-4);
}

.brand {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.25rem;
  text-decoration: none;
  color: var(--color-text);
}

.brand:hover, .brand:focus-visible {
  color: var(--color-primary);
}

.nav__list {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.nav__link {
  display: block;
  padding: var(--space-2) var(--space-3);
  text-decoration: none;
  font-weight: 500;
  color: var(--color-text);
  border-radius: var(--radius);
  transition: background var(--transition), color var(--transition);
}

.nav__link:hover,
.nav__link:focus-visible,
.nav__link[aria-current="page"] {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.nav__link--cta {
  background: var(--color-primary);
  color: #fff !important;
  padding: var(--space-2) var(--space-5);
}

.nav__link--cta:hover,
.nav__link--cta:focus-visible {
  background: var(--color-primary-dark);
}

/* ── 7. Mobile menu toggle ────────────────────────────────────────────────── */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: transparent;
  cursor: pointer;
  color: var(--color-text);
}

.menu-toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.menu-toggle__icon { display: block; }
.menu-toggle__icon--open  { display: block; }
.menu-toggle__icon--close { display: none; }

.menu-toggle[aria-expanded="true"] .menu-toggle__icon--open  { display: none; }
.menu-toggle[aria-expanded="true"] .menu-toggle__icon--close { display: block; }

/* ── 8. Hero ──────────────────────────────────────────────────────────────── */
.hero {
  background: var(--color-bg-alt);
  padding-block: var(--space-20);
  text-align: center;
}

.hero__title {
  margin-bottom: var(--space-5);
  max-width: 20ch;
  margin-inline: auto;
}

.hero__lead {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 55ch;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

/* ── 9. Cards ─────────────────────────────────────────────────────────────── */
.card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.card__title {
  font-size: 1.125rem;
  font-weight: 700;
}

.card__desc {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.card__meta {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.card__link {
  margin-top: auto;
  align-self: flex-start;
  text-decoration: none;
  font-weight: 600;
  color: var(--color-primary);
}

.card__link:hover, .card__link:focus-visible {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* ── 10. Article layout ───────────────────────────────────────────────────── */
.article-page {
  padding-bottom: var(--space-16);
}

.article-header {
  padding-block: var(--space-10) var(--space-8);
}

.article-header__category {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: var(--space-1) var(--space-3);
  border-radius: 999px;
  margin-bottom: var(--space-4);
}

.article-header__title {
  margin-bottom: var(--space-4);
}

.article-header__accent {
  color: var(--color-primary);
}

.article-header__subtitle {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-bottom: var(--space-5);
  max-width: 65ch;
}

.article-header__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-5);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.article-header__meta-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.article-header__meta-icon {
  flex-shrink: 0;
  opacity: 0.6;
}

.article-header__updated {
  font-style: italic;
}

.article-hero {
  margin-bottom: var(--space-10);
}

.article-hero__img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  border-radius: var(--radius-lg);
}

.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  align-items: start;
}

.article-sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
}

.article-sidebar__related-heading,
.article-sidebar__related-list {
  margin-top: var(--space-2);
}

.article-sidebar__related-heading {
  font-weight: 600;
  font-size: 0.9375rem;
  margin-bottom: var(--space-3);
}

.article-sidebar__related-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.article-sidebar__related-link {
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--color-primary);
}

.article-sidebar__related-link:hover {
  text-decoration: underline;
}

/* ── 11. Prose ────────────────────────────────────────────────────────────── */
.prose {
  max-width: var(--max-width-text);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--color-text);
}

.prose h2 { margin-top: var(--space-10); margin-bottom: var(--space-4); }
.prose h3 { margin-top: var(--space-8);  margin-bottom: var(--space-3); }
.prose h4 { margin-top: var(--space-6);  margin-bottom: var(--space-2); }

.prose p  { margin-bottom: var(--space-5); }

.prose ul, .prose ol {
  list-style: revert;
  padding-left: var(--space-6);
  margin-bottom: var(--space-5);
}

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

.prose a { color: var(--color-primary); }

.prose strong { font-weight: 700; }
.prose em { font-style: italic; }

.prose blockquote {
  border-left: 4px solid var(--color-primary);
  padding-left: var(--space-5);
  color: var(--color-text-muted);
  font-style: italic;
  margin-block: var(--space-6);
}

.prose pre {
  background: #1e1e2e;
  color: #cdd6f4;
  padding: var(--space-5);
  border-radius: var(--radius);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  margin-bottom: var(--space-5);
}

.prose code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--color-bg-alt);
  padding: 0.1em 0.4em;
  border-radius: var(--radius);
}

.prose pre code {
  background: none;
  padding: 0;
  font-size: inherit;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--space-6);
  font-size: 0.9375rem;
}

.prose th, .prose td {
  border: 1px solid var(--color-border);
  padding: var(--space-2) var(--space-4);
  text-align: left;
}

.prose th {
  background: var(--color-bg-alt);
  font-weight: 600;
}

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

/* ── 12. Table of contents ────────────────────────────────────────────────── */
.toc {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
}

.toc__heading {
  font-weight: 700;
  font-size: 0.9375rem;
  margin-bottom: var(--space-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.toc__list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  counter-reset: toc;
}

.toc__item {
  counter-increment: toc;
}

.toc__link {
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--color-text);
  display: flex;
  gap: var(--space-2);
  align-items: baseline;
  transition: color var(--transition);
}

.toc__link::before {
  content: counter(toc) ".";
  color: var(--color-primary);
  font-weight: 600;
  min-width: 1.5em;
  flex-shrink: 0;
  font-size: 0.8125rem;
}

.toc__link:hover, .toc__link:focus-visible {
  color: var(--color-primary);
}

/* ── 13. FAQ accordion ────────────────────────────────────────────────────── */
.faq {
  background: var(--color-bg-alt);
}

.faq__list {
  max-width: var(--max-width-text);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.faq__item {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.faq__question {
  display: block;
}

.faq__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  color: var(--color-text);
  font-family: var(--font-body);
  transition: background var(--transition);
}

.faq__toggle:hover {
  background: var(--color-bg-alt);
}

.faq__toggle:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: -2px;
}

.faq__icon {
  flex-shrink: 0;
  transition: transform var(--transition);
  color: var(--color-primary);
}

.faq__toggle[aria-expanded="true"] .faq__icon {
  transform: rotate(180deg);
}

.faq__answer {
  padding: 0 var(--space-6) var(--space-5);
  color: var(--color-text-muted);
  line-height: 1.7;
}

.faq__answer[hidden] {
  display: none;
}

.faq__answer-inner {
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border);
}

/* ── 14. Breadcrumb ───────────────────────────────────────────────────────── */
.breadcrumb {
  padding-block: var(--space-4);
}

.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1);
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.breadcrumb__link {
  color: var(--color-primary);
  text-decoration: none;
}

.breadcrumb__link:hover { text-decoration: underline; }

.breadcrumb__item--sep { margin-inline: var(--space-1); }

.breadcrumb__item--current { color: var(--color-text-muted); }

/* ── 15. Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0.625rem var(--space-5);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background var(--transition), color var(--transition),
              border-color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn--primary {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.btn--primary:hover, .btn--primary:focus-visible {
  background: var(--color-primary-dark);
  border-color: var(--color-primary-dark);
  color: #fff;
}

.btn--ghost {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn--ghost:hover, .btn--ghost:focus-visible {
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
}

.btn--block {
  display: flex;
  width: 100%;
}

.btn--sm {
  padding: 0.375rem var(--space-3);
  font-size: 0.8125rem;
}

/* ── 16. CTA band ─────────────────────────────────────────────────────────── */
.cta-band {
  background: var(--color-primary);
  color: #fff;
  text-align: center;
}

.cta-band__title {
  color: #fff;
  margin-bottom: var(--space-4);
}

.cta-band__lead {
  color: rgb(255 255 255 / 0.85);
  font-size: 1.0625rem;
  max-width: 55ch;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

.cta-band__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
}

.cta-band .btn--ghost {
  border-color: rgba(255 255 255 / 0.6);
  color: #fff;
}

.cta-band .btn--ghost:hover {
  background: rgba(255 255 255 / 0.15);
  border-color: #fff;
  color: #fff;
}

/* ── 17. Call bar (sticky mobile bottom) ─────────────────────────────────── */
.callbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: var(--space-3) var(--space-5);
  display: flex;
  gap: var(--space-3);
  box-shadow: 0 -2px 8px rgb(0 0 0 / 0.08);
}

.callbar .btn {
  flex: 1;
}

/* ── 18. Site footer ──────────────────────────────────────────────────────── */
.site-footer {
  background: var(--color-text);
  color: rgb(255 255 255 / 0.75);
  padding-block: var(--space-16) var(--space-10);
  margin-top: auto;
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-10);
}

.site-footer__col-title {
  font-weight: 700;
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #fff;
  margin-bottom: var(--space-4);
}

.site-footer__link {
  display: block;
  color: rgb(255 255 255 / 0.65);
  text-decoration: none;
  font-size: 0.9375rem;
  padding-block: var(--space-1);
  transition: color var(--transition);
}

.site-footer__link:hover, .site-footer__link:focus-visible {
  color: #fff;
}

.site-footer__bottom {
  border-top: 1px solid rgb(255 255 255 / 0.1);
  padding-top: var(--space-6);
  font-size: 0.8125rem;
  color: rgb(255 255 255 / 0.4);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: space-between;
  align-items: center;
}

/* ── 19. Error page ───────────────────────────────────────────────────────── */
.error-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding-block: var(--space-16);
  text-align: center;
}

.error-page__inner {
  max-width: 540px;
}

.error-page__code {
  font-size: clamp(5rem, 20vw, 9rem);
  font-weight: 800;
  color: var(--color-primary-light);
  line-height: 1;
  margin-bottom: var(--space-4);
  font-family: var(--font-heading);
}

.error-page__title {
  margin-bottom: var(--space-4);
}

.error-page__lead {
  color: var(--color-text-muted);
  margin-bottom: var(--space-8);
  font-size: 1.0625rem;
}

.error-page__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  justify-content: center;
  margin-bottom: var(--space-10);
}

.error-page__links-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-3);
}

.error-page__link-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  justify-content: center;
}

.error-page__link {
  font-size: 0.9375rem;
  color: var(--color-primary);
}

/* ── 20. Articles listing ─────────────────────────────────────────────────── */
.articles-hero {
  background: var(--color-bg-alt);
  text-align: center;
}

.articles-hero__title {
  margin-bottom: var(--space-4);
}

.articles-hero__lead {
  color: var(--color-text-muted);
  font-size: 1.0625rem;
  max-width: 55ch;
  margin-inline: auto;
  margin-bottom: var(--space-8);
}

.articles-hero__stats {
  display: inline-flex;
  align-items: center;
  gap: var(--space-6);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-8);
  box-shadow: var(--shadow-sm);
}

.articles-hero__stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-1);
}

.articles-hero__stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
  font-family: var(--font-heading);
}

.articles-hero__stat-label {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.articles-hero__stat-divider {
  width: 1px;
  height: 2.5rem;
  background: var(--color-border);
}

.articles-category {
  margin-bottom: var(--space-16);
}

.articles-category:last-child {
  margin-bottom: 0;
}

.articles-category__heading {
  font-size: 1.25rem;
  margin-bottom: var(--space-6);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--color-primary);
  display: inline-block;
}

.articles-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-5);
}

.article-card {
  transition: box-shadow var(--transition), transform var(--transition);
}

.article-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.article-card__meta-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.article-card__category {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  background: var(--color-primary-light);
  padding: var(--space-1) var(--space-2);
  border-radius: 999px;
}

.article-card__date {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.article-card__title-link {
  text-decoration: none;
  color: var(--color-text);
}

.article-card__title-link:hover {
  color: var(--color-primary);
}

.article-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: auto;
  flex-wrap: wrap;
}

.article-card__read-time {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

/* ── 21. Utilities ────────────────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ── Responsive overrides ────────────────────────────────────────────────── */

/* Tablet — 48em (768px) */
@media (min-width: 48em) {
  .wrap {
    padding-inline: var(--space-8);
  }

  .menu-toggle {
    display: none !important;
  }

  .site-footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Desktop — 64em (1024px) */
@media (min-width: 64em) {
  .article-grid {
    grid-template-columns: 1fr 320px;
    gap: var(--space-12);
  }

  .article-sidebar {
    position: sticky;
    top: calc(4rem + var(--space-6));
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
  }

  .site-footer__grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .articles-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .callbar {
    display: none;
  }
}

/* Mobile nav — collapses below 48em */
@media (max-width: 47.9375em) {
  .menu-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4) var(--space-5);
    box-shadow: var(--shadow-md);
  }

  .site-nav.is-open {
    display: block;
  }

  .nav__list {
    flex-direction: column;
    align-items: stretch;
  }

  .nav__link {
    padding: var(--space-3) var(--space-4);
  }
}
