/* ===========================================================================
   Aratus Academy — page-level compositions.
   Mobile-first: every multi-column grid starts as a single column, so nothing
   can overflow at 360px. Logical properties throughout.
   =========================================================================== */

/* ---- hero ---------------------------------------------------------------- */

.hero {
  position: relative;
  isolation: isolate;
  z-index: 0;
  min-block-size: calc(100vh - var(--header-h));
  min-block-size: calc(100svh - var(--header-h));
  display: grid;
  place-items: end start;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
  object-position: center 18%;
  z-index: 0;
}

/* A directional gradient: no logical form exists, so it is mirrored below. */
.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    180deg,
    rgba(66, 16, 24, 0.5) 0%,
    rgba(66, 16, 24, 0.72) 55%,
    rgba(66, 16, 24, 0.95) 100%
  );
}

.hero-copy {
  position: relative;
  z-index: 2;
  inline-size: min(var(--max), calc(100% - var(--gutter) * 2));
  margin-inline: auto;
  padding-block: var(--sp-9) var(--sp-9);
}

.hero h1 {
  font-size: clamp(2.6rem, 11vw, 7rem);
  max-width: 14ch;
  margin-block: var(--sp-4) var(--sp-5);
}

[lang="ckb"] .hero h1 {
  max-width: 17ch;
  font-size: clamp(2rem, 8.5vw, 4.6rem);
}

.hero h1 em {
  font-style: italic;
  color: var(--gold-2);
}

[lang="ckb"] .hero h1 em { font-style: normal; }

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-block-start: var(--sp-6);
}

/* Full-bleed CTAs read better than two cramped pills at 360px. */
.hero-actions > .btn { flex: 1 1 100%; }

/* ---- marquee ------------------------------------------------------------- */

.marquee {
  border-block: 1px solid var(--line);
  overflow: hidden;
  padding-block: var(--sp-3);
  color: var(--muted);
}

.marquee-track {
  display: flex;
  gap: var(--sp-8);
  inline-size: max-content;
  animation: marquee 36s linear infinite;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  white-space: nowrap;
}

[lang="ckb"] .marquee-track { font-style: normal; }

@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* Keyframe transforms are physical; the scroll has to run the other way. */
[dir="rtl"] .marquee-track { animation-name: marquee-rtl; }

@keyframes marquee-rtl {
  from { transform: translateX(0); }
  to { transform: translateX(50%); }
}

/* ---- featured block ------------------------------------------------------ */

.featured {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-7);
  align-items: center;
}

.featured-visual {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-3);
  aspect-ratio: 4 / 3;
}

.featured-visual img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.play-btn {
  position: absolute;
  inset: 0;
  margin: auto;
  inline-size: 68px;
  block-size: 68px;
  border-radius: 50%;
  background: var(--gold-2);
  color: var(--ink-on-gold);
  display: grid;
  place-items: center;
  font-size: 1.3rem;
  box-shadow: var(--shadow-gold);
  transition: transform var(--dur) var(--ease);
}

.play-btn:hover { transform: scale(1.06); color: var(--ink-on-gold); }

/* A triangle glyph points along the reading direction. */
[dir="rtl"] .play-btn > .page-arrow,
[dir="rtl"] .play-btn > svg { transform: scaleX(-1); }

.play-overlay {
  position: absolute;
  inset: 0;
  margin: auto;
  inline-size: 68px;
  block-size: 68px;
  pointer-events: none;
}

/* ---- about split --------------------------------------------------------- */

.about-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-8);
  align-items: center;
}

.portrait {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--bg-3);
}

.portrait img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}

.portrait-caption {
  position: absolute;
  inset-inline: var(--sp-4);
  inset-block-end: var(--sp-4);
  padding: var(--sp-4);
  background: var(--overlay);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
}

.portrait-caption .lead { font-size: 0.9rem; }

/* ---- CTA band ------------------------------------------------------------ */

.cta-band {
  margin-inline: var(--gutter);
  margin-block-end: var(--sp-10);
  border-radius: var(--radius-lg);
  padding: var(--sp-8) var(--sp-5);
  text-align: center;
  background-color: var(--surface);
  background-image: radial-gradient(circle at 50% 0%, rgba(223, 180, 73, 0.18), transparent 55%);
  border: 1px solid var(--line);
}

.cta-band h2 {
  font-size: clamp(1.9rem, 7vw, 4rem);
  margin: var(--sp-3) auto var(--sp-4);
  max-width: 18ch;
}

.cta-band .lead { margin-inline: auto; }
.cta-band .btn { margin-block-start: var(--sp-6); }

/* ---- catalogue controls -------------------------------------------------- */

.search-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-block: var(--sp-5) var(--sp-3);
}

.search-row input {
  flex: 1 1 200px;
  min-inline-size: 0;
  min-block-size: var(--tap);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  padding-inline: var(--sp-5);
  font-size: 1rem;
  outline: none;
}

.search-row input:focus { border-color: var(--gold); }
.search-row .btn { flex: 0 0 auto; }

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-block-end: var(--sp-6);
}

.result-count {
  color: var(--dim);
  font-size: 0.84rem;
  margin-block-end: var(--sp-4);
}

/* ---- course detail ------------------------------------------------------- */

.course-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-7);
  padding-block: var(--sp-7) var(--sp-6);
}

.buy-card { padding: var(--sp-5); }

.buy-card img {
  inline-size: 100%;
  border-radius: var(--radius-md);
  margin-block-end: var(--sp-4);
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--bg-3);
}

.buy-card .btn { inline-size: 100%; margin-block-start: var(--sp-3); }

.buy-list { margin-block: var(--sp-4) var(--sp-5); }

.buy-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-2);
  padding-block: var(--sp-2);
  border-block-end: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}

.buy-list li:last-child { border-block-end: 0; }

.teacher-row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-block: var(--sp-6) var(--sp-2);
}

.teacher-row img {
  inline-size: 56px;
  block-size: 56px;
  flex: none;
  border-radius: 50%;
  object-fit: cover;
  aspect-ratio: 1;
  background: var(--surface-2);
}

.teacher-row small { display: block; color: var(--gold); font-size: 0.75rem; }
.teacher-row span { display: block; color: var(--muted); font-size: 0.88rem; }

.review-list {
  display: grid;
  gap: var(--sp-5);
  margin-block-start: var(--sp-5);
}

.review {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: var(--sp-3);
  padding-block-end: var(--sp-4);
  border-block-end: 1px solid var(--line);
}

.review p { margin-block: var(--sp-1); color: var(--muted); }
.review small { color: var(--dim); font-size: 0.8rem; }

/* ---- checkout, donate, contact ------------------------------------------- */

.checkout-grid,
.donate-grid,
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-6);
}

.order-summary { padding: var(--sp-5); }

.order-summary img {
  inline-size: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-block-end: var(--sp-4);
  background: var(--bg-3);
}

/* ---- account area ------------------------------------------------------- */

.account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-6);
  padding-block: var(--sp-7) var(--sp-10);
  align-items: start;
}

/* Horizontal scroller on phones, vertical rail on desktop. The scroller is the
   element that scrolls — the page never does. */
