/* VacTech Polished Canonical CSS — D-047 Wide Landscape Layout */
/* Selkirk College — Vacuum Technology Fundamentals */
/* Version: Polished 5.0 — Tightened vertical rhythm (28px rhythm unit) */
/* WCAG 1.4.1 (color not sole cue), 1.4.8 (measure ≤80ch), 1.4.12 (text spacing) */
/* All meaning conveyed by redundant cues: icon + text label + color + shape */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Brand palette ── */
  --blue-spruce: #28334A;
  --tree-green: #007864;
  --morning-dew: #BCD8D9;
  --light-sage: #EDEADF;
  --white: #FFFFFF;

  /* ── Neutrals ── */
  --near-black: #1a1a1a;
  --dark-gray: #333333;
  --mid-gray: #666666;
  --light-gray: #f8f8f8;
  --border-gray: #e0e0e0;

  /* ── Callout palette (corrected green/red) ── */
  --callout-blue-bg: #f0f4f8;
  --callout-blue-border: #2563eb;
  --callout-amber-bg: #fef3c7;
  --callout-amber-border: #f59e0b;
  --callout-green-bg: #ecfdf5;
  --callout-green-border: #10b981;
  --callout-red-bg: #fef2f2;
  --callout-red-border: #ef4444;

  /* ── Accessible title colors (all ≥4.5:1 on their bg) ── */
  --callout-blue-title: #1e40af;
  --callout-amber-title: #7c3600;
  --callout-green-title: #065f46;
  --callout-red-title: #991b1b;

  /* ── Layout ── */
  --max-width: 960px;
  --content-padding: 5rem;
  /* prose-max removed — 960px wrapper already yields ~88 chars/line */

  /* ── Table globals ── */
  --tbl-font-size: 1rem;
  --tbl-line-height: 1.3;
  --tbl-margin: 1rem;
  --tbl-border-width: 0.5px;
  --th-pad-v: 0.5rem;
  --th-pad-h: 0.75rem;
  --th-font-size: 0.85rem;
  --td-pad-v: 0.5rem;
  --td-pad-h: 0.75rem;

  /* ── Table column widths (% of table) ── */
  --col1-width: auto;
  --col2-width: auto;
  --col3-width: auto;
  --col4-width: auto;

  /* ── Table text alignment per column ── */
  --col1-align: left;
  --col2-align: left;
  --col3-align: left;
  --col4-align: left;

  /* ── Table text wrapping ── */
  --tbl-white-space: normal;
  --tbl-word-break: normal;

  /* ── Scaffold / Nudge globals ── */
  --nudge-font-size: 1rem;
  --nudge-line-height: 1.5;
  --nudge-label-size: 1rem;
  --scaffold-font-size: 1.1rem;
}

/* ── Base typography ── */
body {
  font-family: 'BC Sans', 'Calibri', 'Segoe UI', sans-serif;
  font-size: 17px;
  line-height: 1.5;
  color: var(--dark-gray);
  background: var(--light-sage);
}

/* ── Page wrapper ── */
.page-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--white);
  min-height: 100vh;
  box-shadow: 0 0 40px rgba(0,0,0,0.08);
}

