/* ═══════════════════════════════════════════════════════
   School Vault Academy — stylesheet
   Self-hosted, zero-dependency, cPanel-ready.
   ═══════════════════════════════════════════════════════ */

/* ── Tokens ─────────────────────────────────────────── */
:root {
  /* Brand — navy */
  --green-900: #091D33;   /* darkest navy  — footer, topnav */
  --green-800: #0E2A47;   /* deep navy     — headings, hero */
  --green-700: #1B3560;   /* mid navy      — sidebar links, accents */
  --green-300: #4A7FAD;   /* light navy    — borders */

  /* Brand — teal (primary action) */
  --teal-600:  #159C8E;   /* primary CTA, links, active states */
  --teal-400:  #7ECAC8;   /* logo safe body, light accents */
  --teal-100:  #E6F4F2;   /* tag/pill backgrounds, light teal */
  --green-100: #E6F4F2;
  --green-50:  #F0FAF9;

  /* Brand — gold */
  --amber:     #F5A623;
  --amber-light:#FEF0D0;

  /* Status colours */
  --blue-info: #0E7490;
  --blue-light:#E0F2FE;
  --red-warn:  #B91C1C;
  --red-light: #FEE2E2;

  /* Typography */
  --text-base: #16222E;
  --text-muted:#4A5568;
  --text-light:#718096;

  /* Surfaces */
  --border:    #DDE3EA;
  --surface:   #FFFFFF;
  --bg:        #FAF8F3;   /* warm cream page background */

  /* Geometry */
  --radius-sm: 6px;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(9,29,51,.08);
  --shadow:    0 2px 8px rgba(9,29,51,.10);
  --shadow-lg: 0 4px 20px rgba(9,29,51,.14);
  --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'Consolas', 'Courier New', monospace;
  --max-w:     1140px;
  --sidebar-w: 260px;
  --transition:.18s ease;
}

/* ── Reset ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-body);
  color: var(--text-base);
  background: var(--bg);
  line-height: 1.65;
  min-height: 100vh;
}
a { color: var(--teal-600); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
ul, ol { padding-left: 1.4em; }
li + li { margin-top: .3em; }

/* ── Top nav ─────────────────────────────────────────── */
.topnav {
  background: var(--green-900);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.topnav__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 68px;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.topnav__logo {
  display: flex;
  align-items: center;
  gap: .65rem;
  color: #fff;
  text-decoration: none;
  flex-shrink: 0;
}
.topnav__logo:hover { text-decoration: none; }
.topnav__logo-icon { width: 40px; height: 40px; flex-shrink: 0; }
.topnav__logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
}
.topnav__logo-name {
  font-size: .95rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.topnav__logo-tagline {
  font-size: .58rem;
  font-weight: 700;
  color: var(--amber);
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-top: 3px;
  padding-top: 3px;
  border-top: 1.5px solid rgba(245,166,35,.4);
}
.topnav__badge {
  background: var(--amber);
  color: #000;
  font-size: .6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: .05em;
  text-transform: uppercase;
  margin-left: 2px;
}
.topnav__search {
  flex: 1;
  max-width: 420px;
  position: relative;
}
.topnav__search input {
  width: 100%;
  padding: .45rem 1rem .45rem 2.4rem;
  border-radius: 24px;
  border: none;
  background: rgba(255,255,255,.15);
  color: #fff;
  font-size: .88rem;
  outline: none;
  transition: background var(--transition);
}
.topnav__search input::placeholder { color: rgba(255,255,255,.65); }
.topnav__search input:focus { background: rgba(255,255,255,.25); }
.topnav__search-icon {
  position: absolute;
  left: .7rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  opacity: .7;
  pointer-events: none;
}
.topnav__links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  font-size: .85rem;
}
.topnav__links a {
  color: rgba(255,255,255,.85);
  transition: color var(--transition);
}
.topnav__links a:hover { color: #fff; text-decoration: none; }
.topnav__btn {
  background: var(--amber);
  color: #000 !important;
  padding: .35rem .85rem;
  border-radius: 20px;
  font-weight: 600;
  font-size: .8rem !important;
}
.topnav__btn:hover { background: #FFD54F; text-decoration: none !important; }

/* ── Page layout ─────────────────────────────────────── */
.page-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2rem 1.25rem;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 800px) {
  .page-wrapper { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

/* ── Sidebar ─────────────────────────────────────────── */
.sidebar {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  scrollbar-width: thin;
  padding-right: .5rem;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar__section { margin-bottom: 1.5rem; }
.sidebar__label {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0 .5rem .4rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: .5rem;
}
.sidebar__track-title {
  font-size: .78rem;
  font-weight: 600;
  color: var(--green-800);
  padding: .4rem .5rem .25rem;
  display: flex;
  align-items: center;
  gap: .4rem;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.sidebar__track-title:hover { background: var(--green-50); }
.sidebar__track-title .track-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--green-100);
  color: var(--green-800);
  border-radius: 50%;
  font-size: .65rem;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar__articles { list-style: none; padding-left: 1.75rem; }
.sidebar__articles li a {
  display: block;
  padding: .28rem .5rem;
  font-size: .8rem;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  line-height: 1.4;
}
.sidebar__articles li a:hover { color: var(--green-800); background: var(--green-50); text-decoration: none; }
.sidebar__articles li a.active { color: var(--teal-600); font-weight: 600; background: var(--teal-100); }

/* ── Article ─────────────────────────────────────────── */
.article-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2.5rem 2.75rem;
  line-height: 1.75;
}
@media (max-width: 600px) { .article-card { padding: 1.25rem 1rem; } }

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 1.5rem;
}
.article-meta .breadcrumb {
  font-size: .8rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .35rem;
  flex: 1 0 100%;
  margin-bottom: .25rem;
}
.article-meta .breadcrumb a { color: var(--text-muted); }
.article-meta .breadcrumb a:hover { color: var(--green-800); }
.tag {
  display: inline-flex;
  align-items: center;
  padding: .22rem .65rem;
  border-radius: 20px;
  font-size: .73rem;
  font-weight: 600;
}
.tag--persona { background: var(--green-100); color: var(--green-800); }
.tag--time { background: var(--amber-light); color: #7B5800; }
.tag--stale { background: var(--red-light); color: var(--red-warn); }
.tag--version { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

.article-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-base);
  line-height: 1.3;
  margin-bottom: .75rem;
}
.article-summary {
  font-size: 1rem;
  color: var(--text-muted);
  border-left: 3px solid var(--teal-600);
  padding-left: 1rem;
  margin-bottom: 2rem;
  line-height: 1.7;
}
.article-body h2 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--green-900);
  margin: 2rem 0 .75rem;
  padding-bottom: .35rem;
  border-bottom: 2px solid var(--green-100);
}
.article-body h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-base);
  margin: 1.4rem 0 .5rem;
}
.article-body p { margin-bottom: .9rem; }
.article-body ol, .article-body ul { margin-bottom: .9rem; }
.article-body ol li, .article-body ul li { margin-bottom: .45rem; }
.article-body strong { color: var(--text-base); }
.article-body code {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .1em .4em;
  font-family: var(--font-mono);
  font-size: .85em;
}

