/*
 * The timeline on /curriculum (src/timeline.ts): every week a row that opens
 * in place, in phase bands whose headers stick while their weeks scroll by.
 * Tokens from site.css, so light, dark and every palette work. Motion is a
 * chevron turning and an opened row fading in; with less motion asked for,
 * rows simply open.
 */
.tl { margin-top: var(--stack); }
.tl-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.tl-jump { display: flex; align-items: center; gap: 8px; }
.tl-jump label { font-size: 15px; font-weight: 600; color: var(--text); }
.tl-jump input { width: 7.5rem; min-height: var(--btn-h-sm); padding: 6px 10px; font-size: 15px; }
.tl-all { display: flex; gap: 4px; }
.tl-legend { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 24px; margin-top: 12px; }
.tl-keys { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.tl-keys > span { display: inline-flex; align-items: center; gap: 6px; }
.tl-keys svg { color: var(--text-body); }

/* ---- a phase band ---- */
.tl-phase { margin-top: var(--stack); }
.tl-phase-head {
  position: sticky; top: 0; z-index: 3; display: flex; align-items: center; gap: 14px;
  padding: 12px 0; border-bottom: 1px solid var(--line-strong); background: var(--bg);
}
.tl-phase-n { display: inline-grid; place-items: center; flex-shrink: 0; width: 40px; height: 40px; border-radius: 50%; background: var(--primary-soft); color: var(--link); font: 600 16px/1 var(--mono); }
.tl-phase-text { min-width: 0; }
.tl-phase-head h2 { font-size: var(--h2); font-weight: 600; letter-spacing: -0.015em; color: var(--text); }
.tl-phase-meta { margin-top: 4px; font-size: var(--card-body); color: var(--text-dim); font-variant-numeric: tabular-nums; }
.tl-phase-intro { display: grid; gap: 12px; padding: 20px 0 12px 54px; }
.tl-phase-intro .prose { font-size: 16px; }
.tl-play { display: flex; align-items: flex-start; gap: 8px; max-width: var(--measure); font-size: var(--card-body); line-height: 1.6; color: var(--text-body); }
.tl-play svg { margin-top: 3px; color: var(--warn-fg); }
.tl-play a { color: var(--link); }

/* ---- a week ---- */
.tl-weeks { list-style: none; margin: 8px 0 0; padding: 0; }
.tl-week { border-bottom: 1px solid var(--line); scroll-margin-top: 88px; }
.tl-row > summary {
  display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto 4rem 6.5rem 18px; align-items: center; gap: 4px 16px;
  min-height: 64px; padding: 10px 10px 10px 6px; border-radius: 8px; color: var(--text);
}
.tl-row > summary:hover { background: var(--bg-soft); }
.tl-row > summary:focus-visible { outline-offset: -2px; }
.tl-n { font: 600 15px/1 var(--mono); color: var(--text-dim); text-align: center; font-variant-numeric: tabular-nums; }
.tl-main { display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 14px; min-width: 0; }
.tl-theme { font-size: var(--card-title); font-weight: 600; letter-spacing: -0.01em; color: var(--text); }
.tl-dates { font-size: var(--card-body); color: var(--text-dim); white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-icons { display: grid; grid-template-columns: 20px 20px 34px 20px 20px; align-items: center; gap: 12px; color: var(--text-body); }
.tl-icons > span { display: inline-flex; align-items: center; gap: 2px; }
.tl-icons > :nth-child(5) { color: var(--warn-fg); }
.tl-icons > :nth-child(4) { color: var(--ok-fg); }
.tl-icons b { font-size: 14px; font-weight: 600; }
.tl-icons svg { width: 18px; height: 18px; }
.tl-h { font-size: var(--card-body); color: var(--text-dim); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tl-status { display: flex; justify-content: flex-end; }
.tl-tick { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ok-bg); color: var(--ok-fg); }
.tl-now { padding: 2px 10px; border-radius: 999px; background: var(--primary); color: var(--primary-ink); font-size: 13px; font-weight: 600; line-height: 20px; white-space: nowrap; }
.tl-anon .tl-row > summary { grid-template-columns: 2.5rem minmax(0, 1fr) auto 4rem 18px; }
.tl-anon .tl-status { display: none; }
.tl-chev { color: var(--text-dim); transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1); }
.tl-row[open] > summary .tl-chev { transform: rotate(180deg); }
.tl-week.is-done .tl-theme { color: var(--text-body); }
/* The current week: a line of the accent down its left and a tint. */
.tl-week.is-now { box-shadow: inset 3px 0 0 var(--primary); background: color-mix(in srgb, var(--primary-soft) 70%, transparent); }
.tl-week.is-now .tl-n { color: var(--link); }
/* Grey on the tint is under 4.5:1: the current row's quiet text is a step darker. */
.tl-week.is-now :is(.tl-dates, .tl-h) { color: var(--text-body); }

/* An opened row: the tasks, each under its kind, then the way into the week. */
.tl-body { display: grid; gap: 12px; padding: 4px 10px 20px calc(2.5rem + 22px); }
.tl-row[open] > .tl-body { animation: tl-in 0.22s ease-out; }
@keyframes tl-in { from { opacity: 0; transform: translateY(-4px); } }
.tl-tasks { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.tl-tasks li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 16px; font-size: 16px; line-height: 1.55; color: var(--text-body); }
.tl-kind { padding-top: 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--link); }
.tl-cp .tl-kind { color: var(--ok-fg); }
.tl-tasks a { color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.tl-tasks a:hover { color: var(--link); text-decoration-color: var(--link); }
.tl-goal { color: var(--text-dim); }
.tl-sep { color: var(--text-dim); }
.tl-body .text-link { min-height: 36px; }

/* ---- the Play track, as one band of links ---- */
.tl-band-play .tl-phase-n { background: var(--warn-bg); color: var(--warn-fg); }
.tl-games { list-style: none; margin: 8px 0 0; padding: 0; }
.tl-games li { border-bottom: 1px solid var(--line); }
.tl-games a { display: grid; grid-template-columns: 7rem minmax(0, 1fr) 16px; align-items: center; gap: 12px; min-height: 64px; padding: 10px 10px 10px 6px; border-radius: 8px; color: var(--text); text-decoration: none; font-size: var(--card-title); }
.tl-games a:hover { background: var(--bg-soft); }
.tl-games a:hover strong { color: var(--link); }
.tl-games a > svg { color: var(--text-dim); }
.tl-games-wk { font-size: var(--card-body); color: var(--text-dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-games strong { font-weight: 600; }

/* Tablets: the status column only as wide as what is in it. */
@media (max-width: 859px) {
  .tl-row > summary { grid-template-columns: 2.25rem minmax(0, 1fr) auto 3.5rem auto 18px; }
  .tl-anon .tl-row > summary { grid-template-columns: 2.25rem minmax(0, 1fr) auto 3.5rem 18px; }
  .tl-main { display: grid; gap: 0; }
}
/* Phones: the number, then the week (title, dates and icons stacked), then the hours. */
@media (max-width: 599px) {
  .tl-row > summary, .tl-anon .tl-row > summary { grid-template-columns: 2rem minmax(0, 1fr) auto 18px; grid-template-areas: 'n theme h chev' 'n dates icons chev' 'n status status chev'; align-items: start; row-gap: 2px; padding: 10px 4px; }
  .tl-n { grid-area: n; padding-top: 4px; }
  .tl-main { display: contents; }
  .tl-theme { grid-area: theme; }
  .tl-dates { grid-area: dates; align-self: center; }
  .tl-icons { grid-area: icons; grid-template-columns: repeat(5, auto); gap: 8px; justify-content: end; }
  .tl-icons > :empty { display: none; }
  .tl-h { grid-area: h; padding-top: 3px; }
  .tl-status { grid-area: status; justify-content: flex-start; }
  .tl-status:empty { display: none; }
  .tl-chev { grid-area: chev; margin-top: 3px; }
  .tl-body { padding: 0 4px 16px calc(2rem + 16px); }
  .tl-tasks li { grid-template-columns: 1fr; gap: 0; }
  .tl-phase-intro { padding-left: 0; }
  .tl-games a { grid-template-columns: minmax(0, 1fr) 16px; gap: 2px 12px; }
  .tl-games-wk { grid-column: 1; }
  .tl-games-name { grid-column: 1; }
  .tl-games a > svg { grid-column: 2; grid-row: 1 / 3; }
  .tl-legend { justify-content: flex-start; }
}
/* Touch: every link in an opened row and the jump box are 44px targets. */
@media (pointer: coarse) {
  .tl-jump input, .tl-jump .btn { min-height: 44px; }
  .tl-tasks a { display: inline-flex; align-items: center; min-height: 44px; }
  .tl-tasks li { gap: 0 12px; }
  .tl-body .text-link { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  .tl-row[open] > .tl-body { animation: none; }
  .tl-chev { transition: none; }
}
@media print {
  .tl-phase-head { position: static; }
  .tl-bar { display: none; }
}
