/* All courses (courses.html). Loaded after page.css (chrome, tokens, the
   home finder's tile colours and search box) and fm.css (.prod-link,
   .clear-link, .prod-sr). One list on one page, not a product page:
   - the title, one line and the search box;
   - a row of jump links (the five groups) that sticks under the 64 px
     header; the group in view is solid ink, like the header menu's;
   - the five groups in one column, each a heading, its count and a line,
     then its courses in a panel built from the home tile's own surface
     (--tile-bg, --tile-edge, radius-xl, the chevron and its hover step),
     one row per course: code, full name, Free. SOA's tracks are each their
     own heading and panel.
   While a search is on, rows that don't match hide (and empty tracks and
   groups with them); a line over the list says how many match.
   No JS: every course shows, the jump links work, the search box hides.
   Colours are Clear tokens or page tokens only. */

/* An anchor (a jump link, a breadcrumb's #soa-ila) lands below the header
   and the sticky jump links, with a little air. */
html { scroll-padding-top: 140px; }

/* ── Head: the title, one line, the search box ────────────────────── */
.cx-head { padding-top: 56px; }
.cx-title { font-size: clamp(40px, 4.6vw, 60px); line-height: 1.02; font-weight: 700; letter-spacing: -0.04em; color: var(--ink); }
.cx-lede { margin-top: 14px; max-width: 34em; font-size: 19px; line-height: 1.5; color: var(--muted-foreground); text-wrap: pretty; }
.cx-find { margin-top: 32px; max-width: 560px; }
.cx-find__label { display: block; margin-bottom: 8px; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--card-foreground); }
.cx-search { width: 100%; }
.cx-search input { height: 48px; }
/* No JS: nothing to search with, so the box goes and every course shows. */
html:not(.js) .cx-find { display: none; }

/* ── Jump links: sticky under the header ──────────────────────────── */
.cx-jump { position: sticky; top: 64px; z-index: 9; margin-top: 28px; padding: 10px 0; background: var(--page); border-bottom: 1px solid transparent; transition: border-color 200ms ease; }
/* Stuck under the header (courses.js): the header's hairline moves under
   the row, so the two read as one bar. */
.cx-jump.is-stuck { border-bottom-color: color-mix(in oklab, var(--border) 70%, transparent); }
html:has(.cx-jump.is-stuck) .site-header.is-scrolled:not(.is-menu) { border-bottom-color: transparent; }
.cx-jump__list { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 3px; margin: -3px; }
.cx-jump__list::-webkit-scrollbar { display: none; }
.cx-jump__link { display: inline-flex; align-items: center; gap: 7px; box-sizing: border-box; height: 38px; padding: 0 15px; border: 1px solid var(--border-strong); border-radius: 999px; color: var(--card-foreground); font-size: 15px; line-height: 20px; font-weight: 600; text-decoration: none; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.cx-jump__n { font-weight: 500; color: var(--muted-foreground); font-variant-numeric: tabular-nums; }
@media (hover: hover) { .cx-jump__link:hover { background: var(--nav-hover); } }
/* The group in view: solid ink. No fade between pills (it read as flicker
   in the header menu). */
.cx-jump__link[aria-current], .cx-jump__link[aria-current]:hover { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.cx-jump__link[aria-current] .cx-jump__n { color: var(--paper); }
.cx-jump__link:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--page), 0 0 0 4px var(--ring); }
.cx-jump li[hidden] { display: none; }
@media (forced-colors: active) {
  .cx-jump__link[aria-current] { forced-color-adjust: none; background: Highlight; color: HighlightText; }
  .cx-jump__link[aria-current] .cx-jump__n { color: HighlightText; }
}


/* ── The list ─────────────────────────────────────────────────────── */
/* One column, about 880 px. A size container, so a row lays itself out by
   the column's width. */
.cx-dir { padding-top: 36px; }
.cx-dir > .wrap > * { max-width: 880px; }
.cx-groups { container: cx-list / inline-size; display: grid; row-gap: 56px; }
.cx-dir [hidden] { display: none !important; }
.cx-group__top { margin-bottom: 18px; }
.cx-group__title { font-size: 30px; line-height: 36px; font-weight: 700; letter-spacing: -0.03em; color: var(--ink); }
.cx-group__meta { margin-top: 4px; font-size: 16px; line-height: 24px; color: var(--muted-foreground); text-wrap: pretty; }

/* A group with tracks (SOA): each track is its own small group, a heading
   with its count over its own panel, not a divider inside one long one. */
.cx-group__top + .cx-tracks { margin-top: 26px; }
.cx-tracks { display: grid; row-gap: 26px; }
.cx-track__title { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 6px; margin: 0 0 10px; font-size: 17px; line-height: 24px; font-weight: 700; letter-spacing: -0.012em; color: var(--ink); }
.cx-track__count { font-size: 15px; font-weight: 500; letter-spacing: 0; color: var(--muted-foreground); }

/* One panel per list: the home tile's surface. */
.cx-panel { border: 1px solid var(--tile-edge); border-radius: var(--radius-xl); background: var(--tile-bg); overflow: hidden; }
/* A hairline between visible rows only (a search hides some). */
.cx-list > li:not([hidden]) ~ li:not([hidden]) { border-top: 1px solid var(--hair-soft); }

