/* Learning modules, public pages. Colour and type values are the ones
   .ocd-page-hero already uses in overrides.css, so these pages sit inside
   the existing brand rather than beside it. Mobile first: every rule is
   written for 390px and widened at 640 / 900 / 1024. */

.lrn, .lrn-modal {
  --lrn-cream: #f7efdf;
  --lrn-ink: #0e2a1b;
  --lrn-green: #1c6b3c;
  --lrn-accent: #2f9e4f;
  --lrn-muted: #5f7a6c;
  --lrn-line: #cfe6d8;
  --lrn-tint: #f0fbf3;
  --lrn-body: #2b4a39;
  --lrn-page: #f7fcf8;
  --lrn-display: 'Lora', Georgia, 'Times New Roman', serif;
  overflow-x: clip;
}
.lrn a:focus-visible,
.lrn button:focus-visible { outline: 2px solid var(--lrn-accent); outline-offset: 2px; }

/* Landing fold: the video and the mission copy share one cream band. */
.lrn-fold { background: var(--lrn-cream); color: var(--lrn-ink); padding: 20px 0 36px; }
.lrn-fold__wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; display: grid; gap: 24px; }
.lrn-fold__video { display: flex; justify-content: center; }
.lrn-fold__video video {
  display: block; width: auto; height: auto; max-width: 100%; max-height: min(64vh, 560px);
  border-radius: 14px; background: #000;
}
.lrn-kicker {
  margin: 0 0 10px; font-size: 12px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--lrn-green);
}
.lrn-fold h1 {
  margin: 0 0 16px; font-family: var(--lrn-display); font-weight: 500;
  font-size: clamp(30px, 4.4vw, 44px); line-height: 1.12; letter-spacing: -.015em; color: var(--lrn-ink);
}
.lrn-mission p { margin: 0 0 14px; max-width: 58ch; font-size: 17px; line-height: 1.6; color: var(--lrn-body); }
.lrn-mission p:last-child { margin-bottom: 0; }
.lrn-fold__sig { margin: 18px 0 0; font-family: var(--lrn-display); font-style: italic; font-size: 16px; color: var(--lrn-ink); }
@media (min-width: 900px) {
  .lrn-fold { padding: 36px 0 48px; }
  .lrn-fold__wrap { grid-template-columns: auto minmax(0, 1fr); gap: 56px; align-items: center; padding: 0 24px; }
  .lrn-fold__video video { max-height: 560px; max-width: min(100%, 640px); }
}

