/* Parallel Editions — site stylesheet.
   Shared by index.html and the generated pages (gen-meta.js). It builds on
   system.css (linked first), which holds the tokens and the shared components;
   use those tokens here rather than literal values. */

/* ──────────────────────── Reset / base ──────────────────────── */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "onum", "ss01";
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: none; padding: 0; cursor: pointer; }
em { font-style: italic; }
::selection { background: var(--accent); color: var(--paper); }

#root { position: relative; z-index: 1; }

/* ──────────────────────── Masthead ──────────────────────── */
.masthead-wrap {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
}
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 24px var(--gutter) 16px;
}
#pitch, #catalog, #classroom, #requests { scroll-margin-top: calc(var(--masthead-h) + 8px); }
.masthead-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
/* The mark (.brand-mark, system.css) sits before the name. */
.masthead-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--fs-h3);
  letter-spacing: var(--track-snug);
}
.masthead-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}
.masthead-nav {
  display: flex;
  gap: 32px;
  font-family: var(--sans);
  font-size: var(--fs-ui);
  font-weight: 500;
  letter-spacing: var(--track-ui);
}
.masthead-nav a {
  color: var(--ink-2);
  position: relative;
  padding: 4px 0;
  transition: color 160ms ease;
}
.masthead-nav a:hover { color: var(--accent); }
.masthead-nav a::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: left;
  transition: transform 200ms ease;
}
.masthead-nav a:hover::after { transform: scaleX(1); }

/* Daily challenge: the small secondary button in accent (btn btn-secondary
   btn-sm); the dot pulses until today's sentence is done. */
.masthead-daily {
  flex: none;
  padding-left: 12px;
  color: var(--accent);
  border-color: var(--accent-soft);
}
.masthead-daily:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-wash);
}
.masthead-daily-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}
@media (prefers-reduced-motion: no-preference) {
  .masthead-daily:not(.is-done) .masthead-daily-dot { animation: pe-daily-pulse 2.4s ease-out infinite; }
}
@keyframes pe-daily-pulse {
  0%       { box-shadow: 0 0 0 0 var(--accent-ring); }
  70%, 100%{ box-shadow: 0 0 0 7px transparent; }
}
.masthead-daily.is-done {
  color: var(--ink-2);
  border-color: var(--rule);
}
.masthead-daily.is-done .masthead-daily-dot {
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
  font-size: var(--fs-label);
  line-height: 1;
  color: var(--ink-soft);
}

/* "Browse →" is btn btn-primary btn-sm. */
@media (max-width: 640px) {
  /* Phones: the text links move to a second, scrollable row instead of vanishing. */
  .masthead { flex-wrap: wrap; gap: 8px 12px; padding: 12px var(--gutter) 8px; }
  .masthead-brand { margin-right: auto; }
  .masthead-actions { display: contents; }
  .masthead-nav {
    order: 10; flex: 0 0 100%; gap: 16px; overflow-x: auto; scrollbar-width: none;
    padding: 8px 0 2px; border-top: 1px solid var(--rule); font-size: var(--fs-ui-sm); white-space: nowrap;
  }
  .masthead-nav::-webkit-scrollbar { display: none; }
  .masthead-name { display: none; }
  .masthead .brand-mark { width: 32px; height: 32px; }
  .masthead-daily, .masthead-cta { padding-left: 12px; padding-right: 12px; }
  #pitch, #catalog, #classroom, #requests { scroll-margin-top: calc(var(--masthead-h) + 8px); }
}

/* ──────────────────────── Hero ──────────────────────── */
.hero {
  padding: var(--space-section) var(--gutter) var(--space-page);
  max-width: var(--container);
  margin: 0 auto;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-page) var(--space-block);
  align-items: center;
}
@media (min-width: 960px) {
  .hero { grid-template-columns: minmax(0, 1.05fr) minmax(320px, 0.95fr); }
}
.hero-langs { grid-column: 1 / -1; }
/* A tall specimen must not push the pair chooser down: the copy stays on top. */
.hero-copy { align-self: start; }
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 500;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 32px;
}
.hero-eyebrow-rule {
  display: inline-block;
  width: 36px; height: 1px;
  background: var(--accent);
}
.hero-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--fs-display);
  line-height: var(--lh-display);
  letter-spacing: var(--track-display);
  margin: 0 0 32px;
  color: var(--ink);
  max-width: 16ch;
  text-wrap: balance;
}
.hero-title-em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: var(--track-snug);
  color: var(--accent);
}
.hero-sub {
  font-family: var(--serif);
  font-size: var(--fs-lede);
  line-height: var(--lh-body);
  color: var(--ink-2);
  max-width: 58ch;
  margin: 0 0 32px;
  text-wrap: pretty;
}
/* The hero's copy of the pair chooser: a notch smaller than the catalog's,
   right under the title so it is the page's first question and stays above
   the fold on a laptop, where the title alone runs to five lines. */
.hero .pair-chooser { font-size: var(--fs-chooser-hero); margin: 0 0 32px; }
.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
/* Buttons (.btn, .btn-primary, .btn-secondary, .btn-text, .btn-sm) live in system.css. */

