/* GameLeap Archive — site.css
   One stylesheet for every page. Contract: design/DESIGN.md. Mobile-first.
   Breakpoints (min-width): 600px (sm) · 900px (md) · 1200px (lg). */

/* ------------------------------------------------------------ tokens -- */
:root {
  color-scheme: dark;
  --bg: #0f1115;
  --surface: #161a21;
  --surface-2: #1e232d;
  --border: #2b313d;
  --border-strong: #646d81;
  --text: #e8ebf1;
  --muted: #a3acbd;
  --accent: #38c6f4;
  --accent-strong: #7dd8f8;
  --on-accent: #06141b;
  --accent-soft: rgba(56, 198, 244, .12);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Inter, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-sm: .875rem;   /* 14 */
  --fs-base: 1rem;    /* 16 */
  --fs-md: 1.125rem;  /* 18 */
  --fs-lg: 1.375rem;  /* 22 */
  --fs-xl: 1.75rem;   /* 28 */
  --fs-2xl: 2.25rem;  /* 36 */

  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 32px; --s6: 48px; --s7: 64px;
  --r-sm: 6px; --r: 10px; --r-lg: 14px; --r-pill: 999px;
  --wrap: 1200px;
  --gutter: 16px;
  --header-h: 60px;
  --measure: 70ch;
  --shadow: 0 8px 24px rgba(0, 0, 0, .35);
  --ease: 120ms ease;
}
@media (min-width: 600px) { :root { --gutter: 24px; } }
@media (min-width: 900px) { :root { --header-h: 68px; } }

/* ------------------------------------------------------------- reset -- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + var(--s3)); }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 400 var(--fs-base)/1.5 var(--font);
  overflow-wrap: break-word;
}
main { flex: 1 0 auto; }
img, video, svg, iframe { max-width: 100%; }
img, video { height: auto; }
img { border-style: none; }
h1, h2, h3, h4, h5, h6, p, ul, ol, dl, figure, blockquote { margin: 0; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
ul[class], ol[class], nav ul, nav ol { list-style: none; padding: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
table { border-collapse: collapse; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--s5) 0; }
html [hidden][hidden] { display: none; } /* beats any single-class display rule */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
::selection { background: var(--accent); color: var(--on-accent); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -.25em; fill: currentColor; }
.wrap { width: 100%; max-width: calc(var(--wrap) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------------------------------------------------------- skip link -- */
.skip {
  position: absolute; left: var(--s3); top: -100px; z-index: 100;
  padding: var(--s2) var(--s3); border-radius: var(--r-sm);
  background: var(--accent); color: var(--on-accent); font-weight: 700;
}
.skip:focus { top: var(--s2); }
.skip:hover { color: var(--on-accent); }

/* ------------------------------------------------------------ header -- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(15, 17, 21, .94);
  border-bottom: 1px solid var(--border);
}
@supports (backdrop-filter: blur(8px)) {
  .site-header { background: rgba(15, 17, 21, .88); backdrop-filter: blur(8px); }
}
.site-header__in {
  display: flex; align-items: center; gap: var(--s3);
  min-height: var(--header-h); flex-wrap: wrap;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); font-weight: 800; font-size: var(--fs-md); letter-spacing: -.01em;
  white-space: nowrap;
}
.logo:hover { color: var(--text); text-decoration: none; }
.logo__mark { width: 28px; height: 28px; flex: none; }
.logo__word { width: 86px; height: 18px; flex: none; color: var(--text); }
.logo__tag {
  font-size: .6875rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 2px 6px; line-height: 1.2;
}
.nav-toggle {
  margin-left: auto; display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--r);
  background: transparent; border: 1px solid var(--border); color: var(--text);
}
.nav-toggle:hover { border-color: var(--border-strong); }
.nav-toggle .icon { width: 22px; height: 22px; }
.nav-toggle__close { display: none; }
.site-header.is-open .nav-toggle__open { display: none; }
.site-header.is-open .nav-toggle__close { display: block; }

.site-panel { display: none; width: 100%; flex-direction: column; gap: var(--s3); padding-bottom: var(--s3); }
.site-header.is-open .site-panel { display: flex; }
.site-nav ul { display: flex; flex-direction: column; }
.site-nav a {
  display: block; padding: 10px var(--s2); border-radius: var(--r-sm);
  color: var(--muted); font-weight: 600;
}
.site-nav a:hover { color: var(--text); background: var(--surface-2); text-decoration: none; }
.site-nav a[aria-current] { color: var(--text); }
.site-nav a[aria-current]::after {
  content: ""; display: block; height: 2px; margin-top: 4px; width: 20px;
  background: var(--accent); border-radius: 2px;
}

@media (min-width: 900px) {
  .site-header__in { flex-wrap: nowrap; gap: var(--s4); }
  .nav-toggle { display: none; }
  .site-panel, .site-header.is-open .site-panel {
    display: flex; flex-direction: row; align-items: center; width: auto; flex: 1;
    padding: 0; gap: var(--s4);
  }
  .site-nav ul { flex-direction: row; gap: var(--s1); }
  .site-nav a { padding: var(--s2) 12px; }
  .site-nav a[aria-current]::after { position: relative; top: 4px; width: 100%; margin: 0; }
  .site-panel .site-search { margin-left: auto; width: 280px; }
}

/* ------------------------------------------------------------ search -- */
.search {
  position: relative; display: flex; align-items: center; gap: var(--s2);
  width: 100%;
}
.search > .icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted); pointer-events: none;
}
.search__input {
  flex: 1; min-width: 0; height: 44px; padding: 0 12px 0 40px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: var(--r);
  transition: border-color var(--ease);
}
.search__input::placeholder { color: var(--muted); opacity: 1; }
.search__input:hover { border-color: var(--muted); }
.search__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.search__input::-webkit-search-cancel-button { filter: invert(1) grayscale(1); opacity: .6; }
.search--lg .search__input { height: 56px; font-size: var(--fs-md); padding-left: 48px; border-radius: var(--r-lg); }
.search--lg > .icon { left: 16px; width: 22px; height: 22px; }
.search--lg .btn { height: 56px; padding-inline: var(--s4); border-radius: var(--r-lg); }
@media (max-width: 599px) { .search--lg .btn { display: none; } }

