/* ═══════════════════════════════════════════════════════════════
   CM101 — Introduction to Content Management (course styles)
   Shared across all lesson pages. Light mode.
═══════════════════════════════════════════════════════════════ */

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

:root {
  --bg:           #ffffff;
  --bg2:          #f8f9fb;
  --bg3:          #f0f3f8;
  --surface:      #ffffff;
  --border:       #e2e8f0;
  --border-dark:  #c8d3e0;
  --accent:       #2563eb;
  --accent-light: #eff6ff;
  --accent2:      #7c3aed;
  --accent2-light:#f5f3ff;
  --green:        #059669;
  --green-light:  #ecfdf5;
  --amber:        #d97706;
  --amber-light:  #fffbeb;
  --red:          #dc2626;
  --text:         #0f172a;
  --text-2:       #334155;
  --text-3:       #64748b;
  --text-4:       #94a3b8;
  --radius:       10px;
  --radius-sm:    6px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow:       0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.05);
  --shadow-lg:    0 10px 40px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.06);
  --font: system-ui, -apple-system, sans-serif;
  --font-serif: Georgia, 'Times New Roman', serif;
  --measure: 720px;
}

html { scroll-behavior: smooth; font-size: 16px; }
body { font-family: var(--font); background: var(--bg2); color: var(--text); line-height: 1.7; }

/* ─── Typography ────────────────────────────────────────────── */
h1 { font-size: clamp(1.9rem, 4vw, 2.7rem); line-height: 1.15; letter-spacing: -0.025em; font-weight: 800; color: var(--text); }
h2 { font-size: 1.5rem; line-height: 1.25; letter-spacing: -0.015em; font-weight: 700; color: var(--text); margin: 2.5rem 0 1rem; }
h3 { font-size: 1.15rem; line-height: 1.3; font-weight: 700; color: var(--text); margin: 1.75rem 0 0.6rem; }
p  { color: var(--text-2); margin-bottom: 1rem; }
a  { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
em { font-style: italic; }
strong { font-weight: 600; color: var(--text); }
ul, ol { margin: 0 0 1rem 1.25rem; color: var(--text-2); }
li { margin-bottom: 0.4rem; }
code {
  background: var(--bg3); border: 1px solid var(--border); border-radius: 4px;
  padding: 0.1rem 0.35rem; font-size: 0.85em; font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  color: var(--accent2);
}

/* ─── Top nav ───────────────────────────────────────────────── */
.top-nav {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.95); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.nav-inner {
  max-width: 1080px; margin: 0 auto; padding: 0 1.5rem;
  display: flex; align-items: center; gap: 1.25rem; height: 58px;
}
.nav-brand {
  font-weight: 900; font-size: 1rem; letter-spacing: 0.04em; color: var(--accent);
  border: 2px solid var(--accent); padding: 0.15rem 0.55rem; border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.nav-brand:hover { text-decoration: none; background: var(--accent-light); }
.nav-title { font-size: 0.85rem; color: var(--text-3); font-weight: 500; }
.nav-spacer { flex: 1; }
.nav-toc-link { font-size: 0.85rem; font-weight: 600; color: var(--accent); }

/* ─── Page container ────────────────────────────────────────── */
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 1.5rem; }

/* ═══════════════════════════════════════════════════════════════
   HOME PAGE
═══════════════════════════════════════════════════════════════ */
.home-hero {
  background: linear-gradient(160deg, var(--bg3) 0%, var(--bg2) 60%);
  border-bottom: 1px solid var(--border);
  padding: 4.5rem 1.5rem 3.5rem; text-align: center;
}
.home-hero .eyebrow {
  display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent); background: var(--accent-light);
  border: 1px solid #bfdbfe; padding: 0.3rem 0.8rem; border-radius: 999px; margin-bottom: 1.25rem;
}
.home-hero h1 { max-width: 760px; margin: 0 auto 1.25rem; }
.home-hero p { font-size: 1.1rem; color: var(--text-3); max-width: 620px; margin: 0 auto 2rem; }
.home-meta { display: flex; gap: 2rem; justify-content: center; flex-wrap: wrap; font-size: 0.85rem; color: var(--text-3); }
.home-meta strong { color: var(--text); }