/* Landing body */
.lrn-main { max-width: 1180px; margin: 0 auto; padding: 28px 16px 56px; }
/* Landing note: the section is new and growing */
.lrn-note { margin: 0 0 24px; padding: 18px 18px 6px; border-left: 3px solid var(--lrn-accent); background: var(--lrn-tint); }
.lrn-note h2 { margin: 0 0 8px; font-family: var(--lrn-display); font-weight: 500; font-size: 21px; line-height: 1.25; color: var(--lrn-ink); }
.lrn-note p { margin: 0 0 12px; max-width: 64ch; font-size: 16px; line-height: 1.6; color: var(--lrn-body); }
.lrn-note__link {
  display: inline-flex; align-items: center; min-height: 44px; color: var(--lrn-green); font-weight: 600;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.lrn-note__link:hover { text-decoration-thickness: 2px; }
.lrn-note__link:focus-visible { outline: 2px solid var(--lrn-accent); outline-offset: 2px; }
@media (min-width: 900px) { .lrn-note { padding: 22px 26px 8px; margin-bottom: 28px; } }
.lrn-catbar {
  position: sticky; top: 64px; z-index: 20; margin: 0 -16px; padding: 8px 0;
  background: var(--lrn-page); border-bottom: 1px solid var(--lrn-line);
}
/* One strip that scrolls sideways under the thumb; sticks under the fixed 64px site header. */
.lrn-catnav {
  display: flex; flex-wrap: nowrap; gap: 8px; margin: 0; padding: 0 16px; list-style: none;
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scroll-padding-inline: 16px;
  -webkit-overflow-scrolling: touch;
}
@media (hover: none) { .lrn-catnav { scrollbar-width: none; } }
@media (hover: hover) and (pointer: fine) { .lrn-catnav { scrollbar-width: thin; } }
@media (hover: none) { .lrn-catnav::-webkit-scrollbar { display: none; } }
.lrn-catnav li { flex: 0 0 auto; scroll-snap-align: start; }
.lrn-catnav a {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--lrn-line); background: #fff; color: var(--lrn-green);
  font-weight: 600; font-size: 14px; white-space: nowrap; text-decoration: none; touch-action: manipulation;
}
.lrn-catnav a:hover { background: var(--lrn-tint); }
/* scroll-margin clears the sticky strip (html already pads 72px for the header). */
.lrn-cat { padding: 20px 0 4px; border-top: 1px solid var(--lrn-line); margin-top: 20px; scroll-margin-top: 51px; }
.lrn-cat:first-of-type { margin-top: 0; border-top: 0; }
.lrn-cat__head { display: grid; gap: 6px; margin: 0 0 8px; }
.lrn-cat__head h2 {
  margin: 0; font-family: var(--lrn-display); font-weight: 500; font-size: clamp(22px, 3vw, 32px);
  line-height: 1.15; letter-spacing: -.01em; color: var(--lrn-ink);
}
.lrn-cat__head h2 a { color: inherit; text-decoration: none; }
.lrn-cat__head h2 a:hover { color: var(--lrn-green); }
.lrn-cat__desc { margin: 6px 0 0; max-width: 62ch; font-size: 15px; line-height: 1.5; color: var(--lrn-muted); }
.lrn-subs { display: flex; flex-wrap: wrap; gap: 0 14px; margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.lrn-subs a {
  display: inline-flex; align-items: center; min-height: 44px; color: var(--lrn-green);
  text-decoration: underline; text-decoration-color: rgba(28, 107, 60, .3); text-underline-offset: 4px;
}
.lrn-subs a:hover { text-decoration-color: var(--lrn-green); }
@media (min-width: 640px) {
  .lrn-cat { padding: 32px 0 8px; margin-top: 28px; }
  .lrn-cat:first-of-type { margin-top: 20px; }
  .lrn-cat__head { gap: 12px; margin: 0 0 20px; }
  .lrn-cat__desc { margin-top: 8px; font-size: 16px; line-height: 1.55; }
}
.lrn-empty { margin: 0 0 20px; font-size: 15px; color: var(--lrn-muted); }
@media (min-width: 640px) { .lrn-syllabus, .lrn-lesson, .lrn-watch { padding-left: 1.5rem; padding-right: 1.5rem; } }
@media (min-width: 1024px) { .lrn-syllabus, .lrn-lesson, .lrn-watch { padding-left: 2rem; padding-right: 2rem; } }

/* Lesson cards. Phone: a compact row, small thumb left, text right, hairline between
   (the same shape as .lrn-row on the category page). 640 and up: the grid card. */
.lrn-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; max-width: 980px; }
.lrn-card {
  display: flex; align-items: flex-start; gap: 12px; min-height: 44px; padding: 14px 0;
  border-bottom: 1px solid var(--lrn-line); text-decoration: none; color: inherit;
}
.lrn-cards > li:last-child .lrn-card { border-bottom: 0; }
.lrn-card:hover h3 { color: var(--lrn-green); }
.lrn-card__media {
  position: relative; flex: 0 0 112px; aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--lrn-tint);
}
.lrn-card__media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lrn-card__body { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; }
.lrn-card__row { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.lrn-card__num { font-size: 12px; color: var(--lrn-muted); font-variant-numeric: tabular-nums; }
.lrn-card__sub { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11.5px; font-weight: 500; color: var(--lrn-green); }
.lrn-card h3 {
  margin: 0; font-family: var(--lrn-display); font-weight: 600; font-size: 16px; line-height: 1.3; color: var(--lrn-ink);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.lrn-card p {
  margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--lrn-body);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.lrn-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: auto; padding-top: 6px; font-size: 12.5px; color: var(--lrn-muted); }
.lrn-card .lrn-meta { gap: 2px 12px; padding-top: 2px; font-size: 12px; }
.lrn-meta span { display: inline-flex; align-items: center; gap: 5px; }
.lrn-meta svg { width: 14px; height: 14px; flex-shrink: 0; }
@media (min-width: 640px) {
  .lrn-cards { gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
  .lrn-card {
    flex-direction: column; align-items: stretch; gap: 0; height: 100%; padding: 0; background: #fff;
    border: 1px solid var(--lrn-line); border-radius: 14px; overflow: hidden;
  }
  .lrn-cards > li:last-child .lrn-card { border-bottom: 1px solid var(--lrn-line); }
  .lrn-card:hover { border-color: #a8deb5; }
  .lrn-card__media { flex: none; border-radius: 0; }
  .lrn-card__body { gap: 8px; padding: 16px 16px 18px; }
  .lrn-card__sub { overflow: visible; white-space: normal; }
  .lrn-card h3 { display: block; font-size: 18px; overflow: visible; }
  .lrn-card p { display: block; font-size: 14.5px; line-height: 1.55; overflow: visible; }
  .lrn-card .lrn-meta { padding-top: 6px; font-size: 12.5px; }
}
@media (min-width: 1024px) { .lrn-cards { gap: 20px; } }

/* Category page: the syllabus */
.lrn-syllabus { max-width: 48rem; margin: 0 auto; padding: 20px 1rem 56px; }
.lrn-group { margin: 0 0 36px; scroll-margin-top: 80px; }
.lrn-group h2 { margin: 0 0 6px; font-family: var(--lrn-display); font-weight: 500; font-size: 24px; line-height: 1.2; color: var(--lrn-ink); }
.lrn-group__desc { margin: 0 0 14px; font-size: 15px; line-height: 1.55; color: var(--lrn-muted); }
.lrn-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--lrn-line); }
/* Same shape as the phone lesson card: small thumb left, text right. */
.lrn-row {
  display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 0 12px; align-items: start;
  min-height: 44px; padding: 14px 0; border-bottom: 1px solid var(--lrn-line); text-decoration: none; color: inherit;
}
.lrn-row:hover h3 { color: var(--lrn-green); }
.lrn-row__thumb { aspect-ratio: 16 / 9; border-radius: 8px; overflow: hidden; background: var(--lrn-tint); }
.lrn-row__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lrn-row__body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.lrn-row__num { font-size: 12px; line-height: 1.3; color: var(--lrn-muted); font-variant-numeric: tabular-nums; }
.lrn-row h3 {
  margin: 0; font-family: var(--lrn-display); font-weight: 600; font-size: 16px; line-height: 1.3; color: var(--lrn-ink);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.lrn-row p {
  margin: 0; font-size: 13.5px; line-height: 1.45; color: var(--lrn-body);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.lrn-row .lrn-meta { gap: 2px 12px; padding-top: 2px; font-size: 12px; }
@media (min-width: 640px) {
  .lrn-row { grid-template-columns: 160px minmax(0, 1fr); gap: 0 16px; padding: 16px 0; }
  .lrn-row__thumb { border-radius: 10px; }
  .lrn-row__body { gap: 6px; }
  .lrn-row h3 { display: block; font-size: 18px; overflow: visible; }
  .lrn-row p { display: block; font-size: 14.5px; line-height: 1.55; overflow: visible; }
  .lrn-row .lrn-meta { font-size: 12.5px; }
}

/* Lesson page */
.lrn-lesson { max-width: 48rem; margin: 0 auto; padding: 20px 1rem 56px; }
.lrn-video { margin: 0 0 28px; }
.lrn-video__link {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-top: 4px;
  color: var(--lrn-green); font-weight: 600; font-size: 14px; text-decoration: none;
}
.lrn-video__link svg { width: 16px; height: 16px; }
.lrn-video__link:hover { text-decoration: underline; }
.lrn-lesson .ocd-prose { font-size: 17px; line-height: 1.65; }
.lrn-lesson .ocd-prose img { max-width: 100%; height: auto; border-radius: 10px; }
.lrn-lesson .ocd-prose figure { margin: 1.5em 0; }
.lrn-lesson .ocd-prose iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; border-radius: 8px; }
.lrn-lesson .ocd-prose figcaption { margin-top: 8px; font-size: 14px; line-height: 1.5; color: var(--lrn-muted); }
/* Wide tables scroll sideways inside the column instead of crushing cells to one glyph per line on phones. */
.lrn-lesson .ocd-prose table { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border-collapse: collapse; margin: 1.5em 0; font-size: 15px; line-height: 1.5; }
.lrn-lesson .ocd-prose caption { caption-side: top; text-align: left; padding: 0 0 8px; font-size: 14px; color: var(--lrn-muted); }
.lrn-lesson .ocd-prose th,
.lrn-lesson .ocd-prose td { min-width: 11rem; padding: 10px 12px; vertical-align: top; text-align: left; border-bottom: 1px solid var(--lrn-line, rgba(0,0,0,.12)); word-break: normal; overflow-wrap: normal; }
.lrn-lesson .ocd-prose thead th { font-weight: 600; border-bottom-width: 2px; }
.lrn-lesson .ocd-prose figcaption { margin-top: 8px; font-size: 13px; color: var(--lrn-muted); }

.lrn-sources { margin: 40px 0 0; padding-top: 28px; border-top: 1px solid var(--lrn-line); }
.lrn-sources h2 { margin: 0 0 12px; font-family: var(--lrn-display); font-weight: 500; font-size: 22px; color: var(--lrn-ink); }
.lrn-cites { margin: 0; padding: 0 0 0 1.6em; font-size: 14.5px; line-height: 1.55; color: var(--lrn-muted); }
.lrn-cite { padding-left: 4px; overflow-wrap: anywhere; }
.lrn-cite + .lrn-cite { margin-top: 10px; }
.lrn-cite::marker { color: var(--lrn-green); font-weight: 600; }
.lrn-cite__title a { color: var(--lrn-ink); font-weight: 500; text-decoration: underline; text-decoration-color: #a8deb5; text-underline-offset: 3px; }
.lrn-cite__title a:hover { color: var(--lrn-green); text-decoration-color: currentColor; }
.lrn-cite__url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.lrn-docs { margin: 40px 0 0; padding-top: 28px; border-top: 1px solid var(--lrn-line); }
.lrn-docs h2 { margin: 0 0 4px; font-family: var(--lrn-display); font-weight: 500; font-size: 22px; color: var(--lrn-ink); }
.lrn-docs__lede { margin: 0 0 12px; font-size: 14.5px; color: var(--lrn-muted); }
.lrn-doclist { list-style: none; margin: 0; padding: 0; }
.lrn-doc { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 2px 12px; padding: 14px 0; border-bottom: 1px solid var(--lrn-line); }
.lrn-doc__icon {
  grid-row: span 2; width: 22px; height: 22px; color: var(--lrn-green); display: flex; align-items: center; justify-content: center;
}
.lrn-doc__icon svg { width: 22px; height: 22px; }
.lrn-doc__title { margin: 0; font-weight: 600; font-size: 15.5px; line-height: 1.35; color: var(--lrn-ink); }
.lrn-doc__meta { margin: 0; font-size: 13px; color: var(--lrn-muted); overflow-wrap: anywhere; }
.lrn-doc__actions { grid-column: 2; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.lrn-btn {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--lrn-line); background: #fff; color: var(--lrn-green);
  font: inherit; font-weight: 600; font-size: 14px; text-decoration: none; cursor: pointer; touch-action: manipulation;
}
.lrn-btn:hover { background: var(--lrn-tint); }
.lrn-btn--solid { background: var(--lrn-ink); border-color: var(--lrn-ink); color: #fff; }
.lrn-btn--solid:hover { background: #123c27; border-color: #123c27; }
.lrn-btn svg { width: 16px; height: 16px; }

.lrn-seq { display: grid; gap: 12px; margin: 40px 0 0; padding-top: 24px; border-top: 1px solid var(--lrn-line); }
.lrn-seq a {
  display: flex; flex-direction: column; gap: 4px; min-height: 44px; padding: 14px 16px;
  border: 1px solid var(--lrn-line); border-radius: 12px; background: #fff; text-decoration: none; color: inherit;
}
.lrn-seq a:hover { border-color: #a8deb5; }
.lrn-seq small { font-size: 12px; font-weight: 500; color: var(--lrn-green); }
.lrn-seq strong { font-family: var(--lrn-display); font-weight: 600; font-size: 16px; line-height: 1.3; color: var(--lrn-ink); }
@media (min-width: 640px) {
  .lrn-seq { grid-template-columns: 1fr 1fr; }
  .lrn-seq a.is-next { grid-column: 2; text-align: right; }
}

/* Watch page */
.lrn-watch { max-width: 48rem; margin: 0 auto; padding: 20px 1rem 56px; }
.lrn-watch__desc { margin: 24px 0 0; font-size: 16px; line-height: 1.6; color: var(--lrn-body); }
.lrn-watch__back {
  display: flex; align-items: center; gap: 12px; margin-top: 28px; padding: 16px;
  border: 1px solid var(--lrn-line); border-radius: 12px; background: #fff; text-decoration: none; color: inherit;
}
.lrn-watch__back:hover { border-color: #a8deb5; }
.lrn-watch__back svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--lrn-accent); }
.lrn-watch__back strong { display: block; font-family: var(--lrn-display); font-weight: 600; font-size: 16px; color: var(--lrn-ink); }
.lrn-watch__back span { display: block; font-size: 13px; color: var(--lrn-muted); }

/* Document preview modal */
.lrn-modal {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: stretch; justify-content: center;
  padding: 0; background: rgba(14, 42, 27, .72);
}
.lrn-modal[hidden] { display: none; }
.lrn-modal__panel { display: flex; flex-direction: column; width: 100%; max-width: 960px; background: #fff; }
.lrn-modal__head { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--lrn-line); }
.lrn-modal__title { flex: 1; min-width: 0; margin: 0; font-weight: 600; font-size: 15px; color: var(--lrn-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lrn-modal__close {
  display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0;
  border-radius: 10px; background: transparent; color: var(--lrn-ink); cursor: pointer; touch-action: manipulation;
}
.lrn-modal__close:hover { background: var(--lrn-tint); }
.lrn-modal__close svg { width: 20px; height: 20px; }
.lrn-modal__body { flex: 1; min-height: 0; overflow: auto; background: #fff; -webkit-overflow-scrolling: touch; }
.lrn-modal__body iframe { display: block; width: 100%; height: 100%; min-height: 70vh; border: 0; }
.lrn-modal__body pre {
  margin: 0; padding: 16px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--lrn-body);
}
.lrn-modal__doc { max-width: 72ch; margin: 0 auto; padding: 20px 16px 40px; font-size: 15.5px; line-height: 1.6; color: var(--lrn-body); }
.lrn-modal__doc h1, .lrn-modal__doc h2, .lrn-modal__doc h3 { font-family: var(--lrn-display); color: var(--lrn-ink); margin: 1.4em 0 .5em; line-height: 1.25; }
.lrn-modal__doc h1 { font-size: 1.6em; } .lrn-modal__doc h2 { font-size: 1.3em; } .lrn-modal__doc h3 { font-size: 1.1em; }
.lrn-modal__doc p, .lrn-modal__doc ul, .lrn-modal__doc ol { margin: 0 0 1em; }
.lrn-modal__doc ul, .lrn-modal__doc ol { padding-left: 1.4em; }
.lrn-modal__doc table { width: 100%; border-collapse: collapse; margin: 0 0 1em; font-size: 14px; }
.lrn-modal__doc td, .lrn-modal__doc th { padding: 6px 8px; border: 1px solid var(--lrn-line); text-align: left; vertical-align: top; }
.lrn-modal__doc img { max-width: 100%; height: auto; }
.lrn-modal__status { padding: 24px 16px; font-size: 14px; color: var(--lrn-muted); }
body.lrn-modal-open { overflow: hidden; }
@media (min-width: 640px) {
  .lrn-modal { padding: 24px; }
  .lrn-modal__panel { border-radius: 14px; overflow: hidden; }
}