/* ----------------------------------------------------------- buttons -- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  height: 44px; padding: 0 18px; border-radius: var(--r);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  font-weight: 700; white-space: nowrap;
  transition: background-color var(--ease), border-color var(--ease), color var(--ease);
}
.btn:hover { color: var(--text); border-color: var(--muted); text-decoration: none; }
.btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: var(--on-accent); }

/* -------------------------------------------------------- page chrome -- */
.page { padding-block: var(--s4) var(--s6); }
@media (min-width: 900px) { .page { padding-block: var(--s5) var(--s7); } }

.crumbs { font-size: var(--fs-sm); color: var(--muted); margin-bottom: var(--s3); }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; }
.crumbs li { display: inline-flex; align-items: center; min-width: 0; }
.crumbs li + li::before {
  content: ""; width: 6px; height: 6px; margin: 0 10px 0 8px;
  border-right: 1.5px solid var(--border-strong); border-top: 1.5px solid var(--border-strong);
  transform: rotate(45deg);
}
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--text); }
@media (max-width: 599px) { .crumbs li[aria-current] { display: none; } }
.crumbs [aria-current] { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }

.page-head { margin-bottom: var(--s4); }
.page-head__title { font-size: var(--fs-xl); }
.page-head__lede { margin-top: var(--s2); color: var(--muted); font-size: var(--fs-md); max-width: var(--measure); }
.page-head .meta { margin-top: 12px; }
@media (min-width: 900px) { .page-head__title { font-size: var(--fs-2xl); } }

.meta {
  display: flex; flex-wrap: wrap; align-items: center; row-gap: var(--s1);
  color: var(--muted); font-size: var(--fs-sm);
}
.meta > * + *::before { content: "·"; margin: 0 var(--s2); color: var(--border-strong); }
.meta a { color: var(--muted); }
.meta a:hover { color: var(--text); }

