/* ════════════════════════════════════════════════════════════════
   BFA SITE V2 — CURRICULUM LIBRARY
   Native to the shared design system: square corners (≤2px), shared
   tokens, dark default + light. Loads after base.css.
   Tier accents: gold (Start/Free) · teal (Build/Premium) · purple (Scale/VIP).
   ════════════════════════════════════════════════════════════════ */

:root {
  --teal: #3ECFBB; --teal-tint: rgba(62, 207, 187, 0.12);
  --purple: #A78BFA; --purple-tint: rgba(167, 139, 250, 0.13);
}
body.theme-light {
  --teal: #0E8B7D; --teal-tint: rgba(14, 139, 125, 0.12);
  --purple: #7C5CD6; --purple-tint: rgba(124, 92, 214, 0.12);
}

/* Compact nav for this page: show the join CTA at every width */
.nav-cta { display: inline-flex; }
.nav-sub { display: block; font-family: var(--font-body); font-weight: 500; font-size: 8.5px; letter-spacing: 0.24em; text-transform: uppercase; color: var(--steel-dim); margin-top: 3px; }
.nav-home {
  display: inline-flex; align-items: center; gap: 6px;
  font-weight: 500; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--steel); text-decoration: none; padding: 11px 10px;
  transition: color 200ms;
}
.nav-home:hover { color: var(--gold-ink); }
@media (max-width: 599px) { .nav-home span { display: none; } .nav-cta { padding: 11px 13px; } }

/* ════════════ HERO ════════════ */
.clib-hero { padding: 44px 0 8px; }
.clib-hero h1 { font-size: clamp(30px, 6.5vw, 46px); line-height: 1.08; letter-spacing: -0.02em; margin-top: 16px; max-width: 22ch; }
.clib-hero .sub { font-size: 15px; line-height: 1.6; color: var(--steel); margin-top: 14px; max-width: 56ch; }
.statline { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 20px; }
.stat { background: var(--bg-card); border: 1px solid var(--hair); border-radius: 999px; padding: 6px 12px; font-size: 12px; font-weight: 500; color: var(--steel); }
.stat b { color: var(--gold-ink); font-weight: 700; }
@media (min-width: 900px) { .clib-hero { padding-top: 72px; } }

