/* ============================================
   Hub Teamwork — Route Board & Playbook Archive
   Pure CSS, system fonts, no external deps
   ============================================ */

/* --------------------------------------------
   TOKENS
   -------------------------------------------- */
:root {
  /* Spacing (rhythmic) */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-s: 0.75rem;
  --space-m: 1rem;
  --space-l: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;

  /* Gaps (D3: GG4 rhythmic_variable) */
  --gap-tight: 0.5rem;
  --gap-base: 1rem;
  --gap-wide: 1.5rem;
  --gap-loose: 2rem;

  /* Width tokens (D4) */
  --w-readable: 42rem;
  --w-base: 48rem;
  --w-wide: 64rem;
  --w-board: 72rem;
  --w-inset: 90%;

  /* Typography */
  --text-xs: 0.8125rem;
  --text-s: 0.875rem;
  --text-base: 1rem;
  --text-m: 1.0625rem;
  --text-l: 1.25rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 2.5rem;

  --line-tight: 1.25;
  --line-base: 1.5;
  --line-relaxed: 1.6;

  /* Colors (muted, professional) */
  --color-bg: #faf9f7;
  --color-bg-alt: #f2f0ed;
  --color-bg-panel: #ebe8e4;
  --color-text: #1a1918;
  --color-text-muted: #5c5a57;
  --color-accent: #2d4a3e;
  --color-accent-hover: #3d5a4e;
  --color-border: #d4d1cc;
  --color-border-light: #e8e6e2;

  /* Focus (accessibility) */
  --focus-ring: 2px solid var(--color-accent);
  --focus-offset: 2px;
}

/* --------------------------------------------
   BASE / RESET
   -------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: var(--text-base);
  line-height: var(--line-base);
  color: var(--color-text);
  background: var(--color-bg);
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

a:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

/* --------------------------------------------
   TYPOGRAPHY
   -------------------------------------------- */
h1, h2, h3, h4 {
  line-height: var(--line-tight);
  margin-top: 0;
}

h1 { font-size: var(--text-2xl); margin-bottom: var(--space-m); }
h2 { font-size: var(--text-xl); margin-bottom: var(--space-s); }
h3 { font-size: var(--text-l); margin-bottom: var(--space-s); }

p {
  margin: 0 0 var(--space-m);
}

p:last-child {
  margin-bottom: 0;
}

.eyebrow {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin: 0 0 var(--space-xs);
}

.text-muted {
  color: var(--color-text-muted);
}

/* --------------------------------------------
   LAYOUT / GRID (D3: 12_col_standard)
   -------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--w-wide);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-l);
  padding-right: var(--space-l);
}

.container--wide { max-width: var(--w-wide); }
.container--base { max-width: var(--w-base); }
.container--readable { max-width: var(--w-readable); }
.container--board { max-width: var(--w-board); }

/* --------------------------------------------
   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;
}

/* --------------------------------------------
   HEADER
   -------------------------------------------- */
.site-header {
  background: var(--color-bg-alt);
  border-bottom: 1px solid var(--color-border-light);
  padding: var(--space-m) 0;
}

.nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-m);
}

.site-logo {
  font-weight: 600;
  font-size: var(--text-m);
  color: var(--color-text);
}

.site-logo:hover {
  text-decoration: none;
  color: var(--color-accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--color-border);
  padding: var(--space-xs) var(--space-m);
  font-size: var(--text-base);
  cursor: pointer;
  border-radius: 2px;
}

.nav-toggle:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s) var(--space-l);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  font-size: var(--text-s);
}

.shift-microline {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: var(--space-xs) 0 0;
  width: 100%;
}

/* --------------------------------------------
   BANDS (section spacing)
   -------------------------------------------- */
.band {
  padding: var(--space-2xl) 0;
}

.band--board {
  background: var(--color-bg-alt);
}

.band--inset {
  background: var(--color-bg-panel);
  border-radius: 4px;
  margin: 0 var(--space-l);
  padding-left: var(--space-l);
  padding-right: var(--space-l);
}

/* --------------------------------------------
   HERO ROUTE BOARD (D1)
   -------------------------------------------- */
.hero-route-board {
  padding-top: var(--space-xl);
}

.hero-board-split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--gap-wide);
  align-items: start;
}

