/* IELTS Speaking Syria — the course's own stylesheet.
 *
 * It is NOT a copy of another course's: those are built for a lesson made of exercises, and this
 * page is made of a stage, a transcript and a practice box. What it does keep from them is the
 * palette and the type, so a learner moving between courses on this site is in the same building.
 *
 * BILINGUAL BY DEFAULT. The Arabic line under every English one is visible unless the learner turns
 * it off, and it is typeset as Arabic rather than as English in an Arabic font: its own line height,
 * its own direction, its own size. An Arabic line set at a Latin line height runs into the line
 * above it, which this project measured once and does not need to measure again.
 */
:root {
  --ink: #23201c;
  --muted: #6b645c;
  --paper: #fbf8f3;
  --card: #ffffff;
  --rule: #e2dbd0;
  --accent: #8a5a00;
  --accent-ink: #ffffff;
  --good: #3a5e3a;
  --bad: #963a2c;
  --shadow: 0 1px 2px rgba(35, 32, 28, .06), 0 8px 24px rgba(35, 32, 28, .06);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --ink: #ece7df; --muted: #a79f94; --paper: #17150f; --card: #211e18; --rule: #35312a;
    --accent: #e0a94a; --accent-ink: #1a1710; --good: #8fbd8f; --bad: #e08a78;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --ink: #ece7df; --muted: #a79f94; --paper: #17150f; --card: #211e18; --rule: #35312a;
  --accent: #e0a94a; --accent-ink: #1a1710; --good: #8fbd8f; --bad: #e08a78;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
  color-scheme: dark;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.6 Georgia, "Times New Roman", serif;
}
main {
  max-width: 54rem;
  margin: 0 auto;
  padding-block: 1.5rem 4rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
h1, h2, h4 { font-family: "Helvetica Neue", Arial, sans-serif; text-wrap: balance; }
h1 { font-size: 1.7rem; margin: .2rem 0 1rem; }
h2 { font-size: 1.15rem; margin: 2.2rem 0 .6rem; letter-spacing: .01em; }
.eyebrow {
  font: 600 .72rem/1.4 "Helvetica Neue", Arial, sans-serif;
  letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin: 0;
}
.lead { color: var(--muted); margin: .2rem 0 1rem; }
.small { font-size: .85rem; color: var(--muted); }

/* ---------------------------------------------------------------------------- the stage */
.stagewrap { position: relative; }
svg.stage {
  display: block; width: 100%; aspect-ratio: 16 / 9; border-radius: 10px;
  background: #cfc7b8; box-shadow: var(--shadow);
}
.subs { min-height: 4.2rem; padding: .55rem .2rem 0; text-align: center; }
.subs .en { margin: 0; font-size: 1.02rem; }
.subs .ar {
  margin: .15rem 0 0; font-size: 1.08rem; line-height: 1.95;
  font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", serif; color: var(--muted);
}
.no-ar .ar { display: none; }
/* THE CUE CARD IS BESIDE THE STAGE, NOT OVER IT.
 *
 * The first version floated it over the picture, which is what a television graphic does, and in
 * the candidate's single it covered her face completely - so the one shot whose entire job is to
 * show the person speaking showed a card instead. A real cue card is in the candidate's hand and
 * the examiner can still see her. This one sits under the stage, where it cannot occlude anybody
 * at any width, and _tools/check_pages.py asserts that it never overlaps the stage's box. */
.card {
  margin: .6rem 0 0; background: var(--card); border: 1px solid var(--rule); border-left: 3px solid
  var(--accent); border-radius: 0 9px 9px 0; padding: .8rem 1rem; box-shadow: var(--shadow);
  font-size: .95rem;
}
.controls { display: flex; flex-wrap: wrap; gap: .5rem; margin: .4rem 0 0; }

/* ------------------------------------------------------- the visual rail, BESIDE the stage
 *
 * THE SAME RULE AS THE CUE CARD, for the same reason. A picture of the thing being talked about is
 * worth having and is worth NOTHING if it sits on top of the face of the person talking - and the
 * one shot whose whole job is the face is the one a picture would cover. So the rail is a column
 * next to the stage on a wide screen and a strip under it on a phone, and _tools/check_pages.py
 * asserts the two boxes never intersect.
 *
 * IT FADES, IT DOES NOT CUT. A picture that appears instantly on a word reads as a flash; 220 ms
 * reads as somebody turning a page. */
.stagewrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 11rem;
  grid-template-areas: "stage rail" "turn turn" "subs subs" "card card";
  gap: .7rem;
  align-items: start;
}
.stagewrap > svg.stage { grid-area: stage; }
.rail { grid-area: rail; }
.yourturn { grid-area: turn; }
.subs { grid-area: subs; }
.card { grid-area: card; }
.rail {
  background: var(--card); border: 1px solid var(--rule); border-radius: 10px;
  padding: .5rem .5rem .35rem; box-shadow: var(--shadow); min-width: 0;
}
.railbox {
  aspect-ratio: 4 / 3; border-radius: 7px; overflow: hidden; background: var(--paper);
  opacity: 0;
}
.railbox.in { animation: railin .22s ease-out forwards; }
@keyframes railin { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
.railbox svg { display: block; width: 100%; height: 100%; }
.railcap {
  margin: .35rem 0 0; text-align: center;
  font: 600 .72rem/1.3 "Helvetica Neue", Arial, sans-serif;
  letter-spacing: .07em; text-transform: uppercase; color: var(--muted);
}
@media (prefers-reduced-motion: reduce) {
  .railbox.in { animation: none; opacity: 1; }
}
@media (max-width: 40rem) {
  .stagewrap {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "stage" "rail" "turn" "subs" "card";
  }
  .rail { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); align-items: center; gap: .6rem; }
  .railcap { text-align: left; margin: 0; }
}
/* `hidden` must still win. A class that sets `display` outranks the UA's [hidden] rule, which is
   how an element the script has hidden stays on the screen - silently, and only at one width. */