.account-nav {
  display: flex;
  gap: var(--sp-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-block-end: var(--sp-2);
  min-inline-size: 0;
}

.account-nav::-webkit-scrollbar { display: none; }

.account-nav a {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-block-size: var(--tap);
  padding-inline: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  color: var(--muted);
  font-size: 0.88rem;
  white-space: nowrap;
}

.account-nav a:hover { border-color: var(--line-strong); color: var(--ink); }

/* Sign out sits at the end of the account menu, looking like its neighbours
   but quieter, so it is easy to find without inviting a mis-tap. */
.account-signout { flex: 0 0 auto; margin: 0; }
.account-signout button {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--tap);
  padding-inline: var(--sp-4);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-pill);
  background: none;
  color: var(--muted);
  font: inherit;
  white-space: nowrap;
  cursor: pointer;
}
.account-signout button:hover { color: var(--danger); border-color: var(--danger-line); }

.account-nav a.is-active {
  border-color: var(--gold);
  color: var(--gold-2);
  background-image: linear-gradient(var(--gold-soft), var(--gold-soft));
}

.account-main { min-inline-size: 0; display: grid; gap: var(--sp-6); }

.account-section { display: grid; gap: var(--sp-4); }

.account-section > h2 {
  font-size: 1.5rem;
  padding-block-end: var(--sp-3);
  border-block-end: 1px solid var(--line);
}

/* ---- subscribe page ----------------------------------------------------- */

.subscribe-intro { text-align: center; padding-block: var(--sp-8) var(--sp-7); }
.subscribe-intro .eyebrow { justify-content: center; }
.subscribe-intro .lead { margin-inline: auto; }

/* ---- player ------------------------------------------------------------- */

.player-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-block-size: calc(100vh - var(--header-h));
  min-block-size: calc(100svh - var(--header-h));
}

.player {
  background: #050506;
  display: grid;
  place-items: center;
  padding: var(--sp-4);
  min-inline-size: 0;
}

.player-stage {
  position: relative;
  inline-size: 100%;
  max-inline-size: 1080px;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #0b0b0e;
}

.player-stage img,
.player-stage video {
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
}

.player-chrome {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  padding: var(--sp-8) var(--sp-4) var(--sp-4);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  color: #f4efe4;
}

.player-chrome .progress {
  block-size: 5px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-pill);
  margin-block-end: var(--sp-3);
  overflow: hidden;
}

.player-tools {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-3);
  font-size: 0.85rem;
  color: #d9d1c3;
}

.player-tools button,
.player-tools a {
  min-block-size: var(--tap);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  color: inherit;
}

.lesson-rail {
  border-block-start: 1px solid var(--line);
  background: var(--bg-2);
  overflow-y: auto;
  padding: var(--sp-4);
  max-block-size: 60vh;
  min-inline-size: 0;
}

.lesson-item {
  display: grid;
  /* 2ch, not 72px. The old width was sized for a lesson thumbnail that this
     markup never renders, so the number sat marooned in an empty column and the
     title started a third of the way across a rail that has none to spare. */
  grid-template-columns: 2.1rem minmax(0, 1fr);
  gap: 2px var(--sp-3);
  /* Start, not center: the right-hand cell grows to two or three lines, and
     centering floated the number against the middle of a block it labels. */
  align-items: start;
  inline-size: 100%;
  min-block-size: var(--tap);
  text-align: start;
  padding: var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}
.lesson-item > span:first-child {
  /* Tabular figures so 01/02/10 share a width and the titles line up. */
  font-variant-numeric: tabular-nums;
  font-size: 0.78rem;
  color: var(--dim);
  /* Optical: nudge onto the title's first baseline rather than its box top. */
  padding-block-start: 1px;
}
.lesson-item.is-current > span:first-child { color: var(--gold); }

.lesson-item:has(img) { grid-template-columns: 72px minmax(0, 1fr); }
.lesson-item img {
  inline-size: 72px;
  block-size: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--sp-2);
  background: var(--bg-3);
}
.lesson-item b {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  line-height: 1.35;
}

/* The meta line: duration and status badges.

   Was inline content inside <small>, so the badges aligned on text baselines
   with whatever spacing the inline formatting context produced, and a second
   badge dropped to its own line with a full line-height gap above it. A flex
   row wraps on its own terms and keeps one gap value in both axes. */
.lesson-item small {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--dim);
  font-size: 0.76rem;
  margin-block-start: 4px;
}

/* Badges in the rail are secondary to the title above them. At the shared .pill
   size they competed with it and forced the wrap this block exists to stop. */
.lesson-item .pill {
  padding: 2px 8px;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
  border-color: var(--line);
  background: var(--bg-3);
}
.lesson-item.is-current .pill {
  border-color: color-mix(in srgb, var(--gold) 45%, transparent);
  color: var(--gold);
  background: color-mix(in srgb, var(--gold) 10%, transparent);
}

/* A row's own progress bar sits under the meta line. The shared .progress rule
   carries page-level margins that are far too loose inside a compact row. */
.lesson-item .progress {
  block-size: 3px;
  margin-block: 6px 0;
}

/* The text cell. A grid item is blockified, but it still needs the explicit
   zero minimum or a long lecture title refuses to wrap and widens the rail. */
.lesson-item > span:last-child { min-inline-size: 0; }

.lesson-item.is-current,
.lesson-item:hover {
  background: var(--surface);
  color: var(--ink);
}
.lesson-item.is-current { box-shadow: inset 3px 0 0 var(--gold); }
[dir="rtl"] .lesson-item.is-current { box-shadow: inset -3px 0 0 var(--gold); }

.lesson-item.is-locked { opacity: 0.55; }

/* ---- progress bar ------------------------------------------------------- */

.progress {
  block-size: 6px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  margin-block: var(--sp-3) var(--sp-4);
  overflow: hidden;
}

/* A block child takes its width from the inline start, so this mirrors itself
   in RTL with no override. */
.progress > span {
  display: block;
  block-size: 100%;
  background: var(--gold);
  border-radius: var(--radius-pill);
}

/* ---- page intro -------------------------------------------------------- */

.page-intro { padding-block: var(--sp-8) var(--sp-10); }

.page-intro h1 {
  font-size: clamp(2.1rem, 8vw, 5rem);
  margin-block-start: var(--sp-3);
}

[lang="ckb"] .page-intro h1 { font-size: clamp(1.8rem, 7vw, 4rem); }

.display {
  font-size: clamp(1.9rem, 6.5vw, 4.2rem);
  margin-block: var(--sp-3) var(--sp-4);
}

/* ---- journal ----------------------------------------------------------- */

.journal-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-4);
}

.journal-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-3);
  padding: var(--sp-3);
  align-items: center;
  min-inline-size: 0;
}

.journal-card img {
  inline-size: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
}

.journal-card h3 { font-size: 1.2rem; margin-block: var(--sp-1); }
.journal-card .lead { font-size: 0.94rem; }

.journal-card-lg {
  grid-template-columns: minmax(0, 1fr);
  padding: 0 0 var(--sp-5);
}

.journal-card-lg img {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius) var(--radius) 0 0;
}

.journal-card-lg > div { padding-inline: var(--sp-5); }

.article-hero {
  inline-size: 100%;
  aspect-ratio: 16 / 9;
  max-block-size: 420px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-block-end: var(--sp-6);
  background: var(--bg-3);
}

