/* Site pages: courses, lessons, tracks, blog (Modules 12–15).
   Uses the tokens and shared components defined in style.css. */

/* ── Header navigation (ohmify.com menu: uppercase, orange pill on the active item) ── */

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
  margin-left: 28px;
}

.main-nav a {
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--oh-heading);
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.main-nav a:hover { background: var(--oh-surface-hover); color: var(--oh-heading); }
.main-nav a.active { background: var(--oh-orange); color: #FFFFFF; }
.main-nav a.active:hover { background: var(--oh-orange-hover); }

/* ── Page frame ── */

.site-main { min-height: 60vh; padding-bottom: 80px; }

.site-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 40px 0;
}

.page-band__inner--split {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

/* Pico spreads every <nav> with space-between; chip rows and crumbs pack to the left. */
nav.chip-row, nav.crumbs { justify-content: flex-start; }

.section-head { display: flex; align-items: baseline; flex-wrap: wrap; margin-top: 48px; }

.empty-state { color: var(--oh-subtle); font-weight: 600; }

.plain-list { list-style: none; padding: 0; margin: 0; }
.plain-list li { list-style: none; margin: 0 0 8px; }
.plain-list a { font-weight: 700; color: var(--oh-title); text-decoration: none; }
.plain-list a:hover { color: var(--oh-orange); }

.search-form { margin: 0; min-width: 280px; }
.search-form input[type="search"] {
  margin: 0;
  border-radius: 999px;
  border: none;
  background: var(--oh-surface);
  box-shadow: var(--oh-shadow);
  padding-left: 20px;
  font-weight: 600;
}

/* ── Cards ── */

.course-card { position: relative; }
.course-card__img--empty { background: linear-gradient(135deg, var(--oh-slate), var(--oh-navy)); }
.course-card--soon .course-card__img { filter: grayscale(0.7); opacity: 0.7; }
.course-card__badge { position: absolute; top: 12px; left: 12px; }

.track-tile__meta { font-size: 0.8125rem; font-weight: 600; color: rgba(255, 255, 255, 0.72); }

/* ── Prose (rendered Markdown) ── */

.prose { font-size: 1.0625rem; line-height: 1.7; color: var(--oh-text); overflow-wrap: break-word; }
.prose.panel { padding: 36px 40px; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h2 { font-size: 1.5rem; margin: 2em 0 0.6em; }
.prose h3 { font-size: 1.2rem; margin: 1.6em 0 0.5em; }
.prose p, .prose ul, .prose ol { margin-bottom: 1.1em; }
.prose a { color: var(--oh-link); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--oh-orange); }
.prose img { max-width: 100%; height: auto; border-radius: var(--oh-radius-sm); }
.prose figure { margin: 1.6em 0; }
.prose figure img { display: block; margin: 0 auto; }
.prose figcaption { margin-top: 8px; font-size: 0.875rem; color: var(--oh-muted); text-align: center; }
.prose .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.prose .alignright { float: right; margin: 0 0 1em 1.5em; max-width: 50%; }
.prose .alignleft { float: left; margin: 0 1.5em 1em 0; max-width: 50%; }
.prose::after { content: ""; display: table; clear: both; }
.prose code { font-size: 0.9em; padding: 0.1em 0.35em; border-radius: 4px; background: var(--oh-surface-sunk); color: var(--oh-heading); }
.prose pre {
  margin: 1.4em 0;
  padding: 1.1rem 1.25rem;
  border-radius: var(--oh-radius);
  background: var(--oh-navy);
  color: #E7E8EB;
  font-size: 0.875rem;
  line-height: 1.55;
  overflow-x: auto;
}
.prose pre code { padding: 0; background: none; color: inherit; font-size: inherit; }
.prose blockquote { margin: 1.4em 0; padding: 0.4em 1.2em; border-left: 3px solid var(--oh-orange); color: var(--oh-subtle); }
.prose .table-wrap { overflow-x: auto; margin: 1.4em 0; }
.prose table { margin: 0; font-size: 0.9375rem; }
.prose .math-display { overflow-x: auto; overflow-y: hidden; padding: 4px 0; }
.prose .katex { font-size: 1.08em; }

/* ── Callouts (:::note, :::aside, :::forum) ── */

.callout {
  margin: 1.4em 0;
  padding: 16px 20px;
  border-radius: var(--oh-radius);
  border-left: 4px solid var(--oh-orange);
  background: var(--oh-orange-soft);
}
.callout > :last-child { margin-bottom: 0; }
.callout--aside { border-left-color: var(--oh-muted); background: var(--oh-surface-sunk); }
.callout--muted { border-left-color: var(--oh-border); background: var(--oh-surface-sunk); color: var(--oh-subtle); }
.callout--forum { border-left-color: var(--oh-teal); background: rgba(17, 75, 95, 0.08); }
.callout--forum a { font-weight: 700; }
.yellowbox { margin: 1.4em 0; padding: 16px 20px; border-radius: var(--oh-radius); border-left: 4px solid var(--oh-orange); background: var(--oh-orange-soft); }

/* ── Embeds ── */

.video-embed {
  position: relative;
  margin: 1.4em 0;
  aspect-ratio: 16 / 9;
  border-radius: var(--oh-radius);
  overflow: hidden;
  background: #000;
}
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.prose video { max-width: 100%; border-radius: var(--oh-radius); }

.circuit-canvas { margin: 1.4em 0; }
.circuit-canvas img { display: block; margin: 0 auto; max-height: 560px; width: auto; max-width: 100%; }
.circuit-canvas__link { margin: 6px 0 0; text-align: center; font-size: 0.8125rem; font-weight: 700; }
.circuit-canvas--parts h3 { font-size: 1rem; margin-bottom: 0.5em; }
.circuit-canvas--parts table { max-width: 480px; }

.mark-finished { margin: 2em 0; text-align: center; }
.mark-finished a[role="button"] { background: var(--oh-orange); border-color: var(--oh-orange); color: #FFFFFF; text-decoration: none; }
.mark-finished a[role="button"]:hover { background: var(--oh-orange-hover); border-color: var(--oh-orange-hover); }

/* ── Course page ── */

.course-hero { background: var(--oh-band); }
.course-hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 40px;
  align-items: center;
  padding-top: 40px;
  padding-bottom: 40px;
}
.course-hero__summary { font-size: 1.125rem; color: var(--oh-subtle); margin: 12px 0 18px; }
.course-hero__img { width: 100%; border-radius: var(--oh-radius-lg); box-shadow: var(--oh-shadow-raised); }

.facts { display: flex; flex-wrap: wrap; gap: 8px 24px; list-style: none; padding: 0; margin: 0 0 22px; color: var(--oh-subtle); font-weight: 600; }
.facts li { list-style: none; margin: 0; }
.facts strong { color: var(--oh-heading); }
.facts--stacked { flex-direction: column; gap: 0; min-width: 240px; }
.facts--stacked li { padding: 10px 0; border-bottom: 1px solid var(--oh-border); }

.coming-soon { display: flex; align-items: center; gap: 12px; font-weight: 700; }

.course-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: start;
}
.course-layout__side { position: sticky; top: 104px; }
.course-layout__side .panel { padding: 22px 24px; }

