/* Univa Learning - the curriculum section (/learning/*).
   Reading-first layout on the shared blue spectrum: pale-blue canvas, deep-blue
   ink, pill everything, zero shadows, zero borders. Generated by
   scripts/build-learning.mjs; page structure is fixed, so this file owns all of
   the section's visual decisions. No JS anywhere in the section. */

/* ---------- Shell ---------- */

.learn-page {
  --learn-measure: 72ch;
  --learn-rail: 15rem;
}

.learn-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: clamp(1.25rem, 2.5vh, 2rem) var(--gutter);
}

.learn-nav-brand {
  display: block;
  height: clamp(1.5rem, 2.4vw, 2rem);
  aspect-ratio: 760 / 432;
  background: url("/univa-logo.png") left center / contain no-repeat;
  flex: none;
}

.learn-nav-link {
  background: var(--soft);
  color: var(--dark-2);
  border-radius: var(--r-pill);
  padding: 0.5rem 1.25rem;
  font-size: var(--text-small);
  font-weight: 500;
  white-space: nowrap;
  transition: transform 0.4s var(--ease-pill), background-color 0.2s var(--ease-out);
}
.learn-nav-link:hover { transform: scale(1.05); background: var(--blue-light); }

.learn-main {
  padding-inline: var(--gutter);
  padding-bottom: clamp(4rem, 10vh, 7rem);
}

/* ---------- Hero ---------- */

.learn-hero {
  max-width: 62rem;
  padding-block: clamp(2rem, 5vh, 4rem) clamp(2.5rem, 6vh, 4rem);
}

.learn-eyebrow {
  font-size: var(--text-small);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 1rem;
}
.learn-sep { padding-inline: 0.4rem; color: var(--blue-light); }
.learn-layer { color: var(--blue); }

.learn-title {
  font-size: clamp(2.25rem, 6vw, 4.5rem);
  font-weight: 600;
  line-height: 1.02;
  letter-spacing: var(--track-5);
  text-wrap: balance;
  max-width: 20ch;
}

.learn-display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.5rem, 7vw, 6rem);
  line-height: 0.95;
  letter-spacing: var(--track-5);
  color: var(--ink);
}

.learn-lede {
  max-width: 62ch;
  margin-top: 1.5rem;
  font-size: clamp(1rem, 1.5vw, 1.1875rem);
  line-height: 1.65;
  color: #3c4c78;
}

/* Meta chips (level, study time, prerequisites) */

.learn-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.75rem;
}
.learn-chip {
  background: var(--soft);
  color: var(--dark-2);
  border-radius: var(--r-pill);
  padding: 0.5rem 1.25rem;
  font-size: var(--text-small);
  line-height: 1.5;
  max-width: 100%;
}
.learn-chip b { color: var(--ink); font-weight: 600; }
.learn-chip code { background: var(--bg); }

/* Video placeholder: the slot a YouTube/TikTok embed drops into later. */

.learn-video {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.75rem;
  background: var(--ink);
  color: var(--on-dark);
  border-radius: var(--r-pill);
  padding: 0.7rem 1.5rem 0.7rem 1.25rem;
  font-size: var(--text-small);
  font-weight: 500;
}
.learn-video-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: var(--blue-bright);
  flex: none;
  animation: learn-pulse 2.4s var(--ease-out) infinite;
}
@keyframes learn-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.7); }
}
@media (prefers-reduced-motion: reduce) {
  .learn-video-dot { animation: none; }
}

/* ---------- Two-column reading layout ---------- */

.learn-cols {
  display: grid;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: start;
}
@media (min-width: 60rem) {
  .learn-cols { grid-template-columns: var(--learn-rail) minmax(0, 1fr); }
}

.learn-toc { min-width: 0; }
@media (min-width: 60rem) {
  .learn-toc { position: sticky; top: 2rem; max-height: calc(100vh - 4rem); overflow-y: auto; }
}

