/* /course/ and /en/course/ only (build.py links this file from those two pages and stamps it).
   Shared pieces live in site.css; put only this page's own rules here. Same limits as site.css:
   transitions on transform or opacity only (200 to 450 ms), no keyframes, no sticky or fixed.
   The page: the ten lessons set like the book's contents page, each lesson's two goals numbered
   like the deck's "Today you will be able to" slide (mono teal 01, 02); one lesson opened up on the
   soft teal desks; then the plan, a ladder whose rails run behind six rungs, the built rung solid
   teal at the foot and the five planned rungs drawn in dashed line, the way a draft is drawn. */

/* The last section closes the page. With show_plan false the plan section is dropped at build
   time and "One lesson" is last, so this follows whichever section ends the page. */
.page-course main > .sec:last-child { padding-bottom: 96px; }

/* Ten lessons */
.lessons { margin-top: 40px; border-bottom: 1px solid var(--rule); }
.lesson { padding: 22px 0 24px; border-top: 1px solid var(--rule); }
.lesson-h { display: flex; flex-direction: column; gap: 2px; }
.lesson-n { font-size: 15px; font-weight: 600; line-height: 1.5; letter-spacing: 0.02em; font-variant-numeric: tabular-nums; color: var(--teal); }
.lesson-t { font-size: clamp(21px, 2vw, 25px); font-weight: 800; line-height: 1.35; letter-spacing: -0.025em; color: var(--ink); }
html[lang="en"] .lesson-t { line-height: 1.25; letter-spacing: -0.02em; }
.goals { margin-top: 12px; counter-reset: goal; }
.goals li { counter-increment: goal; position: relative; padding-left: 34px; font-size: 17px; line-height: 1.7; color: var(--body2); }
html[lang="en"] .goals li { line-height: 1.6; }
.goals li + li { margin-top: 6px; }
.goals li::before {
  content: counter(goal, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 5px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.08em;
  color: var(--teal);
}

/* The course's figures, one row under the lesson's text */
.counts {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 20px;
  border-top: 1px solid var(--rule-strong);
}
.counts li {
  padding: 14px 0 16px;
  border-bottom: 1px solid var(--rule);
  font-size: clamp(20px, 1.8vw, 25px);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-wrap: balance;
}
html[lang="en"] .counts li { font-size: clamp(19px, 1.6vw, 22px); }

/* One lesson opened up: the shared desks (site.css .mats, .mat, .desk, .tablet, .book-page, .hw) */
.page-course .mats { margin-top: 40px; }
/* One homework item: the done line has no words of its own here, so only "Start again" shows */
.mat-hw .hw-done p:empty { display: none; }

/* The plan: a ladder, bottom rung first (the list runs from the foot up) */
.ladder {
  position: relative;
  margin-top: 54px;
  max-width: 640px;
  display: flex;
  flex-direction: column-reverse;
  gap: 14px;
}
.ladder::before {
  content: "";
  position: absolute;
  top: -18px;
  bottom: -18px;
  left: 30px;
  right: 30px;
  border-left: 2px solid var(--rule-strong);
  border-right: 2px solid var(--rule-strong);
  pointer-events: none;
}
.rung {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  column-gap: 16px;
  padding: 15px 20px 16px;
  border: 1.5px dashed var(--rule-strong);
  border-radius: 16px;
  background: var(--ground);
}
.rung-name { font-size: 19px; font-weight: 800; line-height: 1.4; letter-spacing: -0.02em; color: var(--ink); }
.rung-alt { display: block; font-size: 15px; font-weight: 400; line-height: 1.5; letter-spacing: 0; color: var(--muted); }
.rung-cefr { font-family: var(--mono); font-size: 13.5px; font-weight: 500; line-height: 1.5; letter-spacing: 0.06em; white-space: nowrap; color: var(--teal); }
.rung.is-built { padding: 18px 20px 20px; border: 1.5px solid var(--teal); background: var(--teal); }
.rung.is-built .rung-name { color: #FFFFFF; }
.rung.is-built .rung-alt, .rung.is-built .rung-cefr { color: var(--on-teal); }
.rung-mark { grid-column: 1 / -1; margin-top: 10px; padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.3); font-size: 16px; font-weight: 600; line-height: 1.5; color: #FFFFFF; }

/* Phones: no type under 14 px */
@media (max-width: 599px) {
  .goals li::before, .rung-cefr { font-size: 14px; }
}

@media (min-width: 600px) {
  .rung { padding: 16px 24px 17px; }
  .rung.is-built { padding: 20px 24px 22px; }
  .rung-alt { display: inline; margin-left: 8px; }
}

@media (min-width: 720px) {
  .lesson { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 40px; align-items: start; }
  .goals { margin-top: 0; }
  .counts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 960px) {
  .page-course main > .sec:last-child { padding-bottom: 136px; }
  .lessons { margin-top: 48px; }
  .lesson { column-gap: 72px; padding: 28px 0 30px; }
  .goals li { font-size: 17.5px; }

  .mat-slide { grid-column: 1 / 9; }
  .mat-page { grid-column: 9 / 13; }
  .mat-hw { grid-column: 1 / 5; }
  .mat-film { grid-column: 5 / 13; }
  .mat-page .desk { padding-left: 28px; padding-right: 28px; }

  /* The plan's words on the left and the ladder on the right, as the run of show sits */
  .plan { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); column-gap: 72px; align-items: start; }
  .ladder { margin-top: 18px; max-width: none; }
}

@media (min-width: 1200px) {
  .counts { grid-template-columns: repeat(7, minmax(0, 1fr)); }
}
