/* reVocab Video Learning Center. Builds on /assets/site.css tokens:
   paper, one orange action colour, soft raised/inset depth like the app. */

.tut-page { min-height: 100svh; }

.tut-header {
  display: flex; align-items: center; gap: 14px;
  min-height: 56px;
  padding: 8px max(16px, env(safe-area-inset-left)) 8px max(16px, env(safe-area-inset-right));
  width: min(100%, var(--max)); margin-inline: auto;
}
.tut-title {
  margin-inline-start: auto;
  font-size: 1.0625rem; font-weight: 700; letter-spacing: -0.01em;
  color: var(--ink); text-align: end;
}

.tut-main {
  width: min(100% - 32px, var(--max)); margin-inline: auto;
  padding-block: 4px 40px;
}

/* Phone: the player first, as big as the screen allows (~80% of its height),
   then the chapters underneath. */
.tut-layout { display: grid; gap: 28px; }
.tut-stage { display: grid; justify-items: center; gap: 14px; min-width: 0; }

.tut-player {
  position: relative; width: 100%;
  border-radius: var(--r-md); overflow: hidden;
  background: var(--paper-hi); box-shadow: var(--raise);
}
.tut-player[data-shape="portrait"] {
  aspect-ratio: 9 / 16;
  width: min(100%, calc(80svh * 9 / 16));
}
.tut-player[data-shape="landscape"] { aspect-ratio: 16 / 9; }
.tut-player.is-playing { background: #000; }
.tut-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.tut-facade {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  border: 0; background: var(--paper-hi); cursor: pointer; padding: 24px;
  color: var(--ink);
}
.tut-facade-icon { width: 64px; height: auto; margin-block-end: 8px; }
.tut-play {
  display: grid; place-items: center;
  width: 84px; height: 84px; border-radius: 50%;
  background: var(--orange); color: var(--ink); box-shadow: var(--raise);
  transition: transform 160ms var(--ease), background-color 160ms var(--ease);
}
.tut-play svg { margin-inline-start: 4px; }
@media (hover: hover) { .tut-facade:hover .tut-play { background: var(--orange-press); } }
.tut-facade:active .tut-play { transform: scale(0.96); }
.tut-play-label { font-size: 1.1875rem; font-weight: 700; text-align: center; text-wrap: balance; }
.tut-duration { font-size: var(--step-small); color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.tut-facade:focus-visible, .tut-chapter:focus-visible, .tut-privacy a:focus-visible, .brand:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 3px;
}

.tut-note {
  width: 100%; max-width: 46ch; padding: 12px 16px; border-radius: var(--r-sm);
  background: var(--paper-hi); box-shadow: var(--inset-sm);
  font-size: var(--step-small); color: var(--ink-body); text-align: center;
}
.tut-lead { font-size: 1rem; color: var(--ink-body); text-align: center; max-width: 42ch; text-wrap: balance; }
.tut-soon {
  width: 100%; max-width: 40ch; padding: 40px 20px; border-radius: var(--r-md);
  background: var(--paper-hi); box-shadow: var(--raise);
  font-size: 1.125rem; font-weight: 600; text-align: center;
}
.tut-privacy { font-size: 0.8125rem; color: var(--ink-soft); text-align: center; max-width: 52ch; }
.tut-privacy a { font-weight: 600; color: var(--ink-body); margin-inline-start: 4px; }

/* Chapters: a list of large tap targets; the playing one is marked. */
.tut-chapters { min-width: 0; }
.tut-chapters-title { font-size: 1.25rem; font-weight: 800; letter-spacing: -0.01em; }
.tut-chapters-hint { font-size: var(--step-small); color: var(--ink-soft); margin-block: 2px 14px; }
.tut-list { display: grid; gap: 10px; }
.tut-chapter {
  display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px;
  padding: 12px 16px; border: 0; border-radius: var(--r-sm); text-align: start; cursor: pointer;
  background: var(--paper); box-shadow: var(--raise-sm);
  transition: box-shadow 160ms var(--ease);
}
.tut-chapter:active { box-shadow: var(--inset-sm); }
.tut-chapter[aria-current="true"] { box-shadow: var(--inset-sm); }
.tut-time {
  flex: none; min-width: 3.4em; padding: 4px 8px; border-radius: 999px; text-align: center;
  font-size: 0.875rem; font-weight: 700; font-variant-numeric: tabular-nums;
  background: var(--paper-hi); color: var(--ink-body);
}
.tut-chapter[aria-current="true"] .tut-time { background: var(--orange); color: var(--ink); }
.tut-name { font-size: 1rem; font-weight: 600; line-height: 1.35; min-width: 0; overflow-wrap: anywhere; }

/* Desktop: player on the left, chapters on the right. */
@media (min-width: 900px) {
  .tut-header { min-height: 72px; padding-inline: var(--margin); }
  .tut-title { font-size: 1.25rem; }
  .tut-main { width: min(100% - 2 * var(--margin), var(--max)); padding-block: 8px 64px; }
  .tut-layout { grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr); align-items: start; gap: 48px; }
  .tut-player[data-shape="portrait"] { width: min(100%, calc(80vh * 9 / 16)); }
  .tut-chapters { padding-block-start: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .tut-play, .tut-chapter { transition: none; }
}