/* ── Callouts ────────────────────────────────────────── */
.callout {
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  margin: 1.25rem 0;
  display: flex;
  gap: .75rem;
  align-items: flex-start;
  font-size: .9rem;
  line-height: 1.6;
}
.callout__icon { flex-shrink: 0; font-size: 1.1rem; margin-top: .05rem; }
.callout__body { flex: 1; }
.callout__body strong { display: block; margin-bottom: .2rem; }
.callout--warning { background: var(--red-light); border-left: 4px solid var(--red-warn); }
.callout--warning .callout__icon::before { content: '⚠️'; }
.callout--tip    { background: var(--teal-100); border-left: 4px solid var(--teal-600); }
.callout--tip    .callout__icon::before { content: '💡'; }
.callout--note   { background: var(--blue-light); border-left: 4px solid var(--blue-info); }
.callout--note   .callout__icon::before { content: '📌'; }
.callout--info   { background: var(--amber-light); border-left: 4px solid var(--amber); }
.callout--info   .callout__icon::before { content: 'ℹ️'; }

/* ── Screenshot placeholder ──────────────────────────── */
.screenshot-placeholder {
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  color: var(--text-light);
  font-size: .82rem;
  margin: 1.25rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 80px;
}
.screenshot-placeholder::before { content: '📷'; font-size: 1.2rem; }

/* ── Steps ───────────────────────────────────────────── */
.steps { list-style: none; padding-left: 44px; counter-reset: step; margin: 1rem 0 1.5rem; }
.steps li {
  counter-increment: step;
  position: relative;
  margin-bottom: 1rem;
  min-height: 28px;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: -44px;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal-600);
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
}

/* ── Prerequisites box ───────────────────────────────── */
.prereqs {
  background: var(--green-50);
  border: 1px solid var(--green-100);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.75rem;
}
.prereqs h4 {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--green-800);
  margin-bottom: .5rem;
}
.prereqs ul { margin: 0; }
.prereqs ul li { font-size: .88rem; }