/* A row: code | name | Free (P and FM) | chevron. One tab stop per
   course; hover is the tile's colour step, never a fade. */
.cx-row { --chev: 16px; position: relative; display: grid; grid-template-columns: 112px minmax(0, 1fr) 100px var(--chev); grid-template-areas: "code name price ."; align-items: center; column-gap: 20px; min-height: 58px; box-sizing: border-box; padding: 11px 18px 11px 20px; text-decoration: none; color: var(--muted-foreground); -webkit-tap-highlight-color: transparent; transition: background-color 150ms ease; }
.cx-code { grid-area: code; font-size: 17px; line-height: 22px; font-weight: 700; letter-spacing: -0.012em; color: var(--card-foreground); white-space: nowrap; }
.cx-name { grid-area: name; font-size: 15.5px; line-height: 22px; color: var(--foreground); text-wrap: pretty; }
.cx-price { grid-area: price; justify-self: end; font-size: 15.5px; line-height: 22px; font-weight: 600; color: var(--card-foreground); white-space: nowrap; }
.cx-price .badge--free { font-size: 12.5px; }
/* A course not open yet (Exam 6C): its month, in a quiet badge. */
.cx-price .badge--soon { font-size: 12.5px; color: var(--card-foreground); border-color: var(--border-strong); background: var(--paper); }
.cx-row::after { content: ""; position: absolute; right: 18px; top: 50%; width: var(--chev); height: 16px; margin-top: -8px; background: var(--tile-chevron);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 3.5 4.5 4.5L6 12.5'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 3.5 4.5 4.5L6 12.5'/%3E%3C/svg%3E") center / 16px 16px no-repeat;
  transition: background-color 150ms ease, transform 220ms var(--ease-signature); }
@media (hover: hover) {
  .cx-row:hover { background: var(--tile-hover); }
  .cx-row:hover::after { background: var(--primary-text); transform: translateX(2px); }
}
.cx-row:active { background: var(--tile-press); }
/* Focus sits inside the panel (its overflow would clip an outer ring). */
.cx-row:focus-visible { outline: 2px solid var(--ring); outline-offset: -3px; border-radius: var(--radius-xl); }
.cx-row:focus-visible::after { background: var(--primary-text); }
@media (prefers-reduced-motion: reduce) {
  .cx-row::after { transition: background-color 150ms ease; }
  .cx-row:hover::after { transform: none; }
}
@media (forced-colors: active) { .cx-row::after { background: LinkText; } }

/* A narrower column: a slimmer code column. */
@container cx-list (max-width: 640px) {
  .cx-row { grid-template-columns: 96px minmax(0, 1fr) 84px var(--chev); column-gap: 16px; padding-left: 18px; }
}
/* Phones and narrow tablets: the code and Free on the first line, the
   name under them across the row. */
@container cx-list (max-width: 520px) {
  .cx-row { grid-template-columns: auto minmax(0, 1fr) auto var(--chev); grid-template-areas: "code . price ." "name name name ."; column-gap: 10px; row-gap: 3px; min-height: 0; padding: 12px 14px 13px 16px; }
  .cx-row::after { right: 12px; }
  .cx-name { font-size: 15px; line-height: 21px; }
  .cx-price { font-size: 15px; }
}

/* Search on: how many match, and Clear search beside it. */
.cx-res { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; margin-bottom: 28px; }
.cx-res__title { font-size: 20px; line-height: 28px; font-weight: 650; letter-spacing: -0.015em; color: var(--ink); overflow-wrap: anywhere; }
.cx-clear { display: inline-flex; align-items: center; gap: 6px; box-sizing: border-box; height: 36px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-lg); background: transparent; color: var(--card-foreground); font: inherit; font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background-color 150ms ease; }
.cx-clear svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .cx-clear:hover { background: var(--nav-hover); } }
.cx-clear:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--page), 0 0 0 4px var(--ring); }
.cx-empty { padding: 4px 0 8px; font-size: 17px; line-height: 1.5; color: var(--muted-foreground); }

/* One short note under the list. */
.cx-notes { display: grid; row-gap: 2px; margin-top: 48px; }
.cx-notes li { display: flex; flex-wrap: wrap; align-items: center; column-gap: 12px; font-size: 16px; line-height: 22px; color: var(--muted-foreground); }


/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .cx-head { padding-top: 32px; }
  .cx-title { font-size: 40px; }
  .cx-lede { margin-top: 10px; font-size: 17px; }
  .cx-find { margin-top: 24px; }
  /* The jump links run to the screen's edges and scroll sideways. */
  .cx-jump { margin-top: 20px; }
  .cx-jump__list { margin: -3px -20px; padding: 3px 20px; scroll-padding-inline: 20px; }
  .cx-jump__link { padding: 0 14px; font-size: 14.5px; }
  .cx-dir { padding-top: 28px; }
  .cx-groups { row-gap: 48px; }
  .cx-group__title { font-size: 28px; line-height: 34px; }
  .cx-tracks { row-gap: 22px; }
  .cx-notes li { font-size: 15px; }
}
/* Touch: thumb-sized targets. */
@media (pointer: coarse) {
  .cx-jump__link { height: 44px; }
  .cx-clear { height: 44px; padding: 0 14px; }
}