.learn-toc-head {
  font-size: var(--text-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.85rem;
}
.learn-toc ol {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
@media (min-width: 60rem) {
  .learn-toc ol { flex-direction: column; flex-wrap: nowrap; gap: 0.15rem; }
}
.learn-toc a {
  display: block;
  border-radius: var(--r-pill);
  padding: 0.4rem 0.9rem;
  font-size: var(--text-small);
  line-height: 1.4;
  color: var(--dark-2);
  transition: background-color 0.2s var(--ease-out), color 0.2s var(--ease-out);
}
.learn-toc a:hover { background: var(--soft); color: var(--ink); }

/* ---------- Prose ---------- */

.learn-prose {
  min-width: 0;
  max-width: var(--learn-measure);
  font-size: 1.0625rem;
  line-height: 1.75;
  color: #3c4c78;
  /* Further reading lists full URLs; let them break rather than push the page wide. */
  overflow-wrap: break-word;
}

.learn-prose > * + * { margin-top: 1.15em; }

.learn-prose h2,
.learn-prose h3,
.learn-prose h4 {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: var(--track-3);
  text-wrap: balance;
  scroll-margin-top: 1.5rem;
}
.learn-prose h2 {
  font-size: clamp(1.5rem, 3vw, 2.125rem);
  letter-spacing: var(--track-5);
  margin-top: 2.4em;
}
.learn-prose h3 { font-size: clamp(1.2rem, 2vw, 1.5rem); margin-top: 2em; }
.learn-prose h4 { font-size: 1.0625rem; margin-top: 1.8em; }

.learn-prose strong { color: var(--ink); font-weight: 600; }
.learn-prose em { font-style: italic; }

.learn-prose a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.2s var(--ease-out);
}
.learn-prose a:hover { color: var(--blue); }

.learn-prose ul,
.learn-prose ol {
  padding-left: 1.4rem;
  display: grid;
  gap: 0.5em;
}
.learn-prose ul { list-style: disc; }
.learn-prose ol { list-style: decimal; }
.learn-prose li::marker { color: var(--blue-light); }
.learn-prose li > ul,
.learn-prose li > ol { margin-top: 0.5em; }

/* Checklists: a real disabled checkbox, restyled to the blue spectrum. */
.learn-prose ul:has(> .learn-task) { list-style: none; padding-left: 0; }
.learn-task {
  display: grid;
  grid-template-columns: 1.15rem 1fr;
  gap: 0.75rem;
  align-items: start;
}
.learn-task input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.3rem 0 0;
  border-radius: 0.4rem;
  background: var(--soft);
  flex: none;
}
.learn-task input[type="checkbox"]:checked {
  background: var(--blue) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 13l4 4L19 7'/%3E%3C/svg%3E") center / 74% no-repeat;
}

.learn-prose blockquote {
  background: var(--soft);
  border-radius: var(--r-card);
  padding: 1.25rem 1.5rem;
  margin-block: 1.8em;
  color: var(--ink);
}
.learn-prose blockquote > * + * { margin-top: 0.75em; }

.learn-prose hr {
  border: 0;
  height: 1px;
  background: var(--blue-light);
  opacity: 0.5;
  margin-block: 2.75em;
}

/* Code */

.learn-prose pre {
  background: var(--ink);
  color: var(--on-dark);
  border-radius: var(--r-card);
  padding: 1.15rem 1.35rem;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.65;
  -webkit-overflow-scrolling: touch;
}
.learn-prose pre code { background: none; color: inherit; padding: 0; }

.learn-prose code,
.learn-chip code,
.learn-table-wrap code {
  font-family: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, monospace;
  font-size: 0.9em;
}
.learn-prose :not(pre) > code,
.learn-chip code {
  background: rgba(37, 99, 255, 0.1);
  color: var(--blue-deep);
  border-radius: 0.45em;
  padding: 0.1em 0.4em;
  overflow-wrap: anywhere;
}

/* ---------- Tables: scroll inside their own container, never the page ---------- */

.learn-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--r-card);
  background: var(--soft);
}
.learn-prose .learn-table-wrap { margin-block: 1.8em; }

.learn-table-wrap table {
  width: 100%;
  min-width: 34rem;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--text-small);
  line-height: 1.55;
  text-align: left;
}
.learn-table-wrap thead th {
  background: var(--ink);
  color: var(--on-dark);
  font-weight: 600;
  letter-spacing: var(--track-3);
  padding: 0.85rem 1.1rem;
  vertical-align: bottom;
  white-space: nowrap;
}
.learn-table-wrap td {
  padding: 0.85rem 1.1rem;
  vertical-align: top;
  color: #3c4c78;
}
.learn-table-wrap tbody tr:nth-child(odd) td { background: rgba(255, 255, 255, 0.55); }
.learn-table-wrap td strong { color: var(--ink); }
.learn-table-wrap a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.learn-table-wrap a:hover { color: var(--blue); }
.learn-table-wrap code { background: rgba(37, 99, 255, 0.1); color: var(--blue-deep); border-radius: 0.45em; padding: 0.1em 0.4em; }