/* Quiet caption pointing at the daily challenge — deliberately not a third button. */
.hero-daily {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--sans);
  font-size: var(--fs-ui);
  color: var(--ink-soft);
  transition: color 160ms ease;
}
.hero-daily:hover { color: var(--accent); }

/* ──────────────────────── Languages line ──────────────────────── */
.hero-langs {
  margin-top: var(--space-block);
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-family: var(--serif);
  font-size: var(--fs-body);
  color: var(--ink-2);
}
.hero-langs-native { font-style: italic; }
.hero-langs-link { color: inherit; border-bottom: 1px solid transparent; transition: border-color 160ms ease, color 160ms ease; }
.hero-langs-link:hover { color: var(--accent); border-bottom-color: var(--accent-soft); }
.hero-langs-code {
  font-family: var(--sans);
  font-size: var(--fs-code);
  font-weight: 600;
  letter-spacing: var(--track-code);
  color: var(--ink-soft);
  margin-left: 4px;
}

/* ──────────────────────── Pitch / format strip ──────────────────────── */
.pitch {
  padding: var(--space-block) var(--gutter) var(--space-section);
  max-width: var(--container);
  margin: 0 auto;
}
.pitch-head {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 64px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--rule);
}
.pitch-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
  margin: 0;
  color: var(--ink);
  max-width: 22ch;
  text-wrap: balance;
}
.pitch-lede {
  font-family: var(--serif);
  font-size: var(--fs-lede);
  line-height: var(--lh-body);
  color: var(--ink-2);
  margin: 0;
  max-width: 56ch;
  text-wrap: pretty;
}

.pitch-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border-top: 1px solid var(--rule);
  border-left: 1px solid var(--rule);
}
@media (max-width: 720px) { .pitch-grid { grid-template-columns: 1fr; } }
.pitch-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 16px;
  padding: 32px 32px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.pitch-n {
  font-family: var(--sans);
  font-size: var(--fs-ui-sm);
  font-weight: 600;
  color: var(--ink-soft);
  line-height: var(--lh-body);
  padding-top: 4px;
}
.pitch-item-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--fs-h3);
  line-height: var(--lh-heading);
  margin: 4px 0 12px;
  letter-spacing: var(--track-snug);
}
.pitch-item-text {
  font-family: var(--serif);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-2);
  margin: 0;
  text-wrap: pretty;
}

/* ──────────────────────── Catalog ──────────────────────── */
.catalog {
  padding: var(--space-page) var(--gutter) var(--space-section);
  max-width: var(--container);
  margin: 0 auto;
}
.catalog-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}

/* Language pair chooser — the one question the catalog asks, set as a sentence. */
.pair-chooser {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 16px;
  font-family: var(--serif);
  font-size: var(--fs-chooser);
  line-height: var(--lh-snug);
  color: var(--ink-2);
}
.pair-chooser-part { display: inline-flex; align-items: baseline; gap: 12px; max-width: 100%; }
.pair-chooser-word { font-style: italic; color: var(--ink-soft); white-space: nowrap; }
.pair-chooser-select {
  font: inherit;
  font-weight: 500;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--ink);
  border-radius: 0;
  padding: 2px 24px 2px 2px;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath d='M2.5 5l4.5 4.5L11.5 5' fill='none' stroke='%2317191d' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 4px center;
  background-size: 14px 14px;
  max-width: 100%;
  text-overflow: ellipsis;
}
.pair-chooser-select:hover { border-bottom-color: var(--accent); }
.pair-chooser-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
/* A fixed half of the pair ("I speak English") reads as plain text, not a dead control. */
.pair-chooser-select:disabled {
  color: var(--ink);
  opacity: 1;
  cursor: default;
  border-bottom-color: var(--rule);
  background-image: none;
  padding-right: 2px;
}
.pair-chooser-sep { color: var(--accent); }

/* Toolbar — search, sort, Kindle-only toggle, view switch, Filters. */
.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
}
.catalog-toolbar-row { display: contents; }
/* "Filters · N" is btn btn-secondary btn-sm (filled while the panel is open). */
.catalog-filters-n { color: var(--accent); }
.catalog-filters-btn[aria-expanded="true"] .catalog-filters-n { color: var(--accent-soft); }
.catalog-active { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }

/* Filters panel — a popover card under the masthead; a bottom sheet on phones. */
.filters-backdrop { position: fixed; inset: 0; z-index: 55; background: var(--scrim-soft); }
.filters-panel {
  position: fixed; z-index: 60;
  top: calc(var(--masthead-h) + 12px); right: var(--gutter);
  width: min(440px, 92vw); max-height: min(72vh, 680px);
  display: flex; flex-direction: column;
  border: 1px solid var(--rule);
  overflow: hidden;
  outline: none;
}
.filters-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px 12px 24px;
}
.filters-panel-title { font-family: var(--display); font-weight: 500; font-size: var(--fs-h3); margin: 0; letter-spacing: var(--track-snug); }
.filters-panel-body { padding: 16px 16px 4px; overflow-y: auto; flex: 1 1 auto; }
.filters-panel-body .lang-filter-label { margin-top: 0; }
.filters-panel-body .lang-filter { margin-bottom: 16px; }
.filters-panel-body .catalog-author { margin-bottom: 12px; }
.filters-panel-foot {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 12px 24px 16px;
}
@keyframes filters-sheet-up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 640px) {
  .catalog-head { gap: 16px; margin-bottom: 24px; padding-bottom: 16px; }
  .pair-chooser { flex-direction: column; align-items: flex-start; gap: 4px; font-size: var(--fs-chooser); }
  .pair-chooser-sep { display: none; }
  .pair-chooser-select { max-width: calc(100vw - var(--gutter) * 2 - 120px); }
  .catalog-toolbar .catalog-search { flex: 0 0 100%; min-width: 0; }
  /* Wrap rather than scroll: a hidden Filters button is a Filters button nobody finds. */
  .catalog-toolbar-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; flex: 0 0 100%; }
  .filters-panel {
    top: auto; right: 0; bottom: 0; left: 0; width: auto; max-height: 80vh;
    border-radius: var(--r-md) var(--r-md) 0 0; border-bottom: 0;
    animation: filters-sheet-up 220ms ease-out;
  }
  .filters-panel-foot { padding-bottom: max(16px, env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) { .filters-panel { animation: none; } }
.catalog-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
  margin: 0;
}
.catalog-sort {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: var(--fs-label);
  color: var(--ink-soft);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  font-weight: 600;
}
/* The sort select and the search box are field-control field-control-sm. */
.catalog-sort select { text-transform: none; letter-spacing: 0; cursor: pointer; }
.catalog-search { min-width: 220px; }

/* Language filter pills */
.lang-filter-label {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 8px 0 12px;
}
.lang-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}
/* Pill toggles: facet pills, the Grid/List switch and the sticky bar's filter
   chips share one geometry: a rule outline, filled with ink when on. */
.lang-filter-btn, .catalog-view-btn, .catalog-bar-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 4px 12px;
  font-family: var(--sans);
  font-size: var(--fs-ui-sm);
  font-weight: 600;
  letter-spacing: 0;
  white-space: nowrap;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}
.lang-filter-btn { border-color: var(--rule); }
.lang-filter-btn:hover:not(:disabled) { border-color: var(--ink); color: var(--ink); }
.lang-filter-btn.is-active, .catalog-view-btn.is-active, .catalog-bar-chip {
  background: var(--ink); border-color: var(--ink); color: var(--paper);
}
.lang-filter-btn.is-active:hover:not(:disabled) { color: var(--paper); }
.lang-filter-count {
  font-family: var(--sans);
  font-size: var(--fs-code);
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  padding: 2px 8px;
  background: var(--paper-2);
  border-radius: var(--r-pill);
}
.lang-filter-btn.is-active .lang-filter-count {
  background: var(--on-ink-wash);
  color: var(--paper);
}

.catalog-resultline {
  font-family: var(--serif);
  font-style: italic;
  font-size: var(--fs-meta);
  color: var(--ink-soft);
  margin-bottom: 48px;
  padding-top: 4px;
}
.catalog-resultline strong {
  color: var(--ink);
  font-style: normal;
  font-weight: 600;
}

/* Catalog grid */
.catalog-grid {
  display: grid;
  gap: var(--space-page) var(--space-column);
}
.catalog-grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

/* Book card */
.book-card {
  display: flex;
  flex-direction: column;
}
.book-card-cover-wrap {
  position: relative;
  margin-bottom: 16px;
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.book-card:hover .book-card-cover-wrap {
  transform: translateY(-3px);
}
.book-card-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--fs-h3);
  line-height: var(--lh-heading);
  margin: 0 0 8px;
  letter-spacing: var(--track-snug);
  text-wrap: balance;
}
.book-card-meta {
  font-family: var(--serif);
  font-size: var(--fs-meta);
  color: var(--ink-soft);
  margin-bottom: 16px;
  font-style: italic;
}
.book-card-dot { margin: 0 8px; }
.book-card-author { font-style: italic; }
.book-card-year { font-variant-numeric: oldstyle-nums; }

/* Direction chips — one per edition on a book card (and on the static book
   pages). This is the control every buyer uses, so each chip is ≥32px tall
   (WCAG 2.5.8 asks 24; platforms 44). List rows show a single direction. */
.edition-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 2px 0 0;
}
.edition-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  font-family: var(--sans);
  font-size: var(--fs-code);
  font-weight: 700;
  letter-spacing: var(--track-code);
  line-height: 1;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
  padding: 4px 12px;
  cursor: pointer;
  transition: all 140ms ease;
}
.edition-chip:hover { border-color: var(--ink); }
.edition-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.edition-chip.is-active .edition-chip-support { color: var(--paper-deep); }
/* On cards the chips are a selector under the cover, not the main content: one
   step smaller (28px stays above the 24px WCAG target) so a 12-edition card
   spends 3–4 rows on them instead of 5–6. The book pages keep the full size. */