.rail[hidden], .yourturn[hidden] { display: none; }

/* SHADOW MODE'S PROMPT. It is a line of text and not a countdown ring: a learner repeating a
   sentence should be looking at the two people, not at a timer. */
.yourturn {
  margin: 0; text-align: center;
  font: 600 .8rem/1 "Helvetica Neue", Arial, sans-serif;
  letter-spacing: .09em; text-transform: uppercase;
  color: var(--accent-ink); background: var(--accent);
  border-radius: 999px; padding: .5rem .9rem; justify-self: center;
}

/* THE WORD BEING SPOKEN. The whole line stays readable - this lifts one word rather than dimming
   the rest, because a learner reading ahead of the voice is doing the right thing. */
.subs .en .w { transition: color .08s linear; }
.subs .en .w.on { color: var(--accent); font-weight: 700; }
.mouth.lipsync { transform-box: fill-box; transform-origin: 50% 50%; }

/* ---------------------------------------------------------------------- the transport
 *
 * THE CYBERSECURITY COURSE'S BAR, drawn in this course's palette. The buttons are the same eight,
 * the speeds are the same three, and the two subtitle switches are what the owner asked for in
 * place of the one عربي button this page used to have. */
.transport {
  display: flex; flex-wrap: wrap; align-items: center; gap: .4rem;
  margin: .6rem 0 0; padding: .5rem .55rem;
  background: var(--card); border: 1px solid var(--rule); border-radius: 10px;
  box-shadow: var(--shadow);
}
.tp-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .45rem .5rem; min-width: 2.1rem;
}
.tp-btn svg { display: block; }
.tp-btn[aria-pressed="true"] {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}
.tp-seg { display: inline-flex; border: 1px solid var(--rule); border-radius: 7px; overflow: hidden; }
.tp-seg button {
  border: 0; border-radius: 0; padding: .45rem .6rem; font-size: .8rem;
  border-left: 1px solid var(--rule);
}
.tp-seg button:first-child { border-left: 0; }
.tp-seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.scrub {
  position: relative; flex: 1 1 7rem; min-width: 6rem; height: 1.6rem; cursor: pointer;
}
.scrub .track, .scrub .fill {
  position: absolute; top: 50%; transform: translateY(-50%); height: 4px; border-radius: 2px;
}
.scrub .track { left: 0; right: 0; background: var(--rule); }
.scrub .fill { left: 0; width: 0; background: var(--accent); }
.scrub .tick {
  position: absolute; top: 50%; transform: translate(-50%, -50%);
  width: 2px; height: 10px; background: var(--rule);
}
.no-transcript .script { display: none; }

