@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,600;1,400&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

:root {
  --ink:        #1c1c2e;
  --ink-soft:   #4a4a6a;
  --ink-faint:  #9090b0;
  --page:       #f6f4ef;
  --surface:    #ffffff;
  --rule:       #e4dfd5;
  --accent:     #2d6a4f;
  --accent-lt:  #e6f4ed;
  --accent-2:   #b07d10;
  --accent-2lt: #fdf2dc;
  --blue:       #1a4fa0;
  --blue-lt:    #e8f0fd;
  --purple:     #5a3e9e;
  --purple-lt:  #f0ecfe;
  --rose:       #a0302a;
  --rose-lt:    #fdecea;
  --teal:       #167a7a;
  --teal-lt:    #e4f5f5;
  --r:          10px;
  --r-lg:       16px;
  --shadow:     0 1px 4px rgba(0,0,0,.06), 0 4px 16px rgba(0,0,0,.06);
}

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

body {
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  line-height: 1.7;
  color: var(--ink);
  background: var(--page);
  min-height: 100vh;
}

/* ── Site header ────────────────────────────────── */
.site-header {
  background: var(--ink);
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.site-header a { text-decoration: none; }
.site-brand {
  font-family: 'Lora', serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: .01em;
}
.site-brand span { color: #72e5aa; }
.site-nav { display: flex; gap: 6px; }
.nav-link {
  color: #b0afd8;
  font-size: .82rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  transition: background .13s, color .13s;
}
.nav-link:hover { background: rgba(255,255,255,.08); color: #fff; }
.nav-link.active { background: rgba(45,106,79,.35); color: #72e5aa; }

/* ── Site footer ────────────────────────────────── */
footer {
  color: var(--page);
  background-color: var(--ink);
  text-align: center;
}
footer a {
  color: var(--accent-lt);
}
footer .page {
  padding-top: 10px;
  padding-bottom: 15px;
}

/* ── Page wrapper ───────────────────────────────── */
.page { max-width: 1080px; margin: 0 auto; padding: 36px 40px 80px; }

/* ── Badge ──────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: .74rem; font-weight: 600;
}
.badge-green  { background: var(--accent-lt);  color: var(--accent); }
.badge-amber  { background: var(--accent-2lt); color: var(--accent-2); }
.badge-blue   { background: var(--blue-lt);    color: var(--blue); }
.badge-purple { background: var(--purple-lt);  color: var(--purple); }
.badge-ink    { background: var(--ink);        color: var(--page); }

/* ── Cards ──────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 20px 13px;
  border-bottom: 1px solid var(--rule);
}
.card-head h2 {
  font-family: 'Lora', serif;
  font-size: .95rem; font-weight: 600;
  margin: 0;
}
.ci {
  width: 30px; height: 30px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .9rem; flex-shrink: 0;
}
.ci-green  { background: var(--accent-lt); }
.ci-amber  { background: var(--accent-2lt); }
.ci-blue   { background: var(--blue-lt); }
.ci-purple { background: var(--purple-lt); }
.ci-rose   { background: var(--rose-lt); }
.ci-teal   { background: var(--teal-lt); }

.card-body { padding: 18px 20px; }

/* ── Grid helpers ───────────────────────────────── */
.grid { display: grid; gap: 20px; }
.col-2 { grid-template-columns: 1fr 1fr; }
.col-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 780px) {
  .col-2, .col-3 { grid-template-columns: 1fr; }
  .page { padding: 24px 20px 60px; }
  .site-header { padding: 0 20px; }
}

/* ── KV pairs ───────────────────────────────────── */
.kv { display: flex; gap: 8px; margin-bottom: 7px; font-size: .87rem; }
.kv-l { font-weight: 600; color: var(--ink-soft); min-width: 120px; flex-shrink: 0; }

/* ── Tags ───────────────────────────────────────── */
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.tag {
  padding: 2px 9px; border-radius: 14px;
  font-size: .74rem; font-weight: 500;
  background: var(--accent-lt); color: var(--accent);
  border: 1px solid #b6e0cb;
}

/* ── Prose (rendered Markdown) ──────────────────── */
.prose { font-size: .9rem; line-height: 1.75; color: var(--ink); }
.prose p  { margin-bottom: .75em; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { padding-left: 1.4em; margin-bottom: .75em; }
.prose ul:last-child, .prose ol:last-child { margin-bottom: 0; }
.prose li { margin-bottom: .2em; }
.prose strong { font-weight: 600; }
.prose em { font-style: italic; }
.prose h3 {
  font-family: 'Lora', serif; font-size: .9rem; font-weight: 600;
  color: var(--ink-soft); margin: 14px 0 4px;
}
.prose h4 {
  font-size: .78rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-soft); margin: 10px 0 4px;
}
.prose hr { border: none; border-top: 1px solid var(--rule); margin: 16px 0; }
.prose figure {
  width: 100%;
  margin-bottom: 10px;

  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}
.prose figure img {
  flex: 1 1 100px;
  width: auto;
  max-width: 400px;
  height: auto;
  max-height: 300px;
}
.prose figcaption {
  width: 100%;
  text-align: center;
}

.prose table {
  background-color: white;
  margin: auto;
  padding: 5px;
  margin-bottom: 10px;
}

.prose table {
 border-collapse: collapse;
}
.prose table th,
.prose table td {
 padding: 4px;
 border: 1px solid var(--ink);
}

/* Checklist variant */
.prose-check ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.prose-check ul li {
  display: flex; align-items: flex-start; gap: 9px; font-size: .88rem;
}
.prose-check ul li::before {
  content: '✓';
  flex-shrink: 0;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent-lt); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 800; margin-top: 2px;
}

/* Arrow list variant */
.prose-arrows ul { list-style: none; padding: 0; }
.prose-arrows ul li { margin-bottom: 5px; }
.prose-arrows ul li::before { content: '→'; color: var(--accent-2); font-weight: 700; flex-shrink: 0; }

/* ── Flow table ─────────────────────────────────── */
.flow-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.flow-table th {
  background: #f3f0e8; color: var(--ink-soft);
  font-weight: 700; font-size: .7rem;
  text-transform: uppercase; letter-spacing: .08em;
  padding: 9px 14px; text-align: left;
  border-bottom: 2px solid var(--rule);
}
.flow-table td {
  padding: 13px 14px; vertical-align: top;
  border-bottom: 1px solid var(--rule);
  line-height: 1.6;
}
.flow-table tr:last-child td { border-bottom: none; }
.stage-pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .82rem; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot-intro { background: #52b788; }
.dot-body  { background: #b07d10; }
.dot-concl { background: #e07b5a; }
.dot-other { background: #9b8ed8; }
.time-chip {
  display: inline-block; padding: 2px 9px; border-radius: 12px;
  background: #ededf5; color: var(--ink-soft);
  font-size: .74rem; font-weight: 600; white-space: nowrap;
}

/* ── Curriculum table ───────────────────────────── */
.curr-table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.curr-table th {
  background: #f3f0e8; color: var(--ink-soft);
  font-weight: 700; font-size: .7rem;
  text-transform: uppercase; letter-spacing: .07em;
  padding: 8px 12px; text-align: left;
}
.curr-table td { padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.curr-table tr:last-child td { border-bottom: none; }

/* ── Reflection ─────────────────────────────────── */
.refl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 680px) { .refl-grid { grid-template-columns: 1fr; } }
.refl-item {
  background: #f9f7f2; border: 1px solid var(--rule);
  border-radius: var(--r); padding: 14px 16px;
}
.refl-item h4 {
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ink-faint); margin-bottom: 8px;
}

.dev-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 16px; }
@media (max-width: 680px) { .dev-grid { grid-template-columns: 1fr; } }
.dev-item {
  background: var(--accent-lt); border: 1px solid #b6e0cb;
  border-radius: var(--r); padding: 12px 14px;
}
.dev-item h5 {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--accent); margin-bottom: 6px;
}

.divider-label {
  font-size: .7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink-faint);
  display: flex; align-items: center; gap: 10px;
  margin: 20px 0 14px;
}
.divider-label::after { content: ''; flex: 1; height: 1px; background: var(--rule); }

/* ── Lesson plan page header ────────────────────── */
.lp-header {
  margin-bottom: 28px;
}
.lp-header h1 {
  font-family: 'Lora', serif;
  font-size: 2rem; font-weight: 600;
  line-height: 1.2;
  margin-bottom: 10px;
}
.lp-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.lp-meta .back {
  color: var(--ink-faint); font-size: .82rem;
  text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
  margin-bottom: 10px;
}
.lp-meta .back:hover { color: var(--accent); }

/* ── Plan grid ──────────────────────────────────── */
.lp-grid { display: flex; flex-direction: column; gap: 20px; }

/* ── Index page ─────────────────────────────────── */
.index-header { margin-bottom: 32px; }
.index-header h1 {
  font-family: 'Lora', serif; font-size: 2rem; font-weight: 600; margin-bottom: 6px;
}
.index-header p { color: var(--ink-soft); font-size: .95rem; }

.article-grid {
  display: grid;
  grid-template-columns:
  repeat(auto-fill, minmax(800px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.plan-grid {
  display: grid;
  grid-template-columns:
  repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}
.plan-card {
  background: var(--surface); border: 1px solid var(--rule);
  border-radius: var(--r-lg); box-shadow: var(--shadow);
  padding: 22px 24px;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow .15s, transform .15s, border-color .15s;
}
.plan-card:hover {
  box-shadow: 0 4px 24px rgba(0,0,0,.1);
  transform: translateY(-2px);
  border-color: #c8c0b0;
}
.plan-card h2 {
  font-family: 'Lora', serif; font-size: 1.1rem; font-weight: 600; line-height: 1.3;
}
.plan-card .pc-meta { display: flex; flex-wrap: wrap; gap: 5px; }
.plan-card .pc-topic { font-size: .85rem; color: var(--ink-soft); line-height: 1.5; }
.plan-card .pc-arrow {
  margin-top: auto; font-size: .8rem; color: var(--accent);
  font-weight: 600; display: flex; align-items: center; gap: 4px;
}

@media print {
  .site-header, .lp-meta .back { display: none; }
  .card { box-shadow: none; break-inside: avoid; }
}