/* ── Header ── */
.course-header {
  background: var(--blue-spruce);
  color: var(--white);
  padding: 1.125rem var(--content-padding) 1.125rem;
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.header-logo { flex-shrink: 0; }
.header-logo img { height: 40px; width: auto; }
.header-text { flex: 1; }
.header-text .module-tag {
  display: inline-block;
  background: var(--tree-green);
  color: var(--white);
  font-size: 1.2rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 3px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.header-text h1 { font-size: 2.2rem; font-weight: 700; line-height: 1.25; margin-bottom: 0.25rem; }
.header-text .lesson-meta { font-size: 1rem; opacity: 0.75; }
.header-text .lesson-meta span { margin-right: 1.5rem; }

/* ── Breadcrumb ── */
.breadcrumb {
  background: var(--light-gray);
  border-bottom: 1px solid var(--border-gray);
  padding: 0.5rem var(--content-padding);
  font-size: 1.1rem;
  color: var(--mid-gray);
}
.breadcrumb a {
  color: var(--tree-green);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.breadcrumb a:hover { text-decoration-thickness: 2px; }

/* ── Content area ── */
.content {
  padding: 1.5rem var(--content-padding) var(--content-padding);
  max-width: var(--max-width);
  border-top: 3px solid var(--morning-dew);
}

/* Prose measure — constrain running text to readable line length.
   Tables, grids, and form elements break out to full width. */
/* Prose measure removed — wrapper width (960px - padding) keeps lines
   at ~88 chars, within readable range. All elements now share a
   consistent left-and-right edge with tables and textareas. */

/* ── Typography ── */
.content h1 { font-size: 1.6rem; font-weight: 700; color: var(--blue-spruce); margin: 0 0 0.75rem; line-height: 1.25; }
.content h2 { font-size: 1.5rem; font-weight: 700; color: var(--blue-spruce); margin: 0.5rem 0 1rem; padding-bottom: 0.35rem; border-bottom: 2px solid var(--morning-dew); line-height: 1.25; }
.content h3 { font-size: 1.25rem; font-weight: 600; color: var(--tree-green); margin: 1.5rem 0 0.5rem; line-height: 1.3; }
.content p { margin-bottom: 0.5rem; text-align: justify; }
.content strong { color: var(--near-black); font-weight: 600; }
.content ul, .content ol { margin: 0.5rem 0 0.5rem 1.5rem; }
.content li { margin-bottom: 0.5rem; padding-left: 0.25rem; text-align: justify; }
.content li::marker { color: var(--tree-green); }

/* ═══════════════════════════════════════════════════════════════
   CALLOUT BOXES — Accessible
   Each type distinguished by: icon + text label + color + border style
   ═══════════════════════════════════════════════════════════════ */
.callout {
  border-left: 4px solid;
  border-radius: 4px;
  padding: 0.5rem 1.25rem;
  margin: 1rem 0;
}
.callout-title {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.callout-title .callout-icon {
  flex-shrink: 0;
  width: 1.25em;
  height: 1.25em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1em;
  line-height: 1;
}
.callout p { margin-bottom: 0.5rem; }
.callout p:last-child { margin-bottom: 0; }

/* Blue — Note / Info: solid border, circle-i icon */
.callout-blue {
  background: var(--callout-blue-bg);
  border-color: var(--callout-blue-border);
  border-left-style: solid;
}
.callout-blue .callout-title { color: var(--callout-blue-title); }

/* Amber — Caution: dashed border, triangle icon */
.callout-amber {
  background: var(--callout-amber-bg);
  border-color: var(--callout-amber-border);
  border-left-style: dashed;
}
.callout-amber .callout-title { color: var(--callout-amber-title); }

/* Green — Tip / Success: double border, star icon */
.callout-green {
  background: var(--callout-green-bg);
  border-color: var(--callout-green-border);
  border-left-style: double;
  border-left-width: 5px;
}
.callout-green .callout-title { color: var(--callout-green-title); }

/* Red — Warning: solid heavy border, stop icon */
.callout-red {
  background: var(--callout-red-bg);
  border-color: var(--callout-red-border);
  border-left-style: solid;
  border-left-width: 6px;
}
.callout-red .callout-title { color: var(--callout-red-title); }

/* ═══════════════════════════════════════════════════════════════
   TABLES — Accessible
   Header distinguished by: color + bold + uppercase + thick bottom border
   Row borders provide non-color row separation
   ═══════════════════════════════════════════════════════════════ */
table { width: 100%; border-collapse: collapse; margin: var(--tbl-margin) 0; font-size: var(--tbl-font-size); line-height: var(--tbl-line-height); }

thead th {
  background: var(--tree-green);
  color: var(--white);
  font-weight: 700;
  text-align: left;
  vertical-align: middle;
  padding: var(--th-pad-v) var(--th-pad-h);
  text-transform: uppercase;
  font-size: var(--th-font-size);
  letter-spacing: 0.04em;
  border-bottom: 3px solid var(--blue-spruce);
}
tbody td {
  padding: var(--td-pad-v) var(--td-pad-h);
  border-bottom: var(--tbl-border-width) solid var(--border-gray);
  vertical-align: middle;
}
tbody tr:nth-child(even) { background: var(--light-sage); }

/* ── Table column widths & alignment ── */
table th:nth-child(1), table td:nth-child(1) { width: var(--col1-width); text-align: var(--col1-align); }
table th:nth-child(2), table td:nth-child(2) { width: var(--col2-width); text-align: var(--col2-align); }
table th:nth-child(3), table td:nth-child(3) { width: var(--col3-width); text-align: var(--col3-align); }
table th:nth-child(4), table td:nth-child(4) { width: var(--col4-width); text-align: var(--col4-align); }
table td, table th { white-space: var(--tbl-white-space); word-break: var(--tbl-word-break); }

/* ── Rig labels ── */
.rig-label {
  font-family: 'Consolas', 'Courier New', monospace;
  background: none;
  border: none;
  padding: 0;
  font-size: 0.9em;
  color: var(--blue-spruce);
  font-weight: 600;
  white-space: nowrap;
}

/* ── Two-column layout ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin: 1.5rem 0; }
.two-col .col { background: var(--light-gray); border-radius: 6px; padding: 1.25rem; border-top: 3px solid var(--tree-green); }
.two-col .col h3 { margin-top: 0; }

/* ── Media placeholder ── */
.media-placeholder {
  background: var(--light-gray);
  border: 2px dashed var(--border-gray);
  border-radius: 6px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  margin: 1.5rem 0;
  color: var(--mid-gray);
}
.media-placeholder .icon { font-size: 2.5rem; margin-bottom: 0.5rem; }
.media-placeholder .label { font-weight: 600; font-size: 0.95rem; }
.media-placeholder .detail { font-size: 0.8rem; margin-top: 0.25rem; }

/* ── Workbook: Student header grid ── */
.wb-header-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
.wb-header-grid label {
  font-weight: 600;
  display: block;
  margin-bottom: 0.25rem;
}
.wb-header-grid input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-gray);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
}
.wb-header-grid input:focus {
  outline: 2px solid var(--blue-spruce);
  outline-offset: 1px;
  border-color: var(--blue-spruce);
}

/* ── Workbook: Textareas ── */
.wb-textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border-gray);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.5;
  resize: vertical;
  margin: 0.5rem 0;
  transition: border-color 0.15s, outline-color 0.15s;
}
.wb-textarea:focus {
  outline: 2px solid var(--blue-spruce);
  outline-offset: 1px;
  border-color: var(--blue-spruce);
}