.book-card .edition-chip { min-height: 28px; font-size: var(--fs-code); padding: 4px 8px; gap: 4px; }
.book-card .edition-chips { gap: 8px; }
/* The direction in words ("Learn German · English alongside") leads; the
   code is metadata: the chips below it, or the pair badge once the card is
   folded to the chosen pair. */
.book-card-direction {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 4px 12px;
  flex-wrap: wrap;
  font-family: var(--serif);
  font-size: var(--fs-meta);
  line-height: var(--lh-meta);
  color: var(--ink-2);
  margin: -4px 0 12px;
}

/* ──────────────── Language pair: one component everywhere ────────────────
   The words lead ("Learn German · English alongside", .pair-words), the code is
   the badge (DE · EN, .pair-code: learned language first, the reader's own
   second, joined by the accent dot). Cards, list rows, book pages, the
   specimen, the sample reader and the sticky filter chip all use it; the
   interactive .edition-chip shares its inner grammar. The accent dot is kept
   for joining a pair; other separators stay ink. */
.pair { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.pair-words { font-family: var(--serif); font-style: normal; font-weight: 400; color: var(--ink-2); }
.pair-code {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-family: var(--sans);
  font-size: var(--fs-code);
  font-weight: 700;
  font-style: normal;
  letter-spacing: var(--track-code);
  line-height: var(--lh-snug);
  color: var(--ink);
  white-space: nowrap;
  border: 1px solid var(--rule);
  border-radius: var(--r-pill);
}
.pair-code-support, .edition-chip-support { color: var(--ink-2); font-weight: 600; }
.pair-code-sep, .edition-chip-sep { color: var(--accent); letter-spacing: 0; }
/* Inside the ink filter chip the badge drops its outline and inverts. */
.catalog-bar-chip .pair-code { padding: 0; border: 0; color: inherit; }
.catalog-bar-chip .pair-code-support { color: var(--paper-deep); }
.catalog-bar-chip .pair-code-sep { color: var(--accent-soft); }
/* "N languages" (btn btn-text btn-sm): the way from a single-direction card or
   row to the pair chooser. */

/* Edition CTAs: "Get on Kindle →" is btn btn-primary btn-sm, "Read a sample" is
   btn btn-secondary btn-sm (system.css). */

/* ───── Cover styles ───── */
.cover {
  aspect-ratio: 640 / 857;
  width: 100%;
  border-radius: 2px;
  box-shadow: var(--shadow-cover);
  position: relative;
  overflow: hidden;
  font-family: var(--display);
}
/* CLASSIC */
.cover-classic {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 0;
}
.cover-band-top {
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.22em;
  padding: 8px 0;
  text-align: center;
}
.cover-classic-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 16px 18px;
  gap: 14px;
}
.cover-classic-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(14px, 1.5vw, 22px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.cover-classic-rule {
  width: 32px;
  height: 1.5px;
}
.cover-classic-author {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  font-weight: 400;
  opacity: 0.85;
}
.cover-band-bot {
  display: flex;
  justify-content: space-between;
  font-family: var(--sans);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  padding: 8px 14px;
  border-top: 1px solid currentColor;
  opacity: 0.7;
}

/* PHOTO */
.cover-photo { padding: 0; }
.cover-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

/* ──────────────────────── Footer ──────────────────────── */
.footer {
  background: var(--ink);
  color: var(--paper);
  margin-top: 64px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1.3fr 2fr;
  gap: 48px;
  max-width: var(--container);
  margin: 0 auto;
  padding: 64px var(--gutter) 48px;
}
@media (max-width: 720px) { .footer-top { grid-template-columns: 1fr; } }
.footer-brand .brand-mark { margin-bottom: 16px; }
.footer-tag {
  font-family: var(--serif);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--paper-deep);
  max-width: 36ch;
}
.footer-cols {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}
@media (max-width: 540px) { .footer-cols { grid-template-columns: 1fr; } }
.footer-col { display: flex; flex-direction: column; gap: 8px; }
.footer-col-h {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--accent-soft);
  margin: 0 0 8px;
}
.footer-note {
  font-family: var(--serif);
  font-style: italic;
  color: var(--paper-deep);
  font-size: var(--fs-meta);
  line-height: var(--lh-meta);
  max-width: 30ch;
  margin-top: 8px;
}
/* The copyright line closes the Contact column (no separate bottom bar). */
.footer-copy {
  font-family: var(--sans);
  font-style: normal;
  font-size: var(--fs-ui-sm);
  opacity: 0.7;
  margin-top: 16px;
}
.footer-col a, .footer-col span:not(.footer-note) {
  font-family: var(--serif);
  font-size: var(--fs-small);
  color: var(--paper-deep);
  transition: color 140ms ease;
}
.footer-col a:hover { color: var(--paper); }

/* ──────────────────────── Classrooms / group discounts ──────────────────────── */
.classroom {
  padding: var(--space-section) var(--gutter);
}
.classroom-inner {
  max-width: var(--measure);
  margin: 0 auto;
}
.classroom-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 12px; }
.pitch-more { margin: 24px 0 0; }

