/* ============================================================
   PSYC3302 Weeks 7-12 Teaching Site
   Palette: Parchment / Slate / Amber / Sage
   Type: Lora (body) · Inter (UI)
   ============================================================ */

:root {
  /* Palette */
  --parchment: #F7F3EC;
  --parchment-2: #EDE7D9;
  --parchment-3: #E4DACC;
  --card-bg: #FDFBF6;
  --slate: #1A1A2E;
  --slate-mid: #4A4860;
  --slate-faint: #9896A8;
  --amber: #B85C2A;          /* main accent */
  --amber-d: #8C3F18;
  --amber-soft: #F2E0D0;
  --sage: #3D6B52;            /* week/progress accent */
  --sage-soft: #D8EAE1;
  --eg-bg: #FEFAE8;           /* example box */
  --eg-border: #D4C06A;
  --line: #D8D0BF;
  --line-soft: #E8E2D6;
  --correct: #2D6A4F;
  --shadow-sm: 0 1px 2px rgba(26,26,46,.04), 0 4px 12px -4px rgba(26,26,46,.12);
  --shadow-md: 0 2px 4px rgba(26,26,46,.05), 0 12px 32px -8px rgba(26,26,46,.18);
  --sidebar-w: 272px;
  --max-content: 700px;
  --radius: 14px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Lora', Georgia, serif;
  font-size: 18px;
  line-height: 1.65;
  color: var(--slate);
  background: var(--parchment);
  -webkit-font-smoothing: antialiased;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--slate);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.sidebar-logo {
  width: 38px; height: 38px;
  border-radius: 10px;
  background: var(--amber);
  color: #fff;
  display: grid; place-items: center;
  font-family: 'Lora', serif;
  font-weight: 600;
  font-size: 20px;
  flex-shrink: 0;
}

.sidebar-unit {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: rgba(255,255,255,.4);
}

.sidebar-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: rgba(255,255,255,.9);
  margin-top: 1px;
}

.sidebar-progress-wrap {
  padding: 14px 20px 12px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.sidebar-progress-bar {
  height: 4px;
  background: rgba(255,255,255,.12);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 6px;
}

.sidebar-progress-fill {
  height: 100%;
  background: var(--amber);
  border-radius: 4px;
  width: 0;
  transition: width .4s;
}

.sidebar-progress-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  color: rgba(255,255,255,.45);
  letter-spacing: .04em;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 24px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.1) transparent;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.1); border-radius: 4px; }

.week-group { margin-bottom: 4px; }

.week-label {
  display: block;
  padding: 10px 20px 4px;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sage-soft);
  opacity: .7;
  cursor: default;
}

.sidebar-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px 20px 8px 26px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  color: rgba(255,255,255,.5);
  line-height: 1.4;
  transition: color .15s, background .15s;
  position: relative;
}

.sidebar-item::before {
  content: '';
  position: absolute;
  left: 14px; top: 50%; transform: translateY(-50%);
  width: 5px; height: 5px;
  border-radius: 50%;
  background: transparent;
  border: 1px solid rgba(255,255,255,.2);
  transition: .15s;
}

.sidebar-item:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.04); }

.sidebar-item.done { color: rgba(255,255,255,.35); }
.sidebar-item.done::before { background: var(--sage); border-color: var(--sage); }

.sidebar-item.active { color: #fff; background: rgba(184,92,42,.15); }
.sidebar-item.active::before { background: var(--amber); border-color: var(--amber); }

/* ---- Mobile header ---- */
.mobile-header {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--slate);
  align-items: center;
  padding: 0 16px;
  gap: 14px;
  z-index: 20;
}

.menu-btn {
  background: none; border: none; color: rgba(255,255,255,.7);
  font-size: 20px; cursor: pointer; padding: 4px;
  flex-shrink: 0;
}

.mobile-title {
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,.85);
  flex: 1;
}

.mobile-progress-track {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: rgba(255,255,255,.1);
}

.mobile-progress-fill {
  height: 100%;
  background: var(--amber);
  width: 0;
  transition: width .4s;
}

/* ---- Drawer (mobile) ---- */
.drawer-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 25;
}

.drawer {
  position: fixed;
  top: 0; left: -290px; bottom: 0;
  width: 280px;
  background: var(--slate);
  z-index: 30;
  transition: left .28s ease;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.drawer.open { left: 0; }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(255,255,255,.08);
  flex-shrink: 0;
}

.drawer-title {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 15px;
  color: rgba(255,255,255,.9);
}

.drawer-close {
  background: none; border: none; color: rgba(255,255,255,.5);
  font-size: 16px; cursor: pointer; padding: 4px;
}

.drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 8px 0 24px;
}

/* drawer inherits .week-label and .sidebar-item styles */
.drawer-nav .week-label { color: var(--sage-soft); opacity: .7; }
.drawer-nav .sidebar-item { color: rgba(255,255,255,.5); }
.drawer-nav .sidebar-item:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.04); }
.drawer-nav .sidebar-item.done { color: rgba(255,255,255,.35); }
.drawer-nav .sidebar-item.done::before { background: var(--sage); border-color: var(--sage); }
.drawer-nav .sidebar-item.active { color: #fff; background: rgba(184,92,42,.15); }
.drawer-nav .sidebar-item.active::before { background: var(--amber); border-color: var(--amber); }

/* ---- Main content area ---- */
.main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.screen { display: none; }
.screen.active { display: flex; flex-direction: column; }

/* ---- Welcome screen ---- */
#welcomeScreen {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.welcome-card {
  max-width: 600px;
  width: 100%;
}

.welcome-week {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 14px;
}

