/* OBSCURA OS - the tutorials: /tutorials and a page for each of the six
   main applications (tutorial-pages.mjs). The page is a reference page
   (reference.css) and the steps are the film steps every how-to film has
   (.film-steps, theme.css); this is only what a film of several minutes
   needs besides: the film at the page's full width with the browser's own
   controls, its steps under chapter headings, and the list of the others.
   Every size, corner and colour is one of theme.css's tokens. */

/* The film. Its width and height are on the element, so it takes its
   place before anything loads; nothing of it is fetched but the poster
   until Play is pressed. */
.tu-film { margin: 0 0 var(--space-4); scroll-margin-top: var(--space-4); }
.tu-film video { display: block; width: 100%; height: auto; aspect-ratio: 1280 / 800; border: 1px solid var(--rule); border-radius: var(--radius-md); background: var(--paper-inset); }
.tu-film figcaption { margin: var(--space-2) 0 0; max-width: var(--measure); font-size: var(--text-sm); line-height: 1.5; color: var(--ink-soft); }

/* What to press to follow along. */
.tu-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); margin: 0 0 var(--space-6); }
/* tool.css opens by taking the padding off everything, after theme.css
   has given a link dressed as a button its own: it is given back here. */
.tu-actions .btn-primary { flex: none; min-height: 44px; padding: 0 var(--space-4); box-sizing: border-box; white-space: nowrap; }
.tu-actions-note { flex: 1 1 28ch; max-width: var(--measure); font-size: var(--text-sm); line-height: 1.5; color: var(--ink-soft); }

/* The steps, chapter by chapter. The numbers run on from one chapter to
   the next, as the film does, so each list leaves the count alone. */
.tu-steps-note, .tu-more-note { margin: 0 0 var(--space-3); max-width: var(--measure); font-size: var(--text-sm); line-height: var(--leading-prose); color: var(--ink-soft); }
.tu-steps { counter-reset: film-step; max-width: var(--measure); }
.tu-steps .film-steps { counter-reset: none; margin-top: 0; }
.tu-chapter { margin: 0 0 var(--space-5); }
.tu-chapter > h3 { margin: 0; padding: var(--space-2) 0; font: 600 var(--text-md)/1.3 var(--font-ui); color: var(--ink); scroll-margin-top: var(--space-8); }

/* A list of tutorials: a row each, its picture beside its words. One
   column at every width; a row is a single link. */
.tu-list { margin: 0 0 var(--space-5); padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.tu-row { border-bottom: 1px solid var(--rule); }
.tu-row > a { display: grid; grid-template-columns: minmax(120px, 224px) minmax(0, 1fr); gap: var(--space-4); align-items: center; padding: var(--space-3) 0; color: inherit; text-decoration: none; }
.tu-row img { display: block; width: 100%; height: auto; aspect-ratio: 1280 / 800; border: 1px solid var(--rule); border-radius: var(--radius-sm); background: var(--paper-inset); }
.tu-row-words { display: grid; gap: var(--space-1); min-width: 0; }
.tu-row-name { font: 600 var(--text-md)/1.3 var(--font-ui); color: var(--ink); }
.tu-row-line { font-size: var(--text-sm); line-height: 1.5; color: var(--ink-soft); }
.tu-row-len { font: var(--text-xs)/1.5 var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: .04em; color: var(--ink-faint); }
.tu-row > a:hover .tu-row-name, .tu-row > a:focus-visible .tu-row-name { color: var(--accent-strong); }
.tu-row > a:hover img, .tu-row > a:focus-visible img { border-color: var(--accent-strong); }
.tu-row > a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.tu-list-index .tu-row > a { grid-template-columns: minmax(120px, 304px) minmax(0, 1fr); gap: var(--space-5); padding: var(--space-4) 0; }
.tu-list-index .tu-row-name { font-size: var(--text-lg); }

/* On a phone the picture goes above the words: beside them it would be
   too small to show anything. */
@media (max-width: 560px) {
  .tu-row > a, .tu-list-index .tu-row > a { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); }
}
