/* v3 Course Pack — shared visual layer for /courses/<subject>/*.html
   Adds the imagery, advanced-SVG, and ornament styling that brings the course
   packs up to the visual standard of the rest of the site (index/blog/college),
   while staying course-accent aware so ONE color swap retints the whole pack.

   Design tenets (mirror assets/lab-notes.css, retuned for course packs):
   - Per-subject accent is read from CSS variables, never hard-coded here, so
     biology (emerald) and chemistry (blue) share this one file unchanged.
   - SVG ornaments are tinted via `mask-image` + `background-color: var(--course)`
     so the accent color flows through (a data-URI fill can't read a CSS var).
   - All motion respects prefers-reduced-motion.
   - Anchor jumps clear the sticky ~65px header (scroll-margin-top).

   Each page MUST declare its accent once, e.g. biology:
     <style>:root{--course:#047857;--course-dark:#065F46;--course-light:#D1FAE5}</style>
   chemistry:
     :root{--course:#1D4ED8;--course-dark:#1E3A8A;--course-light:#DBEAFE}
*/

:root {
  /* Fallbacks (biology emerald) so the file is never colorless if a page
     forgets to declare its accent. Pages override these. */
  --course: #047857;
  --course-dark: #065F46;
  --course-light: #D1FAE5;
}

/* ============================================================= *
 *  Figures & photographic imagery                                *
 * ============================================================= */

/* Rounded, ring-bordered media frame with a calm hover lift + zoom,
   consistent with the figure treatment on the main site. */
.v3-figure {
  margin: 0;
}
.v3-figure .v3-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 0.85rem;
  background: #f1f5f9;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}
.v3-figure .v3-frame.portrait { aspect-ratio: 4 / 5; }
.v3-figure .v3-frame.square { aspect-ratio: 1 / 1; }
.v3-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.v3-figure:hover img { transform: scale(1.04); }

/* Figcaption: small accent rule + muted detail, with an inline-icon slot. */
.v3-figcaption {
  margin-top: 0.7rem;
  font-size: 0.8125rem;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  line-height: 1.4;
}
.v3-figcaption .v3-cap-key {
  color: var(--course-dark);
  font-weight: 700;
}
.v3-figcaption svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  color: var(--course);
}

/* Hero media: a wide banner image with a subtle accent wash so text overlaid
   in adjacent markup stays legible against the photo. */
.v3-hero-media {
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  box-shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.35);
}
.v3-hero-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.v3-hero-media::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, color-mix(in srgb, var(--course) 22%, transparent) 0%, transparent 55%);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .v3-figure img { transition: none; }
  .v3-figure:hover img { transform: none; }
}

/* ============================================================= *
 *  Advanced inline-SVG diagram wrapper                           *
 * ============================================================= */

.v3-viz {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  padding: 1.25rem 1.25rem 1rem;
}
.v3-viz figcaption,
.v3-viz .v3-viz-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.v3-viz .v3-viz-note {
  font-size: 0.875rem;
  color: #475569;
  margin-bottom: 1.1rem;
  line-height: 1.5;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 400;
}
.v3-viz svg { width: 100%; height: auto; display: block; }

/* Reusable diagram token classes — color flows from the accent vars so the
   same SVG markup recolors per subject. Hand-authored SVGs reference these. */
