/* Course index only, loaded after mobile.css (the shared layer is not edited here).
   The rule as a manifesto; the capsule map with its upcoming capsules as one-line rows; the labs as the test sheet
   whose columns are the four ways; the strip of what the course leans on. Tokens only: light, dark, print. */

/* ---------- Hero ---------- */
/* The italic words of the title start their own line (French: « en connaissance de cause. »). */
.hub-hero h1 em { display: inline-block; }
/* The wire's two packets stay on one line at 390 in French too. */
@media (max-width: 480px) { :root:lang(fr) .wire__pkt { letter-spacing: -.02em; padding-inline: 6px; } }

/* ---------- The rule of this course: three lines, the line to remember, the small print ---------- */
.rule-card .rule-lines {
  margin: 0 0 30px; max-width: 23ch;
  font-family: var(--font-display); font-weight: 600; font-size: clamp(1.7rem, 1.1rem + 2.1vw, 2.75rem);
  line-height: 1.12; letter-spacing: -.015em; color: var(--ink); text-wrap: balance;
}
.rule-lines > span { display: block; }
.rule-lines > span + span { margin-top: .12em; }
/* The premise, then the two commitments. */
.rule-lines > span:first-child { margin-bottom: .5em; font-size: .56em; font-weight: 500; line-height: 1.3; letter-spacing: -.005em; color: var(--ink-2); }
.rule-lines em, .rule-close em {
  font-style: italic; font-weight: 500; padding-right: .06em;
  background: var(--text-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.rule-card .rule-close {
  position: relative; margin: 0 0 18px; padding-top: 24px; max-width: 46ch; text-wrap: balance;
  font: italic 500 clamp(1.16rem, 1.02rem + .55vw, 1.42rem)/1.42 var(--font-display); color: var(--ink);
}
.rule-close::before { content: ""; position: absolute; left: 0; top: 0; width: 48px; height: 2px; border-radius: 2px; background: var(--wire); }
.rule-card .rule-small { max-width: 62ch; margin-bottom: .55em; font-size: .98rem; line-height: 1.65; color: var(--ink-2); text-wrap: pretty; }

/* ---------- The capsule map: the upcoming capsules, one line each ---------- */
.course-group__lede { margin-bottom: 4px; }
.capsule-card p { text-wrap: pretty; }
.capsule-card .meta > span { white-space: nowrap; }
/* The meta's items wrap as whole items, and a line never starts or ends with "·": each item carries its dot before
   it, and the dot of the first item on a line falls in a clipped strip on the left. The text separators are for
   readers without CSS. */
.capsule-card .meta { display: flex; flex-wrap: wrap; max-width: none; margin-left: -1.4em; clip-path: inset(0 0 0 1.4em); }
.capsule-card .meta > .meta__sep { display: none; }
.capsule-card .meta > span:not(.meta__sep)::before { content: "·"; content: "·" / ""; display: inline-block; width: 1.4em; text-align: center; }
.capsules > .capsules__group > span:first-child { display: block; text-wrap: balance; }
.capsules__when { display: block; margin-top: 6px; font: 500 .76rem/1.35 var(--font-body); font-style: normal; letter-spacing: .01em; color: var(--ink-3); }
/* "Available now": quiet ink, the lit line is the signal (mint means "draws" on this course). */
.capsules__when--on { color: var(--ink-2); }

.capsules > li > .capsule-row { padding: 0; }
.capsule-row > summary {
  position: relative; display: flex; align-items: baseline; gap: 14px; min-height: 44px; padding: 9px 40px 9px 0;
  cursor: pointer; list-style: none; border-radius: 10px; -webkit-tap-highlight-color: transparent;
}
.capsule-row > summary::-webkit-details-marker { display: none; }
.capsule-row .n { flex: none; min-width: 2.2ch; font: 600 .78rem/1 var(--font-mono); letter-spacing: .04em; color: var(--ink-3); }
.capsule-row__q {
  font-family: var(--font-display); font-weight: 500; font-size: clamp(1.05rem, .98rem + .3vw, 1.18rem); line-height: 1.35;
  color: var(--ink-2); text-wrap: balance; transition: color .2s ease;
}
/* The fold's sign: a quiet plus at the end of the line, a minus once open. */
.capsule-row > summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 22px; height: 22px; margin-top: -11px; border-radius: 50%;
  border: 1px solid var(--rule-strong); opacity: .9;
  background: linear-gradient(var(--ink-3), var(--ink-3)) 50% 50% / 9px 1.5px no-repeat, linear-gradient(var(--ink-3), var(--ink-3)) 50% 50% / 1.5px 9px no-repeat;
  transition: transform .25s var(--ease-out), border-color .2s ease;
}
.capsule-row[open] > summary::after { background: linear-gradient(var(--ink-3), var(--ink-3)) 50% 50% / 9px 1.5px no-repeat; transform: rotate(180deg); }
.capsule-row > summary:hover .capsule-row__q, .capsule-row[open] .capsule-row__q { color: var(--ink); }
.capsule-row > summary:hover::after { border-color: var(--ink-3); }
.capsule-row > summary:focus-visible { outline-offset: 2px; }
.capsules .capsule-row > p { margin: 0 40px 12px calc(2.2ch + 14px + .2em) !important; font-size: .94rem; line-height: 1.55; max-width: 60ch; }
/* The node on the line sits on the row's first line. */
.capsules > li:has(> .capsule-row)::before { top: 15px; }

@media (min-width: 900px) {
  /* A station spans its capsules' rows, so a short row never waits for a long station name. */
  .capsules > .capsules__group[data-span="2"] { grid-row: span 2; }
  .capsules > .capsules__group[data-span="3"] { grid-row: span 3; }
  .capsules > .capsules__group[data-span="4"] { grid-row: span 4; }
  .capsules > .capsules__group:not(:first-child) { padding-top: 30px; contain: size; }
  .capsules > .capsules__group:not(:first-child)::before { top: calc(30px + .62em); }
  /* The first row of a station starts level with the station's name. */
  .capsules > .capsules__group + li > .capsule-row { padding-top: 24px; }
  .capsules > .capsules__group + li:has(> .capsule-row)::before { top: 39px; }
  .capsules__when { margin-top: 4px; }
}
@media (max-width: 899px) {
  .capsules > .capsules__group { padding-top: 30px; }
  .capsules > .capsules__group::before { top: calc(30px + .32em); }
  .capsules > .capsules__group > span:first-child { flex-basis: 100%; }
  .capsules__when { display: inline; margin: 0; }
  .capsules__range + .capsules__when::before { content: "·"; margin-right: 10px; color: var(--rule-strong); }
}
@media (max-width: 520px) {
  /* Phone: the whole map in about two screens. */
  .capsule-card:not(.capsule-card--soon) { margin: 8px 0 12px; padding: 14px 14px 15px; row-gap: 8px; }
  .capsule-card:not(.capsule-card--soon) h3 { font-size: 1.2rem; margin-bottom: 4px; }
  .capsule-card p { font-size: .92rem; line-height: 1.5; }
  .capsule-card .meta { margin-top: 6px; font-size: .66rem; letter-spacing: 0; }
  .capsules > li:has(.capsule-card:not(.capsule-card--soon))::before { top: 30px; }
  .capsules > .capsules__group { padding-top: 22px; }
  .capsules > .capsules__group::before { top: calc(22px + .32em); }
  .capsule-row__q { font-size: 1rem; }
  .capsule-row > summary { gap: 10px; padding-right: 34px; padding-block: 8px; }
  .capsule-row > summary::after { right: 2px; }
  .capsules .capsule-row > p { margin-left: calc(2.2ch + 10px + .2em) !important; margin-right: 6px !important; }
}

/* ---------- The labs: the test sheet, whose columns are the four ways ---------- */
.labs .labs__lead { max-width: 60ch; }
.labs .labs__app { max-width: 60ch; color: var(--ink-2); }
.labs .labs__h { margin: 44px 0 6px; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.32rem, 1.16rem + .55vw, 1.6rem); line-height: 1.2; }
.labs .labs__sheet-p { margin-bottom: 0; color: var(--ink-2); }