.hero-intro {
  position: sticky;
  top: var(--space-l);
}

.hero-subtext {
  margin: var(--space-s) 0 var(--space-l);
  color: var(--color-text-muted);
  max-width: 36ch;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-m);
  margin-bottom: var(--space-xl);
}

.cta-primary {
  font-weight: 600;
  padding: var(--space-xs) var(--space-m);
  border: 1px solid var(--color-accent);
  background: var(--color-accent);
  color: #fff;
  border-radius: 2px;
}

.cta-primary:hover {
  background: var(--color-accent-hover);
  text-decoration: none;
}

.cta-secondary {
  font-weight: 500;
  padding: var(--space-xs) var(--space-m);
  border: 1px solid var(--color-border);
  border-radius: 2px;
}

.cta-secondary:hover {
  border-color: var(--color-accent);
  text-decoration: none;
}

/* Route Board Module (mini cards grid) */
.route-board-module {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: var(--space-l);
}

.board-slots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-tight);
}

.board-slot {
  display: block;
  padding: var(--space-s) var(--space-m);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border-light);
  border-radius: 2px;
  font-size: var(--text-s);
  color: var(--color-text);
}

.board-slot:hover {
  border-color: var(--color-accent);
  background: var(--color-bg-panel);
  text-decoration: none;
}

.slot-label {
  display: block;
  font-weight: 600;
}

.slot-desc {
  display: block;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.board-footer {
  margin-top: var(--space-m);
  padding-top: var(--space-m);
  border-top: 1px solid var(--color-border-light);
}

.board-proof {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0;
}

.board-status-strip {
  margin-top: var(--space-m);
  font-size: var(--text-s);
  color: var(--color-text-muted);
}

.board-status-strip a {
  color: var(--color-accent);
}

.legend-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-l);
}

.chip {
  display: inline-block;
  padding: var(--space-2xs) var(--space-s);
  font-size: var(--text-xs);
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  color: var(--color-text);
}

.chip:hover {
  border-color: var(--color-accent);
  text-decoration: none;
}

.chip--inline {
  background: transparent;
  border: none;
}

/* --------------------------------------------
   SKILL DRILLS (P1 vertical_numbered_steps)
   -------------------------------------------- */
.drills-section .section-lead {
  margin-bottom: var(--space-l);
  color: var(--color-text-muted);
}

.drills-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.drill-item {
  display: grid;
  grid-template-columns: 2rem 1fr;
  gap: var(--space-m);
  margin-bottom: var(--space-l);
}

.drill-num {
  font-weight: 700;
  font-size: var(--text-m);
  color: var(--color-accent);
}

.drill-content {
  grid-column: 2;
}

.drill-why {
  display: block;
  font-size: var(--text-s);
  color: var(--color-text-muted);
  margin-top: var(--space-2xs);
  font-style: italic;
}

/* --------------------------------------------
   FEATURED PLAYBOOK (R2)
   -------------------------------------------- */
.featured-spotlight {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--gap-wide);
  align-items: start;
}

.featured-main h3 {
  margin-top: 0;
}

.featured-main h3 a {
  color: var(--color-text);
}

.featured-main h3 a:hover {
  color: var(--color-accent);
}

.featured-excerpt {
  margin: var(--space-m) 0;
  color: var(--color-text-muted);
  max-width: 50ch;
}

.cta-read {
  font-weight: 600;
}

.featured-related .related-label {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-s);
}

.featured-related ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.featured-related li {
  margin-bottom: var(--space-s);
}

/* --------------------------------------------
   PLAYBOOK SECTIONS (R3 category_blocks)
   -------------------------------------------- */
.playbook-sections .section-lead {
  margin-bottom: var(--space-l);
  color: var(--color-text-muted);
}

.category-blocks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr));
  gap: var(--gap-wide);
}

.category-block h3 {
  font-size: var(--text-m);
  margin-bottom: var(--space-s);
  padding-bottom: var(--space-2xs);
  border-bottom: 1px solid var(--color-border);
}

.category-block ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-block li {
  margin-bottom: var(--space-xs);
}

.category-block a {
  font-size: var(--text-s);
}

/* --------------------------------------------
   SCENARIO SHELF (C4 criteria_rows)
   -------------------------------------------- */
.scenario-panel {
  background: var(--color-bg-panel);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: var(--space-xl);
}