.welcome-h1 {
  font-size: 36px;
  line-height: 1.15;
  color: var(--slate);
  margin: 0 0 16px;
  letter-spacing: -.01em;
}

.welcome-lede {
  font-size: 19px;
  color: var(--slate-mid);
  margin: 0 0 28px;
  line-height: 1.6;
}

.welcome-meta {
  display: flex;
  gap: 28px;
  margin-bottom: 32px;
}

.welcome-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.stat-n {
  font-family: 'Lora', serif;
  font-weight: 600;
  font-size: 34px;
  color: var(--amber);
  line-height: 1;
}

.stat-label {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--slate-faint);
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-top: 2px;
}

.start-btn {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 16px;
  letter-spacing: .03em;
  background: var(--amber);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 15px 32px;
  cursor: pointer;
  transition: background .16s, transform .12s;
  box-shadow: 0 4px 16px rgba(184,92,42,.35);
}

.start-btn:hover { background: var(--amber-d); transform: translateY(-1px); }

/* ---- Lesson screen ---- */
#lessonScreen {
  flex: 1;
  align-items: center;
  padding: 36px 24px 60px;
}

.breadcrumb {
  width: 100%;
  max-width: var(--max-content);
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--slate-faint);
  margin-bottom: 18px;
  letter-spacing: .04em;
}

.breadcrumb span { color: var(--amber); font-weight: 600; }

/* ---- Lesson card ---- */
.lesson-card {
  width: 100%;
  max-width: var(--max-content);
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  display: flex;
  overflow: hidden;
  position: relative;
  animation: fadeUp .4s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lesson-accent-bar {
  width: 5px;
  flex-shrink: 0;
  background: var(--amber);
}

.lesson-inner {
  flex: 1;
  padding: 28px 30px 30px;
  min-width: 0;
}

.lesson-meta {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--sage);
  margin-bottom: 8px;
}

.lesson-title {
  font-family: 'Lora', serif;
  font-weight: 600;
  font-size: 24px;
  line-height: 1.25;
  color: var(--slate);
  margin: 0 0 20px;
  letter-spacing: -.01em;
}

/* body typography */
.lesson-body { font-size: 18px; line-height: 1.7; color: var(--slate); }
.lesson-body p { margin: 0 0 14px; }
.lesson-body p:last-child { margin-bottom: 0; }
.lesson-body strong { color: var(--slate); font-weight: 600; }
.lesson-body em { font-style: italic; color: var(--amber-d); }
.lesson-body ul, .lesson-body ol { margin: 8px 0 14px 18px; padding: 0; }
.lesson-body li { margin-bottom: 6px; line-height: 1.55; }
.lesson-body h3 { font-size: 17px; font-family: 'Inter', sans-serif; font-weight: 600; color: var(--slate-mid); margin: 18px 0 6px; }
.lesson-body hr { border: none; border-top: 1px solid var(--line-soft); margin: 20px 0; }

/* example box */
.lesson-example {
  margin-top: 22px;
  background: var(--eg-bg);
  border: 1px solid var(--eg-border);
  border-left: 4px solid var(--eg-border);
  border-radius: 10px;
  padding: 16px 18px;
  font-size: 16.5px;
  line-height: 1.6;
  color: var(--slate-mid);
}

.lesson-example:empty { display: none; }

.lesson-example .eg-label {
  font-family: 'Inter', sans-serif;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #8A7A20;
  margin-bottom: 8px;
  display: block;
}

.lesson-example p { margin: 0 0 8px; }
.lesson-example p:last-child { margin-bottom: 0; }
.lesson-example strong { color: var(--slate); }

/* ---- Navigation ---- */
.lesson-nav {
  width: 100%;
  max-width: var(--max-content);
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  gap: 12px;
}

.lesson-counter {
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  color: var(--slate-faint);
  letter-spacing: .04em;
  white-space: nowrap;
}

.nav-btn {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 14px;
  border: 1.5px solid var(--line);
  background: var(--card-bg);
  color: var(--slate-mid);
  border-radius: 50px;
  padding: 10px 22px;
  cursor: pointer;
  transition: .16s;
  white-space: nowrap;
}

.nav-btn:hover { border-color: var(--amber); color: var(--amber); }
.nav-btn.primary { background: var(--amber); border-color: var(--amber); color: #fff; box-shadow: 0 3px 12px rgba(184,92,42,.3); }
.nav-btn.primary:hover { background: var(--amber-d); border-color: var(--amber-d); }
.nav-btn:disabled { opacity: .35; cursor: default; pointer-events: none; }

/* ---- Done screen ---- */
#doneScreen {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.done-card { max-width: 580px; text-align: center; }
.done-icon { font-size: 52px; margin-bottom: 16px; }
.done-h2 { font-size: 28px; margin: 0 0 14px; color: var(--slate); }
.done-p { font-size: 18px; color: var(--slate-mid); margin: 0 0 14px; max-width: 46ch; margin-left: auto; margin-right: auto; }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .sidebar { display: none; }
  .mobile-header { display: flex; }
  .drawer-overlay.open { display: block; }
  .main { margin-left: 0; padding-top: 52px; }
  #lessonScreen { padding: 24px 16px 50px; }
  .lesson-inner { padding: 22px 20px 24px; }
  .lesson-title { font-size: 21px; }
  .lesson-body { font-size: 17px; }
  #welcomeScreen { padding: 32px 18px; }
  .welcome-h1 { font-size: 28px; }
}

@media (max-width: 480px) {
  .lesson-title { font-size: 19px; }
  .welcome-h1 { font-size: 24px; }
  .welcome-meta { gap: 18px; }
  .stat-n { font-size: 28px; }
}
