/* Parallel Editions — site stylesheet.
   Shared by index.html and the generated books/<id>/ pages (gen-meta.js).
   Tokens at the top are the source of truth; daily/index.html, privacy.html and
   welcome.html carry copies of the :root block — keep them in sync. */

/* ──────────────────────── Tokens ──────────────────────── */
:root {
  --paper:        #f4f2ec;
  --paper-2:      #eae7dd;
  --paper-deep:   #ddd9cc;
  --ink:          #17191d;
  --ink-2:        #383b42;
  --ink-soft:     #6a6d75;
  --rule:         #d4d0c4;
  --accent:       #1a3e63;   /* deep ink blue */
  --accent-deep:  #112a45;
  --accent-soft:  #6486a6;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --display: "Schibsted Grotesk", "Helvetica Neue", sans-serif;
  --sans: "Schibsted Grotesk", "Helvetica Neue", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", monospace;

  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 14px;

  --shadow-cover: 0 1px 1px rgba(40,28,12,0.08),
                  0 4px 12px rgba(40,28,12,0.10),
                  0 18px 40px -16px rgba(40,28,12,0.30);

  --container: 1280px;
  --gutter: clamp(20px, 4vw, 56px);
  color-scheme: light;
}

/* ──────────────────────── 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: 17px;
  line-height: 1.55;
  -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: 22px var(--gutter) 18px;
}
#pitch, #catalog, #classroom, #requests { scroll-margin-top: 96px; }
.masthead-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}
.masthead-mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--accent);
  border: 1.5px solid var(--accent);
  padding: 6px 10px 5px;
  border-radius: var(--r-sm);
}
.masthead-mark-amp { color: var(--accent-soft); margin: 0 1px; }
.masthead-name {
  font-family: var(--display);
  font-weight: 600;
  font-size: 20px;
  letter-spacing: -0.01em;
}
.masthead-actions {
  display: flex;
  align-items: center;
  gap: 28px;
}
.masthead-nav {
  display: flex;
  gap: 32px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
}
.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 — outlined pill; the dot pulses until today's sentence is done. */
.masthead-daily {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: var(--accent);
  border: 1px solid var(--accent-soft);
  border-radius: 999px;
  padding: 7px 14px 7px 11px;
  transition: color 160ms ease, border-color 160ms ease, background 160ms ease;
}
.masthead-daily:hover {
  border-color: var(--accent);
  background: rgba(26,62,99,0.06);
}
.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 rgba(26,62,99,0.35); }
  70%, 100%{ box-shadow: 0 0 0 7px rgba(26,62,99,0); }
}
.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: 12px;
  line-height: 1;
  color: var(--ink-soft);
}

.masthead-cta {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 999px;
  transition: background 160ms ease, transform 160ms ease;
}
.masthead-cta:hover { background: var(--accent); }
@media (max-width: 640px) {
  /* Phones: the text links move to a second, scrollable row instead of vanishing. */
  .masthead { flex-wrap: wrap; gap: 10px 12px; padding: 14px var(--gutter) 10px; }
  .masthead-brand { margin-right: auto; }
  .masthead-actions { display: contents; }
  .masthead-nav {
    order: 10; flex: 0 0 100%; gap: 20px; overflow-x: auto; scrollbar-width: none;
    padding: 8px 0 2px; border-top: 1px solid var(--rule); font-size: 13px; white-space: nowrap;
  }
  .masthead-nav::-webkit-scrollbar { display: none; }
  .masthead-name { display: none; }
  .masthead-daily { font-size: 12px; padding: 7px 12px 7px 10px; }
  .masthead-cta { font-size: 12px; padding: 9px 12px; }
  #pitch, #catalog, #classroom, #requests { scroll-margin-top: 120px; }
}