.prose {
  max-width: var(--max-prose);
  color: var(--muted);
  font-size: 1.02rem;
}

.prose > * + * { margin-block-start: 1.1em; }
.prose h2, .prose h3 { color: var(--ink); margin-block-start: 1.8em; }
.prose h2 { font-size: 1.6rem; }
.prose h3 { font-size: 1.3rem; }
.prose a { color: var(--gold-2); text-decoration: underline; }

.prose ul, .prose ol { padding-inline-start: var(--sp-5); }
.prose ul li { list-style: disc; }
.prose ol li { list-style: decimal; }
.prose li + li { margin-block-start: 0.4em; }

.prose blockquote {
  margin: 1.6em 0;
  padding-inline-start: var(--sp-5);
  border-inline-start: 2px solid var(--gold);
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink);
}

[lang="ckb"] .prose blockquote { font-style: normal; }

.prose img { border-radius: var(--radius-md); margin-block: 1.6em; }

/* ---- seminars and library ---------------------------------------------- */

.seminar-card,
.library-card { padding: var(--sp-4) var(--sp-4) var(--sp-5); }

.seminar-card img,
.library-card img {
  inline-size: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--radius-md);
  margin-block-end: var(--sp-4);
  background: var(--bg-3);
}

.seminar-card .btn { margin-block-start: var(--sp-4); }
.seminar-card h3 { font-size: 1.3rem; margin-block: var(--sp-2); }

.library-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-4);
  /* Top, not centre. Centring is right for the cover-beside-text layout below,
     but in the stacked card it floated a short card's title halfway down while
     a longer neighbour started at the top, so a row of cards had its headings
     at three different heights. */
  align-items: start;
}

.library-card h3 { font-size: 1.25rem; }
.library-card .btn { inline-size: 100%; }

/* ---- auth, legal, thanks, errors --------------------------------------- */

.auth-card {
  max-inline-size: var(--max-form);
  margin-inline: auto;
}

.auth-card form { padding: var(--sp-5); }

/* Sign-in and sign-up are read by people who rarely fill in forms online, so
   everything here is a size up: plain heading, large labels and boxes, and
   the way to the other form is a full button rather than a small link. */
.auth-card h1 {
  font-size: clamp(2rem, 7vw, 2.6rem);
  margin-block-end: var(--sp-2);
}
.auth-card .lead { margin-block-end: var(--sp-5); }
.auth-card .form-field label {
  font-size: 1.05rem;
  color: var(--ink);
}
.auth-card input[type="email"],
.auth-card input[type="text"],
.auth-card input[type="password"] {
  min-block-size: 54px;
  font-size: 1.05rem;
}
.auth-card input::placeholder { color: var(--dim); opacity: 0.7; }

.pw-field { position: relative; }
.pw-field input { inline-size: 100%; padding-inline-end: 5.5rem; }
.pw-toggle {
  position: absolute;
  inset-block: 6px;
  inset-inline-end: 6px;
  padding-inline: var(--sp-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.pw-toggle:hover { background: var(--surface-3); }

.auth-card .check-row { font-size: 1rem; margin-block: var(--sp-2) var(--sp-4); }
.auth-forgot { text-align: center; margin-block-start: var(--sp-4); }
.auth-forgot a { color: var(--gold-2); text-decoration: underline; text-underline-offset: 3px; }
.auth-agree { margin-block-start: var(--sp-4); }
.auth-agree a { color: var(--gold-2); text-decoration: underline; }

.auth-switch {
  margin-block-start: var(--sp-6);
  padding-block-start: var(--sp-5);
  border-block-start: 1px solid var(--line);
  text-align: center;
}
.auth-switch p { margin-block-end: var(--sp-3); font-size: 1.05rem; color: var(--muted); }

.legal-page {
  max-inline-size: var(--max-narrow);
  padding-block-end: var(--sp-10);
}

.thanks-img {
  inline-size: min(560px, 100%);
  border-radius: var(--radius);
  margin-block-end: var(--sp-6);
  background: var(--bg-3);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-5);
  margin-block-start: var(--sp-5);
  color: var(--muted);
  font-size: 0.88rem;
}

.wide-photo {
  inline-size: 100%;
  aspect-ratio: 21 / 9;
  max-block-size: 440px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-block-start: var(--sp-9);
  border: 1px solid var(--line);
  background: var(--bg-3);
}

.notfound {
  min-block-size: 70vh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--sp-10) var(--gutter);
}

.notfound .hero-actions { justify-content: center; }

/* ---- breakpoints ------------------------------------------------------- */

@media (min-width: 600px) {
  .hero-actions > .btn { flex: 0 0 auto; }

  .hero-shade {
    background: linear-gradient(
      90deg,
      rgba(66, 16, 24, 0.88) 4%,
      rgba(66, 16, 24, 0.42) 42%,
      rgba(66, 16, 24, 0.08) 100%
    );
  }

  [dir="rtl"] .hero-shade {
    background: linear-gradient(
      270deg,
      rgba(66, 16, 24, 0.9) 4%,
      rgba(66, 16, 24, 0.46) 44%,
      rgba(66, 16, 24, 0.1) 100%
    );
  }

  .hero-copy { padding-block: var(--sp-10) var(--sp-10); }
  .marquee-track { font-size: 1.15rem; }
  .play-btn, .play-overlay { inline-size: 84px; block-size: 84px; }

  .journal-card {
    grid-template-columns: 140px minmax(0, 1fr);
    gap: var(--sp-4);
  }

  .journal-card-lg { grid-template-columns: minmax(0, 1fr); }

  /* Two columns only when there is a cover to put in the first one. The
     library card renders no <img>, so applying this unconditionally put the
     whole card into a ~110px column and left the other half empty — which is
     why the titles broke mid-word ("Fractur / ed Age"). */
  .library-card:has(img) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: center; }
  .library-card img { margin-block-end: 0; block-size: 100%; }
  .library-card .btn { inline-size: auto; }

  .review { grid-template-columns: 48px minmax(0, 1fr); gap: var(--sp-4); }

  /* Only when the row actually carries a thumbnail. Unconditionally, this
     reserved 88px for an image the watch rail never renders, which is what
     stranded the lecture number a third of the way across the rail. */
  .lesson-item:has(img) { grid-template-columns: 88px minmax(0, 1fr); }
  .lesson-item img { inline-size: 88px; }

  .cta-band { padding: var(--sp-10) var(--sp-8); }
  .notfound .hero-actions > .btn { flex: 0 0 auto; }
}

@media (min-width: 900px) {
  .featured { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: var(--sp-8); }
  .featured-visual { aspect-ratio: 4 / 3; min-block-size: 420px; }

  .about-split { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--sp-9); }

  .course-hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); gap: var(--sp-7); }

  .buy-card {
    position: sticky;
    inset-block-start: calc(var(--header-h) + var(--sp-4));
  }

  .checkout-grid,
  .donate-grid,
  .contact-grid { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: var(--sp-7); }

  .journal-grid { grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr); }

  .account-layout {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: var(--sp-8);
  }

  .account-nav {
    flex-direction: column;
    overflow: visible;
    position: sticky;
    inset-block-start: calc(var(--header-h) + var(--sp-4));
    padding-block-end: 0;
  }

  .account-nav a {
    border: 0;
    border-radius: var(--radius-sm);
    border-inline-start: 2px solid var(--line);
    justify-content: flex-start;
    padding-inline: var(--sp-4);
    inline-size: 100%;
  }

  .account-nav a.is-active {
    border-inline-start-color: var(--gold);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  }

  [dir="rtl"] .account-nav a.is-active { border-radius: var(--radius-sm) 0 0 var(--radius-sm); }

  .cta-band { margin-inline: var(--sp-5); }
}