/* ── Marks badge ── */
.marks-badge {
  display: inline-block;
  background: var(--morning-dew);
  color: var(--blue-spruce);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin: 0.25rem 0;
  border: 1px solid var(--blue-spruce);
}

/* ── Question stem ── */
.q-stem {
  font-weight: 600;
  color: var(--near-black);
  margin-bottom: 0.5rem;
  line-height: 1.55;
}

/* ── Submit section ── */
.wb-submit-section {
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--callout-blue-bg);
  border: 2px solid var(--callout-blue-border);
  border-radius: 8px;
  text-align: center;
}
.wb-submit-section h2 {
  color: var(--blue-spruce);
  margin-bottom: 0.75rem;
  border: none;
  padding: 0;
}
.btn-submit {
  background: var(--callout-blue-border);
  color: var(--white);
  border: none;
  padding: 14px 48px;
  border-radius: 6px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-submit:hover { filter: brightness(1.1); }
.btn-submit:focus-visible {
  outline: 3px solid var(--blue-spruce);
  outline-offset: 2px;
}
.wb-submission-summary {
  display: none;
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--callout-blue-bg);
  border: 2px solid var(--callout-blue-border);
  border-radius: 8px;
}
.wb-submission-summary h2 {
  color: var(--blue-spruce);
  margin-bottom: 0.75rem;
  border: none;
  padding: 0;
}
.wb-summary-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 16px;
  margin-bottom: 16px;
  font-size: 0.95rem;
}
.wb-submit-status {
  background: #dbeafe;
  padding: 12px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-action {
  border: none;
  color: var(--white);
  padding: 10px 24px;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.9rem;
  transition: filter 0.15s;
}
.btn-action:hover { filter: brightness(1.1); }
.btn-action:focus-visible {
  outline: 3px solid var(--blue-spruce);
  outline-offset: 2px;
}
.btn-action-primary { background: var(--blue-spruce); }
.btn-action-secondary { background: var(--tree-green); }

/* ── Assessor sign-off ── */
.assessor-signoff {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 2px solid var(--morning-dew);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2rem;
  font-size: 0.95rem;
}
.assessor-signoff .signoff-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.assessor-signoff .signoff-label { font-weight: 600; font-size: 0.85rem; color: var(--mid-gray); }
.assessor-signoff .signoff-line {
  border-bottom: 1px solid var(--dark-gray);
  min-height: 1.5rem;
}
.assessor-signoff .signoff-field.full-width {
  grid-column: 1 / -1;
}

/* ── Scenario Card metadata ── */
.sc-meta {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.15rem 1rem;
  font-size: 1rem;
  margin: 0.5rem 0;
}
.sc-meta dt { font-weight: 700; }
.sc-meta dd { margin: 0; }

/* ═══════════════════════════════════════════════════════════════
   QUIZ FEEDBACK — Accessible
   Correct/Incorrect distinguished by: icon + text prefix + color + border style
   ═══════════════════════════════════════════════════════════════ */
.quiz-section { background: var(--light-gray); border: 1px solid var(--border-gray); border-radius: 8px; padding: 1.5rem; margin: 2rem 0; }
.quiz-section h3 { margin-top: 0; color: var(--blue-spruce); }
.quiz-question { margin: 1.25rem 0; padding: 1rem; background: var(--white); border-radius: 6px; border: 1px solid var(--border-gray); }
.quiz-question p.q-stem { font-weight: 600; color: var(--near-black); margin-bottom: 0.75rem; }
.quiz-options { list-style: none; margin: 0; padding: 0; }
.quiz-options li { margin: 0; padding: 0; }
.quiz-options label {
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.15s;
  margin-bottom: 0.25rem;
  border: 2px solid transparent;
}
.quiz-options label:hover { background: var(--morning-dew); }
.quiz-options label:focus-within {
  outline: 2px solid var(--blue-spruce);
  outline-offset: 1px;
}
.quiz-options input[type="radio"] { margin-right: 0.5rem; accent-color: var(--tree-green); }

.quiz-feedback {
  display: none;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-top: 0.75rem;
  font-size: 0.95rem;
}
/* Correct: solid border, checkmark icon, "Correct:" prefix */
.quiz-feedback.correct {
  background: var(--callout-green-bg);
  border: 2px solid var(--callout-green-border);
  color: var(--callout-green-title);
  border-left-width: 5px;
}
.quiz-feedback.correct::before {
  content: "\2713  Correct: ";
  font-weight: 700;
}
/* Incorrect: dashed border, X icon, "Not quite:" prefix */
.quiz-feedback.incorrect {
  background: var(--callout-red-bg);
  border: 2px dashed var(--callout-red-border);
  color: var(--callout-red-title);
  border-left: 5px solid var(--callout-red-border);
}
.quiz-feedback.incorrect::before {
  content: "\2717  Not quite: ";
  font-weight: 700;
}

/* Selected answer visual feedback — accessible */
.quiz-options label.answer-correct {
  background: var(--callout-green-bg);
  border: 2px solid var(--callout-green-border);
}
.quiz-options label.answer-correct::after {
  content: " \2713";
  font-weight: 700;
  color: var(--callout-green-title);
}
.quiz-options label.answer-incorrect {
  background: var(--callout-red-bg);
  border: 2px dashed var(--callout-red-border);
}
.quiz-options label.answer-incorrect::after {
  content: " \2717";
  font-weight: 700;
  color: var(--callout-red-title);
}
.quiz-options label.answer-reveal {
  background: var(--callout-green-bg);
  border: 2px solid var(--callout-green-border);
}
.quiz-options label.answer-reveal::after {
  content: " \2713 (correct answer)";
  font-weight: 700;
  font-size: 0.85em;
  color: var(--callout-green-title);
}

.btn-check {
  background: var(--tree-green);
  color: var(--white);
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  margin-top: 0.5rem;
  transition: background 0.15s;
}
.btn-check:hover { background: #006554; }
.btn-check:focus-visible {
  outline: 3px solid var(--blue-spruce);
  outline-offset: 2px;
}

/* ── Lesson navigation ── */
.lesson-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem var(--content-padding);
  border-top: 2px solid var(--morning-dew);
  background: var(--light-gray);
}
.lesson-nav a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--tree-green);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background 0.15s;
}
.lesson-nav a:hover { background: var(--morning-dew); }
.lesson-nav a:focus-visible {
  outline: 3px solid var(--blue-spruce);
  outline-offset: 2px;
}

