/* learning.css — the public Learning (Massachusetts curriculum) browser.
   Reuses boardsy-home.css tokens (--ink, --brand, --line, --panel, --teal). */

.lrn-main { padding-top: 26px; padding-bottom: 72px; }

/* Breadcrumb */
.lrn-crumbs { font-size: 0.85rem; color: var(--muted); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lrn-crumbs a { color: var(--muted); text-decoration: none; font-weight: 600; }
.lrn-crumbs a:hover { color: var(--brand); }
.lrn-crumbs .crumb-sep { color: var(--line-2); }
.lrn-crumbs .crumb-cur { color: var(--ink); font-weight: 700; }

/* Head */
.lrn-head { margin: 18px 0 22px; }
.lrn-head .eyebrow { color: var(--brand); font-weight: 700; font-size: 0.78rem; letter-spacing: 0.07em; text-transform: uppercase; }
.lrn-head h1 { font-family: "Space Grotesk", Inter, sans-serif; font-size: 2.1rem; margin: 8px 0 8px; color: var(--ink); line-height: 1.12; }
.lrn-lede { color: var(--ink-soft); max-width: 62ch; margin: 0; font-size: 1.02rem; }

/* ===== Sticky filter bar ===== */
.lrn-filters {
  position: sticky; top: 64px; z-index: 20;
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 12px 16px; margin: 0 0 26px;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-sm);
}
.lf-group { display: flex; align-items: center; gap: 10px; min-width: 0; }
.lf-label { font-size: 0.7rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.lf-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.lf-spacer { flex: 1; }
.lf-count { font-size: 0.84rem; color: var(--muted); white-space: nowrap; }

.lf-chip {
  font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer;
  padding: 6px 13px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--paper); color: var(--ink-soft);
  transition: all 0.12s ease;
}
.lf-chip:hover { border-color: var(--brand); color: var(--brand); }
.lf-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.lf-chip.subj.on.science { background: var(--teal); border-color: var(--teal); }
.lf-chip.subj.on.math { background: var(--brand); border-color: var(--brand); }

@media (max-width: 640px) {
  .lrn-filters { top: 60px; gap: 12px; }
  .lf-count { width: 100%; order: 5; }
}

/* ===== Selection screen ===== */
.lsel-block { margin-bottom: 28px; }
.lsel-title { font-family: "Space Grotesk", Inter, sans-serif; font-size: 1.05rem; color: var(--ink); margin: 0 0 12px; }
.lsel-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 12px; max-width: 560px; }
.lsel-grade {
  font: inherit; cursor: pointer; text-align: center;
  padding: 16px 8px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow-sm); transition: all 0.14s ease;
}
.lsel-grade:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow); }
.lsel-grade.on { border-color: var(--brand); background: var(--panel-2); }
.lsel-grade .g-num { display: block; font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.5rem; line-height: 1; }
.lsel-grade .g-lbl { display: block; font-size: 0.72rem; color: var(--muted); margin-top: 4px; letter-spacing: 0.04em; text-transform: uppercase; }

.lsel-subjects { display: flex; gap: 16px; flex-wrap: wrap; }
.lsel-subject {
  font: inherit; cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 6px;
  padding: 20px 22px; border-radius: 16px; min-width: 220px; flex: 1 1 220px; max-width: 300px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  box-shadow: var(--shadow-sm); transition: all 0.14s ease;
}
.lsel-subject:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.lsel-subject.math:hover { border-color: var(--brand); }
.lsel-subject.science:hover { border-color: var(--teal); }
.lsel-subject:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: var(--shadow-sm); }
.lsel-emoji { font-size: 1.7rem; }
.lsel-sub-name { font-family: "Space Grotesk", sans-serif; font-weight: 700; font-size: 1.2rem; }
.lsel-sub-meta { font-size: 0.84rem; color: var(--muted); }
.lsel-hint { color: var(--muted); font-size: 0.9rem; margin: 14px 0 0; }

/* ===== Topics listing ===== */
.lrn-strand { margin-bottom: 30px; }
.lrn-strand-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 14px; padding-bottom: 8px; border-bottom: 2px solid var(--line); }
.lrn-strand-head h2 { font-family: "Space Grotesk", Inter, sans-serif; font-size: 1.28rem; margin: 0; color: var(--ink); }
.lrn-strand-head .strand-count { font-size: 0.82rem; color: var(--muted); }
.lrn-strand.science .lrn-strand-head { border-bottom-color: rgba(18,181,166,0.4); }

.lrn-topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }

.lrn-topic {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  padding: 16px 16px 14px; border-radius: 14px;
  border: 1px solid var(--line); background: var(--paper);
  box-shadow: var(--shadow-sm); transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}
.lrn-topic:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--line-2); }
.lrn-topic h3 { font-size: 1.02rem; margin: 0; color: var(--ink); font-weight: 600; line-height: 1.28; }
.lrn-topic .lt-blurb { font-size: 0.88rem; color: var(--ink-soft); margin: 0; flex: 1; }
.lrn-topic .lt-std { font-family: "Space Mono", monospace; font-size: 0.7rem; color: var(--muted); }
.lrn-topic .lt-formats { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.lrn-topic .lt-fmt {
  font: inherit; font-size: 0.74rem; font-weight: 700; cursor: pointer;
  color: var(--ink-soft, #5a6b85); background: var(--panel-2, #f3f7ff);
  border: 1px solid var(--line-2, #dce6f5); border-radius: 999px; padding: 4px 11px;
  transition: all 0.12s ease;
}
.lrn-topic .lt-fmt:hover { color: var(--brand); border-color: rgba(37,99,255,0.4); background: #fff; }
.lrn-topic .lt-actions { display: flex; gap: 8px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.lrn-topic .lt-open {
  font: inherit; font-size: 0.82rem; font-weight: 700; text-decoration: none; cursor: pointer;
  color: var(--brand); display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--panel);
  transition: all 0.12s ease;
}
.lrn-topic .lt-open:hover { background: var(--panel-2); }
.lrn-topic .lt-open.wb { border-color: rgba(37,99,255,0.35); color: var(--brand); }
.lrn-topic .lt-open.wb:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.lrn-topic .lt-open.ls { border-color: rgba(18,181,166,0.4); color: #0f9c8f; }
.lrn-topic .lt-open.ls:hover { background: var(--teal); color: #fff; border-color: var(--teal); }
.lrn-topic .lt-open.live { color: #0f9c8f; }
.lrn-topic .lt-open .lt-arrow { transition: transform 0.12s ease; }
.lrn-topic .lt-open:hover .lt-arrow { transform: translateX(2px); }

.lt-badge {
  position: absolute; top: 12px; right: 12px;
  font-size: 0.6rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 2px 7px; border-radius: 999px; background: rgba(18,181,166,0.14); color: #0f9c8f;
}

/* Status / loading / error */
.lrn-status { color: var(--muted); padding: 30px 0; text-align: center; }
.lrn-status.error { color: #c0392b; }

/* Skeleton shimmer while topics load */
.lrn-skel { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.lrn-skel .sk { height: 96px; border-radius: 14px; background: linear-gradient(100deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%); background-size: 200% 100%; animation: skshimmer 1.2s infinite; }
@keyframes skshimmer { to { background-position: -200% 0; } }