/* ── Lesson outline ── */

ol.outline { list-style: none; margin: 0; padding: 0; }
.outline ol { list-style: none; margin: 4px 0 8px; padding: 0; }
.outline li { list-style: none; margin: 0; }
.outline__section details { margin: 0 0 4px; border: none; padding: 0; }
.outline__section summary {
  padding: 10px 0 6px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--oh-muted);
  cursor: pointer;
}
.outline__count { margin-left: 4px; font-weight: 700; color: var(--oh-muted); opacity: 0.6; }
.outline__item a, .outline__item > span {
  position: relative;
  display: block;
  padding: 7px 10px 7px 14px;
  border-radius: var(--oh-radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--oh-subtle);
  text-decoration: none;
}
.outline__item a:hover { background: var(--oh-surface-hover); color: var(--oh-heading); }
.outline__item--current a { background: var(--oh-orange-soft); color: var(--oh-heading); }
.outline__item--current a::before {
  content: "";
  position: absolute;
  left: 0;
  top: 6px;
  bottom: 6px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--oh-orange);
}
.outline__item--soon > span { color: var(--oh-muted); }
.outline__n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--oh-band);
  font-size: 0.75rem;
  font-weight: 800;
}

.outline-panel { max-height: calc(100vh - 128px); overflow-y: auto; scrollbar-width: thin; }
.outline-panel__course {
  display: block;
  margin-bottom: 10px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--oh-divider);
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--oh-heading);
  text-decoration: none;
}
.outline-panel__course:hover { color: var(--oh-orange); }

/* ── Lesson page ── */

.lesson-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}
.lesson-layout--single { grid-template-columns: minmax(0, 880px); justify-content: center; }
.lesson-layout__side { position: sticky; top: 104px; }
.lesson-layout__side .panel { padding: 20px; }

.lesson-head { margin-bottom: 20px; }
.lesson-head h1 { font-size: 2.125rem; line-height: 1.2; margin: 6px 0 0; }
.lesson-head__position { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--oh-orange); }

.downloads { margin-top: 32px; }
.downloads ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.downloads li { list-style: none; margin: 0; }
.downloads a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--oh-radius);
  background: var(--oh-surface);
  box-shadow: var(--oh-shadow);
  font-weight: 700;
  color: var(--oh-title);
  text-decoration: none;
}
.downloads a:hover { background: var(--oh-surface-hover); }

/* ── Course questions (Module 24): the question box and what others asked ── */

.course-questions { margin-top: 32px; padding: 24px 28px; }
.course-questions .section-title { margin: 0 0 14px; }
.ask-question label { font-weight: 700; }
.ask-question__error { color: #C0392B; font-weight: 700; }
.ask-question__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.ask-question__foot button { margin: 0; }
.ask-question__foot small { color: var(--oh-muted); }
.ask-question--sent { padding: 14px 18px; border-radius: var(--oh-radius); border-left: 4px solid var(--oh-teal); background: rgba(17, 75, 95, 0.08); }
.ask-question--sent p:last-child { margin-bottom: 0; }
.course-questions__others { margin: 20px 0 0; border-top: 1px solid var(--oh-border); padding-top: 14px; }
.course-questions__others summary { font-weight: 700; cursor: pointer; }
.course-questions__list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 12px; }
.course-questions__list li { list-style: none; margin: 0; }
.course-questions__list > li > a { font-weight: 700; }
.course-questions__meta { display: block; font-size: 0.875rem; color: var(--oh-muted); }
.course-questions__empty { color: var(--oh-muted); margin: 12px 0 0; }
.course-questions__more { width: auto; }