.scenario-shelf .section-lead {
  margin-bottom: var(--space-l);
  color: var(--color-text-muted);
}

.criteria-rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

.scenario-row {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: var(--space-l);
  padding: var(--space-m) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.scenario-row:last-child {
  border-bottom: none;
}

.scenario-meta {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  gap: var(--space-2xs);
}

.meta-tag, .meta-difficulty, .meta-mindset {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

.scenario-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.scenario-link {
  font-weight: 500;
}

/* --------------------------------------------
   ARCHIVE ROWS (R5)
   -------------------------------------------- */
.archive-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.archive-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-s);
  padding: var(--space-s) 0;
  border-bottom: 1px solid var(--color-border-light);
}

.archive-row a {
  flex: 1 1 auto;
  min-width: 0;
}

.archive-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  flex-shrink: 0;
}

.archive-row--helper {
  margin-top: var(--space-l);
  padding-top: var(--space-l);
  border-top: 2px solid var(--color-border);
}

.helper-label {
  width: 100%;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

/* --------------------------------------------
   ABOUT SECTION (X2 content_plus_aside)
   -------------------------------------------- */
.about-split {
  display: grid;
  grid-template-columns: 1fr 16rem;
  gap: var(--gap-wide);
  align-items: start;
}

.about-aside {
  position: sticky;
  top: var(--space-l);
}

.aside-block {
  padding: var(--space-m);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border-light);
  border-radius: 4px;
  margin-bottom: var(--space-m);
}

.aside-block p {
  margin: 0 0 var(--space-xs);
  font-size: var(--text-s);
}

.aside-block p:last-child {
  margin-bottom: 0;
}

.disclaimer p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* --------------------------------------------
   CONTACT CTA (A3 split_cta)
   -------------------------------------------- */
.cta-split {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--gap-wide);
  align-items: center;
}

.cta-split h2 {
  margin-top: 0;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-m);
}

.cta-tertiary {
  font-size: var(--text-s);
  color: var(--color-text-muted);
}

.cta-tertiary:hover {
  color: var(--color-accent);
}

/* --------------------------------------------
   FOOTER
   -------------------------------------------- */
.site-footer {
  background: var(--color-bg-alt);
  border-top: 1px solid var(--color-border-light);
  padding: var(--space-xl) 0;
  margin-top: var(--space-2xl);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-m);
}

.footer-brand {
  font-weight: 600;
  margin: 0;
}

.footer-micro {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-s) var(--space-l);
  list-style: none;
  margin: 0 0 0 auto;
  padding: 0;
}

.footer-links a {
  font-size: var(--text-s);
}

/* --------------------------------------------
   ARTICLE / POST TEMPLATE
   -------------------------------------------- */
.breadcrumb-bar {
  padding: var(--space-m) 0;
  font-size: var(--text-s);
  color: var(--color-text-muted);
  border-bottom: 1px solid var(--color-border-light);
}

.breadcrumb-bar a {
  color: var(--color-accent);
}

.article-legend-row {
  padding: var(--space-s) 0;
  font-size: var(--text-s);
}

.legend-label {
  color: var(--color-text-muted);
  margin-right: var(--space-s);
}

.legend-chips-inline {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.article-layout {
  display: grid;
  grid-template-columns: 14rem 1fr;
  gap: var(--gap-wide);
  align-items: start;
  padding: var(--space-xl) 0;
}

.playbook-sidebar {
  position: sticky;
  top: var(--space-l);
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border-light);
  border-radius: 4px;
  padding: var(--space-m);
}

.sidebar-toggle {
  display: none;
  width: 100%;
  padding: var(--space-s);
  background: none;
  border: 1px solid var(--color-border);
  font-size: var(--text-s);
  cursor: pointer;
  text-align: left;
  border-radius: 2px;
}

.sidebar-toggle:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
}

.toggle-icon {
  float: right;
}

.sidebar-meta dt {
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin: var(--space-m) 0 var(--space-2xs);
}

.sidebar-meta dt:first-child {
  margin-top: 0;
}

.sidebar-meta dd {
  margin: 0 0 var(--space-s);
  font-size: var(--text-s);
}

.article-header {
  margin-bottom: var(--space-xl);
}