/* ------------------------------------------------------------ section -- */
.section { margin-top: var(--s6); }
.section:first-child { margin-top: 0; }
.section__head {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3);
  margin-bottom: var(--s3);
}
.section__title { font-size: var(--fs-lg); }
.section__more { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: var(--fs-sm); white-space: nowrap; }
.section__more .icon { width: 16px; height: 16px; vertical-align: 0; }

/* -------------------------------------------------------------- hero -- */
.hero { padding-block: var(--s5) var(--s2); max-width: 760px; }
.hero__title { font-size: var(--fs-xl); line-height: 1.2; }
.hero__title em { font-style: normal; color: var(--accent); }
.hero .search { margin-top: var(--s4); }
.hero .chips { margin-top: var(--s3); }
@media (min-width: 900px) {
  .hero { padding-block: var(--s6) var(--s2); }
  .hero__title { font-size: var(--fs-2xl); }
}

/* ------------------------------------------------ chips, pills, tabs -- */
.chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  padding: 6px 12px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border);
  color: var(--muted); font-size: var(--fs-sm);
}
.chip strong { color: var(--text); font-weight: 700; font-variant-numeric: tabular-nums; }

.pills { display: flex; flex-wrap: wrap; gap: var(--s2); }
.pill {
  display: inline-flex; align-items: center; gap: var(--s2);
  padding: 4px 12px; min-height: 28px; border-radius: var(--r-pill);
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text); font-size: var(--fs-sm); font-weight: 600; line-height: 1.3;
}
a.pill:hover { border-color: var(--border-strong); color: var(--text); text-decoration: none; background: #252b37; }
.pill--dot::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; flex: none;
  background: var(--c, var(--accent));
}
.pill__count { color: var(--muted); font-weight: 500; font-variant-numeric: tabular-nums; }
.pills--lg .pill { padding: 8px 14px; min-height: 40px; font-size: var(--fs-base); }

.tabs {
  display: flex; gap: var(--s1); overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--border); margin-bottom: var(--s4);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  flex: none; padding: 10px 14px; color: var(--muted); font-weight: 600; font-size: var(--fs-sm);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a[aria-current] { color: var(--text); border-bottom-color: var(--accent); }

/* -------------------------------------------------------------- grids -- */
.grid { display: grid; gap: var(--s4) var(--s3); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 600px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s5) var(--s4); } }
@media (min-width: 1200px) { .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.tiles { display: grid; gap: var(--s3) 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 600px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--s3); } }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* -------------------------------------------------------------- cards -- */
.card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.card__media {
  position: relative; overflow: hidden; border-radius: var(--r);
  aspect-ratio: 16 / 9; background: var(--surface-2); margin-bottom: 12px;
}
.card__media img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 200ms ease; }
.card:hover .card__media img { transform: scale(1.03); }
.card--course .card__media { aspect-ratio: 4 / 1; }
.card__body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.card__kicker {
  display: flex; align-items: center; gap: var(--s2);
  font-size: .8125rem; font-weight: 600; color: var(--muted);
}
.card__kicker a { position: relative; z-index: 1; color: var(--muted); display: inline-flex; align-items: center; gap: var(--s2); }
.card__kicker a:hover { color: var(--text); }
.dot::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.card__title { font-size: var(--fs-md); line-height: 1.35; font-weight: 700; }
.card__title a { color: var(--text); }
.card__title a::after { content: ""; position: absolute; inset: 0; z-index: 0; border-radius: var(--r); }
.card__title a:hover { text-decoration: none; }
.card:hover .card__title a { color: var(--accent-strong); }
.card__title a:focus-visible { outline: none; }
.card__title a:focus-visible::after { outline: 2px solid var(--accent); outline-offset: 4px; }
.card__text {
  color: var(--muted); font-size: var(--fs-sm); line-height: 1.55;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden;
}
.card__meta { display: flex; flex-wrap: wrap; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.card__meta > * + *::before { content: "·"; margin: 0 var(--s2); color: var(--border-strong); }

/* card without media: a bordered text card so rows of mixed cards still read as a grid */
.card--plain { padding: var(--s3); border: 1px solid var(--border); border-radius: var(--r); background: var(--surface); }
.card--plain:hover { border-color: var(--border-strong); }

.card__badge {
  position: absolute; right: var(--s2); bottom: var(--s2);
  padding: 2px 6px; border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .8); color: #fff; font-size: .75rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.card__play {
  position: absolute; left: 50%; top: 50%; width: 48px; height: 48px; margin: -24px 0 0 -24px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(0, 0, 0, .6); color: #fff; opacity: .9; transition: background-color var(--ease);
}
.card__play .icon { width: 22px; height: 22px; margin-left: 3px; }
.card:hover .card__play { background: var(--accent); color: var(--on-accent); }
.card__flag {
  position: absolute; left: var(--s2); top: var(--s2);
  padding: 2px 8px; border-radius: var(--r-sm); background: rgba(0, 0, 0, .8);
  color: var(--text); font-size: .75rem; font-weight: 600;
}

