/* ET School: lesson and My courses layout. Colours, type and buttons come from the course pages'
   own system (--p4-*, --decision-*, .pc4-*); this file only arranges them. */
.ets { --ets-gap: clamp(24px, 3vw, 48px); max-width: 1600px; margin: 0 auto; padding: 0 0 96px; color: var(--p4-paper, #f3f3f3); }
.ets .pc4-crumb a:hover { color: var(--p4-paper); }
.ets-title { font: 700 clamp(32px, 3.4vw, 52px)/1.04 var(--p4-display, 'Archivo', sans-serif); letter-spacing: -.04em; margin: 0; text-wrap: balance; }
.ets-title--xl { font-size: clamp(40px, 4.4vw, 72px); letter-spacing: -.05em; }
.ets-lede { font: 18px/1.5 var(--p4-body, 'Archivo', sans-serif); color: #c7c9c2; margin: 16px 0 32px; max-width: 46ch; }
.ets-kicker { font: 11px/1.5 var(--p4-mono, monospace); letter-spacing: .12em; text-transform: uppercase; color: #a8aaa5; margin: 0 0 16px; } /* the course pages' kicker, without their phone reordering */
.ets .pc4-crumb > span:last-child { display: inline; max-width: 40ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } /* the theme hides it on phones, which left a trailing "/" */
.ets-actions { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.ets .pc4-primary small, .ets .pc4-secondary small { display: block; font: 400 11px/1.4 var(--p4-mono, monospace); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 2px; } /* full ink: at .8 the label on the red button measured 3.95:1 */
.ets .pc4-primary > span:first-child, .ets .pc4-secondary > span:last-child { text-align: left; }

/* lesson: player and words on the left, the course's lessons on the right */
.ets-lesson__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px); gap: var(--ets-gap); padding: 8px 5vw 0; align-items: start; }
.ets-player { position: relative; aspect-ratio: 16 / 9; background: #0b0b0b; }
.ets-player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* poster button until play: same box as the player, so the swap moves nothing */
.ets-facade { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; margin: 0; background: #0b0b0b; color: #fff; cursor: pointer; display: block; overflow: hidden; }
.ets-facade__poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ets-facade__play { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; display: grid; place-items: center; border-radius: 50%; background: rgba(11, 11, 11, .78); border: 1px solid rgba(255, 255, 255, .55); transition: transform .18s ease, background-color .18s ease; }
.ets-facade__play svg { margin-left: 3px; }
.ets-facade:hover .ets-facade__play { background: var(--decision-red, #d71920); transform: scale(1.06); }
.ets-facade:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
.ets-facade:focus-visible .ets-facade__play { background: var(--decision-red, #d71920); }
.ets-facade__len { position: absolute; right: 12px; bottom: 12px; padding: 4px 8px; font: 12px/1.3 var(--p4-mono, monospace); background: rgba(11, 11, 11, .82); color: #f3f3f3; }
@media (prefers-reduced-motion: reduce) { .ets-facade__play { transition: none; } .ets-facade:hover .ets-facade__play { transform: none; } }
.ets-player--empty { display: grid; place-items: center; border: 1px solid var(--p4-line, #3b3b3b); }
.ets-player--empty p { font: 13px/1.5 var(--p4-mono, monospace); color: var(--p4-muted, #b8b8b8); margin: 0; padding: 24px; text-align: center; }
.ets-lesson__head { padding: 32px 0 24px; border-bottom: 1px solid var(--p4-line, #3b3b3b); }
.ets-state { font: 12px/1.5 var(--p4-mono, monospace); color: var(--p4-muted, #b8b8b8); margin: 16px 0 0; }
.ets-notes { font: 16px/1.65 var(--p4-body, sans-serif); color: #c7c9c2; max-width: 68ch; padding: 24px 0; }
.ets-step { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 24px; }
.ets-step a { justify-content: space-between; min-width: 0; }
.ets-step a > span:not([aria-hidden]) { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ets-step .pc4-primary { grid-column: 2; }

.ets-rail { position: sticky; top: 88px; max-height: calc(100vh - 112px); overflow: auto; padding: 24px; background: #161616; scrollbar-width: thin; }
.ets-rail__h { font: 600 20px/1.25 var(--p4-display, sans-serif); letter-spacing: -.02em; margin: 0 0 16px; }
.ets-rail__h a { color: inherit; text-decoration: none; }
.ets-rail__h a:hover { text-decoration: underline; text-underline-offset: 4px; }

.ets-meter { display: grid; gap: 8px; font: 12px/1.5 var(--p4-mono, monospace); color: var(--p4-muted, #b8b8b8); margin: 0 0 24px; }
.ets-bar { display: block; height: 2px; background: var(--p4-line, #3b3b3b); }
.ets-bar i { display: block; height: 100%; background: var(--p4-signal, #c92c28); }

.ets-chapter { font: 600 14px/1.4 var(--p4-body, sans-serif); color: var(--p4-paper); margin: 24px 0 8px; }
.ets-rows { list-style: none; margin: 0; padding: 0; }
.ets-row a { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--p4-line, #3b3b3b); color: var(--p4-paper); text-decoration: none; font: 15px/1.4 var(--p4-body, sans-serif); }
.ets-row a:hover .ets-row__t { text-decoration: underline; text-underline-offset: 4px; }
.ets-row__n, .ets-row__s { font: 12px/1.4 var(--p4-mono, monospace); color: var(--p4-muted, #b8b8b8); }
.ets-row__s { white-space: nowrap; }
.ets-row.is-done .ets-row__s { color: var(--p4-paper); }
.ets-row a[aria-current="page"] { box-shadow: inset 2px 0 var(--p4-signal, #c92c28); padding-left: 12px; margin-left: -12px; }
.ets-row a[aria-current="page"] .ets-row__s { color: var(--p4-paper); }

.ets-locked, .ets-empty { padding: 48px 5vw 0; max-width: 960px; }
.ets-locked .ets-title { margin-bottom: 8px; }

/* My courses */
.ets-classroom__head { padding: 16px 5vw 48px; }
.ets-courses { list-style: none; margin: 0 5vw; padding: 0; display: grid; gap: 1px; background: var(--p4-line, #3b3b3b); border-block: 1px solid var(--p4-line, #3b3b3b); }
.ets-course { display: grid; grid-template-columns: clamp(160px, 18vw, 240px) minmax(0, 1fr); gap: var(--ets-gap); padding: 32px 0; background: var(--p4-bg, #111); }
.ets-course__cover { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: contain; display: block; background: #161616; } /* the covers are 4:5 posters with the course name on them: shown whole, never cropped */
.ets-course__h { font: 700 clamp(24px, 2.2vw, 32px)/1.1 var(--p4-display, sans-serif); letter-spacing: -.03em; margin: 0 0 16px; text-wrap: balance; }
.ets-course__body .ets-meter { max-width: 420px; }
.ets-course__note { font: 15px/1.5 var(--p4-body, sans-serif); color: #c7c9c2; margin: 0 0 24px; max-width: 52ch; }
.ets-all { margin-top: 24px; }
.ets-all summary { cursor: pointer; font: 600 14px/1.4 var(--p4-body, sans-serif); color: #c7c9c2; padding: 8px 0; min-height: 40px; display: flex; align-items: center; gap: 8px; list-style: none; }
.ets-all summary::-webkit-details-marker { display: none; }
.ets-all summary::before { content: "+"; font-family: var(--p4-mono, monospace); color: var(--p4-muted); width: 1ch; }
.ets-all[open] summary::before { content: "−"; }
.ets-all summary:hover { color: var(--p4-paper); }
.ets-all .ets-rows { max-width: 760px; }

/* My courses groups: Subscriptions (each plan, its state, its courses), then the owned courses */
.ets-group { margin: 0 0 56px; }
.ets-group__h { font: 700 clamp(20px, 1.8vw, 26px)/1.2 var(--p4-display, sans-serif); letter-spacing: -.02em; margin: 0 5vw 16px; }
.ets-subs__list { list-style: none; margin: 0 5vw 24px; padding: 0; display: grid; gap: 16px; }
.ets-subs__item { padding: 24px 32px; background: #161616; }
.ets-subs__item .ets-course__h { margin-bottom: 8px; }
.ets-subs__item .ets-course__note { margin-bottom: 16px; }
.ets-subs__item form { margin: 0; }

/* Tuning Sim (inc/sim.php): a card above My courses, and the practice link under a lesson's steps */
.ets-sim { margin: 0 5vw 48px; padding: 32px; background: #161616; border-left: 2px solid var(--p4-signal, #c92c28); }
.ets-sim .ets-course__note { margin-bottom: 24px; }
.ets-sim-practice { margin: 24px 0 0; }
.ets-sim-practice a { justify-content: space-between; min-width: 0; max-width: 100%; }

.ets a:focus-visible, .ets summary:focus-visible { outline: 2px solid var(--p4-paper, #fff); outline-offset: 3px; }

@media (max-width: 960px) {
  .ets-lesson__grid { grid-template-columns: 1fr; padding-inline: 24px; }
  .ets-rail { position: static; max-height: none; }
  .ets-course { grid-template-columns: 1fr; gap: 24px; }
  .ets-course__cover { max-width: 240px; }
  .ets-classroom__head, .ets-locked, .ets-empty { padding-inline: 24px; }
  .ets-courses { margin: 0 24px; }
  .ets-sim { margin-inline: 24px; padding: 24px; }
  .ets-group__h, .ets-subs__list { margin-inline: 24px; }
  .ets-subs__item { padding: 24px; }
}
@media (max-width: 560px) {
  .ets-step { grid-template-columns: 1fr; }
  .ets-step .pc4-primary { grid-column: 1; order: -1; }
  .ets-course { grid-template-columns: 96px minmax(0, 1fr); gap: 16px; }
  .ets-course__cover { max-width: none; grid-row: span 2; align-self: start; }
  .ets-course__h { grid-column: 2; font-size: 22px; margin: 0; align-self: end; }
  .ets-course .ets-meter, .ets-course .ets-course__note { grid-column: 2; margin: 0; align-self: start; }
  .ets-course .ets-actions, .ets-course .ets-all { grid-column: 1 / -1; }
  .ets-course__body { display: contents; }
}