/* ── Related articles ────────────────────────────────── */
.related-articles {
  border-top: 1px solid var(--border);
  margin-top: 2.5rem;
  padding-top: 1.5rem;
}
.related-articles h3 {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: .75rem;
}
.related-articles ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.related-articles ul li a {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: var(--green-50);
  color: var(--green-800);
  border: 1px solid var(--green-100);
  border-radius: 20px;
  padding: .3rem .8rem;
  font-size: .82rem;
  font-weight: 500;
  transition: background var(--transition);
}
.related-articles ul li a:hover { background: var(--green-100); text-decoration: none; }

/* ── Article footer ──────────────────────────────────── */
.article-footer {
  border-top: 1px solid var(--border);
  margin-top: 2rem;
  padding-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  align-items: center;
  font-size: .78rem;
  color: var(--text-light);
}
.article-footer a { color: var(--green-800); }
.article-footer .support-cta {
  margin-top: .5rem;
  flex: 1 0 100%;
  background: var(--green-50);
  border-radius: var(--radius);
  padding: .75rem 1rem;
  font-size: .85rem;
  color: var(--text-muted);
}
.article-footer .support-cta a { font-weight: 600; }

/* ── Changelog ───────────────────────────────────────── */
details.changelog {
  margin-top: 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
details.changelog summary {
  padding: .65rem 1rem;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  background: var(--bg);
  list-style: none;
  display: flex;
  align-items: center;
  gap: .5rem;
}
details.changelog summary::-webkit-details-marker { display: none; }
details.changelog summary::before { content: '▶'; font-size: .65rem; transition: transform var(--transition); }
details[open].changelog summary::before { transform: rotate(90deg); }
details.changelog .changelog-body {
  padding: .75rem 1rem;
  font-size: .82rem;
}
.changelog-entry { display: flex; gap: .75rem; padding: .4rem 0; border-bottom: 1px solid var(--border); }
.changelog-entry:last-child { border-bottom: none; }
.changelog-entry .cl-version { font-weight: 700; color: var(--green-800); min-width: 45px; }
.changelog-entry .cl-date { color: var(--text-muted); min-width: 90px; }

/* ── Home hero ───────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--green-900) 0%, var(--green-700) 100%);
  color: #fff;
  padding: 3.5rem 1.25rem;
  text-align: center;
}
.hero h1 { font-size: 2.2rem; font-weight: 800; margin-bottom: .75rem; }
.hero p { font-size: 1.1rem; opacity: .85; max-width: 540px; margin: 0 auto 2rem; }
.hero__search {
  display: flex;
  max-width: 520px;
  margin: 0 auto;
  gap: 0;
  background: #fff;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.hero__search input {
  flex: 1;
  border: none;
  outline: none;
  padding: .8rem 1.25rem;
  font-size: .95rem;
  color: var(--text-base);
}
.hero__search button {
  padding: .8rem 1.5rem;
  background: var(--amber);
  border: none;
  cursor: pointer;
  font-weight: 700;
  font-size: .9rem;
  color: #000;
  transition: background var(--transition);
}
.hero__search button:hover { background: #FFD54F; }

/* ── Track grid (home) ───────────────────────────────── */
.home-content { max-width: var(--max-w); margin: 0 auto; padding: 2.5rem 1.25rem; }
.track-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}
.track-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  border: 1px solid var(--border);
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex;
  flex-direction: column;
  gap: .65rem;
}
.track-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--teal-600); text-decoration: none; }
.track-card__icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius);
  background: var(--green-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.track-card__num { font-size: .72rem; font-weight: 700; color: var(--text-muted); letter-spacing: .06em; text-transform: uppercase; }
.track-card__title { font-size: 1rem; font-weight: 700; color: var(--text-base); }
.track-card__desc { font-size: .82rem; color: var(--text-muted); line-height: 1.5; flex: 1; }
.track-card__count { font-size: .75rem; color: var(--green-700); font-weight: 600; }

/* ── Search results ──────────────────────────────────── */
.search-result {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: .75rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}
.search-result:hover { box-shadow: var(--shadow); text-decoration: none; display: block; }
.search-result__track { font-size: .72rem; font-weight: 700; color: var(--green-700); text-transform: uppercase; letter-spacing: .05em; margin-bottom: .3rem; }
.search-result__title { font-size: 1rem; font-weight: 700; color: var(--text-base); margin-bottom: .3rem; }
.search-result__summary { font-size: .85rem; color: var(--text-muted); line-height: 1.5; }
.search-result__meta { margin-top: .5rem; font-size: .75rem; color: var(--text-light); display: flex; gap: .75rem; }
mark { background: var(--amber-light); color: var(--text-base); border-radius: 2px; padding: 0 2px; }

/* ── Persona path ────────────────────────────────────── */
.learning-path { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 2rem; }
.path-step { display: flex; gap: 1rem; margin-bottom: 1.25rem; }
.path-step__time { min-width: 55px; font-size: .75rem; font-weight: 700; color: var(--green-800); padding-top: .1rem; }
.path-step__content a { font-weight: 600; }
.path-step__content p { font-size: .83rem; color: var(--text-muted); margin-top: .2rem; }

/* ── Misc utility ────────────────────────────────────── */
.section-heading { font-size: 1.4rem; font-weight: 700; color: var(--text-base); margin-bottom: .3rem; }
.section-sub { font-size: .9rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; } .mb-2 { margin-bottom: 1rem; }
.divider { border: none; border-top: 1px solid var(--border); margin: 1.5rem 0; }

/* ── Mobile nav toggle ───────────────────────────────── */
.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: .3rem;
}
@media (max-width: 800px) {
  .mobile-menu-btn { display: flex; }
  .topnav__links { display: none; }
  .hero h1 { font-size: 1.6rem; }
}