/* game tile: portrait boxart + name + counts */
.tile { position: relative; display: flex; flex-direction: column; gap: 6px; min-width: 0; color: var(--text); }
.tile:hover { color: var(--text); text-decoration: none; }
.tile__art {
  display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover;
  border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border);
  transition: border-color var(--ease);
}
.tile:hover .tile__art { border-color: var(--accent); }
.tile__name { font-weight: 700; font-size: .8125rem; line-height: 1.3; }
@media (min-width: 600px) { .tile__name { font-size: var(--fs-sm); } }
.tile:hover .tile__name { color: var(--accent-strong); }
.tile__meta { color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }

/* compact "By type" link row */
.type-row { display: grid; gap: var(--s2); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 600px) { .type-row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 900px) { .type-row { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.type-row a {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s2);
  padding: 12px var(--s3); border-radius: var(--r); background: var(--surface);
  border: 1px solid var(--border); color: var(--text); font-weight: 600;
}
.type-row a:hover { border-color: var(--accent); text-decoration: none; color: var(--text); }
.type-row span { color: var(--muted); font-weight: 500; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------- pagination -- */
.pager {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s2);
  margin-top: var(--s6); font-variant-numeric: tabular-nums;
}
.pager ol { display: flex; flex-wrap: wrap; gap: var(--s1); }
.pager a, .pager span {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s1);
  min-width: 40px; height: 40px; padding: 0 12px; border-radius: var(--r-sm);
  color: var(--text); font-weight: 600; font-size: var(--fs-sm);
}
.pager a { border: 1px solid var(--border); background: var(--surface); }
.pager a:hover { border-color: var(--border-strong); text-decoration: none; color: var(--text); }
.pager [aria-current] { background: var(--accent); color: var(--on-accent); }
.pager .pager__gap { min-width: 24px; padding: 0; color: var(--muted); }
.pager [aria-disabled] { color: var(--muted); opacity: .6; }
.pager .icon { width: 16px; height: 16px; vertical-align: 0; }
.pager__prev .icon { transform: rotate(180deg); }
@media (max-width: 599px) { .pager ol { display: none; } .pager__status { display: inline-flex; } }
.pager__status { display: none; color: var(--muted); }

/* --------------------------------------------------------------- panel -- */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s4); }
.panel__title { font-size: var(--fs-md); margin-bottom: var(--s2); }
.panel p + p { margin-top: var(--s2); }

.author { display: flex; gap: var(--s3); align-items: flex-start; }
.author__avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; background: var(--surface-2); }
.author__label { font-size: .75rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.author__name { font-weight: 700; font-size: var(--fs-md); }
.author__name a { color: var(--text); }
.author__bio { color: var(--muted); font-size: var(--fs-sm); margin-top: var(--s1); }

.about-game { display: grid; gap: var(--s3); grid-template-columns: 72px minmax(0, 1fr); align-items: start; }
.about-game:not(:has(> img)) { display: block; }
.about-game__art { width: 72px; aspect-ratio: 3 / 4; object-fit: cover; border-radius: var(--r-sm); background: var(--surface-2); }
.about-game p { color: var(--muted); font-size: var(--fs-sm); }
.about-game .btn { margin-top: var(--s3); }
@media (min-width: 600px) { .about-game { grid-template-columns: 112px minmax(0, 1fr); } .about-game__art { width: 112px; } }

.facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 6px var(--s3); margin-top: 12px; font-size: var(--fs-sm); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--text); }