/* ──────────────────────── Hero ──────────────────────── */
.hero {
  padding: clamp(48px, 8vw, 104px) var(--gutter) clamp(20px, 3vw, 40px);
  max-width: var(--container);
  margin: 0 auto;
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(28px, 4vw, 48px) clamp(32px, 5vw, 72px);
  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; }
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 28px;
}
.hero-eyebrow-rule {
  display: inline-block;
  width: 36px; height: 1px;
  background: var(--accent);
}
.hero-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(44px, 7vw, 92px);
  line-height: 1.0;
  letter-spacing: -0.03em;
  margin: 0 0 28px;
  color: var(--ink);
  max-width: 16ch;
  text-wrap: balance;
}
.hero-title-em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--accent);
}
.hero-sub {
  font-family: var(--serif);
  font-size: clamp(17px, 1.4vw, 21px);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 58ch;
  margin: 0 0 36px;
  text-wrap: pretty;
}
.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 15px;
  font-weight: 500;
  padding: 14px 22px;
  border-radius: 999px;
  transition: all 180ms ease;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: var(--paper);
}
.btn-primary:hover {
  background: var(--accent-deep);
  box-shadow: 0 8px 18px -8px rgba(0,0,0,0.25);
}
.btn-ghost {
  color: var(--ink);
  border: 1px solid var(--rule);
  background: transparent;
}
.btn-ghost:hover { border-color: var(--ink); background: rgba(0,0,0,0.03); }

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

/* ──────────────────────── Languages line ──────────────────────── */
.hero-langs {
  margin-top: clamp(40px, 6vw, 72px);
  padding-top: 24px;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-family: var(--serif);
  font-size: 17px;
  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: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--ink-soft);
  margin-left: 5px;
}

/* ──────────────────────── Pitch / format strip ──────────────────────── */
.pitch {
  padding: clamp(32px, 5vw, 64px) var(--gutter) clamp(40px, 6vw, 80px);
  max-width: var(--container);
  margin: 0 auto;
}
.pitch-head {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 64px;
  padding-bottom: 40px;
  border-bottom: 1px solid var(--rule);
}
.pitch-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
  color: var(--ink);
  max-width: 22ch;
  text-wrap: balance;
}
.pitch-lede {
  font-family: var(--serif);
  font-size: clamp(16px, 1.2vw, 19px);
  line-height: 1.6;
  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: 20px;
  padding: 36px 32px;
  border-right: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.pitch-n {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  line-height: 1.6;
  padding-top: 4px;
}
.pitch-item-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  margin: 4px 0 12px;
  letter-spacing: -0.01em;
}
.pitch-item-text {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
  text-wrap: pretty;
}

/* ──────────────────────── Catalog ──────────────────────── */
.catalog {
  padding: clamp(20px, 3vw, 40px) var(--gutter) clamp(72px, 10vw, 120px);
  max-width: var(--container);
  margin: 0 auto;
}
.catalog-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 22px;
  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: clamp(21px, 2.4vw, 28px);
  line-height: 1.3;
  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 26px 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; }
.catalog-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.catalog-toggle input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; cursor: pointer; }
.catalog-toggle:hover { color: var(--ink); }
.catalog-filters-btn {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: all 160ms ease;
}
.catalog-filters-btn:hover { border-color: var(--ink); }
.catalog-filters-btn[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.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: 6px; 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: rgba(23,25,29,0.32); }
.filters-panel {
  position: fixed; z-index: 60;
  top: calc(var(--masthead-h, 89px) + 12px); right: var(--gutter);
  width: min(440px, 92vw); max-height: min(72vh, 680px);
  display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--rule); border-radius: var(--r-md);
  box-shadow: 0 28px 56px -24px rgba(40,28,12,0.5);
  outline: none;
}
.filters-panel-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 20px; border-bottom: 1px solid var(--rule);
}
.filters-panel-title { font-family: var(--display); font-weight: 500; font-size: 18px; margin: 0; letter-spacing: -0.01em; }
.filters-panel-close {
  width: 34px; height: 34px; border: 0; background: transparent; border-radius: 999px;
  font-size: 24px; line-height: 1; color: var(--ink-2); cursor: pointer;
}
.filters-panel-close:hover { background: var(--paper-2); color: var(--ink); }
.filters-panel-body { padding: 18px 20px 6px; 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 20px 16px; border-top: 1px solid var(--rule);
}
@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: 20px; padding-bottom: 16px; }
  .pair-chooser { flex-direction: column; align-items: flex-start; gap: 6px; font-size: 22px; }
  .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: 10px 14px; flex: 0 0 100%; }
  .catalog-sort-note { display: none; }
  .filters-panel {
    top: auto; right: 0; bottom: 0; left: 0; width: auto; max-height: 80vh;
    border-radius: 14px 14px 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: 400;
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0;
}
.catalog-sort {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 600;
}
.catalog-sort select {
  font: inherit;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
  font-weight: 500;
  background: transparent;
  border: 1px solid var(--rule);
  padding: 8px 14px 8px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-family: var(--serif);
  font-size: 15px;
}
.catalog-sort select:hover { border-color: var(--ink-soft); }

