/* Learning plan document styles.
 *
 * These are the reference document's inline styles, lifted into classes with
 * the same values. This stylesheet describes the PRINTED DOCUMENT only — the
 * editor chrome lives in app.css.
 *
 * Two rules from doc-page.js that must not be broken here:
 *   - never write an @page rule (the component injects its own)
 *   - never set width / padding / background on body (the component owns the
 *     sheet box)
 */

:root {
  /* Text ramp */
  --ink: #23282b;        /* body */
  --ink-strong: #12181b; /* headings */
  --ink-soft: #4a5257;   /* intros, secondary prose */
  --ink-list: #3a4247;   /* bullet text, row labels */
  --muted: #8a8279;      /* micro-labels, field captions */

  /* Accent */
  --accent: #0f5c5c;
  --accent-dark: #0a3f3f;

  /* Surfaces and rules */
  --fill: #f6f3ee;       /* meta block, table headers */
  --line: #e3ded5;       /* table borders, card outlines */
  --line-soft: #eeeae3;  /* interior table rules */
  --rule: #cdc6bb;       /* fill-in-the-blank rules */
  --rule-soft: #ddd8d0;  /* reflection writing lines */
  --ftr-line: #dcd7cf;   /* footer hairline */

  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --serif: 'Source Serif 4', Georgia, serif;
}

doc-page:not(:defined) { visibility: hidden; }

/* Every rule, checkbox and table row below sizes as `height` PLUS its border,
 * so the document must stay content-box. This guards against a host page's
 * global border-box reset, which would shave a pixel off each of them.
 * It deliberately targets the slotted content and not <doc-page> itself —
 * the component's own :host box sizing has to stand. */
doc-page > *, doc-page > * * { box-sizing: content-box; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

/* Break hygiene. An objective is a unit — it should move to the next page
 * whole rather than split across the seam. Same for any bordered card. */
.obj { break-inside: avoid; orphans: 3; widows: 3; }
.note { break-inside: avoid; }

/* ── Running footer ─────────────────────────────────────────────────────── */
.doc-footer {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding-top: 8px;
  border-top: 1px solid var(--ftr-line);
  font-size: 10.5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ── Title block ────────────────────────────────────────────────────────── */
.doc-title {
  font-family: var(--serif);
  font-size: 34px;
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--ink-strong);
}

.doc-intro {
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 22px;
  max-width: 52em;
  color: var(--ink-soft);
}

/* ── Meta block (preceptee / preceptor / unit / dates) ───────────────────── */
.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 18px;
  padding: 14px 16px;
  background: var(--fill);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 30px;
}

.meta-label { color: var(--muted); }
.meta-rule { border-bottom: 1px solid var(--rule); height: 20px; }

/* ── Objectives ─────────────────────────────────────────────────────────── */
.obj { margin: 0 0 34px; }

.obj-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent);
}

.obj-num {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  color: var(--accent);
}

.obj-title {
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  margin: 0;
  color: var(--ink-strong);
}

.obj-body {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding-top: 14px;
}

/* The uppercase micro-label above every field */
.label {
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.field-goal .label { margin-bottom: 5px; }

.goal-text {
  font-size: 14.5px;
  line-height: 1.65;
  margin: 0;
}

.obj-cols {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 22px;
}

.list {
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0;
  padding-left: 17px;
  color: var(--ink-list);
}

/* ── Grid tables (objective record + check-ins) ──────────────────────────── *
 * Column widths vary per table, so each instance sets --cols inline; row
 * height varies too (34px for record rows, 58px for check-ins).             */
.tbl {
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}

.tbl-head,
.tbl-row {
  display: grid;
  grid-template-columns: var(--cols);
}

.tbl-head {
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--fill);
  color: var(--muted);
  border-bottom: 1px solid var(--line);
}

.tbl-head > div { padding: 7px 10px; }
.tbl-head > div + div { border-left: 1px solid var(--line); }

.tbl-row {
  height: var(--row-h, 34px);
  border-bottom: 1px solid var(--line-soft);
}

.tbl-row:last-child { border-bottom: 0; }
.tbl-row > div + div { border-left: 1px solid var(--line-soft); }

/* First-cell label, used by the check-ins table */
.row-label {
  padding: 8px 10px;
  font-size: 13px;
  color: var(--ink-list);
}

/* ── "Goal met" line ────────────────────────────────────────────────────── */
.met {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink-soft);
}

.met-box {
  display: inline-block;
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--accent);
  border-radius: 2px;
}

.met-date {
  margin-left: auto;
  color: var(--muted);
}

.met-rule {
  display: inline-block;
  width: 110px;
  height: 14px;
  border-bottom: 1px solid var(--rule);
}

/* ── Section headings (Check-ins, Reflection) ────────────────────────────── */
.section-title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px;
  padding-bottom: 8px;
  color: var(--ink-strong);
  border-bottom: 2px solid var(--accent);
}

.section-intro {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
  margin: 10px 0 16px;
  max-width: 52em;
}

.checkins { margin-bottom: 30px; }

/* ── Reflection ─────────────────────────────────────────────────────────── */
.reflect {
  display: grid;
  gap: 18px;
  margin-bottom: 8px;
}

.reflect-prompt {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: 8px;
}

.write-line {
  border-bottom: 1px solid var(--rule-soft);
  height: 26px;
}