/* -------------------------------------------------------- article page -- */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s6); }
.article { min-width: 0; max-width: 760px; }
.article .page-head { margin-bottom: var(--s4); }
.feature { margin-bottom: var(--s5); }
.feature img { display: block; width: 100%; border-radius: var(--r-lg); background: var(--surface-2); aspect-ratio: 16 / 9; object-fit: cover; }
.article__after { display: grid; gap: var(--s4); margin-top: var(--s6); }

.toc { display: none; }
@media (min-width: 1200px) {
  .article-layout--toc { grid-template-columns: minmax(0, 1fr) 280px; }
  .toc {
    display: block; position: sticky; top: calc(var(--header-h) + var(--s4));
    max-height: calc(100vh - var(--header-h) - var(--s6)); overflow-y: auto;
    font-size: var(--fs-sm); padding-left: var(--s3); border-left: 1px solid var(--border);
  }
}
.toc__title { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; margin-bottom: var(--s2); }
.toc ol { list-style: none; padding: 0; margin: 0; }
.toc a { display: block; padding: 5px 0 5px 12px; margin-left: -13px; border-left: 2px solid transparent; color: var(--muted); line-height: 1.4; }
.toc a:hover { color: var(--text); text-decoration: none; }
.toc a.is-active { color: var(--accent); border-left-color: var(--accent); }
.toc .toc__sub a { padding-left: 24px; font-size: .8125rem; }

