/* =================================================================
   module-hub-v2.css — Module Hub Page Layout
   Replaces module-hub.css. Uses CSS variables set inline per page.
   ================================================================= */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  background: #f8fafc;
  color: #1a1a1a;
  -webkit-font-smoothing: antialiased;
}

/* ── Topbar (identical to subject-hub.css) ───────────────────── */
.mh-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 28px;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 10;
}
.mh-brand {
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 17px;
  color: #0f172a;
  text-decoration: none;
  letter-spacing: -.02em;
}
.mh-nav {
  display: flex;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.mh-nav a {
  font-size: 13px;
  color: #64748b;
  text-decoration: none;
  font-weight: 500;
}
.mh-nav a:hover { color: #0f172a; }
.mh-nav a.mh-active { font-weight: 700; }

/* ── Hero ─────────────────────────────────────────────────────── */
/* Background set via --mh-hero-bg variable on <div class="mh-hero"> */
.mh-hero {
  background: var(--mh-hero-bg);
  color: var(--mh-hero-text);
  padding: 30px 36px 28px;
  min-height: 300px;
  background-color: #070b1a;
  background-repeat: no-repeat !important;
  background-size: 78% auto !important;
  background-position: right center !important;
}
.mh-crumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 11.5px;
  opacity: .62;
  margin-bottom: 12px;
}
.mh-crumbs a { color: currentColor; text-decoration: none; }
.mh-crumbs a:hover { text-decoration: underline; }
.mh-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  opacity: .65;
  margin-bottom: 8px;
}
.mh-hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -.025em;
  margin: 0 0 10px;
  line-height: 1.05;
}
.mh-hero-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}
.mh-hero-desc {
  font-size: 14px;
  line-height: 1.52;
  opacity: .84;
  max-width: 60%;
  margin: 0;
}
.mh-stats {
  display: flex;
  gap: 22px;
  flex-shrink: 0;
}
.mh-stat strong {
  font-family: 'Outfit', sans-serif;
  font-size: 26px;
  font-weight: 800;
  display: block;
  line-height: 1;
  margin-bottom: 2px;
}
.mh-stat span { font-size: 11px; opacity: .75; }

/* CTA strip */
.mh-cta-strip {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.mh-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  text-decoration: none;
  border: none;
  cursor: pointer;
}
.mh-btn-primary {
  background: var(--mh-btn-bg);
  color: var(--mh-btn-text);
}
.mh-btn-primary:hover { opacity: .9; }
.mh-btn-secondary {
  background: rgba(255,255,255,.35);
  color: var(--mh-hero-text);
  border: 1px solid rgba(0,0,0,.12);
}
.mh-btn-secondary:hover { background: rgba(255,255,255,.5); }