@media (min-width: 1100px) {
  .player-layout { grid-template-columns: minmax(0, 1fr) var(--rail-w); }

  .player { padding: var(--sp-7) var(--sp-5); }

  .lesson-rail {
    border-block-start: 0;
    border-inline-start: 1px solid var(--line);
    max-block-size: none;
    padding: var(--sp-5);
  }
}

/* ===========================================================================
   Player pages, as the templates actually build them.

   `private/views/site/watch.php` and `lesson.php` put .breadcrumb, .player-stage,
   .player-chrome, .player-notice and .player-tools as siblings in a column
   inside .player — the chrome is a heading block under the video, not a bar
   over it, and the video carries native `controls`. The overlay treatment is
   kept for the nested case (.player-stage .player-chrome) so both shapes work.
   These rules come last in the file on purpose: they override the generic
   player block above at equal specificity.
   =========================================================================== */

.player {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: var(--sp-5);
  padding: var(--sp-4);
}

/* Everything in the column shares the stage's measure so it reads as one unit. */
.player > * {
  inline-size: 100%;
  max-inline-size: 1080px;
  margin-inline: auto;
}

.player-stage { margin-inline: auto; }

.player-video {
  inline-size: 100%;
  block-size: 100%;
  object-fit: contain;
  background: #000;
}

/* Static by default; a gradient bar only when it really overlays the stage. */
.player-chrome {
  position: static;
  display: grid;
  gap: var(--sp-2);
  padding: 0;
  background: none;
  color: inherit;
}

.player-chrome h1 { font-size: clamp(1.5rem, 5.5vw, 2.4rem); }

.player-stage .player-chrome {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  padding: var(--sp-8) var(--sp-4) var(--sp-4);
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  color: #f4efe4;
}

.player-tools {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  justify-content: flex-start;
  gap: var(--sp-3);
  color: var(--muted);
  font-size: 0.88rem;
}

.player-stage .player-tools {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  color: #d9d1c3;
}

.player-tools .progress { margin-block: 0 var(--sp-2); }
.player-tools p { margin: 0; }

.player-tools-nav {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.player-tools-note { color: var(--dim); font-size: 0.82rem; }

.player-notice {
  display: grid;
  gap: var(--sp-3);
  justify-items: start;
  padding: var(--sp-4) var(--sp-5);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--gold);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  background-image: linear-gradient(var(--gold-soft), var(--gold-soft));
  color: var(--ink);
  font-size: 0.94rem;
}

.player-notice p { margin: 0; }

/* The start affordance: the <video> has no src until player.js fetches a signed
   URL, so its native play button has nothing to act on yet. */
.player-start {
  position: absolute;
  inset: 0;
  margin: auto;
  inline-size: 72px;
  block-size: 72px;
  border-radius: 50%;
  background: var(--gold-2);
  color: var(--ink-on-gold);
  display: grid;
  place-items: center;
  font-size: 1.4rem;
  box-shadow: var(--shadow-gold);
  transition: transform var(--dur) var(--ease);
}

.player-start:hover { transform: scale(1.06); }
[dir="rtl"] .player-start > span { transform: scaleX(-1); }

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--sp-4);
  padding: var(--sp-5);
  text-align: center;
  background: var(--scrim);
  color: var(--ink);
  font-size: 0.94rem;
}

.player-overlay p { margin: 0; }

/* Faint, moved periodically by player.js. A deterrent that makes a leaked copy
   traceable to an account — not protection, and never described as DRM. */
.player-locked {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: var(--sp-4);
  padding: var(--sp-6) var(--sp-5);
  text-align: center;
  background:
    radial-gradient(circle at 50% 30%, rgba(223, 180, 73, 0.12), transparent 60%),
    #0b0b0e;
}

.player-locked p { margin: 0; }

.player-locked-message {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 4.5vw, 1.5rem);
  color: var(--ink);
  max-width: 30ch;
}

/* ---- breadcrumb --------------------------------------------------------- */

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  color: var(--dim);
  font-size: 0.84rem;
}

.breadcrumb a {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--tap);
  color: var(--muted);
}

.breadcrumb a:hover { color: var(--gold-2); }

/* ---- lesson rail, list form --------------------------------------------- */

.lesson-rail-title {
  font-family: var(--font-sans);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: var(--tracking-eyebrow);
  text-transform: var(--case-eyebrow);
  color: var(--gold);
  margin-block-end: var(--sp-4);
}

[lang="ckb"] .lesson-rail-title { font-size: 0.92rem; }

.lesson-list { display: grid; gap: 2px; }

.lesson-module {
  padding: var(--sp-5) var(--sp-3) var(--sp-2);
  color: var(--dim);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: var(--tracking-micro);
  text-transform: var(--case-eyebrow);
}

[lang="ckb"] .lesson-module { font-size: 0.9rem; }

/* In list form the <li> is only a wrapper: the <a> is the row, so the generic
   .lesson-item thumbnail grid above has to be switched off here. */
.lesson-list .lesson-item,
.lesson-list .lesson-item:hover,
.lesson-list .lesson-item.is-current {
  display: block;
  padding: 0;
  background: transparent;
  box-shadow: none;
  color: inherit;
  opacity: 1;
}

.lesson-item-link {
  display: grid;
  grid-template-columns: 2.4rem minmax(0, 1fr);
  gap: 2px var(--sp-3);
  align-items: baseline;
  min-block-size: var(--tap);
  padding: var(--sp-3);
  border-radius: var(--radius-sm);
  color: var(--muted);
  transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.lesson-item-link:hover {
  background: var(--surface);
  color: var(--ink);
}

.lesson-item-number {
  grid-row: 1 / span 3;
  color: var(--dim);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.lesson-item-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: inherit;
}

.lesson-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
}

.lesson-item-duration {
  color: var(--dim);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
}

.lesson-list .lesson-item.is-current > .lesson-item-link {
  background: var(--surface);
  color: var(--ink);
  box-shadow: inset 3px 0 0 var(--gold);
}

[dir="rtl"] .lesson-list .lesson-item.is-current > .lesson-item-link {
  box-shadow: inset -3px 0 0 var(--gold);
}

.lesson-list .lesson-item.is-done .lesson-item-title { color: var(--dim); }
.lesson-list .lesson-item.is-locked > .lesson-item-link { opacity: 0.6; }

@media (min-width: 1100px) {
  .player { padding: var(--sp-7) var(--sp-5); }
}

/* ===========================================================================
   Active-state reconciliation.

   The templates mark the current item with aria-current="page", and only
   sometimes also with .is-active (the mobile drawer uses the attribute alone).
   Styling the attribute means the highlight follows the accessible state
   rather than a parallel class that can drift out of step.
   =========================================================================== */