/* ---------------------------------------------------- prose (article body) -- */
.prose { font-size: var(--fs-md); line-height: 1.65; max-width: var(--measure); color: #d9dde5; }
.prose > * + * { margin-top: 1.1em; }
.prose h2, .prose h3, .prose h4 { color: var(--text); scroll-margin-top: calc(var(--header-h) + var(--s3)); }
.prose h2 { font-size: var(--fs-lg); margin-top: 2em; }
.prose h3 { font-size: 1.25rem; margin-top: 1.6em; }
.prose h4 { font-size: var(--fs-md); margin-top: 1.4em; }
@media (min-width: 900px) { .prose h2 { font-size: var(--fs-xl); } .prose h3 { font-size: var(--fs-lg); } }
.prose h2 + *, .prose h3 + *, .prose h4 + * { margin-top: .6em; }
.prose a { color: var(--accent); text-decoration: underline; text-decoration-color: rgba(56, 198, 244, .45); text-underline-offset: 3px; }
.prose a:hover { color: var(--accent-strong); text-decoration-color: currentColor; }
.prose strong, .prose b { color: var(--text); font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: .4em; }
.prose li > ul, .prose li > ol { margin-top: .4em; }
.prose li::marker { color: var(--muted); }
.prose img { border-radius: var(--r); }
.prose figure { margin-inline: 0; }
.prose figure.image { display: block; width: fit-content; max-width: 100%; margin-inline: auto; }
.prose figure.image img { display: block; max-width: 100%; height: auto; margin-inline: auto; }
.prose figcaption, .prose figure.image figcaption {
  display: table-caption; caption-side: bottom;
  margin-top: var(--s2); color: var(--muted); font-size: var(--fs-sm); text-align: center; line-height: 1.5;
}
.prose figure.image { position: relative; }
.image-fullscreen-button {
  position: absolute; top: var(--s2); right: var(--s2); z-index: 1;
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm);
  background: rgba(0, 0, 0, .7); color: #fff; cursor: zoom-in; line-height: 0;
  opacity: 0; transition: opacity var(--ease);
}
.image-fullscreen-button .icon { width: 18px; height: 18px; }
figure.image:hover .image-fullscreen-button, .image-fullscreen-button:focus { opacity: 1; }
@media (hover: none) { .image-fullscreen-button { opacity: .85; } }
.prose figure.image:fullscreen { display: grid; place-items: center; background: #000; }
.prose figure.image:fullscreen img { max-height: 100vh; width: auto; border-radius: 0; }
.prose figure.image:fullscreen .image-fullscreen-button, .prose figure.image:fullscreen figcaption { display: none; }
@media (min-width: 600px) {
  .prose figure.align-left { float: left; margin: .3em var(--s4) var(--s3) 0; max-width: 50%; }
  .prose figure.align-right { float: right; margin: .3em 0 var(--s3) var(--s4); max-width: 50%; }
}
.prose h2, .prose h3, .prose hr, .prose .large-section-container { clear: both; }
.prose blockquote {
  padding: var(--s3) var(--s4); border-left: 3px solid var(--accent);
  background: var(--surface); border-radius: 0 var(--r) var(--r) 0; color: var(--text);
}
.prose blockquote > * + * { margin-top: .6em; }
.prose code, .prose kbd {
  font-family: var(--mono); font-size: .875em; padding: .1em .35em;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px;
}
.prose pre { overflow-x: auto; padding: var(--s3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); font-size: var(--fs-sm); line-height: 1.5; }
.prose pre code { padding: 0; border: 0; background: none; }

/* tables: renderer wraps in .table-wrap; bare tables still scroll instead of widening the page */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); }
.prose > table { display: block; overflow-x: auto; max-width: 100%; }
.prose table { width: 100%; font-size: var(--fs-sm); line-height: 1.5; border: 0; }
.prose th, .prose td { padding: 10px 12px; border: 1px solid var(--border); text-align: left; vertical-align: top; }
.prose thead th, .prose thead td, .prose tr:first-child > th { background: var(--surface-2); color: var(--text); font-weight: 700; }
.prose tbody tr:nth-child(even) { background: rgba(255, 255, 255, .02); }
.table-wrap table { margin: 0; }
.table-wrap tr > :first-child { border-left: 0; }
.table-wrap tr > :last-child { border-right: 0; }
.table-wrap tr:first-child > * { border-top: 0; }
.table-wrap tr:last-child > * { border-bottom: 0; }
.prose td p + p { margin-top: .4em; }