/* ── Home page BEM aliases ───────────────────────────── */
.hero__inner { max-width: var(--max-w); margin: 0 auto; }
.hero__headline { font-size: 2.2rem; font-weight: 800; margin-bottom: .75rem; color: #fff; }
.hero__sub { font-size: 1.1rem; opacity: .85; max-width: 540px; margin: 0 auto 2rem; color: #fff; }
.hero__search { display: flex; max-width: 520px; margin: 0 auto; background: #fff; border-radius: 32px; overflow: hidden; box-shadow: var(--shadow-lg); }
.hero__search-input { flex: 1; border: none; outline: none; padding: .8rem 1.25rem; font-size: .95rem; color: var(--text-base); }
.hero__search-btn { padding: .8rem 1.5rem; background: var(--amber); border: none; cursor: pointer; font-weight: 700; font-size: .9rem; color: #000; transition: background var(--transition); }
.hero__search-btn:hover { background: #FFD54F; }

.track-section { padding: 2.5rem 1.25rem; max-width: var(--max-w); margin: 0 auto; }
.track-section__inner { width: 100%; }
.track-section__heading { font-size: 1.4rem; font-weight: 700; color: var(--text-base); margin-bottom: 1.25rem; }
.track-card__name { font-size: 1rem; font-weight: 700; color: var(--text-base); }
.track-card__desc { font-size: .82rem; color: var(--text-muted); line-height: 1.5; }

/* ── Persona strip (home) ────────────────────────────── */
.persona-strip { background: var(--green-100); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 2.25rem 1.25rem; }
.persona-strip__inner { max-width: var(--max-w); margin: 0 auto; }
.persona-strip__heading { font-size: 1.3rem; font-weight: 700; color: var(--green-900); margin-bottom: .3rem; }
.persona-strip__sub { font-size: .9rem; color: var(--green-800); margin-bottom: 1.25rem; }
.persona-strip__grid { display: flex; flex-wrap: wrap; gap: .75rem; }
.persona-chip {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .65rem 1.25rem;
  background: #fff;
  border: 2px solid var(--green-300);
  border-radius: 32px;
  font-weight: 600;
  font-size: .9rem;
  color: var(--green-900);
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition);
}
.persona-chip:hover { background: var(--green-900); color: #fff; border-color: var(--green-900); text-decoration: none; }
.persona-chip span { font-size: .78rem; font-weight: 500; opacity: .7; }

/* ── Popular articles (home) ─────────────────────────── */
.popular-section { padding: 2.5rem 1.25rem; max-width: var(--max-w); margin: 0 auto; }
.popular-section__inner { width: 100%; }
.popular-section__heading { font-size: 1.3rem; font-weight: 700; color: var(--text-base); margin-bottom: 1rem; }
.popular-list { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .75rem; }
.popular-list__item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: box-shadow var(--transition); }
.popular-list__item:hover { box-shadow: var(--shadow); }
.popular-list__link { display: block; padding: 1rem 1.25rem; text-decoration: none; color: inherit; }
.popular-list__title { display: block; font-weight: 600; color: var(--text-base); margin-bottom: .25rem; font-size: .95rem; }
.popular-list__meta { font-size: .78rem; color: var(--text-muted); }

/* ── Print ───────────────────────────────────────────── */
@media print {
  .topnav, .sidebar, .topnav__search { display: none; }
  .page-wrapper { grid-template-columns: 1fr; padding: 0; }
  .article-card { box-shadow: none; padding: 0; }
}
