/* ════════════════════════════════════════════════════════════════════════
   pages.css — styles for the multi-page site (non-SPA pages)
   ════════════════════════════════════════════════════════════════════════ */

/* ── Body overrides for non-SPA pages ── */
body.page {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* ── Topnav page-link strip ── */
.topnav-nav {
  display: flex; align-items: center; gap: 2px;
  margin: 0 4px;
  position: relative; z-index: 1;
}
.tn-link {
  padding: 6px 13px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600;
  color: rgba(255,255,255,0.65);
  transition: background var(--t), color var(--t);
  white-space: nowrap;
  text-decoration: none;
}
.tn-link:hover  { background: rgba(255,255,255,0.09); color: #fff; }
.tn-link.active { background: rgba(255,255,255,0.15); color: #fff; font-weight: 700; }

/* ── Page main / wrap ── */
.page-main  { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: 72px; }
.page-wrap  { max-width: 1060px; margin: 0 auto; padding: 28px 36px; }

/* ── Back link ── */
.page-back {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; font-weight: 700; color: var(--text-secondary);
  margin-bottom: 22px;
  background: none; border: none; cursor: pointer;
  text-decoration: none;
  transition: color var(--t);
}
.page-back:hover { color: var(--text-primary); }

/* ── Page heading ── */
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 15px; font-weight: 800; color: var(--text-primary); letter-spacing: -0.2px; }
.page-count {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  background: var(--surface-3); border: 1px solid var(--border);
  padding: 3px 10px; border-radius: var(--r-pill);
}

/* ════════════════════════════════════════════════════════════════════════
   HOMEPAGE
   ════════════════════════════════════════════════════════════════════════ */
.home-hero {
  text-align: center;
  padding: 72px 24px 52px;
  max-width: 600px;
  margin: 0 auto;
}
.home-eyebrow {
  display: inline-block;
  font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
  text-transform: uppercase; color: var(--amber-dark);
  background: var(--amber-light); border: 1px solid var(--amber-line);
  padding: 4px 12px; border-radius: var(--r-pill);
  margin-bottom: 20px;
}
.home-h1 {
  font-size: 44px; font-weight: 900; letter-spacing: -1.8px;
  color: var(--text-primary); line-height: 1.03;
  margin-bottom: 14px;
}
.home-h1 span { color: var(--amber-dark); }
.home-tagline {
  font-size: 15px; color: var(--text-secondary); line-height: 1.6;
}

.home-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 36px 80px;
}
@media (max-width: 900px) { .home-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .home-grid { grid-template-columns: 1fr; padding: 0 20px 60px; } }

.home-card {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: 26px 22px 22px;
  text-decoration: none; color: inherit;
  box-shadow: var(--sh-xs);
  transition: transform 0.14s cubic-bezier(.4,0,.2,1), box-shadow var(--t), border-color var(--t);
  position: relative; overflow: hidden;
}
.home-card::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--hc-bg, transparent) 0%, transparent 60%);
  opacity: 0; transition: opacity var(--t);
}
.home-card:hover { transform: translateY(-3px); box-shadow: var(--sh-md); border-color: var(--border-strong); }
.home-card:hover::before { opacity: 1; }

.hc-icon {
  width: 46px; height: 46px; border-radius: var(--r-md);
  display: grid; place-items: center;
  margin-bottom: 18px; flex-shrink: 0;
  background: var(--hc-bg, var(--surface-3));
  color: var(--hc-color, var(--text-secondary));
}
.hc-title {
  font-size: 17px; font-weight: 800; letter-spacing: -0.3px;
  color: var(--text-primary); margin-bottom: 7px;
}
.hc-desc {
  font-size: 13px; color: var(--text-secondary); line-height: 1.55; flex: 1; margin-bottom: 18px;
}
.hc-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 14px; border-top: 1px solid var(--border-muted);
}
.hc-meta { font-size: 11px; font-weight: 700; letter-spacing: 0.4px; text-transform: uppercase; color: var(--text-muted); }
.hc-arrow { color: var(--hc-color, var(--text-muted)); }

/* ════════════════════════════════════════════════════════════════════════
   MODULE DETAIL PAGE
   ════════════════════════════════════════════════════════════════════════ */
.mod-detail-head {
  display: flex; align-items: flex-start; gap: 20px;
  margin-bottom: 28px; padding-bottom: 24px;
  border-bottom: 1px solid var(--border-muted);
}
.mod-detail-badge {
  width: 60px; height: 60px; border-radius: var(--r-md);
  display: grid; place-items: center;
  font-size: 22px; font-weight: 900; color: #fff;
  background: var(--mc, #4381E5); flex-shrink: 0;
  letter-spacing: -0.5px;
}
.mod-detail-info { flex: 1; min-width: 0; }
.mod-detail-title {
  font-size: 24px; font-weight: 800; letter-spacing: -0.6px;
  color: var(--text-primary); margin-bottom: 5px; line-height: 1.15;
}
.mod-detail-sub {
  font-size: 14px; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.4;
}
.mod-detail-stats { display: flex; gap: 18px; flex-wrap: wrap; }
.mod-detail-stat { font-size: 12px; color: var(--text-muted); }
.mod-detail-stat b { color: var(--text-primary); font-weight: 700; }

.mod-detail-prog-wrap { margin-bottom: 28px; }
.mod-prog-bar {
  height: 6px; border-radius: var(--r-pill);
  background: var(--surface-3); overflow: hidden;
  margin-bottom: 6px;
}
.mod-prog-fill {
  height: 100%; border-radius: var(--r-pill);
  background: var(--mc, #4381E5);
  transition: width 0.6s cubic-bezier(.4,0,.2,1);
}
.mod-prog-label { font-size: 12px; color: var(--text-muted); }
.mod-prog-label b { color: var(--text-primary); }

/* ════════════════════════════════════════════════════════════════════════
   ARTICLE PAGE (no sidebar)
   ════════════════════════════════════════════════════════════════════════ */
body.article-page {
  height: 100vh;
  overflow: hidden;
}
.art-shell {
  display: flex; flex-direction: column;
  height: calc(100vh - 52px);
}
.art-shell .main {
  flex: 1; min-height: 0; overflow-y: auto; min-width: 0;
  position: relative; scroll-behavior: smooth;
}
.art-shell .main::-webkit-scrollbar { width: 10px; }
.art-shell .main::-webkit-scrollbar-thumb { background: #d6d9e2; border-radius: 10px; border: 3px solid var(--bg); }
.art-shell .main:hover::-webkit-scrollbar-thumb { background: #c3c7d4; }

/* ════════════════════════════════════════════════════════════════════════
   SCAN ROW (reused across topics/tier/module-detail pages)
   ════════════════════════════════════════════════════════════════════════ */
.page-scan { padding-top: 4px; }

/* Loading / empty */
.pg-loading { padding: 60px 0; text-align: center; color: var(--text-muted); font-size: 14px; }
.pg-empty   { padding: 40px 0; text-align: center; color: var(--text-muted); font-size: 13px; font-style: italic; }