/* ──────────────────────── Requests / feedback form ──────────────────────── */
.requests {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: var(--space-section) var(--gutter);
}
.requests > * {
  max-width: var(--measure);
  margin-left: auto;
  margin-right: auto;
}
.requests-head { margin-bottom: 48px; }
.requests-eyebrow {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 16px;
}
.requests-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--fs-h1);
  line-height: var(--lh-tight);
  letter-spacing: var(--track-tight);
  margin: 0 0 16px;
  text-wrap: balance;
}
.requests-lede {
  font-family: var(--serif);
  font-size: var(--fs-lede);
  line-height: var(--lh-body);
  color: var(--ink-2);
  margin: 0;
  text-wrap: pretty;
}

.requests-form { display: flex; flex-direction: column; gap: 24px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
.field-label {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-2);
}
.field-opt {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink-soft);
  margin-left: 4px;
}
/* Inputs, selects and textareas are .field-control (system.css). */
.field textarea { resize: vertical; min-height: 140px; }
.field-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none;
}

.requests-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}
/* The submit buttons are btn btn-primary; while sending they show progress. */
.requests-submit:disabled { cursor: progress; }
.requests-error {
  font-family: var(--serif);
  font-size: var(--fs-small);
  color: var(--accent-deep);
}
.requests-error a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.requests-thanks {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  padding: 32px 32px;
  text-align: center;
}
.requests-thanks-mark {
  font-family: var(--display);
  font-size: var(--fs-h2);
  color: var(--accent);
  margin-bottom: 12px;
}
.requests-thanks-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--fs-h2);
  margin: 0 0 8px;
  letter-spacing: var(--track-snug);
}
.requests-thanks p {
  font-family: var(--serif);
  font-size: var(--fs-body);
  color: var(--ink-2);
  margin: 0;
}

/* ──────────────────────── Sample reader modal ──────────────────────── */
.book-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
}

/* One dialog shell: the reader, the mailing-list invite and the filters panel
   share the paper card, radius, shadow, paper-2 head/foot bands and the close
   button. Modal dialogs sit on --scrim; the filters popover on --scrim-soft. */
.reader-card, .subscribe-card, .filters-panel {
  background: var(--paper);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-dialog);
}
.reader-head, .filters-panel-head { background: var(--paper-2); border-bottom: 1px solid var(--rule); }
.reader-foot, .filters-panel-foot { background: var(--paper-2); border-top: 1px solid var(--rule); }
.dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 36px;
  height: 36px;
  font-family: var(--sans);
  font-size: var(--fs-icon);
  line-height: 1;
  color: var(--ink-2);
  background: transparent;
  border: 0;
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
}
.dialog-close:hover { background: var(--paper-deep); color: var(--ink); }

.reader-overlay {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-inset);
  animation: reader-fade-in 200ms ease-out;
}
@keyframes reader-fade-in { from { opacity: 0; } to { opacity: 1; } }

.reader-card {
  width: 100%;
  max-width: var(--dialog-reader);
  height: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.reader-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 16px 24px;
}
.reader-head-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: var(--fs-h3);
  letter-spacing: var(--track-snug);
  margin: 0;
}
/* The edition in the reader head: the pair component (words + badge). */
.reader-head-meta { font-size: var(--fs-meta); margin-top: 4px; }

.reader-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
}
.reader-viewport {
  flex: 1;
  background: var(--page);
  min-width: 0;
  position: relative;
  overflow: hidden;
}
.reader-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-soft);
  pointer-events: none;
}
.reader-nav {
  width: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--display);
  font-size: var(--fs-icon);
  color: var(--ink-soft);
  background: transparent;
  cursor: pointer;
  transition: background 140ms ease, color 140ms ease;
  flex-shrink: 0;
}
.reader-nav:hover:not(:disabled) {
  background: var(--paper-2);
  color: var(--accent);
}
.reader-nav:disabled { opacity: 0.25; cursor: default; }

.reader-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 24px;
  font-family: var(--sans);
  font-size: var(--fs-ui-sm);
  color: var(--ink-soft);
  letter-spacing: var(--track-ui);
}
.reader-progress {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  .reader-card { max-height: 100dvh; height: 100%; border-radius: 0; }
  .reader-foot { padding-left: 16px; padding-right: 16px; }
  .reader-nav { width: 40px; font-size: var(--fs-icon); }
  .reader-head-title { font-size: var(--fs-body); }
  .reader-head-meta { display: none; }
}

/* ──────────────────────── Mailing-list invite ──────────────────────── */
.subscribe-overlay {
  position: fixed;
  inset: 0;
  background: var(--scrim);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-inset);
  animation: reader-fade-in 200ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .subscribe-overlay, .reader-overlay { animation: none; }
}
.subscribe-card {
  width: 100%;
  max-width: 520px;
  padding: var(--space-inset);
  position: relative;
}
.subscribe-close {
  position: absolute;
  top: 16px;
  right: 16px;
}
.subscribe-kicker {
  font-family: var(--sans);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--accent-soft);
}
.subscribe-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: var(--fs-h2);
  letter-spacing: var(--track-tight);
  margin: 12px 0 16px;
}
.subscribe-body {
  font-family: var(--serif);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-2);
  margin: 0 0 12px;
}

