/*
 * Conjugr8 layout for the embedded course apps (/course-apps/<lang>/index.html).
 *
 * The apps are prebuilt single-file bundles with their own look: boxed cards,
 * chunky 3D buttons, a pill tab bar and a winding path. This sheet loads after
 * each bundle's own styles (and its "conjugr8-theme" palette block) and brings
 * them in line with the rest of the site: underline tabs, open ruled lists,
 * flat buttons, Lora headings. It only overrides styles, so a re-exported
 * bundle keeps working as long as the class names stay the same.
 */

/* ── Page frame ─────────────────────────────────────────────────────────── */
.aurora { display: none !important; }
body { background: var(--bg); }
.shell {
  max-width: 720px;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "tabs head" "main main";
  column-gap: 16px;
}
.shell > header.topbar { grid-area: head; padding: 18px 0 0; align-self: start; position: relative; }
.shell > nav.tabs { grid-area: tabs; }
.shell > main { grid-area: main; min-width: 0; }
/* The page already says which language this is (sidebar, page title). */
header.topbar .brand { display: none; }
.icon-btn { border-radius: 8px !important; box-shadow: none !important; }

/* ── Tabs: same underline tabs as the practice pages ───────────────────── */
nav.tabs {
  background: transparent; border: none; border-bottom: 1px solid var(--line);
  border-radius: 0; box-shadow: none; padding: 18px 0 0; gap: 22px;
  margin-bottom: 28px; justify-content: flex-start;
}
nav.tabs button {
  flex: 0 0 auto; padding: 8px 0 11px; border-radius: 0;
  font-size: .9rem; font-weight: 600; color: var(--sub);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
nav.tabs button.active { background: transparent; color: var(--ink); border-bottom-color: var(--accent); }
nav.tabs button:not(.active):hover { background: transparent; color: var(--ink); }
nav.tabs .tab-icon { display: none; }

/* ── Headings ──────────────────────────────────────────────────────────── */
h1 { font-size: 1.75rem; letter-spacing: -0.5px; }
.lede { font-size: .95rem; line-height: 1.55; }
.path-section, .deck-grid-section {
  color: var(--accent); font-size: .72rem; letter-spacing: .09em;
}

/* ── Boxes become open, ruled rows ─────────────────────────────────────── */
.path-item, .deck-card,
.card-shell.up-next, .card-shell.today-card, .card-shell.onboarding-card {
  background: transparent !important; border: none !important; border-radius: 0 !important;
  box-shadow: none !important; transform: none !important;
}
.path-list, .deck-grid { gap: 0 32px; }
.path-item, .deck-card {
  border-bottom: 1px solid var(--line) !important; padding: 14px 0 !important;
}
.path-item:hover .path-title, .deck-card:hover .title { color: var(--accent); }
.path-item.next .path-title { color: var(--accent); }
.card-shell.up-next, .card-shell.today-card, .card-shell.onboarding-card {
  padding: 0 0 22px !important; margin-bottom: 22px !important;
  border-bottom: 1px solid var(--line) !important;
}
.path-kind, .badge { border-radius: 4px; }

/* ── Course path: a straight ruled list instead of a winding trail ─────── */
.unit-banner, .unit-banner.current, .unit-banner.complete {
  background: transparent; color: var(--ink); border: none; border-radius: 0;
  border-top: 2px solid var(--line); box-shadow: none; padding: 16px 0 6px; margin-top: 28px;
}
.unit-banner.current { border-top-color: var(--accent); }
.unit-banner.complete { border-top-color: var(--good); }
.unit-banner-eyebrow { color: var(--accent); opacity: 1; letter-spacing: .09em; }
.unit-banner.complete .unit-banner-eyebrow { color: var(--good); }
.unit-banner-title { font-size: 1.45rem; letter-spacing: -0.4px; }
.unit-banner-goal { color: var(--sub); opacity: 1; font-size: .9rem; }

.path-track { align-items: stretch; padding: 8px 0 4px; }
.path-stop {
  transform: none !important; width: auto; margin: 0;
  display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 16px; align-items: center;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.path-stop:has(.start-flag) { margin-top: 0; }
.path-stop .start-flag { display: none; }
.path-node {
  width: 44px; height: 44px; box-shadow: none !important; animation: none !important;
  transform: none !important; border: 1px solid var(--line);
}
.path-node svg { width: 18px; height: 18px; }
.path-node.next { border-color: var(--accent); }
.path-node.next::after { inset: -5px; border-width: 2px; }
.path-node.done { border-color: var(--done); }
.path-label {
  margin: 0; text-align: left; font-size: .95rem; font-weight: 600; color: var(--ink);
  -webkit-line-clamp: 1;
}
.path-stop:has(.path-node.next) .path-label { color: var(--accent); }
.path-stop:has(.path-node:not(.next):not(.done):not(.started)) .path-label { color: var(--sub); }
.path-pop {
  grid-column: 1 / -1; width: auto; margin: 10px 0 4px 60px; padding: 0 0 6px;
  background: transparent; border: none; border-radius: 0; animation: none;
}
.path-pop button.primary { width: auto; }

/* ── Buttons: flat, like the rest of the site ──────────────────────────── */
button.primary {
  border-radius: 9px; padding: 13px 24px; box-shadow: none !important; transform: none !important;
}
button.primary:not(:disabled):hover { filter: none; opacity: .9; }
button.ghost {
  border: 1px solid var(--line); border-radius: 9px; box-shadow: none !important; transform: none !important;
}
button.ghost:hover { border-color: var(--sub); background: transparent; }
button.mc-opt, button.mc-opt.picked, button.mc-opt.correct, button.mc-opt.wrong {
  border-width: 1px; border-radius: 10px; box-shadow: none !important; transform: none;
}
button.mc-opt { background: transparent; }
.chip { border-radius: 999px; }
.speak-btn { background: transparent; color: var(--accent); }
.session-meta .exit { background: transparent; }
input.answer { border-width: 1px; border-radius: 9px; background: transparent; }

/* ── Exercise card: open page, no floating box ─────────────────────────── */
.card-shell {
  background: transparent; border: none; box-shadow: none; border-radius: 0;
  max-width: 520px; padding: 8px 0 24px;
}
.term-es { font-size: 2.8rem; letter-spacing: -1px; }
.term-en { font-size: 1.7rem; letter-spacing: -0.5px; }
.progress-bar, .lesson-progress { height: 3px !important; }

/* Phones: the site already has a bottom tab bar, so keep the course tabs at
   the top as the same underline row instead of a second fixed bar. */
@media (max-width: 640px) {
  .shell { padding: 0 16px 40px; column-gap: 8px; }
  nav.tabs {
    position: static; box-shadow: none; border-width: 0 0 1px; background: transparent;
    padding: 14px 0 0; gap: 18px; margin-bottom: 22px;
    overflow-x: auto; scrollbar-width: none;
  }
  nav.tabs::-webkit-scrollbar { display: none; }
  nav.tabs button {
    flex: 0 0 auto; flex-direction: row; padding: 8px 0 10px; border-radius: 0; font-size: .85rem;
  }
  nav.tabs button.active { color: var(--ink); }
  nav.tabs .tab-icon, nav.tabs button .en { display: none; }
  .shell > header.topbar { padding-top: 14px; }
  .jump-current { bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 520px) {
  .card-shell { padding: 4px 0 20px; }
  .term-es { font-size: 2.2rem; }
}

/* Flat path nodes: a solid disc with a thin progress ring, no gloss or 3D drop. */
.path-track .path-stop > .path-node {
  width: 44px; height: 44px;
  background: var(--node-base) !important;
  box-shadow: none !important;
}
.path-track .path-stop > .path-node:not(.next):not(.done):not(.started) { --node-base: transparent; }
.path-node .node-icon { filter: none; }
.path-node .node-icon svg { width: 18px; height: 18px; stroke-width: 2; }
.path-node.ringed::before {
  inset: -5px;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 2px), #000 calc(100% - 2px));
}
.path-node.ringed { border-color: transparent; }
.path-node.next::after, .path-node.ringed.next::after { display: none; }
/* The ring already shows lessons done; the floating "0/3" badge is clutter here. */
.node-count { display: none; }

/* ── Practice tab and other lists: ruled rows, not boxes ───────────────── */
.practice-tile, .word-list-item, .conv-unit, .lesson-row, .unit, .unit-group,
.practice-tool, .kpt-card, .case-card, .vowel-group-card, .word-family {
  background: transparent !important; border: none !important; border-radius: 0 !important;
  box-shadow: none !important; transform: none !important;
  border-bottom: 1px solid var(--line) !important;
}
.practice-tile { padding: 12px 0 !important; }
.practice-tile:hover .pt-title, .word-list-item:hover .es { color: var(--accent); }
.word-list-item { padding: 12px 0 !important; }
.word-list, .practice-grid { gap: 0 24px !important; }
.conv-unit > summary { padding: 12px 0; }
.pt-icon, .rule-note > .icon, .intro-callout > .icon { display: none; }
.search-pill {
  background: transparent; border: none; border-bottom: 1px solid var(--line);
  border-radius: 0; box-shadow: none; padding-left: 0; padding-right: 0;
}

/* Notes and tips: a ruled aside instead of a tinted box. */
.rule-note, .culture-note, .usage-note, .why-box, .word-tip, .slip-note,
.intro-callout, .worked-example, .learn-example {
  background: transparent !important; border: none !important; border-radius: 0 !important;
  box-shadow: none !important; border-left: 2px solid var(--accent) !important;
  padding: 2px 0 2px 14px !important;
}

/* Speaker buttons: a drawn icon instead of the 🔊 emoji. */
.speak-btn { font-size: 0 !important; border: 1px solid var(--line); }
.speak-btn::before {
  content: ""; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--speaker-icon) center / contain no-repeat; mask: var(--speaker-icon) center / contain no-repeat;
}
.speak-btn.sm::before { width: 13px; height: 13px; }
:root {
  --speaker-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 256 256'%3E%3Cpath d='M155.51 24.81a8 8 0 0 0-8.42.88L77.25 80H32a16 16 0 0 0-16 16v64a16 16 0 0 0 16 16h45.25l69.84 54.31A8 8 0 0 0 160 224V32a8 8 0 0 0-4.49-7.19ZM144 207.64l-60.09-46.73A8 8 0 0 0 79 160H32V96h47a8 8 0 0 0 4.91-1.69L144 48.36ZM198 101.56a40 40 0 0 1 0 52.88 8 8 0 0 1-12-10.58 24 24 0 0 0 0-31.72 8 8 0 0 1 12-10.58ZM248 128a79.9 79.9 0 0 1-20.37 53.34 8 8 0 0 1-11.92-10.67 64 64 0 0 0 0-85.33 8 8 0 1 1 11.92-10.67A79.83 79.83 0 0 1 248 128Z'/%3E%3C/svg%3E");
}

/* Lessons ("focus" mode) keep the page background rather than a tinted panel. */
body.focus { background: var(--bg) !important; }

/* ══ Less on the course home ══════════════════════════════════════════════
   The path page shows the title, the next lesson and the current unit.
   Other units fold into one-line headings (course-theme.js opens them), and
   the Words / Grammar / Practice tabs move to a quiet line at the bottom. */
.shell:has(.path-map) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "main" "tabs"; position: relative; }
.shell:has(.path-map) > header.topbar { position: absolute; top: 0; right: 24px; z-index: 2; }
.shell:has(.path-map) .path-head { padding-right: 52px; }
.shell:has(.path-map) > main { padding-top: 22px; }
.shell:has(.path-map) > nav.tabs {
  border-bottom: none; border-top: 1px solid var(--line); margin: 40px 0 0; padding-top: 14px; gap: 18px;
}
.shell:has(.path-map) > nav.tabs::before {
  content: "Also in this course"; align-self: center; font-size: .8rem; color: var(--sub-2); margin-right: 4px;
}
.shell:has(.path-map) > nav.tabs button { font-size: .8rem; font-weight: 500; padding: 4px 0; border-bottom: none; }
.shell:has(.path-map) > nav.tabs button.active { display: none; }
.path-head button, .path-head .ghost, .streak, .jump-current { display: none !important; }
.path-head { margin-bottom: 8px; }
.card-shell.up-next { margin-bottom: 8px !important; }