.section-head { text-align: center; margin: 3.5rem 0 2rem; }
.section-head h2 { margin: 0 0 0.5rem; }
.section-head p { color: var(--text-3); }

.lesson-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem; margin-bottom: 4rem;
}
.lesson-card {
  display: flex; gap: 1.1rem; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem; box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
}
.lesson-card:hover { box-shadow: var(--shadow); border-color: var(--border-dark); transform: translateY(-2px); text-decoration: none; }
.lesson-num {
  flex-shrink: 0; width: 2.6rem; height: 2.6rem; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1.1rem;
}
.lesson-card h3 { margin: 0 0 0.35rem; color: var(--text); }
.lesson-card p { margin: 0; font-size: 0.88rem; color: var(--text-3); }

/* ═══════════════════════════════════════════════════════════════
   LESSON PAGE
═══════════════════════════════════════════════════════════════ */
.lesson-hero {
  background: linear-gradient(160deg, var(--bg3) 0%, var(--bg2) 70%);
  border-bottom: 1px solid var(--border); padding: 3rem 1.5rem 2.5rem;
}
.lesson-hero-inner { max-width: 1080px; margin: 0 auto; }
.lesson-kicker {
  font-size: 0.72rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 0.75rem;
}
.lesson-hero h1 { margin-bottom: 0.9rem; }
.lesson-hero .lead { font-size: 1.1rem; color: var(--text-3); max-width: var(--measure); margin: 0; }

.lesson-body { padding: 2.75rem 1.5rem 1rem; }
.lesson-body .wrap { max-width: 780px; }
.lesson-body > .wrap > p:first-of-type { font-size: 1.02rem; }

/* Learning objectives box */
.objectives {
  background: var(--accent-light); border: 1px solid #bfdbfe; border-radius: var(--radius);
  padding: 1.25rem 1.5rem; margin-bottom: 2rem;
}
.objectives h2 { margin: 0 0 0.6rem; font-size: 1rem; color: var(--accent); }
.objectives ul { margin: 0 0 0 1.1rem; }
.objectives li { color: var(--text-2); font-size: 0.92rem; }