.test-sheet__table thead th { vertical-align: top; padding: 16px 10px 14px; width: 17.5%; }
.way__n { display: block; }
.way__s { display: block; margin-top: 6px; font: 400 .76rem/1.38 var(--font-body); letter-spacing: 0; text-transform: none; color: var(--ink-3); text-wrap: balance; }
/* A small night stack per way: your code (amber), what sits between, the OS (sky); the layer that draws is ringed
   in mint. Native: nothing between, the OS draws. Expo: a framework (rose), the OS draws. Ionic, PWA: a browser
   engine (violet) draws. The same meanings as the hero art and capsule 01. */
.way-ico {
  --mid: transparent; --ring: 35px;
  position: relative; display: block; width: 32px; height: 56px; margin: 0 auto 10px; border-radius: 10px;
  background:
    linear-gradient(#fbbf24, #fbbf24) 7px 12px / 18px 5px no-repeat,
    linear-gradient(var(--mid), var(--mid)) 7px 26px / 18px 5px no-repeat,
    linear-gradient(#7dd3fc, #7dd3fc) 7px 40px / 18px 5px no-repeat,
    #0c0f1a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .1);
}
/* The ring: the layer that draws, in mint, 2 px with a 4 px glow (design review S7). */
.way-ico::after { content: ""; position: absolute; left: 3px; top: var(--ring); width: 26px; height: 15px; border-radius: 5px; box-shadow: 0 0 0 2px #5fd3a0, 0 0 4px 2px rgba(95, 211, 160, .6); }
.way-ico--native::before { content: ""; position: absolute; left: 7px; top: 26px; width: 18px; height: 5px; border-radius: 1px; outline: 1px dashed rgba(255, 255, 255, .3); outline-offset: -1px; }
.way-ico--expo { --mid: #ff6aa9; }
.way-ico--ionic, .way-ico--pwa { --mid: #c084fc; --ring: 21px; }
.test-sheet__table td { padding-block: 11px; }
/* With each test, the capsule that prepares it. */
.ts-from { display: inline-block; margin-left: 2px; font: 500 .68rem/1.3 var(--font-mono); letter-spacing: .06em; color: var(--ink-3); white-space: nowrap; }

/* The week's family, picked under the sheet, lights its column. */
.labs:has(.family-pick input[value="native"]:checked) .test-sheet__table :is(th, td):nth-child(2),
.labs:has(.family-pick input[value="expo"]:checked) .test-sheet__table :is(th, td):nth-child(3),
.labs:has(.family-pick input[value="ionic"]:checked) .test-sheet__table :is(th, td):nth-child(4),
.labs:has(.family-pick input[value="pwa"]:checked) .test-sheet__table :is(th, td):nth-child(5) {
  background: color-mix(in srgb, var(--accent) 7%, var(--surface));
}
.labs:has(.family-pick input[value="native"]:checked) .test-sheet__table thead th:nth-child(2),
.labs:has(.family-pick input[value="expo"]:checked) .test-sheet__table thead th:nth-child(3),
.labs:has(.family-pick input[value="ionic"]:checked) .test-sheet__table thead th:nth-child(4),
.labs:has(.family-pick input[value="pwa"]:checked) .test-sheet__table thead th:nth-child(5) {
  color: var(--ink); box-shadow: inset 0 3px 0 var(--accent);
}

.ways-key { display: none; }
.labs .labs__note { margin: 18px 0 0; font-size: .95rem; color: var(--ink-2); }
.family-box { margin-top: 26px; padding: 18px 20px 16px; border-radius: var(--r-lg); border: 1px dashed var(--rule-strong); background: color-mix(in srgb, var(--surface) 60%, transparent); }
.family-box .family-pick { margin: 0; }
.labs .family-pick__note { margin: 10px 0 0; font-size: .88rem; color: var(--ink-3); }

@media (max-width: 640px) {
  .way__s { display: none; }
  .test-sheet__table thead th { padding: 14px 4px 10px; width: 15%; }
  .way-ico { margin-bottom: 8px; }
  .ways-key { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px 16px; margin: 14px 4px 0; }
  .ways-key > div { min-width: 0; }
  .ways-key dt { font: 600 .68rem/1.3 var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
  .ways-key dd { margin: 2px 0 0; font-size: .84rem; line-height: 1.4; color: var(--ink-3); }
  .family-box { padding: 16px 14px 14px; }
}

@media (max-width: 360px) {
  /* The smallest phones: four 44 px columns leave the test names too little room; 40 px targets, thinner gutters. */
  .test-sheet__table td, .test-sheet__table thead th { padding-inline: 2px; }
  .test-sheet td > label { min-width: 40px; }
  .test-sheet__table tbody th { padding-left: 10px; padding-right: 4px; }
}

/* ---------- What this course leans on: a compact strip ---------- */
.leans { margin-top: clamp(64px, 7vw, 104px); }
.leans .leans__h { margin: 0 0 14px; font: 500 .74rem/1.3 var(--font-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.leans .next-grid p { line-height: 1.6; }

.site-foot a { white-space: nowrap; }

/* ---------- Presentation mode: each slide fits one screen ---------- */
[data-teaching="true"] .leans { display: none; }
/* How a capsule works: readable from the back row. */
[data-teaching="true"] .how-capsule { margin-top: 36px; gap: 22px; }
[data-teaching="true"] .how-capsule > li { padding: 30px 28px 28px; }
[data-teaching="true"] .how-capsule::before { top: 49px; }
[data-teaching="true"] .how-capsule h3 { font-size: clamp(1.4rem, 1rem + 1vw, 1.75rem) !important; }
[data-teaching="true"] .how-capsule p { font-size: 1.12rem !important; }
/* The map on one slide: the written capsules side by side, the stations to come in two columns. */
[data-teaching="true"] :is(#capsules, #labs) { --tw: min(1240px, 100vw - 64px); width: var(--tw); margin-left: calc(50% - var(--tw) / 2); }
[data-teaching="true"] .capsules { grid-template-columns: repeat(6, minmax(0, 1fr)); column-gap: 32px; margin-top: 14px; }
[data-teaching="true"] .capsules::before, [data-teaching="true"] .capsules > li::before, [data-teaching="true"] .capsules > li::after, [data-teaching="true"] .cj-glint { display: none; }
[data-teaching="true"] .capsules > .capsules__group { contain: none; display: flex; text-align: left; padding: 16px 0 2px; font-size: 1.2rem; }
[data-teaching="true"] .capsules > .capsules__group:first-child { padding-top: 0; }
[data-teaching="true"] .capsules > .capsules__group > span:first-child { flex-basis: auto; }
[data-teaching="true"] .capsules__range { display: inline; margin: 0; }
[data-teaching="true"] .capsules__when { display: inline; margin: 0; }
[data-teaching="true"] .capsules > .capsules__group + li > .capsule-row { padding-top: 0; }
[data-teaching="true"] .capsule-row > summary { min-height: 40px; padding-block: 6px; }
[data-teaching="true"] .capsule-row__q { font-size: 1.06rem; }
[data-teaching="true"] .capsule-card .meta { font-size: .66rem; letter-spacing: 0; }
[data-teaching="true"] .capsules > li:nth-child(1) { grid-column: 1 / -1; grid-row: 1; }
[data-teaching="true"] .capsules > li:nth-child(2) { grid-column: 1 / 3; grid-row: 2; }
[data-teaching="true"] .capsules > li:nth-child(3) { grid-column: 3 / 5; grid-row: 2; }
[data-teaching="true"] .capsules > li:nth-child(4) { grid-column: 5 / 7; grid-row: 2; }
[data-teaching="true"] .capsules > li:nth-child(n+5):nth-child(-n+12) { grid-column: 1 / 4; }
[data-teaching="true"] .capsules > li:nth-child(n+13) { grid-column: 4 / 7; }
[data-teaching="true"] .capsules > li:nth-child(5), [data-teaching="true"] .capsules > li:nth-child(13) { grid-row: 3; }
[data-teaching="true"] .capsules > li:nth-child(6), [data-teaching="true"] .capsules > li:nth-child(14) { grid-row: 4; }
[data-teaching="true"] .capsules > li:nth-child(7), [data-teaching="true"] .capsules > li:nth-child(15) { grid-row: 5; }
[data-teaching="true"] .capsules > li:nth-child(8), [data-teaching="true"] .capsules > li:nth-child(16) { grid-row: 6; }
[data-teaching="true"] .capsules > li:nth-child(9), [data-teaching="true"] .capsules > li:nth-child(17) { grid-row: 7; }
[data-teaching="true"] .capsules > li:nth-child(10), [data-teaching="true"] .capsules > li:nth-child(18) { grid-row: 8; }
[data-teaching="true"] .capsules > li:nth-child(11), [data-teaching="true"] .capsules > li:nth-child(19) { grid-row: 9; }
[data-teaching="true"] .capsules > li:nth-child(12) { grid-row: 10; }
[data-teaching="true"] .capsule-card:not(.capsule-card--soon) { height: calc(100% - 20px); grid-template-columns: 52px minmax(0, 1fr); align-content: start; column-gap: 14px; row-gap: 8px; padding: 16px 18px 18px; margin: 10px 0; }
[data-teaching="true"] .capsule-card:not(.capsule-card--soon) > :not(.capsule-card__art) { grid-column: 1 / -1; }
[data-teaching="true"] .capsule-card:not(.capsule-card--soon) > .capsule-card__eyebrow { grid-column: 2; grid-row: 1; align-self: center; margin: 0 !important; }
[data-teaching="true"] .capsule-card__art { grid-row: 1; min-height: 0; height: 52px; border-radius: 13px; }
[data-teaching="true"] .capsule-card:not(.capsule-card--soon) h3 { font-size: 1.3rem; margin-top: 2px; }
/* The labs on one slide: the words on the left, the test sheet on the right. */
[data-teaching="true"] #labs { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); grid-template-rows: repeat(7, auto) 1fr; grid-auto-flow: dense; column-gap: 48px; align-content: center; }
[data-teaching="true"] #labs > * { grid-column: 1; }
[data-teaching="true"] #labs > .test-sheet { grid-column: 2; grid-row: 1 / -1; align-self: start; margin: 0; }
[data-teaching="true"] #labs .labs__h { margin-top: 18px; }
[data-teaching="true"] #labs .family-box { margin-top: 18px; }
[data-teaching="true"] #labs .family-pick > legend { width: 100%; margin: 0 0 8px; }

/* ---------- Print ---------- */
@media print {
  .rule-lines em, .rule-close em { background: none; color: #16161f; -webkit-text-fill-color: #16161f; }
  .capsule-row > summary::after { display: none; }
  .way-ico { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .family-box { border-color: #bbb; }
}