.catalog-search {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--rule);
  padding: 8px 14px;
  border-radius: var(--r-sm);
  min-width: 220px;
}
.catalog-search::placeholder { color: var(--ink-soft); font-style: italic; }
.catalog-search:hover { border-color: var(--ink-soft); }
.catalog-search:focus-visible { border-color: var(--ink); }

/* Language filter pills */
.lang-filter-label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 8px 0 12px;
}
.lang-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.lang-filter-btn {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: transparent;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: all 160ms ease;
}
.lang-filter-btn:hover:not(:disabled) {
  border-color: var(--ink);
  color: var(--ink);
}
.lang-filter-btn.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
.lang-filter-btn.is-active:hover:not(:disabled) {
  color: var(--paper);
}
.lang-filter-name { font-weight: 600; }
.lang-filter-count {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
  padding: 2px 7px;
  background: var(--paper-2);
  border-radius: 999px;
  margin-left: 4px;
}
.lang-filter-btn.is-active .lang-filter-count {
  background: rgba(255,255,255,0.15);
  color: var(--paper);
}

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

/* Catalog grid */
.catalog-grid {
  display: grid;
  gap: clamp(28px, 3vw, 44px) clamp(20px, 2.5vw, 32px);
}
.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: 18px;
  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: 19px;
  line-height: 1.2;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.book-card-meta {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 14px;
  font-style: italic;
}
.book-card-dot { margin: 0 6px; }
.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: 5px;
  min-height: 32px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--ink);
  background: var(--paper-2);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 6px 11px;
  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-support { color: var(--ink-2); font-weight: 600; }
.edition-chip-sep { color: var(--accent); font-size: 11px; letter-spacing: 0; }
.edition-chip.is-active .edition-chip-support { color: var(--paper-deep); }
/* On Kindle now: a filled dot. Kindle listing pending: dashed border, muted text, full opacity
   (the old 0.55 opacity read at ~3.6:1). */
.edition-chip-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex: none; margin-right: 1px;
}
.edition-chip.is-active .edition-chip-dot { background: var(--accent-soft); }
.edition-chip--soon { border-style: dashed; color: var(--ink-2); background: transparent; }
.edition-chip--soon .edition-chip-support { color: var(--ink-soft); }
.edition-chip--soon.is-active { border-style: solid; color: var(--paper); background: var(--ink); }
.edition-chip--soon.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: 11px; padding: 4px 9px; gap: 4px; }
.book-card .edition-chips { gap: 6px; }
.book-card-direction {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 6px 12px;
  flex-wrap: wrap;
  font-family: var(--serif);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin: 8px 0 10px;
}
/* "N languages" — the way from a single-direction card or row to the pair chooser. */
.book-langs {
  font-family: var(--sans);
  font-style: normal;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
}
.book-langs:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Edition CTA — the primary buy button on a card */
.edition-cta {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--accent);
  padding: 9px 16px;
  border-radius: 999px;
  transition: background 160ms ease, transform 160ms ease;
  white-space: nowrap;
}
.edition-cta:hover {
  background: var(--accent-deep);
}
.edition-cta--ghost {
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--rule);
}
.edition-cta--ghost:hover {
  background: var(--paper-2);
  border-color: var(--ink-soft);
  color: var(--ink);
  transform: none;
}

