/* The learner home (web/js/pages/learn-home.js). Phone first: one column, swipeable rows; from 900px a side column. */
.lh { display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.lh-kick { display: block; font: 700 11.5px/1.3 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.lh-muted { color: var(--ink-3); }
.lh-small { font-size: 13px; }
.lh-clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* hero: greeting + the pressing thing, and four numbers */
.lh-hero { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
.lh-hello { min-width: 0; flex: 1 1 320px; }
.lh-hello h1 { margin: 4px 0 6px; font: 600 clamp(26px, 4vw, 34px)/1.15 var(--serif); color: var(--ink); }
.lh-hello p { margin: 0; color: var(--ink-2); font-size: 16px; line-height: 1.45; }
.lh-stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(84px, 1fr); gap: 8px; flex: 0 1 auto; }
.lh-stats a { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.lh-stats a:hover { border-color: var(--maroon-line); box-shadow: var(--shadow); }
.lh-stats b { font: 600 22px/1.1 var(--serif); color: var(--maroon-text); }
.lh-stats span { font-size: 12.5px; color: var(--ink-3); white-space: nowrap; }

/* the grid: continue, then what's due and live, then recommended (phones); side column on wide screens */
.lh-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; }
.lh-sec { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.lh-sec-head, .lh-box-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.lh-sec-head h2, .lh-box-head h2 { margin: 0; font: 600 18px/1.3 var(--sans); color: var(--ink); display: inline-flex; align-items: center; gap: 8px; }
.lh-box-head h2 svg { width: 18px; height: 18px; color: var(--maroon-text); }
.lh-side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (min-width: 900px) {
  .lh-grid:not(.one) { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); grid-template-rows: auto 1fr; }
  .lh-grid:not(.one) .lh-a-cont { grid-column: 1; grid-row: 1; }
  .lh-grid:not(.one) .lh-a-rec { grid-column: 1; grid-row: 2; }
  .lh-grid:not(.one) .lh-side { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: calc(var(--jb-head, 0px) + 16px); }
}

/* media: picture or the brand gradient with initials */
.lh-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--chip-soft); border-radius: inherit; }
.lh-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lh-ph { display: grid; place-items: center; background: linear-gradient(135deg, var(--maroon) 0%, var(--maroon-ink) 100%); color: var(--on-maroon); font: 500 30px/1 var(--serif); letter-spacing: .04em; }

/* the featured "continue" card */
.lh-feat { display: grid; grid-template-columns: minmax(0, 1fr); background: var(--card); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.lh-feat-media { position: relative; display: block; }
.lh-feat-media .lh-media { border-radius: 0; height: 100%; }
.lh-feat-pct { position: absolute; left: 12px; bottom: 12px; background: rgba(0, 0, 0, .62); color: #fff; font: 700 13px/1 var(--sans); padding: 6px 9px; border-radius: 999px; }
.lh-feat-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 20px; min-width: 0; }
.lh-feat h3 { margin: 0; font: 600 22px/1.2 var(--serif); }
.lh-feat h3 a { color: var(--ink); text-decoration: none; }
.lh-feat h3 a:hover { text-decoration: underline; }
.lh-next { margin: 0; display: flex; gap: 8px; align-items: flex-start; color: var(--ink-2); font-size: 15px; }
.lh-next svg { width: 16px; height: 16px; flex: none; margin-top: 3px; color: var(--maroon-text); }
.lh-prog { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--ink-3); }
.lh-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.lh-actions .jb-btn { flex: 1 1 auto; }
@media (min-width: 600px) {
  .lh-feat { grid-template-columns: minmax(200px, 42%) minmax(0, 1fr); }
  .lh-feat-media .lh-media { aspect-ratio: auto; min-height: 220px; }
  .lh-actions .jb-btn { flex: 0 0 auto; min-width: 160px; }
}