/* ── Body layout ─────────────────────────────────────────────── */
.mh-body {
  display: grid;
  grid-template-columns: 1fr 300px;
  background:
    radial-gradient(circle at 7% 0%, color-mix(in srgb, var(--mh-snap-ink, #1e3a8a) 8%, transparent) 0%, transparent 32%),
    linear-gradient(180deg, #fbfdff 0%, #f6f8fc 100%);
  min-height: 60vh;
}

/* ── Lesson column ───────────────────────────────────────────── */
.mh-lesson-col {
  padding: 30px 34px 46px;
  border-right: 1px solid #dbe3ef;
}
.mh-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--mh-snap-ink, #1e3a8a);
  margin-bottom: 16px;
}
.mh-section-label .mh-sl-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--mh-snap-ink, #1e3a8a) 34%, transparent), transparent);
}
.mh-lesson-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 12px;
  text-decoration: none;
  color: #0f172a;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 1px 0 rgba(15,23,42,0.04);
  transition: transform .14s ease, background .14s ease, border-color .14s ease, box-shadow .14s ease;
  margin-bottom: 8px;
}
.mh-lesson-row:hover {
  transform: translateX(3px);
  background: #fff;
  border-color: color-mix(in srgb, var(--mh-snap-ink, #1e3a8a) 22%, #dbe3ef);
  box-shadow: 0 10px 24px rgba(15,23,42,0.08);
}
.mh-lesson-num {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--mh-snap-ink, #1e3a8a) 12%, #fff);
  color: var(--mh-snap-ink, #1e3a8a);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 12.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--mh-snap-ink, #1e3a8a) 18%, transparent);
}
.mh-lesson-quiz {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%);
  color: #fff7ed;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .04em;
  box-shadow: 0 8px 18px rgba(249,115,22,0.22);
}
.mh-lesson-title {
  font-size: 14.5px;
  font-weight: 650;
  flex: 1;
  line-height: 1.3;
}
.mh-quiz-row {
  background: linear-gradient(135deg, rgba(255,247,237,0.92), rgba(254,243,199,0.72));
  border-color: rgba(251,191,36,0.22);
}
.mh-lesson-row.mh-quiz-row .mh-lesson-title {
  font-weight: 750;
  color: #713f12;
}
.mh-lesson-arrow {
  color: color-mix(in srgb, var(--mh-snap-ink, #1e3a8a) 38%, #cbd5e1);
  font-size: 20px;
  flex-shrink: 0;
  transition: transform .14s ease, color .14s ease;
}
.mh-lesson-row:hover .mh-lesson-arrow {
  transform: translateX(3px);
  color: var(--mh-snap-ink, #1e3a8a);
}

/* ── Sidebar ─────────────────────────────────────────────────── */
.mh-side-col {
  padding: 30px 24px;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--mh-snap-ink, #1e3a8a) 8%, #fff) 0%, #f8fafc 100%);
}
.mh-snapshot {
  background: rgba(255,255,255,0.88);
  border: 1px solid color-mix(in srgb, var(--mh-snap-ink, #1e3a8a) 18%, #e2e8f0);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 12px 30px rgba(15,23,42,0.08);
}
.mh-snapshot h3 {
  font-family: 'Outfit', sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 12px;
}
.mh-snap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.mh-snap-stat {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--mh-snap-ink, #1e3a8a) 8%, #fff), #fff);
  border: 1px solid rgba(226,232,240,0.9);
  border-radius: 11px;
  padding: 12px;
}
.mh-snap-stat strong {
  font-family: 'Outfit', sans-serif;
  font-size: 22px;
  font-weight: 800;
  color: var(--mh-snap-ink, #0f172a);
  display: block;
  line-height: 1;
  margin-bottom: 2px;
}
.mh-snap-stat span { font-size: 10.5px; color: #64748b; }

.mh-side-cta {
  background:
    radial-gradient(circle at 100% 0%, rgba(255,255,255,0.18), transparent 34%),
    linear-gradient(145deg, #101a3b 0%, color-mix(in srgb, var(--mh-snap-ink, #1e3a8a) 74%, #111827) 100%);
  color: var(--mh-hero-text);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 14px 32px rgba(15,23,42,0.16);
}
.mh-side-cta h4 {
  font-family: 'Outfit', sans-serif;
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 6px;
}
.mh-side-cta p {
  font-size: 12px;
  line-height: 1.45;
  opacity: .82;
  margin: 0 0 12px;
}
.mh-side-cta .mh-btn {
  width: 100%;
  justify-content: center;
  font-size: 12.5px;
}

/* ── Mobile ──────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .mh-body { grid-template-columns: 1fr; }
  .mh-side-col { border-top: 1px solid #e5e7eb; border-right: none; }
  .mh-hero {
    min-height: 280px;
    background-size: 92% auto !important;
    background-position: 82% center !important;
  }
  .mh-hero h1 { font-size: 30px; }
  .mh-hero-row { flex-direction: column; align-items: flex-start; }
  .mh-hero-desc { max-width: 100%; }
}
@media (max-width: 600px) {
  .mh-topbar { padding: 11px 16px; }
  .mh-nav { gap: 14px; overflow-x: auto; }
  .mh-hero {
    min-height: 300px;
    padding: 22px 18px 20px;
    background-size: auto 108% !important;
    background-position: 78% center !important;
  }
  .mh-lesson-col { padding: 18px 16px 32px; }
  .mh-side-col { padding: 18px 16px; }
}