/* ───── 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-mark {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  letter-spacing: 0.02em;
  color: var(--accent-soft);
  border: 1.5px solid var(--accent-soft);
  padding: 6px 10px 5px;
  border-radius: var(--r-sm);
  display: inline-block;
  margin-bottom: 16px;
}
.footer-tag {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  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: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin: 0 0 6px;
}
.footer-note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px !important;
  line-height: 1.5;
  max-width: 30ch;
  margin-top: 6px;
}
/* The copyright line closes the Contact column (no separate bottom bar). */
.footer-copy {
  font-family: var(--sans);
  font-style: normal;
  font-size: 13px !important;
  opacity: 0.7;
  margin-top: 14px;
}
.footer-col a, .footer-col span {
  font-family: var(--serif);
  font-size: 15px;
  color: var(--paper-deep);
  transition: color 140ms ease;
}
.footer-col a:hover { color: var(--paper); }

/* ──────────────────────── Classrooms / group discounts ──────────────────────── */
.classroom {
  padding: clamp(48px, 7vw, 88px) var(--gutter);
}
.classroom-inner {
  max-width: 720px;
  margin: 0 auto;
}
.classroom-actions { margin-top: 28px; }

/* ──────────────────────── Requests / feedback form ──────────────────────── */
.requests {
  background: var(--paper-2);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: clamp(40px, 6vw, 72px) var(--gutter);
}
.requests > * {
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}
.requests-head { margin-bottom: 40px; }
.requests-eyebrow {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.requests-title {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(30px, 3.6vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  text-wrap: balance;
}
.requests-lede {
  font-family: var(--serif);
  font-size: clamp(16px, 1.2vw, 19px);
  line-height: 1.6;
  color: var(--ink-2);
  margin: 0;
  text-wrap: pretty;
}

.requests-form { display: flex; flex-direction: column; gap: 22px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }
.field-label {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  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;
}
.field input,
.field select,
.field textarea {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--r-sm);
  padding: 12px 14px;
  width: 100%;
  transition: border-color 140ms ease, background 140ms ease;
}
.field textarea { resize: vertical; min-height: 140px; }
.field input:hover,
.field select:hover,
.field textarea:hover { border-color: var(--ink-soft); }
.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible { border-color: var(--accent); }
.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: 18px;
  margin-top: 6px;
}
.requests-submit {
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--accent);
  color: var(--paper);
  padding: 14px 24px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 160ms ease, transform 160ms ease;
}
.requests-submit:hover:not(:disabled) {
  background: var(--accent-deep);
}
.requests-submit:disabled {
  opacity: 0.6;
  cursor: progress;
}
.requests-error {
  font-family: var(--serif);
  font-size: 15px;
  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: 40px 32px;
  text-align: center;
}
.requests-thanks-mark {
  font-family: var(--display);
  font-size: 36px;
  color: var(--accent);
  margin-bottom: 12px;
}
.requests-thanks h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 24px;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.requests-thanks p {
  font-family: var(--serif);
  font-size: 16px;
  color: var(--ink-2);
  margin: 0;
}

/* ──────────────────────── Sample reader modal ──────────────────────── */
.book-card-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 14px;
}
.read-sample-btn {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink);
  border: 1px solid var(--ink);
  background: transparent;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 160ms ease;
}
.read-sample-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.reader-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 6, 0.72);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 32px);
  animation: reader-fade-in 200ms ease-out;
}
@keyframes reader-fade-in { from { opacity: 0; } to { opacity: 1; } }