/* ════════════ TIER SNAPSHOT ════════════ */
.snapshot { padding: 28px 0 6px; }
.snap-title { font-size: 10.5px; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--steel-dim); margin-bottom: 10px; }
.snap-grid { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 900px) { .snap-grid { flex-direction: row; } .snap-grid .snap-card { flex: 1; } }
.snap-card {
  display: flex; align-items: center; gap: 14px; background: var(--bg-card);
  border: 1px solid var(--hair); border-radius: 2px; padding: 14px 16px;
  position: relative; overflow: hidden; text-align: left; transition: border-color 0.15s ease;
}
.snap-card:hover { border-color: var(--hair-2); }
.snap-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.snap-card.gold::before { background: var(--gold); }
.snap-card.teal::before { background: var(--teal); }
.snap-card.purple::before { background: var(--purple); }
.snap-num { font-family: var(--font-hero); font-size: 20px; font-weight: 700; width: 38px; height: 38px; border-radius: 2px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.gold .snap-num { background: var(--gold-tint); color: var(--gold-ink); }
.teal .snap-num { background: var(--teal-tint); color: var(--teal); }
.purple .snap-num { background: var(--purple-tint); color: var(--purple); }
.snap-body { flex: 1; min-width: 0; }
.snap-row1 { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.snap-name { font-family: var(--font-hero); font-weight: 700; font-size: 17px; color: var(--ink); }
.pill { font-size: 9.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill.free { background: var(--gold-tint); color: var(--gold-ink); }
.pill.premium { background: var(--teal-tint); color: var(--teal); }
.pill.vip { background: var(--purple-tint); color: var(--purple); }
.snap-unlock { font-size: 12px; color: var(--steel); margin-top: 3px; }
.snap-count { font-size: 11px; font-weight: 600; color: var(--steel-dim); margin-top: 4px; }

/* ════════════ CATALOG ════════════ */
.catalog { max-width: 820px; margin: 0 auto; padding-bottom: 60px; min-width: 0; }
.tier-head { margin: 28px 0 12px; padding: 18px; border-radius: 2px; background: var(--bg-dark); border: 1px solid var(--hair); position: relative; overflow: hidden; }
.tier-head::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.tier-head.gold::before { background: var(--gold); }
.tier-head.teal::before { background: var(--teal); }
.tier-head.purple::before { background: var(--purple); }
.tier-eyebrow { font-size: 10.5px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; }
.gold .tier-eyebrow { color: var(--gold-ink); }
.teal .tier-eyebrow { color: var(--teal); }
.purple .tier-eyebrow { color: var(--purple); }
.tier-head h2 { font-family: var(--font-hero); font-weight: 700; font-size: 26px; margin-top: 6px; color: var(--ink); }
.tier-promise { font-size: 13.5px; line-height: 1.55; color: var(--steel); margin-top: 6px; }
.tier-stack { font-size: 12px; font-weight: 700; margin-top: 11px; padding-top: 11px; border-top: 1px dashed var(--hair-2); }
.teal .tier-stack { color: var(--teal); }
.purple .tier-stack { color: var(--purple); }
.tier-meta { font-size: 11.5px; font-weight: 600; color: var(--steel-dim); margin-top: 8px; }

.chap { background: var(--bg-card); border: 1px solid var(--hair); border-radius: 2px; margin-bottom: 8px; overflow: hidden; }
.chap-row { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; text-align: left; min-height: 48px; }
.chap-num { font-family: var(--font-hero); font-size: 12px; font-weight: 600; color: var(--steel-dim); width: 26px; flex-shrink: 0; }
.chap-title { flex: 1; font-size: 14px; font-weight: 500; color: var(--ink); }
.chap-count { font-size: 11px; font-weight: 600; color: var(--steel-dim); white-space: nowrap; }
.chev { width: 18px; height: 18px; flex-shrink: 0; color: var(--steel-dim); transition: transform 0.25s ease; }
.chap.open { border-color: var(--gold-line); }
.chap.open .chap-title { font-weight: 700; }
.chap.open .chev { transform: rotate(180deg); }
.lessons { display: none; border-top: 1px solid var(--hair); padding: 6px 12px 10px; }
.chap.open .lessons { display: block; }

.lesson-row { width: 100%; display: flex; gap: 12px; align-items: center; padding: 10px 4px; border-bottom: 1px solid var(--hair); text-align: left; }
.lesson-row:last-child { border-bottom: none; }
.thumb-sm { width: 76px; height: 46px; border-radius: 2px; flex-shrink: 0; background: #0A0A0C; position: relative; overflow: hidden; }
.thumb-sm img { width: 100%; height: 100%; object-fit: contain; }
.thumb-sm .pb { position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 2px 8px rgba(0,0,0,0.6); }
.thumb-sm .pb::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border-left: 7px solid #0A0A0B; border-top: 4.5px solid transparent; border-bottom: 4.5px solid transparent; transform: translateX(1.5px); }
.lesson-info { flex: 1; min-width: 0; }
.lesson-title { font-size: 13.5px; font-weight: 700; line-height: 1.3; color: var(--ink); }
.lesson-hook { font-size: 11.5px; color: var(--steel); line-height: 1.4; margin-top: 2px; }
.lesson-icons { display: flex; gap: 6px; margin-top: 5px; }
.mini-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.05em; color: var(--steel); background: var(--bg-dark); border: 1px solid var(--hair); border-radius: 2px; padding: 2.5px 6px; }
.mini-tag svg { width: 9px; height: 9px; color: var(--gold-ink); }

/* ════════════ LESSON VIEW (modal) ════════════ */
.lv-backdrop { display: none; position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,0.6); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); }
.lv { display: none; position: fixed; inset: 0; z-index: 100; background: var(--bg); overflow-y: auto; overscroll-behavior: contain; }
body.lv-open { overflow: hidden; }
body.lv-open .lv-backdrop { display: block; }
body.lv-open .lv { display: block; }

/* ── DESKTOP (≥1024px): master-detail — list left, lesson panel right ── */
@media (min-width: 1024px) {
  .clib-layout { display: grid; grid-template-columns: minmax(340px, 470px) minmax(0, 1fr); gap: 28px; align-items: start; }
  .catalog { max-width: none; margin: 0; }
  .tier-head { margin-top: 20px; }
  .tier-head:first-child, #tier-0 .tier-head { margin-top: 28px; }
  .lv-wrap { position: sticky; top: 96px; padding: 28px 0 40px; min-width: 0; }
  .lv, body.lv-open .lv {
    display: block; position: static; inset: auto; transform: none;
    width: auto; max-height: calc(100vh - 150px); overflow-y: auto;
    border: 1px solid var(--hair-2); border-radius: 2px; background: var(--bg-dark);
    scrollbar-width: thin;
  }
  .lv:empty { display: none; }
  .lv-backdrop, body.lv-open .lv-backdrop { display: none; }
  body.lv-open { overflow: auto; }
  .lv-back { display: none; }            /* nothing to go "back" from */
  .lv-top { justify-content: flex-end; }
  .lesson-row.active { background: var(--gold-tint); box-shadow: inset 2px 0 0 var(--gold-ink); }
  .lesson-row { border-radius: 2px; padding-left: 8px; padding-right: 8px; transition: background 150ms; }
  .lesson-row:hover { background: var(--gold-tint); }
}
.lv-top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--hair); background: var(--glass-strong); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.lv-back { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--steel); background: none; border: none; min-height: 44px; }
.lv-join { display: inline-block; background: var(--gold); color: var(--on-gold); font-family: var(--font-hero); font-weight: 600; font-size: 12px; padding: 9px 14px; border-radius: 2px; text-decoration: none; white-space: nowrap; }
.lv-hero { margin: 18px 18px 0; border-radius: 2px; overflow: hidden; position: relative; aspect-ratio: 16 / 9; background: #0A0A0C; cursor: pointer; }
.lv-hero img { width: 100%; height: 100%; object-fit: contain; }
.play-btn { position: absolute; inset: 0; margin: auto; width: 58px; height: 58px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 8px 28px rgba(0,0,0,0.6); pointer-events: none; }
.play-btn::after { content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0; border-left: 16px solid #0A0A0B; border-top: 10px solid transparent; border-bottom: 10px solid transparent; transform: translateX(3px); }
.runtime-chip { position: absolute; bottom: 10px; right: 10px; background: rgba(10,10,11,0.85); border: 1px solid rgba(156,156,160,0.2); color: #F0E8D0; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 2px; }
.lock-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; background: rgba(10,10,11,0.62); }
.lock-badge { width: 54px; height: 54px; border-radius: 50%; background: #FFFFFF; display: flex; align-items: center; justify-content: center; }
.lock-badge svg { width: 22px; height: 22px; }
.lock-text { font-size: 13px; font-weight: 700; color: #F2EDE0; letter-spacing: 0.02em; }
.gate-overlay { position: absolute; inset: 0; display: none; flex-direction: column; align-items: center; justify-content: center; gap: 12px; background: rgba(10,10,11,0.82); padding: 20px; text-align: center; }
.gate-overlay.show { display: flex; }
.gate-msg { font-family: var(--font-hero); font-weight: 600; font-size: 16px; color: #FFFFFF; line-height: 1.35; max-width: 300px; }
.gate-cta { display: inline-block; background: var(--gold); color: #141416; font-family: var(--font-hero); font-weight: 600; font-size: 14px; padding: 12px 22px; border-radius: 2px; text-decoration: none; }

.lv-meta { padding: 16px 20px 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lv-pos { font-size: 12px; font-weight: 600; color: var(--steel-dim); }
.lv-title { font-family: var(--font-hero); font-weight: 700; font-size: 24px; line-height: 1.15; padding: 12px 20px 0; color: var(--ink); }
.lv-brief { font-size: 14.5px; line-height: 1.65; color: var(--steel); padding: 10px 20px 0; }
.lv-section { margin: 22px 20px 0; }
.lv-label { font-size: 10.5px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: var(--steel-dim); margin-bottom: 9px; }
.lv-body { font-size: 13.5px; line-height: 1.7; color: var(--ink); }
.check-list { list-style: none; margin-top: 6px; padding: 0; }
.check-list li { display: flex; gap: 9px; font-size: 13px; line-height: 1.5; padding: 5px 0; color: var(--ink); }
.check-list li::before { content: "✓"; color: var(--gold-ink); font-weight: 700; flex-shrink: 0; }
.res-item { display: flex; align-items: center; gap: 11px; background: var(--bg-card); border: 1px solid var(--hair); border-radius: 2px; padding: 11px 13px; margin-bottom: 7px; }
.res-icon { width: 32px; height: 32px; border-radius: 2px; display: flex; align-items: center; justify-content: center; font-size: 8.5px; font-weight: 800; letter-spacing: 0.03em; flex-shrink: 0; color: #FFF; }
.res-icon.pdf { background: #D2603F; }
.res-icon.sheet { background: #2E8F5B; }
.res-icon.doc { background: #3D6FB4; }
.res-icon.link { background: #8A8A92; }
.res-info { flex: 1; min-width: 0; }
.res-name { font-size: 13px; font-weight: 700; color: var(--ink); }
.res-type { font-size: 11px; color: var(--steel-dim); margin-top: 1px; }
.prompt-item { display: flex; align-items: center; gap: 11px; background: var(--bg-dark); border: 1px dashed var(--hair-2); border-radius: 2px; padding: 11px 13px; margin-bottom: 7px; }
.prompt-icon { width: 32px; height: 32px; border-radius: 2px; background: var(--gold-tint); color: var(--gold-ink); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; }
.prompt-name { flex: 1; font-size: 13px; font-weight: 700; color: var(--ink); }
.copy-chip { font-size: 11px; font-weight: 700; color: var(--gold-ink); background: var(--gold-tint); padding: 6px 11px; border-radius: 999px; flex-shrink: 0; text-decoration: none; }
.lv-cta { margin: 26px 20px 34px; }
.cta-main { display: block; text-align: center; background: var(--gold); color: #141416; font-family: var(--font-hero); font-weight: 600; font-size: 15px; padding: 16px; border-radius: 2px; text-decoration: none; min-height: 48px; }
.cta-main.teal { background: var(--teal); color: #0A0A0B; }
.cta-main.purple { background: var(--purple); color: #0A0A0B; }
.cta-sub { text-align: center; font-size: 11.5px; color: var(--steel-dim); margin-top: 8px; }

/* ════════════ PAGE FOOT CTA ════════════ */
.clib-foot { border-top: 1px solid var(--hair); padding: 40px 0 48px; text-align: center; }
.clib-foot p { font-size: 12px; color: var(--steel-dim); margin-top: 14px; }
@media (max-width: 1023px) { footer, .clib-foot { padding-bottom: 96px; } }