/* Shared by the modal and the footer. */
.subscribe-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 24px;
}
.subscribe-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
}
.subscribe-field { flex: 1 1 220px; }
.subscribe-consent {
  font-family: var(--serif);
  font-size: var(--fs-meta);
  line-height: var(--lh-meta);
  color: var(--ink-soft);
  margin: 0;
}
.subscribe-consent a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.subscribe-done {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 24px;
}
.subscribe-mark {
  font-family: var(--display);
  font-size: var(--fs-h2);
  line-height: var(--lh-tight);
  color: var(--accent);
}
.subscribe-done p {
  font-family: var(--serif);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink-2);
  margin: 0;
}
/* The honest exit — present and unmissable, deliberately quieter than Subscribe. */
.subscribe-optout {
  font-family: var(--sans);
  font-size: var(--fs-ui-sm);
  color: var(--ink-soft);
  background: none;
  padding: 0;
  margin-top: 16px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 140ms ease;
}
.subscribe-optout:hover { color: var(--ink); }

/* Footer variant — sits on var(--ink). */
.footer .subscribe-form { margin-top: 24px; max-width: 36ch; }
.footer .subscribe-consent { color: var(--paper-deep); opacity: 0.72; }
.footer .subscribe-consent a { color: var(--paper-deep); }
.footer .subscribe-done p { color: var(--paper-deep); }
.footer .subscribe-mark { color: var(--accent-soft); }
.footer .requests-error { color: var(--paper-deep); }
.footer-subscribed {
  font-family: var(--serif);
  font-size: var(--fs-small);
  color: var(--paper-deep);
  margin: 24px 0 0;
}

/* ──────────────────────── Motion ──────────────────────── */
/* (Focus ring, .sr-only and .skip-link live in system.css.) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ──────────────────────── Hero specimen (generated: specimen.js) ──────────────────────── */
.specimen { margin: 0; width: 100%; max-width: 540px; justify-self: end; }
.specimen-page {
  background: var(--page);
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-cover);
  padding: var(--space-inset);
  font-family: var(--serif);
}
.specimen-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-family: var(--sans); font-size: var(--fs-label); font-weight: 600;
  letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--rule);
}
.specimen-pair { padding: 0.35em 0; border-bottom: 1px solid var(--pair-rule); }
.specimen-pair:last-of-type { border-bottom: 0; padding-bottom: 0; }
/* The reader surface: reading paper, the reading leading, the pair rule. The
   hero's copy is the one scaled instance; /how-it-works/ reads at full size. */
.specimen-target p, .specimen-source p { margin: 0 0 0.45em; font-size: var(--fs-read-compact); line-height: var(--lh-read); }
.infopage-specimen .specimen-target p, .infopage-specimen .specimen-source p { font-size: var(--fs-read); }
.specimen-source p { color: var(--ink-2); font-style: italic; opacity: 0.9; margin-bottom: 0.6em; }
.specimen-caption {
  font-family: var(--sans); font-size: var(--fs-ui-sm); line-height: var(--lh-meta); color: var(--ink-soft);
  margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
}
.specimen-facts { flex: 0 0 100%; font-size: var(--fs-ui-sm); letter-spacing: var(--track-ui); color: var(--ink-soft); }

/* ──────────────────────── Empty state ──────────────────────── */
.catalog-empty {
  text-align: center; padding: var(--space-block) 24px;
  border: 1px dashed var(--rule); border-radius: var(--r-md);
  font-family: var(--serif); color: var(--ink-2);
}
.catalog-empty p { margin: 0 0 16px; font-size: var(--fs-body); }

/* ──────────────────────── Book card links + deep-link highlight ──────────────────────── */
.book-card, .book-row { scroll-margin-top: calc(var(--masthead-h) + 64px); }
.book-card-cover-link { display: block; color: inherit; }
.book-card-title a { color: inherit; }
.book-card-title a:hover { text-decoration: underline; text-underline-offset: 3px; }
.book-card.is-highlighted .book-card-cover-wrap {
  outline: 2px solid var(--accent); outline-offset: 6px; border-radius: var(--r-xs);
}
.book-card-actions { min-height: 36px; }