.reader-card {
  background: var(--paper);
  width: 100%;
  max-width: 920px;
  height: 100%;
  max-height: 92vh;
  border-radius: var(--r-lg);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}
.reader-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--rule);
  background: var(--paper-2);
}
.reader-head-title {
  font-family: var(--display);
  font-weight: 500;
  font-size: 18px;
  letter-spacing: -0.01em;
  margin: 0;
}
.reader-head-meta {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-soft);
  margin-left: 8px;
}
.reader-close {
  font-family: var(--sans);
  font-size: 22px;
  line-height: 1;
  color: var(--ink-2);
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 140ms ease;
}
.reader-close:hover { background: var(--paper-deep); }

.reader-body {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: stretch;
}
.reader-viewport {
  flex: 1;
  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: 28px;
  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 22px;
  border-top: 1px solid var(--rule);
  background: var(--paper-2);
  font-family: var(--sans);
  font-size: 12px;
  color: var(--ink-soft);
  letter-spacing: 0.04em;
}
.reader-progress {
  font-variant-numeric: tabular-nums;
}
.reader-cta {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--paper);
  background: var(--accent);
  padding: 8px 14px;
  border-radius: 999px;
  transition: background 160ms ease;
}
.reader-cta:hover { background: var(--accent-deep); }
.reader-cta--ghost {
  color: var(--ink-2);
  background: transparent;
  border: 1px solid var(--rule);
}
.reader-cta--ghost:hover { border-color: var(--ink); color: var(--ink); background: transparent; }

@media (max-width: 600px) {
  .reader-card { max-height: 100dvh; height: 100%; border-radius: 0; }
  .reader-nav { width: 40px; font-size: 24px; }
  .reader-head-title { font-size: 16px; }
  .reader-head-meta { display: none; }
}

/* ──────────────────────── Mailing-list invite ──────────────────────── */
.subscribe-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 14, 6, 0.72);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 3vw, 32px);
  animation: reader-fade-in 200ms ease-out;
}
@media (prefers-reduced-motion: reduce) {
  .subscribe-overlay, .reader-overlay { animation: none; }
}
.subscribe-card {
  background: var(--paper);
  width: 100%;
  max-width: 520px;
  border-radius: var(--r-lg);
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.5);
  padding: clamp(28px, 4vw, 40px);
  position: relative;
}
.subscribe-close {
  position: absolute;
  top: 14px;
  right: 14px;
}
.subscribe-kicker {
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-soft);
}
.subscribe-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: -0.02em;
  margin: 10px 0 14px;
}
.subscribe-body {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  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: 22px;
}
.subscribe-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
  flex-wrap: wrap;
}
.subscribe-field { flex: 1 1 220px; }
.subscribe-consent {
  font-family: var(--serif);
  font-size: 13px;
  line-height: 1.5;
  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: 22px;
}
.subscribe-mark {
  font-family: var(--display);
  font-size: 26px;
  line-height: 1.1;
  color: var(--accent);
}
.subscribe-done p {
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0;
}
/* The honest exit — present and unmissable, deliberately quieter than Subscribe. */
.subscribe-optout {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--ink-soft);
  background: none;
  padding: 0;
  margin-top: 18px;
  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: 20px; 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: 15px;
  color: var(--paper-deep);
  margin: 20px 0 0;
}