.pager { display: flex; justify-content: space-between; gap: 16px; margin-top: 32px; }
.pager a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 48%;
  padding: 14px 18px;
  border-radius: var(--oh-radius);
  background: var(--oh-surface);
  box-shadow: var(--oh-shadow);
  font-weight: 700;
  color: var(--oh-title);
  text-decoration: none;
}
.pager a:hover { background: var(--oh-surface-hover); }
.pager a span { font-size: 0.75rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--oh-muted); }
.pager__next { margin-left: auto; text-align: right; }

/* ── Members-only gate ── */

.gate { display: flex; justify-content: center; padding-top: 64px; }
.gate__panel { max-width: 560px; text-align: center; padding: 40px; }
.gate__panel h1 { font-size: 1.75rem; margin: 12px 0; }
.gate__actions { display: flex; justify-content: center; gap: 12px; flex-wrap: wrap; }

/* ── Track page (ohmify single-track) ── */

.track-hero { background: var(--oh-band); }
.track-hero__inner {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr) auto;
  gap: 40px;
  align-items: start;
  padding-top: 48px;
  padding-bottom: 48px;
}
.track-hero__icon { width: 140px; height: 158px; object-fit: contain; }
.track-hero__text .page-title { margin: 10px 0 14px; }
.track-hero__text .prose { font-size: 1.0625rem; margin-bottom: 20px; }

.track-courses { list-style: none; padding: 0; margin: 0 0 24px; }
.track-courses li { list-style: none; margin: 0 0 14px; }
.track-course {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-right: 20px;
  border-radius: var(--oh-radius);
  overflow: hidden;
  background: var(--oh-surface);
  box-shadow: var(--oh-shadow);
  color: var(--oh-text);
  text-decoration: none;
  transition: background 0.2s;
}
.track-course:hover { background: var(--oh-surface-hover); }
.track-course--soon { opacity: 0.65; }
.track-course__n {
  flex-shrink: 0;
  width: 44px;
  text-align: center;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--oh-orange);
}
.track-course__img { width: 164px; height: 92px; object-fit: cover; flex-shrink: 0; }
.track-course__info { display: flex; flex-direction: column; gap: 4px; padding: 14px 0; }
.track-course__title { font-size: 1.125rem; font-weight: 700; color: var(--oh-heading); }
.track-course__meta { font-size: 0.875rem; font-weight: 600; color: var(--oh-muted); }

/* ── Blog ── */

.post-list { display: grid; gap: 16px; }
.post-card {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  border-radius: var(--oh-radius);
  overflow: hidden;
  background: var(--oh-surface);
  box-shadow: var(--oh-shadow);
  color: var(--oh-text);
  text-decoration: none;
  transition: box-shadow 0.2s, transform 0.2s;
}
.post-card:hover { box-shadow: var(--oh-shadow-raised); transform: translateY(-1px); }
.post-card__img { width: 100%; height: 100%; min-height: 160px; max-height: 200px; object-fit: cover; }
.post-card__body { display: flex; flex-direction: column; gap: 8px; padding: 20px 24px; grid-column: 2; }
.post-card:not(:has(.post-card__img)) .post-card__body { grid-column: 1 / -1; }
.post-card__title { font-size: 1.25rem; font-weight: 800; line-height: 1.3; color: var(--oh-title); }
.post-card__excerpt { color: var(--oh-subtle); font-weight: 500; }

.post-layout { max-width: 880px; }
.post-head h1 { font-size: 2.25rem; line-height: 1.2; margin: 6px 0 10px; }
.post-head { margin-bottom: 20px; }
.post-hero { width: 100%; max-height: 460px; object-fit: cover; border-radius: var(--oh-radius-lg); margin-bottom: 20px; }

/* ── Footer ── */