.article-meta {
  font-size: var(--text-s);
  color: var(--color-text-muted);
  margin: var(--space-s) 0 0;
}

.article-content.prose {
  max-width: 65ch;
}

.prose h2 {
  margin-top: var(--space-xl);
  padding-top: var(--space-m);
  border-top: 1px solid var(--color-border-light);
}

.prose h2:first-of-type {
  margin-top: var(--space-l);
  padding-top: 0;
  border-top: none;
}

.prose blockquote {
  margin: var(--space-l) 0;
  padding-left: var(--space-l);
  border-left: 3px solid var(--color-accent);
  color: var(--color-text-muted);
}

.prose code {
  font-size: 0.9em;
  background: var(--color-bg-alt);
  padding: 0.1em 0.3em;
  border-radius: 2px;
}

.related-plays {
  margin-top: var(--space-2xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
}

.related-plays h2 {
  font-size: var(--text-m);
  margin-bottom: var(--space-m);
}

.related-plays ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.related-plays li {
  margin-bottom: var(--space-s);
}

.article-contact-mini {
  margin-top: var(--space-xl);
  font-size: var(--text-s);
  color: var(--color-text-muted);
}

/* --------------------------------------------
   CONTACT PAGE
   -------------------------------------------- */
.contact-page, .privacy-page {
  padding: var(--space-2xl) 0;
}

.contact-details {
  margin: var(--space-l) 0;
}

.contact-details dt {
  font-weight: 600;
  font-size: var(--text-s);
  margin-top: var(--space-m);
}

.contact-details dt:first-child {
  margin-top: 0;
}

.contact-details dd {
  margin: 0.2em 0 0;
}

.form-stub {
  margin-top: var(--space-2xl);
  padding: var(--space-l);
  background: var(--color-bg-alt);
  border: 1px dashed var(--color-border);
  border-radius: 4px;
}

.form-stub-notice {
  margin-bottom: var(--space-m);
  font-size: var(--text-s);
  color: var(--color-text-muted);
}

.contact-form-stub p {
  margin-bottom: var(--space-m);
}

.contact-form-stub label {
  display: block;
  font-size: var(--text-s);
  margin-bottom: var(--space-2xs);
}

.contact-form-stub input,
.contact-form-stub textarea {
  width: 100%;
  max-width: 24rem;
  padding: var(--space-s);
  border: 1px solid var(--color-border);
  border-radius: 2px;
  font-family: inherit;
}

.contact-form-stub input:disabled,
.contact-form-stub textarea:disabled {
  background: var(--color-bg-panel);
  cursor: not-allowed;
}

/* --------------------------------------------
   PRIVACY PAGE
   -------------------------------------------- */
.policy-updated {
  font-size: var(--text-s);
  color: var(--color-text-muted);
  margin-bottom: var(--space-xl);
}

.privacy-page section {
  margin-bottom: var(--space-xl);
}

.privacy-page h2 {
  font-size: var(--text-l);
  margin-top: var(--space-xl);
}

/* --------------------------------------------
   RESPONSIVE (D3: CL2, CL3, CL4, CL6)
   -------------------------------------------- */
@media (max-width: 64rem) {
  .hero-board-split {
    grid-template-columns: 1fr;
  }

  .board-slots-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .featured-spotlight {
    grid-template-columns: 1fr;
  }

  .about-split {
    grid-template-columns: 1fr;
  }

  .about-aside {
    position: static;
  }

  .cta-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 48rem) {
  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
  }

  .nav-links.is-open {
    display: flex;
  }

  .board-slots-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .category-blocks {
    grid-template-columns: 1fr;
  }

  .scenario-row {
    grid-template-columns: 1fr;
  }

  .article-layout {
    grid-template-columns: 1fr;
  }

  .playbook-sidebar {
    position: static;
  }

  .sidebar-toggle {
    display: block;
  }

  .sidebar-content.is-collapsed {
    display: none;
  }

  .band--inset {
    margin: 0 var(--space-s);
  }

  .container {
    padding-left: var(--space-m);
    padding-right: var(--space-m);
  }
}

@media (max-width: 32rem) {
  .board-slots-grid {
    grid-template-columns: 1fr;
  }

  .cta-row {
    flex-direction: column;
  }

  .cta-actions {
    flex-direction: column;
  }

  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-links {
    margin-left: 0;
  }
}