.v3-node { fill: var(--course-light); stroke: var(--course); stroke-width: 2; }
.v3-node-soft { fill: #f8fafc; stroke: #cbd5e1; stroke-width: 1.6; }
.v3-flow { fill: none; stroke: var(--course); stroke-width: 2.2; }
.v3-flow-alt { fill: none; stroke: var(--course-dark); stroke-width: 2.2; stroke-dasharray: 6 5; }
.v3-label { fill: #0f172a; font-weight: 700; }
.v3-sub { fill: #475569; }

/* ============================================================= *
 *  Prose (essay pages) — base typography + ornaments             *
 *  Single source of truth; accent-driven so one --course swap    *
 *  retints every pack. Replaces the per-page inline <style>.     *
 * ============================================================= */

.prose-essay p { font-family: 'Lora', Georgia, serif; font-size: 1.05rem; line-height: 1.75; margin-bottom: 1.1rem; color: #334155; }
.prose-essay strong { color: #0f172a; font-weight: 700; }
.prose-essay em { font-style: italic; color: #475569; }
.prose-essay ul { margin: 0.5rem 0 1.2rem; padding-left: 1.5rem; list-style: disc; }
.prose-essay ul li { font-family: 'Lora', Georgia, serif; font-size: 1.05rem; line-height: 1.65; margin-bottom: 0.4rem; color: #334155; }

/* H2: chapter-style heading + a slim line + diamond marker, accent-tinted. */
.prose-essay h2 {
  font-family: 'Lora', Georgia, serif;
  font-size: 1.4rem;
  font-weight: 800;
  color: #0f172a;
  margin: 2.4rem 0 0.8rem;
  line-height: 1.25;
  position: relative;
  padding-top: 1.2rem;
  scroll-margin-top: 6rem;
}
.prose-essay h2::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 56px;
  height: 14px;
  background-color: var(--course);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 14'><path d='M0 7 L40 7' stroke='black' stroke-width='1.5' stroke-linecap='round'/><path d='M44 7 L50 1 L56 7 L50 13 Z' fill='black'/></svg>") no-repeat center / contain;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 56 14'><path d='M0 7 L40 7' stroke='black' stroke-width='1.5' stroke-linecap='round'/><path d='M44 7 L50 1 L56 7 L50 13 Z' fill='black'/></svg>") no-repeat center / contain;
  opacity: 0.9;
}
.prose-essay h3 { scroll-margin-top: 6rem; }

/* Blockquote: accent border + opening-quote glyph, tinted by the accent. */
.prose-essay blockquote {
  position: relative;
  padding-left: 2.75rem;
  border-left: 3px solid var(--course);
  margin: 1.4rem 0;
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  color: var(--course-dark);
}
.prose-essay blockquote::before {
  content: '\201C';
  position: absolute;
  top: 0.1rem;
  left: 0.8rem;
  font-family: 'Lora', Georgia, serif;
  font-size: 3.25rem;
  line-height: 1;
  color: var(--course);
  opacity: 0.3;
  font-style: normal;
  user-select: none;
}

/* ============================================================= *
 *  Data table + prompt box (resource pages) — accent-driven      *
 * ============================================================= */

.seq-table { width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.92rem; }
.seq-table th { background: color-mix(in srgb, var(--course) 10%, white); color: var(--course-dark); text-align: left; padding: 0.7rem 0.9rem; font-weight: 700; border: 1px solid color-mix(in srgb, var(--course) 22%, white); }
.seq-table td { padding: 0.7rem 0.9rem; border: 1px solid #e2e8f0; color: #334155; vertical-align: top; }
.seq-table tr:nth-child(even) td { background: #f8fafc; }

.prompt-box { font-family: 'SFMono-Regular', ui-monospace, Menlo, Consolas, monospace; font-size: 0.9rem; line-height: 1.6; background: color-mix(in srgb, var(--course) 6%, white); border: 1px solid color-mix(in srgb, var(--course) 25%, white); border-left: 3px solid var(--course); border-radius: 0.5rem; padding: 0.85rem 1.05rem; margin: 0.9rem 0; color: var(--course-dark); }

/* ============================================================= *
 *  Scroll-reveal (motion-safe progressive disclosure)            *
 * ============================================================= */

/* Hidden initial state applies ONLY after v3-pack.js marks the document
   (html.v3-anim). With no JS, content stays fully visible. */
.v3-anim .v3-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}
.v3-anim .v3-reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .v3-anim .v3-reveal { opacity: 1; transform: none; transition: none; }
}

/* ============================================================= *
 *  Model notebook entry (lab-notebook-starter pages)            *
 *  A legible, accessible mock of a real notebook page. Text is  *
 *  real (never AI-garbled handwriting); accent flows per pack.  *
 * ============================================================= */

.nb-figure { margin: 1.9rem 0 2.3rem; }
.nb-page {
  position: relative;
  background: #fffdf8;
  border: 1px solid #ece7da;
  border-radius: 0.6rem;
  box-shadow: 0 16px 36px -22px rgba(15, 23, 42, 0.42);
  padding: 1.35rem 1.5rem 1.5rem 1.65rem;
  overflow: hidden;
}
.nb-page::before {
  content: '';
  position: absolute; inset: 0 auto 0 0; width: 6px;
  background: var(--course); opacity: 0.85;
}
.nb-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.3rem 0.8rem;
  border-bottom: 2px solid var(--course-light);
  padding-bottom: 0.55rem; margin-bottom: 0.85rem;
}
.nb-date { font-size: 0.78rem; font-weight: 700; color: var(--course-dark); white-space: nowrap; }
.nb-title { font-family: 'Lora', Georgia, serif; font-weight: 700; font-size: 1.15rem; color: #0f172a; }
.nb-row {
  display: grid; grid-template-columns: 8.5rem 1fr; gap: 0.85rem;
  padding: 0.5rem 0; border-bottom: 1px dashed #e8e6df;
}
.nb-row:last-of-type { border-bottom: 0; }
.nb-label {
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.06em;
  font-weight: 800; color: var(--course); padding-top: 0.2rem;
}
.nb-body { font-size: 0.95rem; line-height: 1.6; color: #334155; }
.nb-body em { color: #475569; font-style: italic; }
.nb-note { color: #b45309; font-style: italic; font-size: 0.86em; }
.nb-data { border-collapse: collapse; margin: 0.4rem 0; font-size: 0.84rem; }
.nb-data th, .nb-data td { border: 1px solid #e2e8f0; padding: 0.22rem 0.55rem; text-align: left; }
.nb-data th { background: var(--course-light); color: var(--course-dark); font-weight: 700; }
.nb-sketch {
  display: flex; align-items: center; gap: 0.7rem; margin-top: 0.55rem;
  border: 1.5px dashed var(--course); border-radius: 0.45rem;
  padding: 0.55rem 0.75rem; background: #fff; color: var(--course-dark);
  font-size: 0.8rem; font-style: italic; max-width: 24rem;
}
.nb-sketch svg { width: 3.4rem; height: auto; color: var(--course); flex-shrink: 0; }
@media (max-width: 540px) {
  .nb-row { grid-template-columns: 1fr; gap: 0.15rem; }
  .nb-label { padding-top: 0; }
}

/* ============================================================= *
 *  Breadcrumbs — orientation trail for deep leaf pages           *
 *  Sits as a calm white strip between the sticky header and the  *
 *  hero. Link color flows from the accent vars (recolors/pack).  *
 * ============================================================= */

.v3-breadcrumb {
  background: #fff;
  border-bottom: 1px solid #e2e8f0;
}
.v3-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  list-style: none;
  margin: 0;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  font-size: 0.78rem;
  line-height: 1.4;
}
.v3-breadcrumb li {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}
.v3-breadcrumb a {
  color: #64748b;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}
.v3-breadcrumb a:hover { color: var(--course); }
.v3-breadcrumb li[aria-current="page"] {
  color: var(--course-dark);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.v3-breadcrumb .v3-crumb-sep {
  color: #cbd5e1;
  font-weight: 400;
  user-select: none;
}

/* ============================================================= *
 *  Sequence nav — prev / hub / next at the foot of ordered      *
 *  group pages (essays, unit rubrics). Accent-aware.            *
 * ============================================================= */

.v3-seqnav {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.875rem;
}
.v3-seqnav a,
.v3-seqnav span {
  flex: 1 1 0;
  min-width: 0;
}
.v3-seqnav .v3-seq-prev { text-align: left; }
.v3-seqnav .v3-seq-hub { flex: 0 0 auto; align-self: center; }
.v3-seqnav .v3-seq-next { text-align: right; }
.v3-seqnav a {
  color: #64748b;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.15s ease;
}
.v3-seqnav .v3-seq-next { color: var(--course); }
.v3-seqnav a:hover { color: var(--course-dark); }
.v3-seqnav .v3-seq-eyebrow {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

/* ============================================================= *
 *  Keyboard focus — a branded, accent-aware focus ring on the   *
 *  interactive v3 surfaces (breadcrumb, seqnav, framed media).  *
 *  Mouse users keep the clean hover treatment; only keyboard    *
 *  navigation (:focus-visible) draws the ring.                  *
 * ============================================================= */

.v3-breadcrumb a:focus-visible,
.v3-seqnav a:focus-visible,
.v3-figure a:focus-visible {
  outline: 2px solid var(--course);
  outline-offset: 2px;
  border-radius: 0.25rem;
  color: var(--course-dark);
}
.v3-figure a:focus-visible {
  outline-offset: 3px;
  border-radius: 0.95rem;
}

/* ============================================================= *
 *  Anchor exemplars — grader calibration pair                    *
 *  A concrete "what Mastered sounds like / what Not yet sounds   *
 *  like" pair beneath a unit rubric, so a guide who is not a     *
 *  subject expert can still judge consistently. Accent-aware.    *
 * ============================================================= */

.v3-exemplar {
  display: grid;
  gap: 1rem;
  margin: 1.8rem 0;
}
@media (min-width: 640px) {
  .v3-exemplar { grid-template-columns: 1fr 1fr; }
}
.v3-exemplar-yes,
.v3-exemplar-no {
  border-radius: 0.85rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid;
}
.v3-exemplar-yes {
  background: var(--course-light);
  border-color: var(--course);
}
.v3-exemplar-no {
  background: #fff7ed;
  border-color: #fdba74;
}
.v3-exemplar-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  margin-bottom: 0.45rem;
}
.v3-exemplar-yes .v3-exemplar-label { color: var(--course-dark); }
.v3-exemplar-no .v3-exemplar-label { color: #9a3412; }
.v3-exemplar p {
  font-family: 'Lora', Georgia, serif;
  font-style: italic;
  color: #334155;
  line-height: 1.6;
  margin: 0;
  font-size: 0.95rem;
}

/* ============================================================= *
 *  Operating-principle cards (how-rubrics-work page)             *
 * ============================================================= */

.v3-principles {
  display: grid;
  gap: 1rem;
  margin: 1.5rem 0;
}
@media (min-width: 768px) {
  .v3-principles { grid-template-columns: repeat(3, 1fr); }
}
.v3-principle {
  border: 1px solid #e2e8f0;
  border-top: 3px solid var(--course);
  border-radius: 0.85rem;
  padding: 1.25rem;
  background: #fff;
}
.v3-principle-n {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--course);
  margin-bottom: 0.5rem;
}
.v3-principle h3 {
  font-family: 'Lora', Georgia, serif;
  font-weight: 800;
  color: #0f172a;
  font-size: 1.05rem;
  margin: 0 0 0.4rem;
}
.v3-principle p {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.6;
  margin: 0;
}

/* ============================================================= *
 *  Mastery-to-grade bundle rows (how-rubrics-work page)          *
 *  Specifications-grading contracts: each grade is a bundle of   *
 *  mastery thresholds, not a points total.                       *
 * ============================================================= */

.v3-bundle {
  display: grid;
  gap: 0.75rem;
  margin: 1.5rem 0;
}
.v3-bundle-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  padding: 1rem 1.2rem;
  background: #fff;
}
.v3-bundle-mark {
  font-family: 'Lora', Georgia, serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--course-dark);
  background: var(--course-light);
  width: 2.6rem;
  height: 2.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.6rem;
  flex-shrink: 0;
}
.v3-bundle-row h3 {
  font-family: 'Lora', Georgia, serif;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 0.2rem;
  font-size: 1rem;
}
.v3-bundle-row p {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.55;
  margin: 0;
}

/* ============================================================= *
 *  Print — turn any rubric page into a clean one-page handout.   *
 *  Strips navigation chrome (header, footer, breadcrumb, seqnav, *
 *  skip link) and keeps the title, table, exemplars, and notes.  *
 * ============================================================= */

@media print {
  header,
  footer,
  nav,
  a[href="#main"] {
    display: none !important;
  }
  body { color: #000; background: #fff; }
  main { max-width: 100% !important; }
  .rubric-table {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  .rubric-table th {
    background: #1f2937 !important;
    color: #fff !important;
  }
  .rubric-table tr,
  .v3-exemplar,
  .v3-principle,
  .v3-bundle-row {
    break-inside: avoid;
  }
}