.site-footer { background: var(--oh-surface); border-top: 1px solid var(--oh-border); }
.site-footer__inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.site-footer a { font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--oh-subtle); text-decoration: none; }
.site-footer a:hover { color: var(--oh-orange); }
.site-footer__brand { display: flex; align-items: center; gap: 14px; }
.site-footer__copy { font-size: 0.8125rem; color: var(--oh-subtle); }
.site-footer__youtube { display: inline-flex; align-items: center; gap: 6px; }
.site-footer__youtube svg { color: #FF0000; }

/* ── Progress (Module 15) ── */

.complete-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: var(--oh-radius);
  background: var(--oh-surface);
  box-shadow: var(--oh-shadow);
}
.complete-bar form { margin: 0; }
.complete-bar button { margin: 0; }
.complete-bar--done { background: rgba(31, 157, 92, 0.08); }
.complete-bar__status { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; color: #1F9D5C; }
.complete-bar a[role="button"] { margin-left: auto; }
.link-button {
  padding: 0 !important;
  border: none !important;
  background: none !important;
  color: var(--oh-muted) !important;
  font-weight: 700;
  letter-spacing: 0 !important;
  text-transform: none !important;
  text-decoration: underline;
  cursor: pointer;
}

.outline__check { display: inline-block; width: 1.2em; margin-left: -2px; color: #1F9D5C; font-weight: 900; }
.outline__item--done a { color: var(--oh-heading); }
.outline__item--done .outline__n { background: #1F9D5C; color: #FFFFFF; }

.outline-panel .progress { margin-top: 2px; }
.outline-panel .progress-label { margin-bottom: 10px; }

.course-card__body .progress { margin-bottom: 0; }
.course-card__body .progress-label { margin-bottom: 8px; }
.track-tile .progress { margin-top: auto; }

.hero-progress { max-width: 420px; margin: 0 0 18px; }
.hero-progress .progress { height: 10px; }

.inline-form { margin: 0; }

/* Ring like ohmify.com's track page (.card .percent) */
.ring {
  --size: 52px;
  position: relative;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--size);
  height: var(--size);
  margin-left: auto;
  border-radius: 50%;
  background: conic-gradient(var(--oh-orange) calc(var(--percent) * 1%), var(--oh-track-bar) 0);
}
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--oh-surface); }
.ring span { position: relative; font-size: 0.75rem; font-weight: 800; color: var(--oh-heading); }
.ring--done { background: conic-gradient(#1F9D5C 100%, #1F9D5C 0); }

/* ── Certificates (Module 15): A4 landscape, same colours in dark mode and print ── */

.certificate-form { text-align: left; margin-top: 18px; }
.certificate-form button { width: 100%; margin-top: 8px; }
.form-error { display: block; margin-top: -8px; margin-bottom: 8px; color: var(--oh-coral); font-weight: 700; }

.certificate-page { background: var(--oh-bg); }
.certificate-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 20px 24px;
}
.certificate-toolbar__actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.certificate-toolbar__actions button { margin: 0; }
.certificate-wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px 48px; }