/* ──────────────────────── A11y / focus ──────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ──────────────────────── Accessibility utilities ──────────────────────── */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 16px; top: -100px; z-index: 100;
  font-family: var(--sans); font-size: 14px; font-weight: 600;
  background: var(--ink); color: var(--paper);
  padding: 10px 16px; border-radius: 999px;
  transition: top 120ms ease;
}
.skip-link:focus { top: 12px; }
@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: #fffdf7;
  border: 1px solid var(--rule);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-cover);
  padding: clamp(18px, 3vw, 28px) clamp(20px, 3vw, 30px);
  font-family: var(--serif);
}
.specimen-head {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  font-family: var(--sans); font-size: 12px; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--rule);
}
.specimen-chip {
  font-size: 11px; color: var(--ink); background: var(--paper-2);
  border: 1px solid var(--rule); border-radius: 999px; padding: 3px 9px; letter-spacing: 0.06em;
}
.specimen-pair { padding: 0.35em 0; border-bottom: 1px solid rgba(60, 60, 60, 0.14); }
.specimen-pair:last-of-type { border-bottom: 0; padding-bottom: 0; }
.specimen-target p, .specimen-source p { margin: 0 0 0.45em; font-size: 15.5px; line-height: 1.5; }
.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: 13.5px; line-height: 1.5; color: var(--ink-soft);
  margin-top: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px;
}
.specimen-btn {
  font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--accent);
  border: 1px solid var(--accent-soft); border-radius: 999px; padding: 7px 14px; white-space: nowrap;
  transition: background 160ms ease, border-color 160ms ease;
}
.specimen-btn:hover { border-color: var(--accent); background: rgba(26,62,99,0.06); }

/* ──────────────────────── Sort note, empty state ──────────────────────── */
.catalog-sort-note { text-transform: none; letter-spacing: 0; font-weight: 500; }
.catalog-empty {
  text-align: center; padding: clamp(32px, 6vw, 64px) 20px;
  border: 1px dashed var(--rule); border-radius: var(--r-md);
  font-family: var(--serif); color: var(--ink-2);
}
.catalog-empty p { margin: 0 0 18px; font-size: 17px; }

/* ──────────────────────── Book card links + deep-link highlight ──────────────────────── */
.book-card, .book-row { scroll-margin-top: calc(var(--masthead-h, 89px) + 72px); }
.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: 2px;
}
.book-card-actions { min-height: 38px; }

/* ──────────────────────── Book page (books/<id>/, generated by gen-meta.js) ──────────────────────── */
.bookpage {
  max-width: 1040px; margin: 0 auto;
  padding: clamp(24px, 4vw, 48px) var(--gutter) 80px;
  display: grid; grid-template-columns: minmax(200px, 300px) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 56px); 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: 13px; font-weight: 600;
  letter-spacing: 0.04em; color: var(--ink-soft);
}
.bookpage-back:hover { color: var(--accent); }
.bookpage-cover { margin: 0; }
.bookpage-eyebrow {
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}
.bookpage-title {
  font-family: var(--display); font-weight: 500; font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 10px; text-wrap: balance;
}
.bookpage-meta { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ink-soft); margin: 0 0 22px; }
.bookpage-lede {
  font-family: var(--serif); font-size: 17px; line-height: 1.6; color: var(--ink-2);
  margin: 0 0 28px; max-width: 58ch; text-wrap: pretty;
}
.bookpage-group-h {
  font-family: var(--sans); font-size: 12px; font-weight: 600; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-soft); margin: 26px 0 6px;
}
.bookpage-editions { list-style: none; margin: 0; padding: 0; }
.bookpage-edition {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px;
  padding: 12px 0; border-bottom: 1px solid var(--rule);
}
.bookpage .edition-chip { cursor: default; }
.bookpage-edition-label { font-family: var(--serif); font-size: 16px; color: var(--ink); }
.bookpage-edition.is-soon .bookpage-edition-label { color: var(--ink-2); }
.bookpage-edition-actions { margin-left: auto; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.bookpage-note { font-family: var(--serif); font-size: 14.5px; color: var(--ink-soft); margin: 26px 0 0; max-width: 60ch; }
.bookpage-note a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

/* ──────────────────────── Catalog at scale: facets, paging, bar, list ──────────────────────── */
.catalog-author { display: flex; flex-direction: column; gap: 8px; margin-bottom: 20px; }
.catalog-author .lang-filter-label { margin: 8px 0 0; }
.catalog-select {
  font-family: var(--serif); font-size: 15px; color: var(--ink);
  background: transparent; border: 1px solid var(--rule); border-radius: var(--r-sm);
  padding: 8px 12px; max-width: 320px; cursor: pointer;
}
.catalog-select:hover { border-color: var(--ink-soft); }
.catalog-view { display: inline-flex; gap: 0; border: 1px solid var(--rule); border-radius: 999px; padding: 3px; }
.catalog-view-btn {
  font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink-2); padding: 6px 14px; border-radius: 999px; min-height: 32px;
  transition: background 140ms ease, color 140ms ease;
}
.catalog-view-btn.is-active { background: var(--ink); color: var(--paper); }
.catalog-more { display: flex; justify-content: center; margin-top: clamp(28px, 4vw, 48px); }
.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: 0 8px 18px -14px rgba(40,28,12,0.35);
}
.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: 10px; overflow-x: auto; scrollbar-width: none;
}
.catalog-bar-inner::-webkit-scrollbar { display: none; }
.catalog-bar-search { flex: 0 0 auto; min-width: 160px; padding: 6px 12px; font-size: 14px; }
.catalog-bar .catalog-active { flex-wrap: nowrap; }
.catalog-bar-chip {
  font-family: var(--sans); font-size: 12px; font-weight: 600; background: var(--ink); color: var(--paper);
  border-radius: 999px; padding: 7px 11px; white-space: nowrap; min-height: 32px;
}
.catalog-bar-chip:hover { background: var(--accent); }
.catalog-bar-count { margin-left: auto; font-family: var(--serif); font-style: italic; font-size: 13px; color: var(--ink-soft); white-space: nowrap; }
.catalog-bar-all { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--accent); white-space: nowrap; }
.catalog-bar-filters {
  font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--ink); white-space: nowrap;
  background: transparent; border: 1px solid var(--rule); border-radius: 999px; padding: 6px 12px; min-height: 32px; cursor: pointer;
}
.catalog-bar-filters:hover { border-color: var(--ink); }
.catalog-bar-filters[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
@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: 6px 16px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--rule);
}
.book-row-thumb {
  width: 48px; aspect-ratio: 640 / 857; border-radius: 2px; 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: 17px; letter-spacing: -0.01em; }