.nav-links a[aria-current],
.mobile-nav a[aria-current],
.footer-col a[aria-current] { color: var(--gold-2); }

.account-nav a[aria-current] {
  border-color: var(--gold);
  color: var(--gold-2);
  background-image: linear-gradient(var(--gold-soft), var(--gold-soft));
}

.filter-btn[aria-current] {
  border-color: var(--gold);
  color: var(--gold-2);
  background-image: linear-gradient(var(--gold-soft), var(--gold-soft));
}

@media (min-width: 900px) {
  .account-nav a[aria-current] {
    border: 0;
    border-inline-start: 2px solid var(--gold);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  }

  [dir="rtl"] .account-nav a[aria-current] {
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  }
}

/* partial/pagination.php builds the control from .pill.filter-btn inside
   .filters.pagination, with a decorative ellipsis. Keep the ellipsis plain. */
.pagination .pill[aria-hidden="true"] {
  border-color: transparent;
  background: none;
  padding-inline: var(--sp-1);
  color: var(--dim);
}

.pagination .filter-btn { min-inline-size: var(--tap); justify-content: center; }

/* `.player-tools a { color: inherit }` above is meant for plain inline links in
   the overlay chrome, but it out-specifies the button classes, which carry
   their own colour. Restore it for anything that is a button. */
.player-tools .btn,
.player-tools .button {
  display: inline-flex;
  color: var(--ink);
}

.player-tools .btn-gold,
.player-tools .btn--gold,
.player-tools .button-primary { color: var(--ink-on-gold); }

.player-tools .btn-line { color: var(--gold-2); }

/* Plan description: operator-authored rich text inside a plan card, so it has
   to carry paragraphs and emphasis without inheriting the page's prose rhythm,
   which is far too generous for a card. */
.plan-description {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}
.plan-description > :first-child { margin-block-start: 0; }
.plan-description > :last-child  { margin-block-end: 0; }
.plan-description p { margin-block: 0 var(--sp-2); }
.plan-description strong { color: var(--ink); font-weight: 600; }
.plan-description ul,
.plan-description ol { margin-block: 0 var(--sp-2); padding-inline-start: 1.1em; }

/* ===========================================================================
   Welcome page — what a guest sees while the site is members only.
   Always Kurdish and right-to-left; logical properties keep it correct either
   way. Centred, one column, plain: the job is "what is this, and how do I get
   in", nothing more.
   =========================================================================== */

.welcome-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: var(--sp-9) var(--sp-10);
  text-align: center;
}

/* A warm pool of light behind the seal, so the page reads as burgundy and
   gold rather than a flat field. */
.welcome-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(ellipse 60% 48% at 50% 18%, rgba(223, 180, 73, 0.16), transparent 70%),
    radial-gradient(ellipse 90% 70% at 50% 30%, var(--surface-2), transparent 75%);
}

.welcome-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.welcome-seal {
  inline-size: clamp(120px, 34vw, 168px);
  block-size: auto;
  margin-block-end: var(--sp-6);
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.45));
}

/* The kicker's leading rule looks lopsided on a centred line; drop it here. */
.welcome-eyebrow::before { display: none; }

.welcome-title {
  margin-block: var(--sp-3) var(--sp-4);
  font-size: clamp(2.1rem, 8vw, 3.6rem);
  color: var(--ink);
}

.welcome-lead {
  margin: 0 auto var(--sp-3);
  max-width: 34rem;
  font-size: clamp(1.15rem, 3.6vw, 1.4rem);
  color: var(--gold-2);
}

.welcome-body {
  margin: 0 auto;
  max-width: 36rem;
  font-size: 1.05rem;
  color: var(--muted);
}

.welcome-gate {
  inline-size: min(100%, 36rem);
  margin-block-start: var(--sp-8);
  padding: var(--sp-6) var(--sp-5);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.welcome-members {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  margin: 0 0 var(--sp-5);
  text-align: start;
  color: var(--ink);
  font-size: 1.05rem;
}

.welcome-lock {
  flex: none;
  inline-size: 26px;
  block-size: 26px;
  margin-block-start: 0.2em;
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.welcome-actions {
  display: grid;
  gap: var(--sp-3);
}

.welcome-actions .btn { inline-size: 100%; }

/* ---- shared section heading -------------------------------------------- */

.welcome-section-head {
  margin: 0 auto var(--sp-7);
  max-width: 36rem;
  text-align: center;
}

.welcome-section-head h2 {
  margin: 0 0 var(--sp-2);
  font-size: clamp(1.6rem, 5vw, 2.3rem);
}

.welcome-section-head p {
  margin: 0;
  color: var(--muted);
}

/* ---- trailers ----------------------------------------------------------- */

.welcome-videos { padding-block-start: 0; }

.welcome-video-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-6);
}

.welcome-video {
  margin: 0;
}

.welcome-video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #050506;
  box-shadow: var(--shadow);
}

.welcome-video-frame video,
.welcome-video-frame iframe {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  border: 0;
  object-fit: contain;
  background: #050506;
}

.welcome-video figcaption {
  margin-block-start: var(--sp-3);
  text-align: center;
  color: var(--ink);
  font-size: 1.02rem;
}

/* ---- three points ------------------------------------------------------- */

.welcome-point-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-4);
}