/* ──────────────────────── Book page (books/<id>/, generated by gen-meta.js) ──────────────────────── */
.bookpage {
  max-width: var(--container-page); margin: 0 auto;
  padding: var(--space-page) var(--gutter) 64px;
  display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
  gap: var(--space-block); align-items: start;
}
@media (max-width: 720px) {
  .bookpage { grid-template-columns: 1fr; }
  .bookpage-cover { max-width: 260px; }
}
.bookpage-back {
  grid-column: 1 / -1; font-family: var(--sans); font-size: var(--fs-ui-sm); font-weight: 600;
  letter-spacing: var(--track-ui); color: var(--ink-soft);
}
.bookpage-back:hover { color: var(--accent); }
.bookpage-cover { margin: 0; }
.bookpage-eyebrow {
  font-family: var(--sans); font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--track-label);
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.bookpage-title {
  font-family: var(--display); font-weight: 500; font-size: var(--fs-h1);
  line-height: var(--lh-tight); letter-spacing: var(--track-tight); margin: 0 0 12px; text-wrap: balance;
}
.bookpage-meta { font-family: var(--serif); font-style: italic; font-size: var(--fs-body); color: var(--ink-soft); margin: 0 0 24px; }
.bookpage-lede {
  font-family: var(--serif); font-size: var(--fs-body); line-height: var(--lh-body); color: var(--ink-2);
  margin: 0 0 32px; max-width: 58ch; text-wrap: pretty;
}
.bookpage-group-h {
  font-family: var(--sans); font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--track-label);
  text-transform: uppercase; color: var(--ink-soft); margin: 24px 0 8px;
}
.bookpage-editions { list-style: none; margin: 0; padding: 0; }
.bookpage-edition {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px;
  padding: 12px 0; border-bottom: 1px solid var(--rule);
}
/* The code is a badge after the words, not a control. */
.bookpage-edition-label { font-family: var(--serif); font-size: var(--fs-body); color: var(--ink); }
.bookpage-edition-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
/* The visitor's own edition (learner.js, when a language pair is remembered):
   one card above the lists, which fold under "Other languages (N)". */
.bookpage-featured { margin: 0 0 8px; }
.bookpage-featured .bookpage-edition {
  border: 1px solid var(--ink); border-radius: var(--r-md);
  padding: 16px 24px; background: var(--paper-2);
}
.bookpage-featured .bookpage-edition-label { font-size: var(--fs-lede); }
.bookpage-others > summary {
  display: inline-block; margin: 16px 0 0; cursor: pointer;
  font-family: var(--sans); font-size: var(--fs-ui-sm); font-weight: 600; letter-spacing: var(--track-ui); color: var(--accent);
}
.bookpage-others > summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.bookpage-others[open] > summary { margin-bottom: 4px; }
/* No language known yet: three editions' covers, fanned, first-ranked on top. */
.bookpage-stack { position: relative; aspect-ratio: 640 / 857; }
.bookpage-stack-layer { position: absolute; width: 84%; }
.bookpage-stack-layer:not(:last-child) { filter: brightness(0.97); }
.bookpage-stack--3 .bookpage-stack-layer:nth-child(1) { left: 0; top: 1%; transform: rotate(-5deg); }
.bookpage-stack--3 .bookpage-stack-layer:nth-child(2) { right: 0; top: 0; transform: rotate(4deg); }
.bookpage-stack--2 .bookpage-stack-layer:nth-child(1) { right: 0; top: 0; transform: rotate(4deg); }
.bookpage-stack .bookpage-stack-layer:last-child { left: 7%; top: 9%; }
.bookpage-note { font-family: var(--serif); font-size: var(--fs-small); color: var(--ink-soft); margin: 24px 0 0; max-width: 60ch; }
.bookpage-note a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ──────────────────────── Explanatory pages (how-it-works/, teachers/, requests/; gen-meta.js from pages/*.html) ──────────────────────── */
.infopage { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: var(--space-page) var(--gutter) 64px; }
.infopage-title {
  font-family: var(--display); font-weight: 500; font-size: var(--fs-h1);
  line-height: var(--lh-tight); letter-spacing: var(--track-tight); margin: 0 0 16px; text-wrap: balance;
}
.infopage-lede { font-family: var(--serif); font-size: var(--fs-lede); line-height: var(--lh-body); color: var(--ink-2); margin: 0 0 24px; text-wrap: pretty; }
.infopage > h2 {
  font-family: var(--display); font-weight: 500; font-size: var(--fs-h2); letter-spacing: var(--track-snug);
  margin: 48px 0 16px; padding-top: 24px; border-top: 1px solid var(--rule); scroll-margin-top: calc(var(--masthead-h) + 16px);
}
.infopage > p { font-family: var(--serif); font-size: var(--fs-body); line-height: var(--lh-body); color: var(--ink-2); margin: 0 0 16px; text-wrap: pretty; }
.infopage > p a:not(.btn), .infopage-books a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.infopage-points { margin: 0 0 16px; padding-left: 1.2em; font-family: var(--serif); font-size: var(--fs-body); line-height: var(--lh-body); color: var(--ink-2); }
.infopage-points li { margin: 0 0 12px; padding-left: 4px; }
.infopage-points strong { color: var(--ink); font-weight: 600; }
.infopage-cta { margin: 24px 0 0; }
.infopage-specimen { max-width: none; margin: 0 0 12px; }
.infopage-level { font-family: var(--sans); font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink); margin: 24px 0 8px; }
.infopage-level span { color: var(--ink-soft); font-weight: 500; margin-left: 8px; letter-spacing: var(--track-ui); }
.infopage-books { list-style: none; margin: 0; padding: 0; font-family: var(--serif); font-size: var(--fs-small); line-height: var(--lh-meta); color: var(--ink-2); }
.infopage-books li { padding: 4px 0; border-bottom: 1px solid var(--rule); break-inside: avoid; }
@media (min-width: 720px) { .infopage-books { columns: 2; column-gap: 32px; } }
/* The requests page is the homepage form section, full width. */
.infopage--requests { max-width: none; padding: 0; }
.infopage--requests .requests { border-top: 0; }
.infopage--requests .requests-title { font-size: var(--fs-h1); }