.unit-banner:not(.current) { cursor: pointer; padding: 14px 0 12px; margin-top: 0; border-top-width: 1px; }
.unit-banner:not(.current) .unit-banner-goal { display: none; }
.unit-banner:not(.current) .unit-banner-title { font-size: 1.05rem; letter-spacing: -0.2px; }
.unit-banner:not(.current) .unit-banner-eyebrow { color: var(--sub-2); }
.unit-banner:not(.current) .unit-banner-text::after {
  content: "Show steps"; display: block; margin-top: 2px; font-size: .78rem; color: var(--sub-2);
}
.unit-banner.open:not(.current) .unit-banner-text::after { content: "Hide steps"; }
.unit-banner:not(.current):hover .unit-banner-title { color: var(--accent); }
.unit-banner.current { margin-top: 20px; margin-bottom: 0; }
.unit-banner:not(.current):not(.open) + .path-track,
.unit-banner:not(.current):not(.open) + .path-track + .unit-extras { display: none; }
.unit-banner.current + .path-track + .unit-extras { margin-bottom: 28px; }
/* "Jump here?" (skip ahead to a unit) only shows on a unit you've opened. */
.unit-banner:not(.current):not(.open) .banner-btn { display: none; }
.banner-btn { box-shadow: none !important; border: 1px solid var(--line) !important; border-radius: 9px !important; background: transparent !important; transform: none !important; }
.unit-extras details { border-color: var(--line); }