.welcome-point {
  padding: var(--sp-6) var(--sp-5);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.welcome-point-icon {
  inline-size: 44px;
  block-size: 44px;
  margin: 0 auto var(--sp-4);
  padding: 9px;
  border-radius: 50%;
  background: var(--gold-soft);
  fill: none;
  stroke: var(--gold);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* The play triangle reads better filled. */
.welcome-point:first-child .welcome-point-icon { fill: var(--gold); stroke: none; }

.welcome-point h3 {
  margin: 0 0 var(--sp-2);
  font-size: 1.2rem;
  color: var(--gold-2);
}

.welcome-point p {
  margin: 0;
  color: var(--muted);
}

.welcome-closing {
  margin-block-start: var(--sp-8);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-4);
  text-align: center;
}

.welcome-closing p { margin: 0; color: var(--muted); }

.welcome-closing p a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

/* ---- minimal footer while the site is locked ---------------------------- */

.site-footer.is-locked .footer-grid { grid-template-columns: minmax(0, 1fr); }
.site-footer.is-locked .footer-col { text-align: center; }
.site-footer.is-locked .footer-quote { margin-inline: auto; max-width: 30rem; }
.site-footer.is-locked .footer-bottom {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

@media (min-width: 600px) {
  .welcome-hero { padding-block: var(--sp-10) var(--sp-11); }
  .welcome-gate { padding: var(--sp-7); }
  .welcome-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 900px) {
  .welcome-video-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .welcome-video-grid.is-single {
    grid-template-columns: minmax(0, 1fr);
    max-width: 920px;
    margin-inline: auto;
  }
  .welcome-point-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---- subscribe: optional top-up --------------------------------------- */

/* Collapsed by default so a plan card reads as price + button; opening it
   shows the fixed amounts as large tap targets, each with its new total. */
.pay-more {
  margin-block-end: var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-3);
}
.pay-more summary {
  cursor: pointer;
  padding: var(--sp-2) var(--sp-3);
  color: var(--gold-2);
  font-size: 0.98rem;
  list-style-position: inside;
}
.pay-more[open] summary { border-block-end: 1px solid var(--line); }
.pay-more fieldset {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 6px;
  margin: 0;
  padding: var(--sp-2);
  border: 0;
}

.pay-more-option { display: block; }
.pay-more-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pay-more-option label {
  display: flex;
  align-items: center;
  justify-content: center;
  min-block-size: 38px;
  padding: 6px var(--sp-3);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.4;
  cursor: pointer;
}
.pay-more-option input:checked + label {
  border-color: var(--gold);
  background-image: linear-gradient(var(--gold-soft), var(--gold-soft));
  color: var(--gold-2);
}
.pay-more-option input:focus-visible + label {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---- subscribe: payment-method tiles with logos ------------------------- */

/* Same pattern as .pay-more-option above: the real radio is visually hidden, the
   label is the tile, :checked styles it. Every tile is the SAME size: .pay-list is a
   grid whose rows are all as tall as the tallest, and each label fills its row, so no
   method can look bigger than another. --k scales the band, logos, tick and padding
   (0.8 = 20% smaller than the first design). Logos sit on a light band because the
   navy of FastPay and Visa vanishes on the burgundy page. */
.pay-methods {
  --k: 0.8;
  min-inline-size: 0;
  margin: 0 0 var(--sp-4);
  padding: 0;
  border: 0;
}
.pay-methods > legend { padding: 0; margin-block-end: var(--sp-3); }
.pay-list {
  display: grid;
  grid-auto-rows: 1fr;
  gap: var(--sp-3);
}
.pay-method { display: flex; position: relative; }
.pay-method input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.pay-method label {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-inline-size: 0;
  overflow: hidden;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  transition: border-color var(--dur-fast) var(--ease),
              box-shadow var(--dur-fast) var(--ease),
              background-color var(--dur-fast) var(--ease);
}
.pay-method label:hover { border-color: var(--gold-deep); }

.pay-logos {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: calc(16px * var(--k));
  block-size: calc(72px * var(--k));
  padding: 0 calc(52px * var(--k));   /* side room keeps the logos clear of the tick */
  background: #fffdf8;
}
.pay-logos img { display: block; inline-size: auto; max-inline-size: 100%; }
.pay-logo-fastpay { block-size: calc(38px * var(--k)); }
.pay-logo-visa    { block-size: calc(26px * var(--k)); }
.pay-logo-mc      { block-size: calc(42px * var(--k)); }
.pay-logo-fib     { block-size: calc(42px * var(--k)); }

/* the name: one slot of two lines, text centred in it */
.pay-name {
  flex: 1;
  display: flex;
  align-items: center;
  padding-block: calc(8px - 12px * (1 - var(--k)));
  padding-inline: calc(16px * var(--k));
}
.pay-name strong {
  color: var(--ink);
  font-size: calc(0.88rem * (0.55 + 0.45 * var(--k)));
  font-weight: 600;
  line-height: calc(1.55 - 0.75 * (1 - var(--k)));
}
.pay-brand {
  color: var(--gold-2);
  font-family: var(--font-sans);
  font-weight: 600;
  letter-spacing: 0.04em;
}

/* the selection mark: top corner of the logo band */
.pay-tick {
  position: absolute;
  inset-block-start: calc(12px * var(--k));
  inset-inline-start: calc(12px * var(--k));
  inline-size: calc(26px * var(--k));
  block-size: calc(26px * var(--k));
  border: 2px solid #cdbfb6;
  border-radius: 50%;
  background: #fff;
  transition: background-color var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease);
}
.pay-tick::after {
  content: "";
  position: absolute;
  inset-block-start: 22%;
  inset-inline-start: 31%;
  inline-size: 24%;
  block-size: 42%;
  border: solid var(--ink-on-gold);
  border-width: 0 2.5px 2.5px 0;
  transform: rotate(45deg) scale(0);
  transition: transform var(--dur-fast) var(--ease);
}

/* a method with no logo (Manual, FIB, ...): text only, tick centred beside the name */
.pay-method--text .pay-tick {
  inset-block-start: 50%;
  transform: translateY(-50%);
}
.pay-method--text .pay-name { padding-inline-start: calc(52px * var(--k)); }

.pay-method input:checked + label {
  border-color: var(--gold);
  box-shadow: 0 0 0 1px var(--gold), var(--shadow-gold);
  background-image: linear-gradient(var(--gold-soft), var(--gold-soft));
}
.pay-method input:checked + label .pay-tick {
  background: var(--gold);
  border-color: var(--gold-deep);
}
.pay-method input:checked + label .pay-tick::after { transform: rotate(45deg) scale(1); }
.pay-method input:focus-visible + label {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  .pay-method label, .pay-tick, .pay-tick::after { transition: none; }
}

/* ---- subscribe + checkout: one plain line about FastPay's 10-minute QR code ---- */

.pay-note {
  margin: var(--sp-3) 0 0;
  padding: var(--sp-2) var(--sp-3);
  border-inline-start: 3px solid var(--gold);
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
  color: var(--ink);
  font-size: 0.88rem;
  line-height: 1.7;
}
/* In the method choice the line belongs to FastPay, so it shows only while FastPay's tile is
   ticked. Browsers that cannot tell (no :has) skip this block and just always show the line. */
@supports selector(:has(*)) {
  .pay-methods .pay-note--fastpay { display: none; }
  .pay-methods:has(input[value="fastpay"]:checked) .pay-note--fastpay { display: block; }
}

/* ---- donate: one compact column ---------------------------------------- */

.donate-column {
  max-inline-size: 640px;
  margin-inline: auto;
}
.donate-page h1 {
  font-size: clamp(2rem, 7vw, 2.8rem);
  margin-block-end: var(--sp-2);
}
.donate-page .lead { margin-block-end: var(--sp-5); }
.donate-block { display: grid; gap: var(--sp-4); }
.donate-step { margin: 0; padding: 0; border: 0; }
.donate-step legend {
  margin-block-end: var(--sp-3);
  font-size: 1.05rem;
  color: var(--ink);
}
.donate-message {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-3);
}
.donate-message summary {
  cursor: pointer;
  padding: var(--sp-3) var(--sp-4);
  color: var(--gold-2);
}
.donate-message .form-field { margin: 0; padding: 0 var(--sp-3) var(--sp-3); }
.donate-checks { display: grid; gap: var(--sp-2); }
.donate-wall-section { margin-block-start: var(--sp-8); }
.donate-wall-section h2 { font-size: 1.4rem; margin-block-end: var(--sp-3); }
.donate-wall {
  display: grid;
  gap: var(--sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.donate-wall li {
  display: grid;
  gap: 2px;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}
.donate-wall li span { color: var(--muted); }
.donate-checks .check-row { margin: 0; }
/* The amount box is left-to-right in both languages (it holds digits), but
   the currency word sits at the inline end of the page — the left in
   Kurdish. Reserve the room on that side, or the word covers the text. */
[dir="rtl"] .amount-field input { padding-inline: 84px var(--sp-4); }

/* ---- sign in with Google ----------------------------------------------- */

/* Google's branding asks for a white button with the four-colour mark. */
.btn-google {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  min-block-size: 52px;
  margin-block-end: var(--sp-2);
  background: #ffffff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  font-weight: 600;
}
.btn-google:hover { background: #f2f2f2; color: #1f1f1f; }
.btn-google svg { flex: none; }

.auth-or {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  margin-block: var(--sp-3);
  color: var(--dim);
  font-size: 0.9rem;
}
.auth-or::before,
.auth-or::after {
  content: "";
  flex: 1;
  border-block-start: 1px solid var(--line);
}

/* Embedded provider player (Bunny). The stage's 1px border leaves the frame a
   hair wider than 16:9, so the player's picture sits a fraction of a pixel in
   from each side. The player page is light and this site is dark, which makes
   the browser paint an opaque white backing behind it, and that gap showed as
   a thin white line down the left edge. Declaring the frame light lets the
   stage's own dark background show through instead. */
.player-stage .player-embed { color-scheme: light; }

/* Full screen: some browsers (Safari, Firefox) give a full-screen element a white
   background of its own, which showed as white bars when the picture does not fill
   the screen (4:3 interviews, wide laptop screens). Keep it black. */
.player-stage .player-embed { background: #000; }
.player-stage .player-embed:fullscreen { background: #000; }
.player-stage .player-embed:-webkit-full-screen { background: #000; }

/* FAQ numbering. The questions on the FAQ page are numbered automatically from
   their order, so moving a question in the admin renumbers them all, and an
   answer can say "see question 6" without "above" or "below". Kurdish pages use
   the Arabic-Indic digits of the Kurdish text. Each row is a flex line with the
   "+" at its far end, so the number joins the start of the row and the "+" keeps
   the far end. Scoped to the FAQ page: the course and subscribe pages share the
   accordion styles and stay unnumbered. */
body[data-page="faq"] .accordion { counter-reset: faq-n; }
body[data-page="faq"] .accordion details { counter-increment: faq-n; }
body[data-page="faq"] .accordion summary { justify-content: flex-start; }
body[data-page="faq"] .accordion summary::before {
  content: counter(faq-n);
  flex: none;
  min-inline-size: 1.6em;
  color: var(--gold);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
html[lang="ckb"] body[data-page="faq"] .accordion summary::before { content: counter(faq-n, arabic-indic); }
body[data-page="faq"] .accordion summary::after { margin-inline-start: auto; }

/* The running quote strip, Kurdish page: sixteen quotes, so one loop takes 5 min 53 s
   (the first setting was 6 min 46 s; the owner asked for 15% more speed). English keeps
   the standard 36 s loop of its shorter strip. */
[lang="ckb"] .marquee-track { animation-duration: 353s; }

/* ===========================================================================
   Home: the trailer section (2026-10-31). It sits where the course and lesson
   counts used to be, under its own title. The player itself reuses the
   welcome page's .welcome-video frame, so a trailer looks the same on both.
   =========================================================================== */

/* The short description under a trailer, on the home page and on the welcome page. */
.welcome-video-desc {
  margin: var(--sp-2) 0 0;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.home-trailers { padding-block-start: var(--sp-6); }

/* The title: gold, with an arrow on each side that bobs down towards the trailer. */
.home-trailers-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  max-width: none;
}

.home-trailers-head h2 {
  margin: 0;
  color: var(--gold-2);
  font-size: clamp(1.8rem, 7vw, 2.6rem);
}

.home-trailers-arrow {
  display: inline-flex;
  color: var(--gold-2);
}

.home-trailers-arrow svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  animation: home-trailers-bob 1.5s ease-in-out infinite;
}

@keyframes home-trailers-bob {
  0%, 100% { transform: translateY(-3px); opacity: 0.7; }
  50% { transform: translateY(5px); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .home-trailers-arrow svg { animation: none; }
}

/* Welcome page: space between the trailers and the list of what the site offers. */
.home-trailer-row.has-list { margin-block-end: var(--sp-8); }

/* The sign-up page's one button (welcome page): centred, not stretched across two columns. */
.welcome-actions.is-single {
  grid-template-columns: minmax(0, 1fr);
  max-inline-size: 22rem;
  margin-inline: auto;
}

.welcome-login {
  margin: var(--sp-4) 0 0;
  text-align: center;
  color: var(--muted);
}

.welcome-login a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.home-trailer-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--sp-6);
}

.home-trailer-row.is-single {
  max-width: 920px;
  margin-inline: auto;
}

@media (max-width: 599px) {
  /* Several trailers: swipe sideways, the next one peeking in at the edge. */
  .home-trailer-row:not(.is-single) {
    display: flex;
    gap: var(--sp-4);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gutter);
    margin-inline: calc(var(--gutter) * -1);
    padding-inline: var(--gutter);
    padding-block-end: var(--sp-2);
    -webkit-overflow-scrolling: touch;
  }

  .home-trailer-row:not(.is-single) .welcome-video {
    flex: 0 0 86%;
    min-inline-size: 0;
    scroll-snap-align: center;
  }

  /* On a phone the banner no longer fills the whole first screen, so the title
     and the video are seen without scrolling. */
  body[data-page="home"] .hero { min-block-size: 0; }
  body[data-page="home"] .hero-copy { padding-block: var(--sp-6) var(--sp-5); }
  body[data-page="home"] .hero h1 { margin-block: var(--sp-2) var(--sp-3); }
  body[data-page="home"] .hero .lead { line-height: 1.65; }
  body[data-page="home"] .hero-actions {
    flex-wrap: nowrap;
    gap: var(--sp-2);
    margin-block-start: var(--sp-4);
  }
  body[data-page="home"] .hero-actions > .btn {
    flex: 1 1 0;
    min-inline-size: 0;
    padding-inline: var(--sp-3);
  }

  .home-trailers { padding-block-start: var(--sp-5); }
  .home-trailers .welcome-section-head { margin-block-end: var(--sp-4); }
}

@media (min-width: 900px) {
  .home-trailer-row:not(.is-single) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* ===========================================================================
   Lesson list, YouTube style (2026-11-01)

   Thumbnail with the length in its corner, and the title. Nothing else.
   Computer: rows in the column beside the player. Tablet: rows under the player.
   Phone: a big picture with the title under it, one after another, like YouTube.
   Course cards: the picture is 16:9 so the lettering on the thumbnails is never cropped.
   To undo: delete everything from this comment to the end of the block.
   =========================================================================== */

.course-card .course-cover { aspect-ratio: 16 / 9; }

.lesson-rail { max-block-size: none; }
.lesson-rail ol { display: grid; gap: var(--sp-2); margin: 0; padding: 0; list-style: none; }

.lesson-item.lesson-row {
  display: grid;
  grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
  gap: var(--sp-3);
  align-items: start;
  min-block-size: 0;
  padding: 6px;
  border-radius: var(--radius-md);
  color: var(--ink);
}

.lesson-item.lesson-row > .lesson-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  padding: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  font-size: 0.8rem;
  color: #fff;
}

.lesson-item.lesson-row .lesson-thumb img {
  position: absolute;
  inset: 0;
  inline-size: 100%;
  block-size: 100%;
  aspect-ratio: auto;
  object-fit: cover;
  border-radius: 0;
  background: transparent;
}

.lesson-row .lesson-dur {
  position: absolute;
  inset-inline-end: 6px;
  inset-block-end: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 0.72rem;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.lesson-row .lesson-bar {
  position: absolute;
  inset-inline: 0;
  inset-block-end: 0;
  block-size: 3px;
  background: rgba(255, 255, 255, 0.3);
}
.lesson-row .lesson-bar > span { display: block; block-size: 100%; background: var(--gold); }

.lesson-item.lesson-row > .lesson-text {
  display: grid;
  gap: 6px;
  align-content: start;
  min-inline-size: 0;
}

.lesson-row .lesson-text b {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--ink);
}
.lesson-row .lesson-text small { margin: 0; }

.lesson-item.lesson-row:hover,
.lesson-item.lesson-row.is-current { background: var(--surface); box-shadow: none; }
.lesson-item.lesson-row.is-current .lesson-thumb { outline: 2px solid var(--gold); outline-offset: -2px; }
.lesson-item.lesson-row.is-locked { opacity: 0.6; }

/* Computer: the list column is a little wider so the title has room beside a 168px picture. */
@media (min-width: 1100px) {
  .player-layout { --rail-w: 420px; }
  .lesson-rail { padding: var(--sp-4); }
  .lesson-item.lesson-row { grid-template-columns: 168px minmax(0, 1fr); }
}

/* Tablet and narrow windows: rows under the player, with a bigger picture. */
@media (min-width: 700px) and (max-width: 1099px) {
  .lesson-item.lesson-row { grid-template-columns: 220px minmax(0, 1fr); }
  .lesson-row .lesson-text b { font-size: 1rem; }
}

/* Phone: full-width picture, title under it. */
@media (max-width: 699px) {
  .lesson-rail { padding: var(--sp-4) var(--sp-3) var(--sp-7); }
  .lesson-rail ol { gap: var(--sp-5); }
  .lesson-item.lesson-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 0; }
  .lesson-item.lesson-row:hover,
  .lesson-item.lesson-row.is-current { background: none; }
  .lesson-item.lesson-row > .lesson-thumb { border-radius: var(--radius-md); }
  .lesson-row .lesson-text b { font-size: 1rem; -webkit-line-clamp: 2; line-clamp: 2; padding-inline: 2px; }
  .lesson-row .lesson-text small { padding-inline: 2px; }
  .lesson-row .lesson-dur { inset-inline-end: 8px; inset-block-end: 8px; font-size: 0.78rem; }
}


/* ===========================================================================
   Welcome page: bigger logo, title and sign-up button (owner picked size B, 2026-11-01).
   To undo: delete everything from this comment to the end of the file.
   =========================================================================== */

.welcome-seal { inline-size: clamp(230px, 66vw, 340px); margin-block-end: var(--sp-5); }
.welcome-title { font-size: clamp(2.9rem, 12vw, 4.8rem); line-height: 1.2; }
.welcome-actions.is-single { max-inline-size: 28rem; }
.welcome-actions .btn { min-block-size: 76px; font-size: 1.4rem; font-weight: 600; }
.welcome-login { font-size: 1.2rem; }
@media (max-width: 599px) {
  .welcome-hero { padding-block-start: var(--sp-7); }
  .welcome-gate { margin-block-start: var(--sp-6); }
}
@media (min-width: 900px) {
  .welcome-hero { padding-block-start: var(--sp-7); }
  .welcome-seal { inline-size: 270px; }
  .welcome-title { font-size: 4.5rem; }
  .welcome-actions .btn { min-block-size: 68px; }
}

/* ---- subscribe (release 26, 2026-11-12): FastPay "easiest and best" strip + the FIB transfer panel ---- */

/* The FastPay tile is the big one now, so the rows no longer have to match. Every other tile keeps the
   old height through min-block-size. */
.pay-list { grid-auto-rows: auto; }
.pay-method label { min-block-size: calc(134px * var(--k)); }

/* A gold strip across the top of the FastPay tile. It is placed over the tile's top padding, so the
   logo, the name and the tick keep their normal places below it. One line on every phone (the font
   size follows the screen width). */
.pay-method--best { --best-h: 3rem; }
.pay-method--best label { padding-block-start: var(--best-h); }
.pay-best {
  position: absolute;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  block-size: var(--best-h);
  padding-inline: 12px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: var(--ink-on-gold);
  font-size: clamp(0.92rem, 4.3vw, 1.2rem);
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  white-space: nowrap;
}
.pay-method--best .pay-tick { inset-block-start: calc(var(--best-h) + 12px * var(--k)); }

/* The FIB panel: the number, a warning nobody can miss, and the pointer to FastPay. */
.pay-panel {
  margin: var(--sp-3) 0 0;
  padding: var(--sp-4);
  border: 1.5px solid var(--gold);
  border-radius: var(--radius-md);
  background: var(--surface-2);
  color: var(--ink);
}
.pay-panel-title { margin: 0 0 var(--sp-2); color: var(--gold-2); font-size: 1.1rem; }
.pay-panel-send { margin: 0 0 var(--sp-2); font-weight: 600; line-height: 1.7; }
.pay-number {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-3);
  margin: 0 0 var(--sp-3);
}
.pay-number strong {
  color: var(--gold-2);
  font-size: 1.8rem;
  letter-spacing: 0.08em;
  unicode-bidi: isolate;
}
.pay-warn {
  margin: 0 0 var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border: 2px solid var(--gold);
  border-inline-start-width: 7px;
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
}
.pay-warn strong { display: block; margin-block-end: 4px; color: var(--gold-2); font-size: 1.05rem; }
.pay-warn p { margin: 0; font-size: 1.05rem; font-weight: 700; line-height: 1.75; }
.pay-panel-wait { margin: 0 0 var(--sp-3); line-height: 1.8; }
.pay-better { margin: 0 0 var(--sp-2); padding-block-start: var(--sp-3); border-block-start: 1px solid var(--line); font-weight: 600; line-height: 1.8; }
.pay-copy[hidden] { display: none; }


/* ===========================================================================
   "NEW" tag on videos added in the last 7 days (release 30, 2026-11-19).
   The tag itself comes from src/Service/NewBadge.php (words and number of days are set there).
   Corner of a picture, or small after a title. To undo: delete everything from this comment to the end of the block.
   =========================================================================== */

.new-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  background: var(--gold);
  color: var(--ink-on-gold);
  border: 1px solid var(--gold-deep);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.6;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.new-badge b { font-weight: 700; font-family: var(--font-sans); }
.new-badge i { font-style: normal; font-size: 0.68rem; letter-spacing: 0.08em; font-family: var(--font-sans); }

/* Top corner of a thumbnail or course picture (the side where the title starts, left in English, right in Kurdish). */
.new-badge--corner {
  position: absolute;
  inset-block-start: 8px;
  inset-inline-start: 8px;
  z-index: 2;
}

/* Small, after a title. */
.new-badge--title {
  margin-inline-start: 10px;
  font-size: 0.72rem;
  vertical-align: middle;
  position: relative;
  inset-block-start: -0.1em;
}
.new-badge--title i { font-size: 0.62rem; }