/* ──────────────────────── Catalog at scale: facets, paging, bar, list ──────────────────────── */
.catalog-author { display: flex; flex-direction: column; gap: 8px; margin-bottom: 24px; }
.catalog-author .lang-filter-label { margin: 8px 0 0; }
.catalog-select { max-width: 320px; cursor: pointer; }
.catalog-view { display: inline-flex; gap: 0; border: 1px solid var(--rule); border-radius: var(--r-pill); padding: 2px; }
.catalog-more { display: flex; justify-content: center; margin-top: var(--space-page); }
.catalog-more-left { color: var(--ink-soft); font-weight: 400; margin-left: 4px; }

/* Sticky compact bar: search + active filters once the catalog head has scrolled away. */
.catalog-bar {
  display: none; position: fixed; left: 0; right: 0; top: var(--masthead-h, 89px); z-index: 40; /* under the masthead (50) */
  background: var(--paper); border-bottom: 1px solid var(--rule);
  box-shadow: var(--shadow-bar);
}
.catalog-bar.is-visible { display: block; }
.catalog-bar-inner {
  max-width: var(--container); margin: 0 auto; padding: 8px var(--gutter);
  display: flex; align-items: center; gap: 8px; overflow-x: auto; scrollbar-width: none;
}
.catalog-bar-inner::-webkit-scrollbar { display: none; }
.catalog-bar-search { flex: 0 0 auto; min-width: 160px; }
.catalog-bar .catalog-active { flex-wrap: nowrap; }
.catalog-bar-chip:hover { background: var(--accent); border-color: var(--accent); }
.catalog-bar-count { margin-left: auto; font-family: var(--serif); font-style: italic; font-size: var(--fs-meta); color: var(--ink-soft); white-space: nowrap; }
/* "Language ↑" is btn btn-text btn-sm; "Filters" is btn btn-secondary btn-sm. */
@media (max-width: 640px) {
  .catalog-bar { top: var(--masthead-h, 114px); }
  .catalog-bar-count { display: none; }
}

/* List view (and the static language pages) */
.catalog-list { list-style: none; margin: 0; padding: 0; }
.book-row {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto auto;
  gap: 4px 16px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--rule);
}
.book-row-thumb {
  width: 48px; aspect-ratio: 640 / 857; border-radius: var(--r-xs); overflow: hidden;
  box-shadow: var(--shadow-cover); display: block; background: var(--paper-2);
}
.book-row-thumb img, .book-row-thumb-blank { width: 100%; height: 100%; object-fit: cover; display: block; }
.book-row-main { display: flex; flex-direction: column; min-width: 0; }
.book-row-title { font-family: var(--display); font-weight: 500; font-size: var(--fs-h3); letter-spacing: var(--track-snug); }
.book-row-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.book-row-meta { font-family: var(--serif); font-style: italic; font-size: var(--fs-meta); color: var(--ink-soft); white-space: nowrap; }
.book-row-dir { font-size: var(--fs-meta); margin-top: 4px; }
.book-row-langs { white-space: nowrap; }
.book-row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
@media (max-width: 640px) {
  .book-row { grid-template-columns: 48px minmax(0, 1fr); }
  .book-row-langs, .book-row-actions { grid-column: 2; }
}

/* Static language pages (learn/<code>/, english-for/<code>/ — generated by gen-meta.js) */
.langpage { max-width: var(--container-page); margin: 0 auto; padding: var(--space-page) var(--gutter) 64px; }
.langpage .bookpage-back { display: inline-block; margin-bottom: 16px; }
.langpage-title {
  font-family: var(--display); font-weight: 500; font-size: var(--fs-h1);
  line-height: var(--lh-tight); letter-spacing: var(--track-tight); margin: 0 0 12px; text-wrap: balance;
}
.langpage-lede { font-family: var(--serif); font-size: var(--fs-body); line-height: var(--lh-body); color: var(--ink-2); margin: 0 0 16px; max-width: 60ch; text-wrap: pretty; }
.langpage-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0 0 24px; }
.langpage-others { font-family: var(--serif); font-size: var(--fs-small); color: var(--ink-soft); margin: 32px 0 0; }
.langpage-others a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; margin-right: 12px; }

/* Book page: facts, collections, series (generated by gen-meta.js) */
.bookpage-facts { font-family: var(--sans); font-size: var(--fs-label); font-weight: 600; letter-spacing: var(--track-label); text-transform: uppercase; color: var(--ink-soft); margin: -12px 0 16px; }
.bookpage-tags, .bookpage-series, .bookpage-daily { font-family: var(--serif); font-size: var(--fs-small); line-height: var(--lh-body); color: var(--ink-2); margin: 0 0 12px; }
.bookpage-tags a, .bookpage-series a, .bookpage-daily a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