/* ---------- Prev / next ---------- */

.learn-pager {
  display: grid;
  gap: 0.75rem;
  margin-top: clamp(3rem, 8vh, 5rem);
  max-width: 62rem;
}
@media (min-width: 42rem) {
  .learn-pager { grid-template-columns: 1fr 1fr; }
}

.learn-pager-link {
  display: grid;
  gap: 0.35rem;
  background: var(--soft);
  border-radius: var(--r-card);
  padding: 1.25rem 1.5rem;
  color: var(--ink);
  transition: background-color 0.2s var(--ease-out), transform 0.3s var(--ease-spring);
}
a.learn-pager-link:hover { background: var(--blue-light); transform: scale(1.015); }
.learn-pager-link.is-empty { background: none; }
.learn-pager-next { text-align: right; }
.learn-pager-dir {
  font-size: var(--text-small);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.learn-pager-name {
  font-size: clamp(1.05rem, 1.8vw, 1.375rem);
  font-weight: 600;
  letter-spacing: var(--track-3);
  line-height: 1.2;
}

/* ---------- Index page ---------- */

.learn-section {
  max-width: 62rem;
  margin-top: clamp(3rem, 8vh, 5rem);
}

.learn-h2 {
  font-size: clamp(1.5rem, 3.2vw, 2.5rem);
  font-weight: 600;
  letter-spacing: var(--track-5);
  color: var(--ink);
  margin-bottom: 1.5rem;
}

.learn-note {
  max-width: 62ch;
  margin-bottom: 1.75rem;
  color: #3c4c78;
  line-height: 1.7;
}

.learn-index-table td { vertical-align: middle; }
.learn-index-table a {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.learn-index-table a:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.learn-index-table .learn-num { color: var(--muted); font-variant-numeric: tabular-nums; width: 2.5rem; }
.learn-index-table .learn-time { color: var(--muted); white-space: nowrap; }
.learn-layer-tag {
  display: inline-block;
  /* A tint, not a flat token colour: the row stripe alternates between --soft and
     near-white, and either token would make the pill vanish on one of them. */
  background: rgba(37, 99, 255, 0.13);
  color: var(--blue-deep);
  border-radius: var(--r-pill);
  padding: 0.3rem 0.85rem;
  font-size: 0.8125rem;
  white-space: nowrap;
}

/* Four-week path */

.learn-weeks {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 48rem) {
  .learn-weeks { grid-template-columns: 1fr 1fr; }
}

.learn-week {
  background: var(--soft);
  border-radius: var(--r-panel);
  padding: clamp(1.5rem, 3vw, 2rem);
}
.learn-week-name {
  font-size: var(--text-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--blue);
}
.learn-week-theme {
  font-size: clamp(1.15rem, 2vw, 1.5rem);
  font-weight: 600;
  letter-spacing: var(--track-3);
  line-height: 1.15;
  color: var(--ink);
  margin-top: 0.35rem;
}
.learn-week-list {
  list-style: none;
  padding: 0;
  margin-top: 1.25rem;
  display: grid;
  gap: 0.85rem;
  font-size: var(--text-small);
  line-height: 1.6;
  color: #3c4c78;
}
.learn-week-list li {
  background: var(--bg);
  border-radius: var(--r-card);
  padding: 0.8rem 1rem;
}
.learn-week-list a { color: var(--ink); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.learn-week-list a:hover { color: var(--blue); }

.learn-done {
  max-width: 62ch;
  margin-top: 1.5rem;
  color: #3c4c78;
  line-height: 1.7;
}
.learn-done b { color: var(--ink); }

.learn-prose-tight { max-width: 62ch; }

/* ---------- Footer ---------- */

.learn-foot {
  padding: clamp(2.5rem, 6vh, 4rem) var(--gutter) clamp(2.5rem, 6vh, 4rem);
  color: var(--muted);
  font-size: var(--text-small);
  line-height: 1.7;
  display: grid;
  gap: 0.5rem;
}
.learn-foot p { max-width: 60ch; }
.learn-foot-links a { color: var(--dark-2); text-decoration: underline; text-underline-offset: 3px; }
.learn-foot-links a:hover { color: var(--blue); }
.learn-foot-links span { padding-inline: 0.4rem; color: var(--blue-light); }
