/* ── Design tokens ── */
:root {
  --bg:           #FAFAF8;
  --bg-alt:       #F2EEE7;
  --surface:      #FFFFFF;
  --border:       #DDD6C8;
  --text:         #1C1917;
  --text-muted:   #6B6059;
  --primary:      #1B3A6B;
  --accent:       #007EA8;
  --accent-light: #00B4D8;
  --cta:          #C96A00;
  --hero-tint:    #EBF0F8;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: 'Space Grotesk', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

/* ── Nav web component — transparent in layout ── */
cis-nav { display: contents; }

/* ── Nav ── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--hero-tint);
  border-bottom: 1px solid transparent;
  padding: 0 48px;
  display: flex;
  align-items: center;
  height: 68px;
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
nav.scrolled {
  background: var(--surface);
  border-bottom-color: var(--border);
  box-shadow: 0 1px 6px rgba(27,58,107,0.06);
}
.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  text-decoration: none;
}
.wm-abbr {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: -0.03em;
  line-height: 1;
}
.wm-sep { width: 1.5px; height: 30px; background: #C5D0E0; flex-shrink: 0; }
.wm-name { font-size: 0.68rem; font-weight: 400; color: #5A6E8A; line-height: 1.4; }
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  font-size: 0.875rem;
  font-weight: 500;
  margin-left: 40px;
}
.nav-links a { color: var(--primary); text-decoration: none; opacity: 0.8; }
.nav-links a:hover { opacity: 1; }
.nav-links a[aria-current="page"] { opacity: 1; border-bottom: 2px solid var(--accent); padding-bottom: 2px; }

/* ── Hamburger toggle (shown only on mobile) ── */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: auto;
  flex-direction: column;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

/* ── Buttons ── */
.btn-primary {
  background: var(--cta);
  color: #fff;
  padding: 13px 28px;
  border-radius: 7px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  font-family: inherit;
}
.btn-primary:hover { background: #b35e00; }
.btn-secondary {
  background: var(--surface);
  color: var(--primary);
  padding: 12px 28px;
  border-radius: 7px;
  font-weight: 500;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1.5px solid #C5D0E0;
  font-family: inherit;
}
.btn-secondary:hover { border-color: var(--primary); }

/* ── Page header (inner pages) ── */
.page-header {
  position: relative;
  background: linear-gradient(
    180deg,
    var(--hero-tint) 0%,
    var(--hero-tint) 70%,
    var(--bg) 100%
  );
}
.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('figures/background.png') center / cover no-repeat;
  opacity: 0.08;
  pointer-events: none;
  z-index: 0;
}
.page-header > * {
  position: relative;
  z-index: 1;
}
.page-header-inner { max-width: 1100px; margin: 0 auto; padding: 40px 48px 56px; }
.page-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.page-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.025em;
  color: var(--primary);
  margin-bottom: 14px;
}
.page-header-meta { font-size: 1rem; font-weight: 500; color: var(--text-muted); }

/* ── Date components ── */
.date-row { margin-bottom: 14px; }
.date-row:last-child { margin-bottom: 0; }
.date-lbl { font-size: 0.7rem; font-weight: 500; color: var(--text-muted); margin-bottom: 2px; }
.date-val { font-size: 0.92rem; font-weight: 600; color: var(--text); }
.date-note { font-size: 0.68rem; color: var(--text-muted); font-style: italic; margin-top: 1px; }
.date-divider { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

/* ── Sidebar cards ── */
.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 12px rgba(27,58,107,0.06);
  margin-bottom: 20px;
}
.sidebar-card-title {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.sidebar-links { display: flex; flex-direction: column; gap: 10px; }
.sidebar-link { display: block; font-size: 0.88rem; font-weight: 500; color: var(--accent); text-decoration: none; }
.sidebar-link:hover { text-decoration: underline; }
.sidebar-link-note { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ── Topic grid ── */
.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.topic-item {
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent-light);
  border-radius: 8px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

/* ── Placeholder (pages not yet built) ── */
.placeholder { max-width: 1100px; margin: 0 auto; padding: 56px 48px 120px; }
.placeholder p { font-size: 0.97rem; color: var(--text-muted); line-height: 1.78; margin-bottom: 14px; }

/* ── Footer ── */
footer { background: var(--primary); color: #C5D0E0; padding: 40px 48px; }
.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-wordmark { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.footer-wordmark .wm-abbr { color: #fff; font-size: 1.5rem; }
.footer-wordmark .wm-sep { background: #4A6080; }
.footer-wordmark .wm-name { color: #8FA4C0; }
.footer-tagline { font-size: 0.82rem; font-style: italic; font-weight: 300; color: #8FA4C0; }
.footer-copy { font-size: 0.75rem; color: #6B849E; }
.footer-attr { font-size: 0.72rem; color: #6B849E; }
.footer-attr a { color: #6B849E; text-decoration: underline; }
.footer-attr a:hover { color: #C5D0E0; }

/* ── Mobile ── */
@media (max-width: 768px) {
  nav { padding: 0 16px; }
  .nav-toggle { display: flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 68px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 16px rgba(27,58,107,0.12);
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 8px 0;
  }
  .nav-links.open { display: flex; }
  .nav-links li a { display: block; padding: 12px 20px; }

  .page-header-inner { padding: 28px 20px 36px; }
  .placeholder { padding: 40px 20px 80px; }
  footer { padding: 32px 20px; }
  .footer-inner { flex-direction: column; align-items: flex-start; gap: 12px; }

  .topic-grid { grid-template-columns: 1fr 1fr; }
}

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