/* embeds: renderer wraps iframes in .embed (16:9); inline CMS width/height are clamped */
.embed { position: relative; aspect-ratio: 16 / 9; border-radius: var(--r); overflow: hidden; background: #000; }
.embed iframe {
  position: absolute; inset: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%; border: 0;
}
.prose iframe { display: block; border: 0; margin-inline: auto; }
.prose > iframe { aspect-ratio: 16 / 9; width: 100%; height: auto; }
.prose video { display: block; width: 100%; border-radius: var(--r); background: #000; }

/* TinyMCE's inline table of contents (.mce-toc) — kept, styled as a card */
.prose .mce-toc { padding: var(--s3) var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); font-size: var(--fs-base); }
.prose .mce-toc h2 { margin: 0 0 var(--s2); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.prose .mce-toc ul { list-style: none; padding-left: 0; margin: 0; }
.prose .mce-toc ul ul { padding-left: var(--s3); margin-top: .3em; }
.prose .mce-toc li + li { margin-top: .3em; }
.prose .mce-toc a { text-decoration: none; }

/* CMS template: .large-section-container — header row (optional image + h3) and a <section> body */
.prose .large-section-container {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  overflow: hidden; margin-top: var(--s4);
}
.prose .large-section-container > div:first-child {
  display: flex; align-items: center; gap: var(--s3);
  padding: var(--s3) var(--s4); background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.prose .large-section-container > div:first-child > div { flex: none; line-height: 0; }
.prose .large-section-container > div:first-child img {
  width: 64px; height: 64px; object-fit: cover; border-radius: var(--r); margin: 0;
}
.prose .large-section-container > div:first-child br { display: none; }
.prose .large-section-container > div:first-child :is(h2, h3, h4) { margin: 0; font-size: var(--fs-lg); }
.prose .large-section-container > section { padding: var(--s3) var(--s4) var(--s4); }
.prose .large-section-container > section > * + * { margin-top: .9em; }
.prose .large-section-container + .large-section-container { margin-top: var(--s3); }
@media (min-width: 600px) {
  .prose .large-section-container > div:first-child img { width: 88px; height: 88px; }
}

/* CMS template: .misc-container — small icon + text */
.prose .misc-container {
  display: flex; gap: var(--s3); align-items: flex-start;
  padding: var(--s3); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
}
.prose .misc-container + .misc-container { margin-top: var(--s2); }
.prose .misc-container > div:first-child { flex: none; width: 56px; line-height: 0; }
.prose .misc-container > div:first-child img { width: 56px; height: 56px; object-fit: contain; border-radius: var(--r-sm); margin: 0; }
.prose .misc-container > div:first-child br { display: none; }
.prose .misc-container > div:last-child { flex: 1; min-width: 0; font-size: var(--fs-base); }
.prose .misc-container > div:last-child > * + * { margin-top: .5em; }
.prose .misc-container ul { padding-left: 1.2em; }

/* ------------------------------------------------------- video player -- */
.player { position: relative; aspect-ratio: 16 / 9; background: #000; border-radius: var(--r-lg); overflow: hidden; }
.player video { display: block; width: 100%; height: 100%; object-fit: contain; }
@media (max-width: 599px) { .player:not(.player--unavailable) { margin-inline: calc(-1 * var(--gutter)); border-radius: 0; } }
.player--unavailable {
  display: grid; place-items: center; padding: var(--s4);
  background: var(--surface-2); background-size: cover; background-position: center;
  border: 1px solid var(--border);
}
.player--unavailable::before { content: ""; position: absolute; inset: 0; background: rgba(15, 17, 21, .82); }
.player__msg { position: relative; max-width: 440px; text-align: center; color: var(--muted); font-size: var(--fs-sm); }
.player__msg strong { display: block; color: var(--text); font-size: var(--fs-md); margin-bottom: var(--s1); }
.player__msg .icon { width: 36px; height: 36px; color: var(--border-strong); margin-bottom: var(--s2); }

.watch { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
.watch__main > .page-head { margin: var(--s4) 0 0; }
.watch__desc { margin-top: var(--s3); color: #d9dde5; max-width: var(--measure); line-height: 1.65; }
@media (min-width: 1024px) {
  .watch { grid-template-columns: minmax(0, 1fr) 340px; }
  .watch__side { position: sticky; top: calc(var(--header-h) + var(--s4)); align-self: start; max-height: calc(100vh - var(--header-h) - var(--s5)); overflow-y: auto; }
}

/* -------------------------------------------------- course page + lessons -- */
.course-cover { position: relative; aspect-ratio: 4 / 1; border-radius: var(--r-lg); overflow: hidden; background: var(--surface-2); margin-bottom: var(--s4); }
.course-cover img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.course-head, .course-section { max-width: 820px; }
.course-head { display: flex; flex-direction: column; gap: var(--s3); margin-bottom: var(--s5); }
.course-head .btn { align-self: flex-start; }
.course-head .btn .icon { width: 18px; height: 18px; }

.course-section + .course-section { margin-top: var(--s4); }
.course-section__title { font-size: var(--fs-sm); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: var(--s2); display: flex; justify-content: space-between; gap: var(--s2); }
.course-section__title span { font-weight: 500; text-transform: none; letter-spacing: 0; font-variant-numeric: tabular-nums; }

.lessons { border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface); counter-reset: lesson; }
.lessons li + li { border-top: 1px solid var(--border); }
.lesson {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px var(--s3); color: var(--text);
}
a.lesson:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.lesson__n { color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; text-align: right; }
.lesson__title { font-weight: 600; line-height: 1.4; }
.lesson__dur { color: var(--muted); font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.lesson__flag { display: block; color: var(--muted); font-size: .75rem; font-weight: 500; }
.lesson[aria-current] { background: var(--accent-soft); box-shadow: inset 3px 0 0 var(--accent); }
.lesson[aria-current] .lesson__n { color: var(--accent); }

.course-nav { display: grid; gap: var(--s3); }
.course-nav__head { padding-bottom: var(--s2); }
.course-nav__label { font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.course-nav__title { font-size: var(--fs-md); font-weight: 700; line-height: 1.3; }
.course-nav__title a { color: var(--text); }
.course-nav .lesson { padding: 10px 12px; grid-template-columns: 22px minmax(0, 1fr) auto; font-size: var(--fs-sm); }

/* --------------------------------------------------------- filter + search -- */
.filter { position: relative; max-width: 420px; margin-bottom: var(--s4); }
.search-results { margin-top: var(--s5); }
.search-results__head { color: var(--muted); font-size: var(--fs-sm); margin-bottom: var(--s3); }

/* ------------------------------------------------------------ empty/404 -- */
.empty {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--s2);
  padding: var(--s6) var(--s4); border: 1px dashed var(--border-strong); border-radius: var(--r-lg);
  color: var(--muted);
}
.empty .icon { width: 32px; height: 32px; color: var(--border-strong); }
.empty__title { color: var(--text); font-weight: 700; font-size: var(--fs-md); }
.empty .search { max-width: 480px; margin-top: var(--s3); }
.notfound { padding-block: var(--s6); max-width: 640px; }
.notfound__code { font-size: 4.5rem; font-weight: 800; line-height: 1; color: var(--accent); letter-spacing: -.03em; }
.notfound .search { margin-top: var(--s4); }
.notfound .pills { margin-top: var(--s4); }

/* ----------------------------------------------------------------- FAQ -- */
.faq { border-top: 1px solid var(--border); max-width: var(--measure); }
.faq details { border-bottom: 1px solid var(--border); }
.faq summary {
  display: flex; justify-content: space-between; align-items: center; gap: var(--s3);
  padding: var(--s3) 0; cursor: pointer; font-weight: 700; font-size: var(--fs-md); list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: none; width: 9px; height: 9px; margin-right: 6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg) translateY(-3px); transition: transform var(--ease);
}
.faq details[open] > summary::after { transform: rotate(-135deg) translateY(-3px); }
.faq summary:hover { color: var(--accent-strong); }
.faq__a { padding-bottom: var(--s3); color: #d9dde5; line-height: 1.65; }
.faq__a > * + * { margin-top: .8em; }

/* -------------------------------------------------------------- footer -- */
.site-footer { margin-top: var(--s6); border-top: 1px solid var(--border); background: var(--surface); font-size: var(--fs-sm); color: var(--muted); }
.site-footer__in { display: grid; gap: var(--s4); padding-block: var(--s5); }
.site-footer__brand p { margin-top: var(--s2); max-width: 44ch; }
.site-footer ul { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); }
.site-footer a { color: var(--text); display: inline-flex; align-items: center; gap: 6px; }
.site-footer a:hover { color: var(--accent-strong); }
.site-footer a .icon { width: 16px; height: 16px; }
.site-footer__legal { border-top: 1px solid var(--border); padding-top: var(--s3); font-size: .8125rem; }
@media (min-width: 900px) {
  .site-footer__in { grid-template-columns: 1fr auto; align-items: start; }
  .site-footer__legal { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------- motion -- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0s; animation-duration: 0s; scroll-behavior: auto; }
  .card:hover .card__media img { transform: none; }
}

/* -------------------------------------------------------------- print -- */
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f3f4f6; --border: #ccc; --border-strong: #999; --text: #000; --muted: #444; --accent: #0b5f86; }
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .skip, .toc, .image-fullscreen-button, .tabs, .pager, .search, .nav-toggle, .article__after, .watch__side { display: none; }
  .prose { color: #000; max-width: none; font-size: 11pt; }
  .prose a { color: #000; }
  .prose a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #444; }
  .card, .panel, .large-section-container, .misc-container, figure, tr { break-inside: avoid; }
  .player video { display: none; }
}