button {
  font: 600 .88rem/1 "Helvetica Neue", Arial, sans-serif; border-radius: 7px; padding: .62rem .9rem;
  border: 1px solid var(--rule); background: var(--card); color: var(--ink); cursor: pointer;
}
button:hover { border-color: var(--accent); }
button:disabled { opacity: .5; cursor: default; border-color: var(--rule); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.tiny { padding: .35rem .55rem; font-size: .78rem; }
button.live { border-color: var(--bad); color: var(--bad); }

/* ------------------------------------------------------------------------- the transcript */
ol.lines { list-style: none; margin: 0; padding: 0; }
ol.lines li {
  display: grid; grid-template-columns: 2.2rem 6.2rem 1fr; gap: .1rem .6rem;
  padding: .45rem .4rem; border-bottom: 1px solid var(--rule); align-items: baseline;
}
ol.lines li.active { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.linebtn { grid-row: span 2; padding: .3rem .4rem; font-size: .8rem; }
.who {
  font: 600 .74rem/1.5 "Helvetica Neue", Arial, sans-serif; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted);
}
.who.examiner { color: var(--accent); }
ol.lines .ar {
  grid-column: 3; direction: rtl; text-align: right; line-height: 1.95; color: var(--muted);
  font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", serif;
}

/* ---------------------------------------------------------------------- the practice boxes */
.box {
  background: var(--card); border: 1px solid var(--rule); border-radius: 10px;
  padding: 1rem 1.1rem; margin: 0 0 1rem; box-shadow: var(--shadow);
}
.qnum {
  font: 600 .7rem/1.4 "Helvetica Neue", Arial, sans-serif; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 .25rem;
}
.box .q { margin: 0 0 .5rem; font-size: 1.05rem; }
.box .cue { margin: 0 0 .7rem 1.1rem; color: var(--muted); }
.box textarea {
  width: 100%; min-width: 0; font: 1rem/1.6 Georgia, serif; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 7px; padding: .6rem .7rem;
  resize: vertical;
}
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.model {
  margin-top: .8rem; padding: .7rem .85rem; border-left: 3px solid var(--accent);
  background: color-mix(in srgb, var(--accent) 7%, transparent); border-radius: 0 7px 7px 0;
}
.model .label {
  font: 600 .7rem/1.4 "Helvetica Neue", Arial, sans-serif; letter-spacing: .12em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 .3rem;
}
.model p { margin: 0 0 .4rem; }
.model .why { font-size: .9rem; color: var(--muted); }

/* ------------------------------------------------------------------------- the tutor pop-up */
dialog.tutorbox {
  width: min(44rem, 94vw); border: 1px solid var(--rule); border-radius: 12px;
  background: var(--card); color: var(--ink); padding: 1.1rem 1.2rem 1.4rem; box-shadow: var(--shadow);
}
dialog.tutorbox::backdrop { background: rgba(20, 18, 14, .55); }
.xrow { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
dialog blockquote {
  margin: .7rem 0 1rem; padding-left: .8rem; border-left: 3px solid var(--rule); color: var(--muted);
}
.tutor-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; }
.tutor-note { font-size: .88rem; color: var(--muted); }
.tutor-out { margin-top: .9rem; }
.tutor-out h4 { margin: 1rem 0 .3rem; font-size: .95rem; }
.tutor-out .band h4:first-child { margin-top: 0; }
.tutor-out ol { padding-left: 1.2rem; }
.tutor-honest {
  margin-top: 1rem; padding: .7rem .85rem; font-size: .88rem; color: var(--muted);
  border: 1px dashed var(--rule); border-radius: 7px;
}
.tutor-meta { margin-top: .5rem; }
.bad { color: var(--bad); }

@media (max-width: 34rem) {
  ol.lines li { grid-template-columns: 2.2rem 1fr; }
  .who { grid-column: 2; }
  ol.lines .tx, ol.lines .ar { grid-column: 2; }
}

/* ---------------------------------------------------------------- moving between the parts */
nav.partnav {
  display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center;
  max-width: 54rem; margin: 0 auto 3rem;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
nav.partnav a {
  font: 600 .85rem/1 "Helvetica Neue", Arial, sans-serif; text-decoration: none; color: inherit;
  border: 1px solid var(--rule); border-radius: 7px; padding: .6rem .9rem; background: var(--card);
}
nav.partnav a:hover { border-color: var(--accent); }
nav.partnav a[aria-current="page"] {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}

/* ------------------------------------------------- the Part 2 cue card, on the stage */
.card .label {
  font: 600 .64rem/1.4 "Helvetica Neue", Arial, sans-serif; letter-spacing: .14em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 .2rem;
}
.card .prompt { margin: 0 0 .6rem; font-size: 1rem; }
.card ul { margin: .1rem 0 0 1rem; padding: 0; }
.card li { margin: .1rem 0; }

/* ------------------------------------------------------------------- the marking write-up */
.overall { margin: .2rem 0 0; color: var(--muted); }
.overall b { color: var(--accent); font-size: 1.25rem; }
.crits { display: grid; gap: 1rem; }
@media (min-width: 48rem) { .crits { grid-template-columns: 1fr 1fr; } }
.crit {
  background: var(--card); border: 1px solid var(--rule); border-radius: 10px;
  padding: 1rem 1.1rem; box-shadow: var(--shadow); position: relative; min-width: 0;
}
.crit.active, .liftbox.active, .lesson-head.active {
  box-shadow: var(--shadow), 0 0 0 2px var(--accent);
  border-radius: 10px;
}
.bandnum {
  position: absolute; top: .8rem; right: 1.1rem; margin: 0;
  font: 700 1.5rem/1 "Helvetica Neue", Arial, sans-serif; color: var(--accent);
}
.crit .cue { margin: .2rem 0 .7rem 1.1rem; color: var(--muted); font-size: .92rem; }
.critcomment { margin: 0; }
.liftbox {
  margin-top: 2rem; padding: 1rem 1.1rem; background: var(--card);
  border: 1px solid var(--rule); border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0; box-shadow: var(--shadow);
}
.liftbox h2 { margin-top: 0; }
.disclaimer {
  margin-top: 1.4rem; padding: .7rem .85rem; border: 1px dashed var(--rule); border-radius: 7px;
}

/* --------------------------------------------------- the tutor: options, Arabic, the chat */
.tutor-opts { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.tutor-opts label { font: 600 .74rem/1 "Helvetica Neue", Arial, sans-serif; color: var(--muted); }
.tutor-opts select {
  font: 600 .8rem/1 "Helvetica Neue", Arial, sans-serif; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 6px; padding: .3rem .35rem;
}
button[aria-pressed="true"].ghost.tiny { border-color: var(--accent); color: var(--accent); }

/* The Arabic inside the feedback. It is typeset as Arabic, not as English in an Arabic font:
   its own direction, its own line height. An Arabic line set at a Latin line height runs into
   the line above it, which this project measured once and need not measure again. */
.tutor-out .ar, .chat .ar {
  direction: rtl; text-align: right; line-height: 1.95; color: var(--muted);
  font-family: "Segoe UI", Tahoma, "Noto Naskh Arabic", serif;
  margin: .15rem 0 .6rem;
}
.tutor.no-ar .ar { display: none; }

.chat { margin-top: 1.1rem; border-top: 1px solid var(--rule); padding-top: .8rem; }
.chat-h { margin: 0 0 .5rem; font-size: .95rem; }
.chat-log { display: flex; flex-direction: column; gap: .5rem; }
.chat-log .me, .chat-log .them {
  padding: .55rem .75rem; border-radius: 9px; max-width: 88%; font-size: .95rem;
}
.chat-log .me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); }
.chat-log .them { align-self: flex-start; background: var(--paper); border: 1px solid var(--rule); }
.chat-log .them p:first-child { margin-top: 0; }
.chat-log .them p:last-child { margin-bottom: 0; }
.chat-log .them.wait { color: var(--muted); font-style: italic; }
.chat-row { display: flex; gap: .5rem; margin-top: .7rem; align-items: flex-start; }
.chat-row textarea {
  flex: 1; min-width: 0; font: .95rem/1.5 Georgia, serif; color: var(--ink);
  background: var(--paper); border: 1px solid var(--rule); border-radius: 7px; padding: .5rem .6rem;
  resize: vertical;
}
.chat-note { margin: .5rem 0 0; }