.certificate {
  aspect-ratio: 297 / 210;
  width: 100%;
  padding: 2.2%;
  background: #FFFFFF;
  color: #2D3142;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.14);
  container-type: inline-size;
}
.certificate__frame {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 4cqw 6cqw 3cqw;
  border: 0.45cqw solid #2D3142;
  outline: 0.25cqw solid #F7A541;
  outline-offset: -1.4cqw;
}
.certificate__logo { width: 15cqw; height: auto; margin-bottom: 2.2cqw; }
.certificate__kicker { margin: 0 0 2.4cqw; font-size: 1.5cqw; font-weight: 800; letter-spacing: 0.3em; text-transform: uppercase; color: #F7A541; }
.certificate__lead { margin: 0; font-size: 1.6cqw; color: #404660; }
.certificate__name { margin: 0.8cqw 0 1.2cqw; font-size: 5cqw; font-weight: 800; line-height: 1.1; color: #2D3142; letter-spacing: -0.01em; }
.certificate__track { margin: 0.8cqw 0 1cqw; font-size: 3cqw; font-weight: 800; line-height: 1.15; color: #114B5F; }
.certificate__courses { max-width: 80%; margin: 0; font-size: 1.15cqw; line-height: 1.6; color: #6B6F82; }
.certificate__footer {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  align-items: end;
  gap: 2cqw;
  width: 100%;
  margin-top: auto;
}
.certificate__meta { display: flex; flex-direction: column; gap: 0.3cqw; text-align: left; font-size: 1.3cqw; font-weight: 700; }
.certificate__meta--right { text-align: right; }
.certificate__label { font-size: 0.95cqw; font-weight: 800; letter-spacing: 0.15em; text-transform: uppercase; color: #868A9C; }
.certificate__verify { font-size: 0.95cqw; font-weight: 600; color: #868A9C; }
.certificate__signature { display: flex; flex-direction: column; align-items: center; gap: 0.4cqw; font-size: 1.2cqw; font-weight: 700; }
.certificate__signature img { width: 17cqw; height: auto; padding-bottom: 0.4cqw; border-bottom: 0.12cqw solid #2D3142; }

@page { size: A4 landscape; margin: 0; }
@media print {
  .certificate-toolbar { display: none; }
  .certificate-page { background: #FFFFFF; }
  .certificate-wrap { max-width: none; padding: 0; }
  .certificate { width: 297mm; height: 210mm; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* ── Narrow screens ── */

@media (max-width: 1100px) {
  .course-hero__inner { grid-template-columns: minmax(0, 1fr) 320px; }
  .course-layout, .lesson-layout { grid-template-columns: minmax(0, 1fr); }
  .course-layout__side, .lesson-layout__side { position: static; }
  .outline-panel { max-height: none; }
  .track-hero__inner { grid-template-columns: 100px minmax(0, 1fr); }
  .track-hero__inner .facts--stacked { grid-column: 2; }
  .track-hero__icon { width: 100px; height: 112px; }
}

@media (max-width: 900px) {
  .site-header__inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 0; row-gap: 4px; }
  .main-nav { order: 3; width: 100%; margin: 0 -6px; padding-bottom: 8px; overflow-x: auto; scrollbar-width: none; }
  .main-nav a { padding: 6px 12px; font-size: 0.75rem; white-space: nowrap; }
  .header-actions { margin-left: auto; }
  .site-container { padding: 20px 16px 0; }
  .page-band__inner--split { flex-direction: column; align-items: stretch; }
  .search-form { min-width: 0; }
  .course-hero__inner { grid-template-columns: minmax(0, 1fr); padding-top: 24px; padding-bottom: 24px; }
  .course-hero__img { order: -1; }
  .prose.panel { padding: 22px 18px; }
  .course-questions { padding: 20px 18px; }
  .prose .alignright, .prose .alignleft { float: none; margin: 1em auto; max-width: 100%; }
  .lesson-head h1, .post-head h1 { font-size: 1.625rem; }
  .pager { flex-direction: column; }
  .pager a { max-width: none; }
  .track-hero__inner { grid-template-columns: minmax(0, 1fr); padding-top: 28px; padding-bottom: 28px; gap: 16px; }
  .track-hero__inner .facts--stacked { grid-column: auto; }
  .track-course { gap: 12px; }
  .track-course__img { display: none; }
  .post-card { grid-template-columns: minmax(0, 1fr); }
  .post-card__img { max-height: 180px; }
  .post-card__body { grid-column: 1; }
  .site-footer__inner { padding: 22px 16px; }
}

/* ── School accounts (Module 16) ─────────────────────────────────────────── */
.form-ok { color: #1F9D5C; font-weight: 700; }
.header-logout { margin: 0; }
.header-logout button { padding: 0.45rem 0.8rem; margin: 0; }
.login-panel { text-align: left; width: 100%; }
.login-panel h1 { text-align: center; }
.login-form button { width: 100%; }
.login-panel__help { margin: 16px 0 0; color: var(--oh-subtle); font-size: 0.875rem; text-align: center; }
.school-back { display: inline-block; margin-bottom: 8px; font-weight: 600; font-size: 0.875rem; text-decoration: none; }
.school-courses { display: grid; gap: 20px; }
.school-course { padding: 24px; }
.school-course__head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.school-course__head h2 { font-size: 1.25rem; margin: 0; }
.school-course__head a { text-decoration: none; }
.school-course__count { color: var(--oh-subtle); font-weight: 700; font-size: 0.875rem; }
.school-lessons { margin: 16px 0; padding-left: 1.4em; }
.school-lessons li { margin: 4px 0; display: flex; justify-content: space-between; gap: 12px; list-style: decimal; display: list-item; }
.school-lessons .is-done a { color: var(--oh-heading); }
.school-status { float: right; font-size: 0.8125rem; font-weight: 700; color: var(--oh-subtle); }
.school-status--done { color: #1F9D5C; }
.school-status--started { color: var(--oh-orange); }
.school-class-card { display: block; padding: 24px; text-decoration: none; color: inherit; }
.school-class-card h2 { font-size: 1.2rem; margin: 10px 0 6px; }
.school-class-card p { margin: 0; color: var(--oh-subtle); }
.table-scroll { overflow-x: auto; margin-bottom: 32px; }
.school-grid th small { display: block; font-weight: 400; color: var(--oh-subtle); }
.school-grid td { min-width: 120px; }
.school-grid__pct { font-size: 0.8125rem; font-weight: 700; color: var(--oh-subtle); }
.school-grid__seen { white-space: nowrap; color: var(--oh-subtle); }
.school-filter { max-width: 360px; }
.school-tree { list-style: none; padding: 0; }
.school-tree li { list-style: none; }
.school-tree > li { border-bottom: 1px solid var(--oh-border); padding: 6px 0; }
.school-tree details { margin: 0; }
.school-tree summary { display: flex; align-items: center; gap: 12px; }
.school-tree summary small { color: var(--oh-subtle); margin-left: auto; }
.school-tree ul { padding-left: 1.6em; margin: 6px 0; }
.school-tree label { display: inline-flex; gap: 8px; align-items: center; margin: 2px 0; }
.school-save { position: sticky; bottom: 0; padding: 16px 0; background: var(--oh-bg); }
.school-add { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; margin-bottom: 12px; }
.school-add .panel { padding: 24px; margin: 0; }
.school-add h2 { font-size: 1.15rem; margin-bottom: 8px; }
.school-seats { color: var(--oh-subtle); font-weight: 600; }
.school-inline { display: flex; gap: 8px; align-items: center; margin: 0; }
.school-inline input { margin: 0; min-width: 0; }
.school-inline button { margin: 0; white-space: nowrap; }
.school-actions { display: flex; gap: 8px; justify-content: flex-end; }
.school-actions form { margin: 0; }
.school-actions button { margin: 0; white-space: nowrap; }
.school-created { padding: 24px; border-left: 4px solid var(--oh-orange); }
.school-admin-form { padding: 24px; margin-bottom: 32px; }
.school-sheet__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 24px 0; }
.school-sheet__bar p { margin: 0; flex: 1 1 260px; }
.school-sheet__cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.school-sheet__card { border: 1px dashed var(--oh-border); border-radius: 8px; padding: 16px; break-inside: avoid; background: var(--oh-surface); }
.school-sheet__name { font-weight: 800; font-size: 1.1rem; margin: 10px 0 0; }
.school-sheet__class { color: var(--oh-subtle); margin: 0 0 10px; font-size: 0.875rem; }
.school-sheet__card dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; font-size: 0.875rem; }
.school-sheet__card dt { font-weight: 700; }
.school-sheet__card dd { margin: 0; word-break: break-all; }
@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  .school-sheet__cards { grid-template-columns: repeat(2, 1fr); }
  .school-sheet__card { background: #fff; }
}

/* ── Email settings (Module 10) ──────────────────────────────────────────── */
.email-settings fieldset { border: 1px solid var(--oh-border); border-radius: 8px; padding: 12px 16px; margin: 16px 0; }
.email-settings label { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.email-settings__all { font-weight: 700; }

/* Member dashboard (/dashboard/) */
.dashboard__section { margin-bottom: 40px; }
/* Sizes as the old dashboard's (custom-pages-style.css): 24px section titles, 18px card titles, 12px "N% Completed" */
.dashboard .section-title { font-weight: 600; }
.dashboard .section-link { font-weight: 600; }
.dashboard .course-card__title { font-weight: 600; margin-bottom: 20px; }
.dashboard .course-card__meta, .dashboard .track-tile__meta { display: none; }
.dashboard .progress-label { font-weight: 400; }
.dashboard .course-card .progress-label { color: var(--oh-subtle); }
/* The old dashboard's new courses: a divider across the card, then a teal FIND OUT MORE (btn-style2) */
.course-card__cta { display: block; margin: auto -20px 0; padding: 20px 20px 0; border-top: 1px solid var(--oh-divider); }
.course-card__button { display: inline-block; padding: 10px 16px; border-radius: var(--oh-radius-sm); background: var(--oh-teal); color: #fff; font-size: 0.875rem; font-weight: 600; line-height: 1.75; letter-spacing: 1.6px; text-transform: uppercase; transition: background-color .2s; }
.course-card:hover .course-card__button { background: var(--oh-navy); }
.dashboard .track-tile { min-height: 360px; padding: 48px; gap: 0; }
.dashboard .track-tile__icon { width: 80px; height: 80px; margin-bottom: 26px; }
.dashboard .track-tile__title { margin: 16px 0; font-weight: 600; line-height: 1.33; }
.dashboard .label, .dashboard-featured .label { padding: 6px 12px; font-size: 0.875rem; font-weight: 600; letter-spacing: 0; line-height: 1.43; }
.dashboard .dashboard-more__text { font-size: 1.125rem; font-weight: 600; }
.dashboard__columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; align-items: start; }

/* What the old dashboard ("Dashboard 3.0") showed: who you are, your rank and numbers, your intensive or track */
.dashboard-top__inner { display: flex; flex-wrap: wrap; gap: 22px; padding: 24px; border-radius: 12px; background: var(--oh-band); }
/* Old .personal-info: two thirds of the band; you and your rank on the left (42 %), the four numbers on the right */
.dashboard-top__card { flex: 0 0 66%; min-width: 0; display: flex; flex-wrap: wrap; align-items: stretch; padding: 32px; border-radius: 8px; background: var(--oh-surface); }
.dashboard-top__me { width: 42%; display: flex; flex-direction: column; }
.dashboard-top__person { display: flex; gap: 18px; align-items: flex-start; }
.dashboard-top__avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex: none; }
.dashboard-top__avatar--empty { display: inline-flex; align-items: center; justify-content: center; background: var(--oh-slate); color: #fff; font-weight: 700; font-size: 1.375rem; flex: none; }
.dashboard-top__name { font-size: 1.5rem; font-weight: 500; line-height: normal; margin: -3px 0 0; color: var(--oh-heading); }
.dashboard-top__link { display: block; margin-top: 5px; font-size: 0.875rem; line-height: 1.43; font-weight: 600; color: var(--oh-orange); text-decoration: none; }
.dashboard-top__link:hover { color: var(--oh-orange-hover); }
.dashboard-top__rank { display: flex; gap: 18px; align-items: flex-start; margin-top: 15px; padding-top: 11px; border-top: 1px solid var(--oh-divider); }
.dashboard-top__rank-icon { width: 40px; height: 40px; flex: none; margin-top: 6px; border-radius: 50%; object-fit: cover; }
.dashboard-top__rank-info { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 1rem; line-height: 1.5; color: var(--oh-heading); }
.dashboard-top__rank-info > :first-child { margin-top: 5px; }
.dashboard-top__rank-info .progress { margin-top: 10px; }
.dashboard-top__rank-info > :last-child { margin-top: 4px; line-height: normal; }
.dashboard-top__rank-info strong { font-weight: 800; margin-right: 4px; }
.dashboard-top__points { color: var(--oh-muted); }
.dashboard-top__stats { width: 58%; padding-left: 32px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 12px; }
/* Old .key-info-boxes__box: the number centred in what the label leaves */
.dashboard-stat { display: flex; align-items: center; padding: 12px; border-radius: 8px; background: var(--oh-surface-sunk); overflow: hidden; }
.dashboard-stat__number { flex: 1 0 auto; min-width: 40px; white-space: nowrap; text-align: center; font-size: 2rem; font-weight: 500; line-height: 40px; color: var(--oh-subtle); }
.dashboard-stat__text { flex: 0 0 82px; padding-left: 12px; font-size: 0.875rem; font-weight: 500; line-height: 16px; color: var(--oh-muted); }
/* Old .current_track: the last third */
.dashboard-featured { flex: 1 1 0; min-width: 0; display: flex; align-items: center; justify-content: center; gap: 24px; padding: 41px 32px; border-radius: 8px; background: var(--oh-slate); color: #fff; text-decoration: none; transition: background-color .2s; }
.dashboard-featured:hover { background: var(--oh-slate-hover); color: #fff; }
.dashboard-featured__icon { flex: none; width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.dashboard-featured__body { display: flex; flex-direction: column; flex: 1; min-width: 0; text-align: left; }
.dashboard-featured__title { margin: 16px 0; font-size: 1.125rem; font-weight: 600; line-height: 1.33; }
.dashboard-featured .label { align-self: flex-start; }
.dashboard-featured .progress { display: block; margin-top: 10px; background: rgba(255, 255, 255, 0.85); }
.dashboard-featured .progress__bar { display: block; }
.dashboard-featured .progress-label { font-weight: 400; color: #F9F9F9; }
.dashboard-more { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; min-height: 200px; padding: 24px; border: 2px dashed var(--oh-border); border-radius: var(--oh-radius); text-align: center; }
.dashboard-more__text { font-weight: 700; color: var(--oh-heading); }
.dashboard-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.dashboard-action { display: flex; align-items: center; gap: 24px; padding: 20px; border-radius: 12px; background: var(--oh-orange-soft); color: #fff; font-size: 1.5rem; line-height: 1.15; font-weight: 600; text-decoration: none; transition: background-color .2s; }
.dashboard-action__icon { flex: none; width: 64px; height: 64px; }
@media (max-width: 1000px) { .dashboard-action { font-size: 1.125rem; gap: 16px; padding: 14px; } .dashboard-action__icon { width: 48px; height: 48px; } }
/* The old dashboard's colours for its three community actions (custom-pages-style.css .action1–3) */
.dashboard-action--1 { background: #E86B59; }
.dashboard-action--1:hover { background: #d56252; color: #fff; }
.dashboard-action--2 { background: #F7A541; }
.dashboard-action--2:hover { background: #f79b29; color: #fff; }
.dashboard-action--3 { background: #114B5F; }
.dashboard-action--3:hover { background: #2D3142; color: #fff; }
.dashboard__columns--two { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 40px; }
.dashboard-posts { margin-top: 12px; padding: 4px 0; border-radius: var(--oh-radius); background: var(--oh-surface); box-shadow: var(--oh-shadow); }
.dashboard-post { display: flex; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--oh-divider); border-left: 3px solid transparent; transition: background-color .2s, border-color .2s; }
.dashboard-post:last-child { border-bottom: 0; }
.dashboard-post:hover { background: var(--oh-surface-hover); border-left-color: var(--oh-orange); }
.dashboard-post .dashboard-post__avatar.dashboard-top__avatar--empty { background: var(--oh-orange); color: #fff; }
.dashboard-post__avatar { width: 32px; height: 32px; margin-top: 4px; border-radius: 50%; object-fit: cover; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.dashboard-post__title { font-size: 1.125rem; font-weight: 600; line-height: 1.33; color: var(--oh-title); text-decoration: none; }
.dashboard-post__excerpt { margin: 8px 0; font-size: 0.875rem; font-weight: 500; line-height: 1.43; color: var(--oh-subtle); }
.dashboard-post .muted { font-size: 0.875rem; font-weight: 500; }
.dashboard-tools { list-style: none; margin: 12px 0 0; padding: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; border-radius: var(--oh-radius); background: var(--oh-surface); box-shadow: var(--oh-shadow); }
.dashboard-tools li { list-style: none; margin: 0; padding: 0; }
.dashboard-tools li::marker { content: none; }
/* As the old dashboard drew them: a coloured square per tool, the name beside it */
.dashboard-tools a { display: flex; align-items: center; gap: 20px; padding: 12px; font-size: 1rem; border-radius: 16px; color: var(--oh-heading); font-weight: 600; line-height: 1.25; text-decoration: none; transition: background-color .2s; }
.dashboard-tools a:hover { background: var(--oh-surface-hover); }
.dashboard-tools__icon { flex: none; width: 60px; height: 60px; border-radius: 12px; }
@media (max-width: 500px) { .dashboard-tools { grid-template-columns: minmax(0, 1fr); padding: 12px; } }
/* The old dashboard's breakpoints (custom-pages-style.css) */
@media (max-width: 1200px) { .dashboard-top__stats { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 835px) {
  .dashboard-top__card { flex-basis: 50%; }
  .dashboard-top__me, .dashboard-top__stats { width: 100%; }
  .dashboard-top__stats { padding-left: 0; margin-top: 21px; }
}
@media (max-width: 680px) {
  .dashboard-top__inner { margin: 0 -16px; padding: 20px; row-gap: 12px; }
  .dashboard-top__card, .dashboard-featured { flex-basis: 100%; }
  .dashboard-top__card { padding: 20px; }
}
.dashboard__list { list-style: none; margin: 0 0 8px; padding: 0; }
.dashboard__list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 8px 0; border-bottom: 1px solid var(--oh-border); }
.dashboard__list li:last-child { border-bottom: 0; }

/* Account area (Module 1 § Account pages): one tab row over four pages */
.account-tabs { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 4px; margin: 0; padding: 0; border-bottom: 1px solid var(--oh-border); }
.account-tabs__tab {
  margin-bottom: -1px; padding: 10px 16px; border-bottom: 3px solid transparent;
  color: var(--oh-subtle); font-weight: 700; text-decoration: none;
}
.account-tabs__tab:hover { color: var(--oh-heading); }
.account-tabs__tab.is-active { color: var(--oh-heading); border-bottom-color: var(--oh-orange); }
.account { padding-top: 24px; padding-bottom: 40px; }
.account:not(.account__columns) > .panel + .panel { margin-top: 24px; }
.account .login-panel__help { display: block; text-align: left; }
.account__columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; align-items: start; }
.account__form { max-width: 420px; }
.account__form button, .account .email-settings button, .account .avatar-edit label[role=button] { width: auto; }

/* Contact and support forms (Module 17): the honeypot field is off-screen, not display:none, which some bots skip */
.message-form__hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Thank-you page (Module 18) */
.checkout-success { text-align: left; }
.checkout-success__message img { max-width: 100%; height: auto; }
.checkout-success__actions { margin: 16px 0; }
.account__billing { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin: 16px 0 0; }
.account__billing button { width: auto; margin: 0; }

/* Gift cards (Module 19) */
.gift-code { font-size: 1rem; letter-spacing: 0.08em; }

/* Admin (Module 20) */
.admin-index .panel { display: block; color: inherit; text-decoration: none; margin: 0; }
.admin-index h2 { margin-top: 0; }
.admin-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; margin-bottom: 24px; }
.admin-stats .panel { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.admin-stats strong { font-size: 1.75rem; color: var(--oh-heading); }
.admin-stats__label { font-size: 0.8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--oh-subtle); }
.admin-reports table, .admin-members table { width: 100%; font-size: 0.9375rem; }
.admin-reports .panel, .admin-members .panel { overflow-x: auto; }
.admin-members td form { margin: 0; }
.admin-members td button { margin: 0; padding: 4px 10px; font-size: 0.8125rem; width: auto; }
.admin-danger { border: 2px solid var(--oh-coral); }
.avatar-edit__row { display: flex; gap: 16px; align-items: flex-start; }
.avatar-edit__img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; flex: none; }
.avatar-edit__img--empty { display: grid; place-items: center; background: var(--oh-orange); color: #fff; font-weight: 800; font-size: 1.75rem; }
.avatar-edit label[role=button] { width: auto; margin-bottom: 4px; }
.avatar-edit form button { width: auto; margin-top: 8px; }

/* Quizzes (Module 23) */
.quiz { margin: 24px 0; }
.quiz__title { margin-top: 0; font-size: 1.25rem; }
.quiz__question { border: 1px solid var(--oh-border); border-radius: 8px; padding: 12px 16px; margin: 0 0 16px; }
.quiz__question legend, .quiz__question > div:first-of-type { font-weight: 700; }
.quiz__question legend p, .quiz__question p { margin: 0; }
.quiz__choice { display: flex; gap: 8px; align-items: center; margin: 6px 0; font-weight: 400; }
.quiz__choice--correct { color: #1F9D5C; font-weight: 700; }
.quiz__choice--wrong { color: var(--oh-coral); }
.quiz__image { max-width: 100%; height: auto; margin: 8px 0; }
.quiz__verdict { font-weight: 800; }
.quiz__question--right .quiz__verdict { color: #1F9D5C; }
.quiz__question--wrong .quiz__verdict { color: var(--oh-coral); }
.quiz__explanation { margin-top: 8px; padding: 8px 12px; background: var(--oh-band); border-radius: 6px; }
.quiz__again a { width: auto; padding: 8px 20px; }

/* <child-pages/>: the pages under this one */
.child-pages { columns: 2 16rem; padding-left: 1.2rem; }
.admin-filters { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: flex-end; padding: 16px; }
.admin-filters label { display: flex; flex-direction: column; gap: 4px; font-size: 0.8125rem; margin: 0; }
.admin-filters input, .admin-filters select { margin: 0; width: auto; }
.admin-bulk__bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 16px 0 8px; }
.admin-bulk__bar select, .admin-bulk__bar input, .admin-bulk__bar button { margin: 0; width: auto; }
.admin-list table { font-size: 0.875rem; }
.admin-list td { vertical-align: top; }
.admin-pages { margin: 16px 0 32px; }
.admin-form .panel { padding: 24px; margin-bottom: 24px; max-width: 720px; }
.admin-form label { display: block; margin-bottom: 12px; }
.admin-lessons { margin: 4px 0 0; padding-left: 18px; font-size: 0.8125rem; }
/* A course the reader may not open (views/site/course.ejs): the theme's members-only message under the teaser */
.course-gate { padding: 28px; }
.course-gate h2 { margin: 10px 0 12px; }
.course-gate .gate__actions { justify-content: flex-start; }
.admin-forums h2 { margin: 32px 0 8px; }
.admin-forums td { vertical-align: middle; }
.admin-forums td input[type="text"], .admin-forums td select { margin: 0; min-width: 200px; }
.admin-forums td small { display: block; margin-top: 2px; }
.admin-forums input.admin-forums__order { margin: 0; width: 5.5rem; }
.admin-forums button { width: auto; margin: 0; }
.admin-forums .login-panel__help { text-align: left; }
.admin-forums td input[type="checkbox"] { margin: 0; }
.admin-forums__hidden td:not(:first-child) { opacity: 0.6; }

/* The community feed for a viewer no forum opens for (views/feed.ejs) */
.feed-gate h2 { margin: 12px 0 8px; }
.feed-gate p { color: var(--oh-subtle); }
.feed-gate .gate__actions { justify-content: flex-start; }
/* The same box on a protected page or project (views/site/theme/members-only.ejs), inside the theme's column */
.page-gate { margin: 8px 0 32px; font-size: 1rem; line-height: 1.55; }
.page-gate p { margin: 0 0 20px; }
