/* Shared shell for the syllabus app. Classroom-first: this is projected on a
   screen in front of five-year-olds, so type is large and contrast is high. */

:root {
  --ink: #1d1b18;
  --muted: #6d675f;
  --line: #e2ddd4;
  --paper: #fbf8f3;
  --card: #ffffff;
  --accent: #8a5a2b;
  --accent-soft: #f3e7d7;
  --ok: #2f6f4e;
  --warn: #9a6a12;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(40, 30, 15, .06), 0 8px 24px rgba(40, 30, 15, .07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 17px/1.6 Georgia, "Iowan Old Style", "Times New Roman", serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 28px 22px 80px; }

header.top {
  border-bottom: 1px solid var(--line);
  background: rgba(251, 248, 243, .92);
  backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
header.top .wrap { padding: 14px 22px; display: flex; align-items: baseline; gap: 16px; }
header.top a.brand { font-weight: 700; color: var(--ink); text-decoration: none; font-size: 18px; }
header.top .sub { color: var(--muted); font-size: 14px; }
header.top nav { margin-left: auto; display: flex; gap: 18px; }
header.top nav a { color: var(--muted); text-decoration: none; font-size: 15px; }
header.top nav a:hover, header.top nav a.on { color: var(--accent); }

.eyebrow {
  font: 600 11px/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}

h1 { font-size: 34px; line-height: 1.15; margin: 6px 0 4px; }
h2 { font-size: 22px; margin: 0 0 8px; }
.lede { color: var(--muted); font-size: 18px; margin: 0 0 26px; }

/* ---- week grid ---- */
.term-head { display: flex; align-items: baseline; gap: 12px; margin: 34px 0 14px; }
.term-head h2 { margin: 0; }
.term-head span { color: var(--muted); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(228px, 1fr)); gap: 16px; }

.week {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit; display: flex; flex-direction: column;
  transition: transform .12s ease, box-shadow .12s ease;
}
.week:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.week .thumb { aspect-ratio: 3/2; background: var(--accent-soft) center/cover no-repeat; }
.week .body { padding: 12px 14px 14px; }
.week .n { font: 600 11px/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .12em;
           text-transform: uppercase; color: var(--muted); }
.week .who { font-weight: 700; margin: 5px 0 2px; }
.week .what { color: var(--muted); font-size: 14px; font-style: italic; }

.pill { display: inline-block; font: 600 10px/1 ui-sans-serif, system-ui, sans-serif;
        letter-spacing: .1em; text-transform: uppercase; padding: 4px 7px; border-radius: 5px; }
.pill.draft { background: #f1ede6; color: var(--muted); }
.pill.reviewed { background: #fdf0d8; color: var(--warn); }
.pill.published { background: #e2f0e8; color: var(--ok); }
.pill.hymn { background: var(--accent-soft); color: var(--accent); }

/* ---- card deck ---- */
.deck { max-width: 760px; margin: 0 auto; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 30px 34px; margin-bottom: 20px; box-shadow: var(--shadow);
}
.card.art { padding: 0; overflow: hidden; }
.card.art img { width: 100%; display: block; }
.card h3 {
  font: 600 11px/1 ui-sans-serif, system-ui, sans-serif; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 14px;
}
.card p { font-size: 21px; line-height: 1.62; margin: 0; }
.card ol { margin: 0; padding-left: 22px; }
.card ol li { font-size: 21px; line-height: 1.6; margin-bottom: 14px; }
.card iframe { border-radius: 12px; display: block; }

.deck-head { text-align: center; margin: 8px 0 26px; }
.deck-head h1 { font-size: 38px; }
.deck-head .who { color: var(--muted); font-size: 20px; font-style: italic; }

.bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 26px 0; }

.btn {
  font: 600 14px/1 ui-sans-serif, system-ui, sans-serif;
  padding: 10px 16px; border-radius: 9px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; gap: 7px;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { filter: brightness(1.08); color: #fff; }
.btn:disabled { opacity: .5; cursor: default; }

.note { color: var(--muted); font-size: 14px; }
.empty { color: var(--muted); text-align: center; padding: 60px 20px; }

/* ---- image placeholder ----
   Every lesson shows an illustration slot from day one, so an unillustrated
   deck reads as "not made yet", never as a layout that is missing a piece. */
.ph {
  aspect-ratio: 16/9; border: 1.5px dashed #d8cfbe; border-radius: var(--radius);
  background: repeating-linear-gradient(45deg, #fdfaf5, #fdfaf5 11px, #f7f1e6 11px, #f7f1e6 22px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; color: var(--muted); text-align: center; padding: 20px;
}
.ph .glyph { font-size: 32px; opacity: .45; }
.ph .msg { font-size: 14px; max-width: 34ch; line-height: 1.5; }
.week .thumb.ph { aspect-ratio: 3/2; border: none; border-radius: 0; gap: 4px; }
.week .thumb.ph .glyph { font-size: 22px; }

/* ---- inline editing on the card deck ---- */
.card.editing { border-color: #d9c49a; background: #fffdf8; }
.edit-in {
  width: 100%; font: inherit; font-size: 21px; line-height: 1.62; color: var(--ink);
  border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px;
  background: #fff; resize: vertical;
}
.edit-in:focus { outline: 2px solid #d9c49a; outline-offset: 1px; border-color: transparent; }
.edit-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; }
.edit-row .grow { flex: 1; }
.saving { font-size: 13px; color: var(--muted); }
.saving.ok { color: var(--ok); }
.saving.err { color: #a4442e; }

.adminbar {
  background: #fdf6e7; border-bottom: 1px solid #ecdfc4;
  font: 500 14px/1 ui-sans-serif, system-ui, sans-serif;
}
.adminbar .wrap { display: flex; align-items: center; gap: 12px; padding: 10px 22px; }
.adminbar .sp { flex: 1; }

/* ---- admin ---- */
.editor { display: grid; grid-template-columns: 260px 1fr; gap: 26px; align-items: start; }
.editor .side { position: sticky; top: 78px; max-height: calc(100vh - 100px); overflow-y: auto; }
.editor .side a {
  display: block; padding: 8px 10px; border-radius: 8px; text-decoration: none;
  color: var(--ink); font-size: 14px; border: 1px solid transparent;
}
.editor .side a:hover { background: #fff; }
.editor .side a.on { background: #fff; border-color: var(--line); font-weight: 700; }
.editor .side .n { color: var(--muted); font-size: 11px; }

.field { margin-bottom: 18px; }
.field label {
  display: block; font: 600 11px/1 ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px;
}
.field input, .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; font: inherit; font-size: 16px; color: var(--ink); resize: vertical;
}
.field textarea { min-height: 96px; line-height: 1.55; }
.field .hint { color: var(--muted); font-size: 13px; margin-top: 5px; }
.field.warn input, .field.warn textarea { border-color: #e0b877; background: #fffdf7; }

.count { float: right; font-weight: 400; letter-spacing: 0; text-transform: none; }
.count.over { color: #a4442e; }

@media (max-width: 780px) {
  .editor { grid-template-columns: 1fr; }
  .editor .side { position: static; max-height: none; }
  .card { padding: 22px; }
  .card p, .card ol li { font-size: 19px; }
}

@media print { header.top, .bar, .no-print { display: none !important; } }

/* "Replace or Edit Image" — the image peer of inline text editing. */
.imgedit { border: 1px solid #e0d3b6; background: #fffdf8; border-radius: 12px; padding: 14px; }
.imgedit .edit-in { font-size: 16px; line-height: 1.5; }
.imgedit .edit-row { flex-wrap: wrap; }