/* Callouts */
.callout {
  display: flex; gap: 0.9rem; align-items: flex-start;
  border-radius: var(--radius); padding: 1.1rem 1.35rem; margin: 1.75rem 0; font-size: 0.92rem;
}
.callout p { margin: 0; color: var(--text-2); }
.callout .ico { font-size: 1.1rem; flex-shrink: 0; margin-top: 0.05rem; }
.callout.blue  { background: var(--accent-light);  border: 1px solid #bfdbfe; }
.callout.green { background: var(--green-light);   border: 1px solid #a7f3d0; }
.callout.amber { background: var(--amber-light);   border: 1px solid #fde68a; }
.callout.purple{ background: var(--accent2-light); border: 1px solid #ddd6fe; }

/* Definition block */
.def {
  border-left: 3px solid var(--accent2); background: var(--accent2-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 1rem 1.25rem; margin: 1.5rem 0;
}
.def .term { font-weight: 800; color: var(--text); font-size: 0.95rem; }
.def p { margin: 0.3rem 0 0; font-size: 0.9rem; }

/* Pull quote */
blockquote {
  border-left: 3px solid var(--accent); background: var(--accent-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0; padding: 1rem 1.35rem;
  margin: 1.75rem 0; font-style: italic; color: var(--text-2);
}
blockquote cite { display: block; margin-top: 0.5rem; font-style: normal; font-size: 0.8rem; color: var(--text-3); }

/* Section number headings */
h2 .h2-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.7rem; height: 1.7rem; border-radius: var(--radius-sm);
  background: var(--accent); color: #fff; font-size: 0.9rem; font-weight: 800;
  margin-right: 0.6rem; vertical-align: 0.1em;
}

/* Labeled aside / sidebar box */
.aside {
  background: var(--bg2); border: 1px solid var(--border); border-left: 4px solid var(--text-4);
  border-radius: 0 var(--radius) var(--radius) 0; padding: 1.25rem 1.5rem; margin: 1.75rem 0;
}
.aside .aside-label {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-4); margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.4rem;
}
.aside h3 { margin: 0 0 0.5rem; font-size: 1.05rem; }
.aside p:last-child { margin-bottom: 0; }
.aside ul { margin-bottom: 0; }

/* Example box */
.example {
  background: var(--green-light); border: 1px solid #a7f3d0;
  border-radius: var(--radius); padding: 1.1rem 1.35rem; margin: 1.5rem 0; font-size: 0.9rem;
}
.example .ex-label {
  font-size: 0.68rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--green); margin-bottom: 0.4rem;
}
.example p:last-child { margin-bottom: 0; }

/* Key terms recap */
.keyterms {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.5rem 1.75rem; margin: 2.5rem 0 1rem; box-shadow: var(--shadow-sm);
}
.keyterms h2 { margin: 0 0 1rem; font-size: 1.15rem; display: flex; align-items: center; gap: 0.5rem; }
.keyterms dl { margin: 0; display: grid; gap: 0.75rem; }
.keyterms dt { font-weight: 700; color: var(--text); font-size: 0.9rem; }
.keyterms dd { margin: 0.1rem 0 0; color: var(--text-3); font-size: 0.86rem; }

/* Numbered process list */
.steps { list-style: none; margin: 1.5rem 0; counter-reset: step; display: grid; gap: 0.85rem; }
.steps li {
  display: flex; gap: 0.9rem; align-items: flex-start; counter-increment: step;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.25rem; box-shadow: var(--shadow-sm); margin: 0;
}
.steps li::before {
  content: counter(step); flex-shrink: 0;
  width: 1.8rem; height: 1.8rem; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem;
}
.steps li strong { display: block; margin-bottom: 0.15rem; }
.steps li .step-body { font-size: 0.88rem; color: var(--text-3); }

/* Reading time on lesson hero */
.lesson-facts { display: flex; gap: 1.5rem; margin-top: 1rem; font-size: 0.82rem; color: var(--text-3); flex-wrap: wrap; }
.lesson-facts span { display: inline-flex; align-items: center; gap: 0.35rem; }

/* Discussion question (distinct from review) */
.q.discuss .q-num { background: var(--accent2-light); color: var(--accent2); }
.q.discuss .discuss-note {
  margin: 0.5rem 0 0 2.35rem; font-size: 0.85rem; color: var(--text-3); font-style: italic;
}

/* Card grid inside lessons */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem; margin: 1.5rem 0;
}
.grid.two { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.tile {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.25rem; box-shadow: var(--shadow-sm);
}
.tile.t-blue   { border-top: 3px solid var(--accent); }
.tile.t-purple { border-top: 3px solid var(--accent2); }
.tile.t-green  { border-top: 3px solid var(--green); }
.tile.t-amber  { border-top: 3px solid var(--amber); }
.tile .ico { font-size: 1.4rem; margin-bottom: 0.5rem; }
.tile h3 { margin: 0 0 0.35rem; font-size: 1rem; }
.tile p { margin: 0; font-size: 0.85rem; color: var(--text-3); }
.tile .abbr { font-size: 1.4rem; font-weight: 900; margin-bottom: 0.3rem; }

/* Comparison table */
.tbl { width: 100%; border-collapse: collapse; font-size: 0.88rem; margin: 1.5rem 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.tbl th { background: var(--bg3); text-align: left; padding: 0.65rem 0.9rem;
  font-size: 0.72rem; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border); }
.tbl td { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text-2); }
.tbl tr:last-child td { border-bottom: none; }

/* Lifecycle strip */
.flow { display: flex; gap: 0; overflow-x: auto; padding: 0.5rem 0 1rem; margin: 1.5rem 0; }
.flow-step { flex: 1; min-width: 110px; text-align: center; position: relative; padding: 0 0.4rem; }
.flow-step::after { content: '→'; position: absolute; right: -0.5rem; top: 1rem; color: var(--text-4); }
.flow-step:last-child::after { display: none; }
.flow-dot { width: 2.3rem; height: 2.3rem; border-radius: 50%; margin: 0 auto 0.5rem; color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; background: var(--accent); }
.flow-step:nth-child(2) .flow-dot { background: var(--accent2); }
.flow-step:nth-child(3) .flow-dot { background: var(--amber); }
.flow-step:nth-child(4) .flow-dot { background: var(--green); }
.flow-step:nth-child(5) .flow-dot { background: var(--text-3); }
.flow-step:nth-child(6) .flow-dot { background: var(--red); }
.flow-label { font-weight: 700; font-size: 0.78rem; color: var(--text); }
.flow-desc { font-size: 0.7rem; color: var(--text-3); line-height: 1.4; margin-top: 0.15rem; }

/* ═══════════════════════════════════════════════════════════════
   REVIEW QUESTIONS
═══════════════════════════════════════════════════════════════ */
.review {
  background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--accent);
  border-radius: var(--radius); padding: 2rem; margin: 3rem 0 1rem; box-shadow: var(--shadow-sm);
}
.review h2 { margin: 0 0 0.4rem; font-size: 1.35rem; }
.review .review-sub { color: var(--text-3); font-size: 0.9rem; margin-bottom: 1.5rem; }
.q { border-bottom: 1px solid var(--border); padding: 1rem 0; }
.q:last-child { border-bottom: none; padding-bottom: 0; }
.q-text { display: flex; gap: 0.75rem; font-weight: 600; color: var(--text); }
.q-num {
  flex-shrink: 0; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  background: var(--accent-light); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 0.8rem; font-weight: 800;
}
.q details { margin: 0.6rem 0 0 2.35rem; }
.q summary {
  cursor: pointer; color: var(--accent); font-size: 0.85rem; font-weight: 600;
  list-style: none; display: inline-flex; align-items: center; gap: 0.35rem;
  user-select: none;
}
.q summary::-webkit-details-marker { display: none; }
.q summary::before { content: '▸'; transition: transform 0.15s; }
.q details[open] summary::before { transform: rotate(90deg); }
.q details[open] summary { margin-bottom: 0.5rem; }
.q .answer {
  background: var(--green-light); border: 1px solid #a7f3d0; border-radius: var(--radius-sm);
  padding: 0.85rem 1.1rem; font-size: 0.9rem; color: var(--text-2);
}
.q .answer strong { color: var(--green); }

/* ─── Prev/next pager ───────────────────────────────────────── */
.pager { display: flex; gap: 1rem; margin: 2rem 0 4rem; }
.pager a {
  flex: 1; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.25rem; box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, border-color 0.2s;
}
.pager a:hover { box-shadow: var(--shadow); border-color: var(--border-dark); text-decoration: none; }
.pager .dir { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-4); }
.pager .lbl { font-weight: 600; color: var(--text); font-size: 0.92rem; margin-top: 0.2rem; }
.pager a.next { text-align: right; }
.pager a.disabled { opacity: 0.4; pointer-events: none; }

/* ─── Footer ────────────────────────────────────────────────── */
.site-footer { background: var(--text); color: #94a3b8; padding: 2.5rem 1.5rem; margin-top: 2rem; }
.footer-inner { max-width: 1080px; margin: 0 auto; display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.footer-brand { font-weight: 900; font-size: 1.1rem; letter-spacing: 0.05em; color: #fff; margin-bottom: 0.4rem; }
.site-footer p { color: #94a3b8; font-size: 0.83rem; margin: 0; max-width: 420px; }
.site-footer a { color: #cbd5e1; }
.footer-links { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.83rem; }

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav-title { display: none; }
  .lesson-grid { grid-template-columns: 1fr; }
  .pager { flex-direction: column; }
  .review { padding: 1.5rem; }
  .home-meta { gap: 1rem; }
}