/* swipeable rows on phones, wrapping grids on wider screens */
.lh-row-scroll { display: grid; grid-auto-flow: column; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 2px 2px 8px; margin: 0 -2px; overscroll-behavior-x: contain; scrollbar-width: thin; }
.lh-row-scroll > * { scroll-snap-align: start; }
.lh-minis { grid-auto-columns: minmax(260px, 82%); }
.lh-recs { grid-auto-columns: minmax(230px, 74%); }
@media (min-width: 600px) { .lh-minis { grid-auto-columns: minmax(260px, 46%); } .lh-recs { grid-auto-columns: minmax(230px, 40%); } }
/* computers: the rows become grids that keep adding columns as the screen widens (desktop-ready) */
@media (min-width: 1100px) {
  .lh-minis { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); overflow: visible; }
  .lh-recs { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); overflow: visible; }
  /* three or more recommendations fill the row (up to four across); one or two keep their card size */
  .lh-recs:has(> :nth-child(3)) { grid-template-columns: repeat(auto-fit, minmax(max(240px, calc(25% - 12px)), 1fr)); }
}
@media (min-width: 1500px) { .lh-recs:has(> :nth-child(3)) .lh-media { aspect-ratio: 21 / 9; }   /* wider cards, shorter pictures */
}
/* big monitors: the featured course and the rest of what's in progress sit side by side, and the side column widens */
@media (min-width: 1500px) {
  .lh-a-cont { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(320px, 1fr); gap: 12px 22px; align-items: start; grid-template-rows: auto 1fr; }   /* the heading row stays its own height beside the tall featured card */
  .lh-a-cont > .lh-feat { grid-column: 1; grid-row: 1 / span 2; }
  .lh-a-cont > .lh-sec-head { grid-column: 2; grid-row: 1; }
  .lh-a-cont > .lh-minis { grid-column: 2; grid-row: 2; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
  .lh-feat-media .lh-media { min-height: 280px; }
}
@media (min-width: 1900px) { .lh-grid:not(.one) { grid-template-columns: minmax(0, 1fr) minmax(360px, 440px); } }

.lh-mini { display: flex; gap: 12px; align-items: center; padding: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; color: var(--ink); min-width: 0; transition: box-shadow .15s, border-color .15s; }
.lh-mini:hover, .lh-rec:hover { box-shadow: var(--shadow); border-color: var(--maroon-line); }
.lh-mini .lh-media { width: 92px; flex: none; border-radius: var(--r-sm); }
.lh-mini .lh-ph { font-size: 20px; }
.lh-mini-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.lh-mini-body b { font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lh-mini-body > .lh-muted { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lh-mini-prog { display: flex; align-items: center; gap: 8px; }
.lh-mini-prog .jb-meter { flex: 1; margin: 0; }
.lh-mini-prog small { font-weight: 700; color: var(--ink-3); font-size: 12px; }

.lh-rec { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; text-decoration: none; color: var(--ink); min-width: 0; transition: box-shadow .15s, border-color .15s; }
.lh-rec .lh-media { border-radius: 0; }
.lh-rec-body { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px 14px; flex: 1; }
.lh-rec-body b { font-size: 16px; line-height: 1.3; }
.lh-rec-body .lh-muted { font-size: 13.5px; line-height: 1.4; }
.lh-why { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 4px 9px; border-radius: 999px; background: var(--maroon-wash); color: var(--maroon-text); font: 600 12px/1.25 var(--sans); }
.lh-why svg { width: 13px; height: 13px; flex: none; }
.lh-why span { overflow-wrap: anywhere; }
.lh-why svg { margin-top: 1px; align-self: flex-start; }
.lh-why-new { background: var(--accent-tint); color: var(--amber); }
.lh-facts { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: auto; padding-top: 4px; font-size: 12.5px; color: var(--ink-3); }

/* side boxes: required, live */
.lh-box { display: flex; flex-direction: column; gap: 10px; padding: 16px; }
.lh-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.lh-list > li + li { border-top: 1px solid var(--line-soft); }
.lh-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; text-decoration: none; color: var(--ink); min-width: 0; }
.lh-row:hover b { text-decoration: underline; }
.lh-grow { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.lh-grow b { font-size: 15px; line-height: 1.3; overflow-wrap: anywhere; }
.lh-req-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.lh-req-meta small { color: var(--ink-3); font-size: 12.5px; }
.lh-req-overdue .pill-due { background: #FDE7E5; color: #9B1C14; }
.lh-row > .jb-btn, .lh-live > .jb-btn { flex: none; }
.lh-live { display: flex; align-items: center; gap: 12px; padding: 10px 0; min-width: 0; }
.lh-live .lh-grow > .lh-muted { font-size: 13.5px; display: flex; flex-wrap: wrap; gap: 4px 6px; align-items: center; }
.lh-live .lh-grow svg { width: 13px; height: 13px; vertical-align: -2px; }
.lh-date { width: 46px; flex: none; display: flex; flex-direction: column; align-items: center; padding: 5px 0 6px; border-radius: var(--r-sm); background: var(--maroon-wash); color: var(--maroon-text); }
.lh-date small { font: 700 10.5px/1.2 var(--sans); text-transform: uppercase; letter-spacing: .06em; }
.lh-date b { font: 600 19px/1.1 var(--serif); }
.lh-live.on .lh-date { background: #E3F5E8; color: #17663A; }
@media (max-width: 599px) {
  .lh { gap: 18px; }
  .lh-stats { width: 100%; grid-auto-columns: minmax(0, 1fr); gap: 6px; }
  .lh-stats a { padding: 8px 10px; }
  .lh-stats b { font-size: 19px; }
  .lh-stats span { font-size: 12px; white-space: normal; }
  .lh-feat-media .lh-media { aspect-ratio: 2 / 1; }
}
@media (min-width: 600px) and (max-width: 899px) {
  .lh-side { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); align-items: start; }
}

/* the course player's top bar on phones: Listen / Tutor / language keep their buttons with shorter padding */
@media (max-width: 600px) {
  .cp-top { gap: 4px; padding: 0 8px; }
  .cp-top > button.jb-btn { flex: none; padding: 0 10px; }
}
@media (max-width: 360px) { .cp-top > button.jb-btn .cp-btl { display: none; } }

/* interface language (web/js/i18n.js): the account menu's Language row and its picker */
.jb-menu [data-lang] { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.jb-menu-v { color: var(--ink-3); font-size: 13px; }
.jb-langs { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.jb-lang { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 64px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); color: var(--ink); cursor: pointer; text-align: left; }
.jb-lang b { font-size: 17px; }
.jb-lang span { font-size: 13px; color: var(--ink-3); }
.jb-lang:hover { border-color: var(--maroon-line); }
.jb-lang.on { border-color: var(--maroon); box-shadow: inset 0 0 0 1px var(--maroon); background: var(--maroon-wash); }

/* the course player's top bar shows the course name once: the lesson bar below already carries it, so the top bar's
   own title steps aside, and on tablets and phones the back link is its arrow alone (its label stays for screen readers) */
.cp-top .cp-ctitle { display: none; }
@media (max-width: 1024px) {
  .cp-top .cp-back { flex: 0 0 auto; padding: 0 10px; }
  .cp-top .cp-back .cp-btl { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .cp-top .cp-grow { display: block; flex: 1; }
}

/* longer month and weekday names (Spanish, French) in the header: tablets and small laptops show the short date
   ("17 nov.") and keep each line on one line, so the date never runs into the search box */
@media (max-width: 1200px) {
  html:not([lang="en"]) .jb-top .date { min-width: 0; overflow: hidden; }
  html:not([lang="en"]) .jb-top .date .d1, html:not([lang="en"]) .jb-top .date .d2 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  html:not([lang="en"]) .jb-top .date .d2 .lg { display: none; }
  html:not([lang="en"]) .jb-top .date .d2 .sh { display: inline; }
}

/* ---------------------------------------------------------------- topic channels (web/js/pages/channels.js) */
.ch { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; min-width: 0; }
/* no channels yet: drop the empty detail pane so the empty state sits centered across the page (desktop) */
.ch:has(.ch-none) { grid-template-columns: minmax(0, 1fr); }
.ch:has(.ch-none) > :not(.ch-side) { display: none; }
.ch-none { padding: clamp(16px, 4vh, 48px) 0; }
.ch-side-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.ch-side-head h1 { margin: 0; font: 600 clamp(24px, 3vw, 30px)/1.2 var(--serif); }
.ch-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ch-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--card); text-decoration: none; color: var(--ink); min-height: 56px; }
.ch-item:hover { border-color: var(--maroon-line); }
.ch-item.on { border-color: var(--maroon); box-shadow: inset 0 0 0 1px var(--maroon); background: var(--maroon-wash); }
.ch-item-body { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.ch-item-body b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-snip { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ch-badge { flex: none; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: var(--maroon); color: var(--on-maroon); font: 700 12px/22px var(--sans); text-align: center; }
.ch-muted svg { width: 16px; height: 16px; color: var(--ink-4); }
.ch-dot { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font: 700 16px/1 var(--sans); }
.ch-dot.lg { width: 44px; height: 44px; font-size: 20px; border-radius: 12px; }
.ch-c-indigo { background: #E5E4F3; color: #2D2B6E; } .ch-c-teal { background: #DDF1EF; color: #0F5E57; } .ch-c-amber { background: #FCEBD2; color: #7A4B00; }
.ch-c-rose { background: #FBE3E7; color: #8E1F38; } .ch-c-green { background: #E1F3E4; color: #1D6331; } .ch-c-slate { background: #E6E9EE; color: #33404F; }

.ch-pane { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ch-head { display: flex; align-items: flex-start; gap: 12px; }
.ch-head-t { flex: 1; min-width: 0; }
.ch-head-t h2 { margin: 0; font: 600 22px/1.25 var(--sans); overflow-wrap: anywhere; }
.ch-head-t p { margin: 2px 0 0; color: var(--ink-3); font-size: 14px; }
.ch-head-acts { display: flex; align-items: center; gap: 6px; flex: none; }
.ch-back { flex: none; }
.ch-note { padding: 12px 14px; color: var(--ink-2); }
.ch-compose { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); box-shadow: var(--shadow); }
.ch-compose textarea { width: 100%; min-height: 64px; resize: vertical; border: 1px solid var(--line); border-radius: var(--r); padding: 10px 12px; font: 15px/1.45 var(--sans); background: var(--paper); color: var(--ink); }
.ch-compose-bar { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.ch-meta { color: var(--ink-3); font-size: 13px; }
.ch-feed { display: flex; flex-direction: column; gap: 12px; }
.ch-post { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--card); }
.ch-post.pinned { border-color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.ch-post.reply { padding: 10px 0 0; border: 0; border-radius: 0; background: none; border-top: 1px solid var(--line-soft); }
.ch-av { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--sage-tint); color: var(--sage-ink); font: 700 13px/1 var(--sans); flex: none; }
.ch-post.reply .ch-av { width: 30px; height: 30px; font-size: 11px; }
.ch-av.me { background: var(--maroon-tint); color: var(--maroon-text); }
.ch-post-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ch-post-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.ch-post-head b { font-size: 15px; }
.ch-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 15px; line-height: 1.5; color: var(--ink); }
.ch-acts { display: flex; gap: 4px; flex-wrap: wrap; margin-left: -8px; }
.ch-act { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 10px; border: 0; border-radius: 999px; background: none; color: var(--ink-3); font: 600 13px/1 var(--sans); cursor: pointer; }
.ch-act:hover { background: var(--chip-soft); color: var(--ink); }
.ch-act svg { width: 16px; height: 16px; }
.ch-act.on { color: #B4233C; } .ch-act.on svg { fill: currentColor; }
.ch-replies { display: flex; flex-direction: column; gap: 4px; margin-top: 4px; }
.ch-replybox { display: flex; gap: 8px; align-items: flex-end; margin-top: 6px; }
.ch-replybox textarea { flex: 1; min-width: 0; min-height: 40px; resize: vertical; border: 1px solid var(--line); border-radius: var(--r); padding: 8px 10px; font: 14px/1.4 var(--sans); }
.ch-more { align-self: center; }
.ch-menu { display: flex; flex-direction: column; gap: 8px; }
.ch-danger { color: #9B1C14; }
.ch-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.ch-sw { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 4px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; }
.ch-sw input { position: absolute; opacity: 0; pointer-events: none; }
.ch-sw .ch-dot { width: 26px; height: 26px; font-size: 13px; border-radius: 50%; }
.ch-sw:has(input:checked) { border-color: var(--maroon); box-shadow: inset 0 0 0 1px var(--maroon); }
.ch-sw:has(input:focus-visible) { outline: 2px solid var(--maroon); outline-offset: 2px; }
.ch-pick { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow: auto; }
/* phones: the list, or the open channel; wider: both side by side, the list staying in view */
@media (max-width: 899px) { .ch.open .ch-side { display: none; } }
@media (min-width: 900px) {
  .ch { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr); align-items: start; }
  .ch-side { position: sticky; top: calc(var(--jb-head, 0px) + 16px); max-height: calc(100vh / var(--zf, 1) - var(--jb-head, 0px) - 32px); overflow: auto; }
  .ch-back { display: none; }
}
@media (min-width: 1600px) { .ch { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); } }

/* the learner home's channels box */
.lh-ch { display: flex; flex-direction: column; }
.lh-ch .ch-item { border: 0; border-radius: 0; padding: 10px 0; min-height: 0; background: none; }
.lh-ch .ch-item + .ch-item { border-top: 1px solid var(--line-soft); }
.lh-ch .ch-item:hover b { text-decoration: underline; }
.ch-about { display: none; padding: 16px; gap: 10px; flex-direction: column; }
.ch-about h3 { margin: 0; font: 600 16px/1.3 var(--sans); }
.ch-about p { margin: 0; color: var(--ink-2); font-size: 14px; }
.ch-about dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 14px; }
.ch-about dt { color: var(--ink-3); } .ch-about dd { margin: 0; }
@media (min-width: 1400px) {
  .ch.open { grid-template-columns: minmax(260px, 320px) minmax(0, 1fr) minmax(260px, 320px); }
  .ch-about { display: flex; position: sticky; top: calc(var(--jb-head, 0px) + 16px); }
}
@media (min-width: 2200px) { .ch.open { grid-template-columns: minmax(300px, 380px) minmax(0, 1fr) minmax(300px, 380px); } }
.ch-compose-bar .jb-btn { margin-left: auto; }
@media (max-width: 599px) {
  .ch-head { gap: 8px; }
  .ch-head .ch-dot.lg { width: 36px; height: 36px; font-size: 17px; }
  .ch-head-t h2 { font-size: 20px; }
  .ch-head-acts .jb-pill { display: none; }      /* who it's for: in the channel settings and the About box on bigger screens */
  .ch-compose { padding: 12px; gap: 8px 10px; }
  .ch-compose .ch-av { display: none; }
  .ch-compose { grid-template-columns: minmax(0, 1fr); }
  .ch-post { padding: 12px; gap: 10px; }
}