/* ── Footer ── */
.course-footer {
  background: var(--blue-spruce);
  color: rgba(255,255,255,0.6);
  padding: 0.75rem var(--content-padding);
  font-size: 0.85rem;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════════════
   SCAFFOLD / NUDGE SYSTEM — Accessible
   Each level distinguished by: icon + text label + color + border style
   ═══════════════════════════════════════════════════════════════ */
.scaffold-control {
  background: #f0f4f8;
  border-bottom: 2px solid var(--morning-dew);
  padding: 0.5rem var(--content-padding);
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: var(--scaffold-font-size);
  color: var(--blue-spruce);
}
.scaffold-control label {
  font-weight: 600;
  white-space: nowrap;
}
.scaffold-control select {
  font-family: inherit;
  font-size: 0.88rem;
  padding: 0.35rem 0.6rem;
  border: 1px solid var(--morning-dew);
  border-radius: 4px;
  background: #fff;
  color: var(--blue-spruce);
  cursor: pointer;
}
.scaffold-control select:focus {
  outline: 2px solid var(--blue-spruce);
  outline-offset: 1px;
}
.scaffold-control .scaffold-note {
  font-size: 0.78rem;
  color: var(--mid-gray);
  margin-left: auto;
}

/* Nudge containers — each level has: distinct icon + text label + border style + color */
.nudge {
  border-radius: 0 4px 4px 0;
  padding: 0.65rem 1rem;
  margin: 0.5rem 0 1rem 0;
  font-size: var(--nudge-font-size);
  line-height: var(--nudge-line-height);
  color: #334155;
  display: none;
}
.nudge-label {
  font-weight: 600;
  font-size: var(--nudge-label-size);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-right: 0.4rem;
}
.nudge-icon {
  margin-right: 0.3rem;
  font-size: 1em;
}

/* Level 1 — Clue: solid border, lightbulb icon */
.nudge[data-level="1"] {
  background: #f0f4f8;
  border-left: 3px solid #3b6ea5;
  border-left-style: solid;
}
.nudge[data-level="1"] .nudge-label { color: #2c5580; }

/* Level 2 — Guided: dashed border, compass icon */
.nudge[data-level="2"] {
  background: #fef9ef;
  border-left: 3px dashed #8a5500;
  border-left-style: dashed;
}
.nudge[data-level="2"] .nudge-label { color: #7a4b00; }

/* Level 3 — Step-by-step: double border, clipboard icon */
.nudge[data-level="3"] {
  background: #faf5fc;
  border-left: 5px double #7b3280;
  border-left-style: double;
}
.nudge[data-level="3"] .nudge-label { color: #6b2a70; }

.worked-example {
  background: #faf5fc;
  border-left: 3px solid #7b3280;
  border-radius: 0 4px 4px 0;
  padding: 1rem 1.25rem;
  margin: 0.75rem 0 1.25rem 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: #334155;
  display: none;
}
.worked-example .we-label {
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b2a70;
  margin-bottom: 0.5rem;
}

.scaffold-control.hidden-for-students { display: none; }

/* ── Responsive ── */
@media (max-width: 768px) {
  :root { --content-padding: 1.25rem; }
  body { font-size: 16px; }
  .course-header { flex-direction: column; gap: 0.75rem; }
  .course-header h1 { font-size: 1.4rem; }
  .content h2 { font-size: 1.25rem; }
  .two-col { grid-template-columns: 1fr; }
  .wb-header-grid { grid-template-columns: 1fr; }
  .assessor-signoff { grid-template-columns: 1fr; }
  .scaffold-control { padding: 0.5rem 1.25rem; flex-wrap: wrap; }
  .scaffold-control .scaffold-note { margin-left: 0; width: 100%; }
}

/* ── Print ── */
@media print {
  body { background: white; }
  .page-wrapper { box-shadow: none; }
  .lesson-nav, .breadcrumb, .scaffold-control { display: none; }
  .wb-submit-section, .wb-submission-summary { display: none !important; }
  .quiz-section, .callout { break-inside: avoid; }
  .nudge, .worked-example { break-inside: avoid; }
  .wb-textarea { border: 1px solid #999; min-height: 4rem; }
}