.book-row-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.book-row-meta, .book-row-dir { font-family: var(--serif); font-style: italic; font-size: 13.5px; color: var(--ink-soft); white-space: nowrap; }
.book-row-dir { color: var(--ink-2); }
.book-row-langs { white-space: nowrap; }
.book-row-actions { display: flex; gap: 10px; 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; }
  .book-row-dir { white-space: normal; }
}

/* Static language pages (learn/<code>/, english-for/<code>/ — generated by gen-meta.js) */
.langpage { max-width: 960px; margin: 0 auto; padding: clamp(24px, 4vw, 48px) var(--gutter) 80px; }
.langpage .bookpage-back { display: inline-block; margin-bottom: 18px; }
.langpage-title {
  font-family: var(--display); font-weight: 500; font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05; letter-spacing: -0.02em; margin: 0 0 12px; text-wrap: balance;
}
.langpage-lede { font-family: var(--serif); font-size: 17px; line-height: 1.6; color: var(--ink-2); margin: 0 0 18px; max-width: 60ch; text-wrap: pretty; }
.langpage-links { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0 0 24px; font-family: var(--sans); font-size: 14px; font-weight: 600; }
.langpage-links a { color: var(--accent); }
.langpage-links a:hover { text-decoration: underline; text-underline-offset: 3px; }
.langpage-others { font-family: var(--serif); font-size: 14.5px; color: var(--ink-soft); margin: 28px 0 0; }
.langpage-others a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; margin-right: 10px; }

/* Book page: facts, collections, series (generated by gen-meta.js) */
.bookpage-facts { font-family: var(--sans); font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-soft); margin: -12px 0 14px; }
.bookpage-tags, .bookpage-series { font-family: var(--serif); font-size: 15px; line-height: 1.55; color: var(--ink-2); margin: 0 0 12px; }
.bookpage-tags a, .bookpage-series a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
