/* T.M.Gareth: site styles.
   Palette and fonts follow the current BookBub-built site (checked on the live page):
   neutral cool-gray base theme (shared pages), black text, Life Savers headings, Libre Baskerville body.
   Each book brings its own colours through its Theme-* lines (Of Silver Bells and Golden Doodles = blues, Cut Like a Gem = burgundy).
   Change the variables in :root only. */
:root {
  --bg: #e8eaec;
  --bg-alt: #d8dbde;
  --bg-deep: #c6cacd;
  --link: #2b2f36;
  --card: #ffffff;
  --ink: #000000;
  --muted: #4a4c52;
  --accent: #3d4048;
  --accent-ink: #ffffff;
  --focus: #1c1f24;
  --line: #c3c7ca;
  --radius: 6px;
  --font-body: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --font-head: "Life Savers", "Trebuchet MS", Georgia, serif;
  --gutter: 16px;
  --max: 68rem;
}

/* Fonts are hosted on this site (assets/fonts/, SIL Open Font License; see fonts-license.txt), so nothing depends on
   an outside service. font-display: swap shows readable fallback text instantly if a file is slow, then swaps.
   Libre Baskerville ships as one variable file covering weights 400-700. Latin character set (English, accents). */
@font-face { font-family: "Libre Baskerville"; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url("../fonts/libre-baskerville.woff2") format("woff2"); }
@font-face { font-family: "Libre Baskerville"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../fonts/libre-baskerville-italic.woff2") format("woff2"); }
@font-face { font-family: "Life Savers"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/life-savers-700.woff2") format("woff2"); }
@font-face { font-family: "Life Savers"; font-style: normal; font-weight: 800; font-display: swap;
  src: url("../fonts/life-savers-800.woff2") format("woff2"); }

/* Registered so the color scheme can fade when the two-book home page swaps themes. */
@property --accent { syntax: '<color>'; inherits: true; initial-value: #3d4048; }
@property --link { syntax: '<color>'; inherits: true; initial-value: #2b2f36; }
@property --bg-deep { syntax: '<color>'; inherits: true; initial-value: #c6cacd; }
@property --bg { syntax: '<color>'; inherits: true; initial-value: #e8eaec; }
@property --bg-alt { syntax: '<color>'; inherits: true; initial-value: #d8dbde; }
@property --line { syntax: '<color>'; inherits: true; initial-value: #c3c7ca; }
@property --focus { syntax: '<color>'; inherits: true; initial-value: #1c1f24; }
/* Background colours fade when a book's theme is swapped in. Border and text colours stay instant (animating them flickered the nav). */
:root { transition: --bg-deep 0.4s ease, --bg 0.4s ease, --bg-alt 0.4s ease; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: linear-gradient(180deg, var(--bg-deep), var(--bg) 40rem) no-repeat var(--bg);
  color: var(--ink);
  font: 1rem/1.75 var(--font-body);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
main:focus { outline: none; }
/* Sticky footer: short pages keep the footer at the bottom of the screen. */
body { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
main { flex: 1 0 auto; }

h1, h2, h3, .h3 { font-family: var(--font-head); font-weight: 700; line-height: 1.15; margin: 0 0 0.6em; }
h1 { font-weight: 800; }
h1 { font-size: clamp(2.2rem, 6vw, 3.4rem); }
h2 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); }
h3, .h3 { font-size: 1.5rem; }
p { margin: 0 0 1em; }
.card, .prose, .post, .notice { overflow-wrap: anywhere; }

.wrap { width: min(100% - 2 * var(--gutter), var(--max)); margin-inline: auto; }
.narrow { max-width: 46rem; }
.section { padding-block: 2.5rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.skip-link {
  position: absolute; left: var(--gutter); top: -4rem; z-index: 10;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: 0 0 8px 8px;
}
.skip-link:focus { top: 0; }

/* Header: centered wordmark over a centered nav row */
.header-inner { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; padding-block: 1.5rem 1rem; }
.brand { font: 800 clamp(3rem, 11vw, 5.5rem)/1 var(--font-head); color: var(--ink); text-decoration: none; }
.site-nav ul { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0.4rem 0.4rem; list-style: none; margin: 0; padding: 0; }
/* Nav links read as buttons: a light button with a thin border and the same corners as the other buttons; the current page is filled with the accent colour. */
.site-nav a {
  display: block; padding: 0.35rem 0.85rem; border-radius: var(--radius); border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55); color: var(--ink); text-decoration: none; font-size: 1rem;
}
.site-nav a:hover { background: #fff; border-color: var(--accent); }
.site-nav a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
/* Logo image: capped at 26rem wide and centred (the header is a centred column). */
.brand { display: block; width: min(100%, 26rem); text-align: center; }
.brand img { width: 100%; height: auto; }
.nav-icon { display: flex !important; align-items: center; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1.2rem 0; }
.btn {
  display: inline-block; padding: 0.6rem 1.3rem; border-radius: var(--radius); border: 1px solid var(--accent);
  background: var(--accent); color: var(--accent-ink); font: 400 1rem var(--font-body); text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.12); }
.btn--ghost { background: transparent; color: var(--ink); border-color: #8d8a84; }
.btn--ghost:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); filter: none; }
/* Buy Now pop-out (a <details> element, so it works without JavaScript) */
.buy { position: relative; display: inline-block; }
.buy summary { list-style: none; }
.buy summary::-webkit-details-marker { display: none; }
.buy summary::after { content: " \25BE"; }
.buy[open] summary::after { content: " \25B4"; }
.buy-menu {
  position: absolute; top: calc(100% + 0.4rem); left: 0; z-index: 5; min-width: 100%; margin: 0; padding: 0.4rem;
  list-style: none; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 8px 20px rgba(28, 26, 22, 0.25);
}
.buy-menu a { display: block; padding: 0.5rem 0.9rem; border-radius: 4px; color: var(--ink); text-decoration: none; white-space: nowrap; }
.buy-menu a:hover { background: var(--accent); color: var(--accent-ink); }

/* Hero */
.hero { padding-block: 2.5rem 1.5rem; }
.hero-inner { display: grid; gap: 2rem; align-items: center; }
.hero h1 { font-size: clamp(2.4rem, 6.5vw, 4.5rem); }
.tagline { font-style: italic; color: var(--muted); }
.prose { max-width: 42rem; }
@media (min-width: 760px) {
  .hero-inner--split { grid-template-columns: 1.1fr 0.9fr; }
  .hero-inner--split .covers { justify-content: center; }
}

/* Covers: a row for four or fewer, a scroll-snap carousel for more */
.covers { display: flex; flex-wrap: wrap; justify-content: center; gap: 1.5rem; padding-block: 1.25rem; }
.cover-link { display: block; width: clamp(9rem, 26vw, 15rem); aspect-ratio: 2 / 3; border-radius: 4px; }
.cover-link img {
  width: 100%; height: 100%; object-fit: cover; border-radius: 4px;
  box-shadow: 0 6px 10px rgba(28, 26, 22, 0.3);
}
.cover-link:hover img, .cover-link:focus-visible img, .cover-link:active img {
  animation: hop 0.65s cubic-bezier(0.3, 0.7, 0.4, 1) both;
}
@keyframes hop {
  0%   { transform: translateY(0);     box-shadow: 0 6px 10px rgba(28, 26, 22, 0.3); }
  30%  { transform: translateY(-16px) rotate(-1deg); box-shadow: 0 24px 22px -8px rgba(28, 26, 22, 0.22); }
  55%  { transform: translateY(0);     box-shadow: 0 2px 4px rgba(28, 26, 22, 0.45); }
  72%  { transform: translateY(-6px);  box-shadow: 0 12px 14px -6px rgba(28, 26, 22, 0.24); }
  100% { transform: translateY(0);     box-shadow: 0 6px 10px rgba(28, 26, 22, 0.3); }
}
.covers--carousel {
  flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scroll-snap-type: x mandatory;
  padding: 1.75rem 0.75rem 1.25rem; scrollbar-width: thin;
}
.covers--carousel > * { flex: 0 0 auto; scroll-snap-align: center; }
.carousel-ui { display: flex; align-items: center; justify-content: center; gap: 0.75rem; }
.carousel-ui button {
  border: 1px solid var(--accent); background: var(--card); color: var(--accent); border-radius: 999px;
  width: 2.5rem; height: 2.5rem; font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.carousel-ui button:hover { background: var(--accent); color: var(--accent-ink); }
.carousel-ui .dots { display: flex; gap: 0.35rem; }
.carousel-ui .dots button { width: 1.25rem; height: 1.25rem; padding: 0; border-color: var(--muted); font-size: 0; }
.carousel-ui .dots button[aria-current="true"] { background: var(--ink); border-color: var(--ink); }

/* Update cards: two-up grid, 2:1 image, blue date, display-font title */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr)); gap: 2.5rem 2rem; }
.card { position: relative; display: flex; flex-direction: column; }
.card-media { width: 100%; aspect-ratio: 2 / 1; object-fit: cover; margin-bottom: 1rem; }
.card-media--cover { aspect-ratio: 2 / 3; object-fit: contain; background: var(--bg-alt); }
.card .date { order: -1; margin: 0; }
.card-body { display: flex; flex-direction: column; }
.card-body .date { order: -1; }
.card h3 a, .card .h3 a { color: var(--ink); text-decoration: none; }
.card h3 a::after, .card .h3 a::after { content: ""; position: absolute; inset: 0; }
.card:hover h3 a, .card:hover .h3 a { text-decoration: underline; }
.card:focus-within { outline: 3px solid var(--focus); outline-offset: 6px; }
.card h3 a:focus-visible, .card .h3 a:focus-visible { outline: none; }
.date { font-family: var(--font-head); font-weight: 700; color: var(--link); text-transform: uppercase; font-size: 1rem; letter-spacing: 0.02em; margin-bottom: 0.2rem; }
.more { margin-top: 1.5rem; }

/* Paragraph alignment from the text files' {left} {right} {center} {full} tags and Align: header. "full" = justified; hyphenation
   (the page language is English) keeps the spacing even. Classes beat the page's normal alignment, e.g. the centred hero. */
.align-left { text-align: left; }
.align-right { text-align: right; }
.align-center { text-align: center; }
.align-full { text-align: justify; text-justify: inter-word; -webkit-hyphens: auto; hyphens: auto; }

/* Featured (newest) update on the home page: shown in full, in a reading-width column */
.featured-update { padding-bottom: 1rem; }
.featured-update h2 a { color: var(--ink); text-decoration: none; }
.featured-update h2 a:hover { text-decoration: underline; }
.featured-update .series { margin-bottom: 0.4rem; }

/* Book page */
.book-grid { display: grid; gap: 2rem; }
.book-cover img { width: min(100%, 22rem); margin-inline: auto; border-radius: 4px; box-shadow: 0 10px 24px rgba(28, 26, 22, 0.35); }
@media (min-width: 760px) { .book-grid { grid-template-columns: minmax(12rem, 20rem) 1fr; align-items: start; } }

.post-image { margin-bottom: 1.5rem; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.portrait { max-width: 16rem; margin-bottom: 1.5rem; }
/* A wide page image (Argonne Anthology): full width of the text column, natural proportions. */
.page-banner { width: 100%; height: auto; margin-bottom: 1.5rem; border-radius: var(--radius); }
.ai-mark--banner { margin-bottom: 1.5rem; }
.ai-mark--banner > img { width: 100%; height: auto; border-radius: var(--radius); }
@media (min-width: 760px) {
  .about { display: grid; grid-template-columns: 16rem 1fr; gap: 0 2.5rem; max-width: 56rem; }
  .about h1 { grid-column: 2; }
  .about .portrait { grid-column: 1; grid-row: 1 / span 2; }
  .about .prose { grid-column: 2; }
}

.bonus-signup { display: flex; flex-wrap: wrap; gap: 2rem; align-items: flex-start; }
.bonus-signup img { flex: 0 0 auto; border-radius: var(--radius); }
.bonus-signup .form { flex: 1 1 16rem; min-width: 16rem; }

/* Forms and notices */
.form label { display: block; margin-bottom: 0.25rem; }
.form input, .form textarea {
  width: 100%; padding: 0.7rem 0.8rem; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid #77746d; border-radius: var(--radius);
}
.notice { background: var(--bg-alt); border-left: 5px solid var(--accent); padding: 0.8rem 1rem; border-radius: var(--radius); }
.notice--error { border-left-color: #a12a1b; }
.notice ul { margin: 0; padding-left: 1.2rem; }

/* AI-generated image notice. Any image whose file name ends in _ai before the extension carries it (see is_ai_image() in
   lib.php). ONE line of text along the lower right edge, no wider than 45% of the image (it sits between 55% and 95% of the
   width), white lettering with a dark outline so it reads over any colour. The type size is tied to the image width:
   the sentence is about 17.6 character-widths long in bold Arial; dividing 45cqw by 20 leaves room for Windows
   rounding the type size and glyph widths up at small sizes, so it stays inside 45% everywhere (cqw = 1% of the
   image width; the wrapper or cover box is the size container). It never wraps, so on very small images it gets small. */
.ai-mark { position: relative; display: block; container-type: inline-size; }
.ai-mark > img { display: block; margin-bottom: 0; }
.ai-mark--card { margin-bottom: 1rem; }
.ai-mark--post { margin-bottom: 1.5rem; }
.ai-mark--portrait { margin-bottom: 1.5rem; width: fit-content; max-width: 16rem; }
.ai-badge {
  position: absolute; right: 5%; bottom: 2.5%; z-index: 3; pointer-events: none;
  white-space: nowrap; text-align: right;
  font: 700 8px/1 Arial, Helvetica, "Liberation Sans", sans-serif; font-size: calc(45cqw / 20); letter-spacing: 0;
  color: #fff;
  text-shadow: -0.07em -0.07em 0 #000, 0.07em -0.07em 0 #000, -0.07em 0.07em 0 #000, 0.07em 0.07em 0 #000,
               0 0 0.22em #000, 0 0 0.22em #000;
}
@supports (paint-order: stroke fill) {
  .ai-badge { -webkit-text-stroke: 0.14em #000; paint-order: stroke fill; }
}
/* Cover badge: dynamic splash text from the book file's Badge: line */
.cover-link, .book-cover { position: relative; container-type: inline-size; }
.cover-badge {
  --fill: #ffd84d; --ink: #2a1a00; --edge: #2a1a00; --speed: 3.6s; --scale: 1; --tilt: 9deg; --tilt-alt: 5deg;
  position: absolute; top: 5%; right: 4%; z-index: 2; max-width: min(90%, calc(46% * var(--scale))); padding: 0.2em 0.5em;
  background: var(--fill); color: var(--ink); border: 2px solid var(--edge); border-radius: 5px;
  font: 700 0.75rem/1.1 var(--font-head);
  font-size: clamp(calc(0.7rem * var(--scale)), calc(7.5cqw * var(--scale)), calc(1.3rem * var(--scale)));
  text-align: center; text-wrap: balance; box-shadow: 0 3px 6px rgba(0, 0, 0, 0.35);
  transform: rotate(var(--tilt)); pointer-events: none;
  animation: badge-bob var(--speed) ease-in-out infinite;
}
.cover-badge--top-left { top: 5%; right: auto; left: 4%; --tilt: -9deg; --tilt-alt: -5deg; }
.cover-badge--bottom-right { top: auto; bottom: 5%; }
.cover-badge--bottom-left { top: auto; bottom: 5%; right: auto; left: 4%; --tilt: -9deg; --tilt-alt: -5deg; }
.cover-badge--top { top: 5%; right: auto; left: 50%; translate: -50% 0; }
.cover-badge--bottom { top: auto; bottom: 5%; right: auto; left: 50%; translate: -50% 0; }
.cover-badge--left { top: 50%; right: auto; left: 4%; translate: 0 -50%; --tilt: -9deg; --tilt-alt: -5deg; }
.cover-badge--right { top: 50%; right: 4%; translate: 0 -50%; }
.cover-badge--center { top: 50%; right: auto; left: 50%; translate: -50% -50%; }
/* Reduced-motion setting: a slow, tiny sway instead of the pulse (no scaling). */
@keyframes badge-sway {
  0%, 100% { transform: rotate(var(--tilt)); }
  50%      { transform: rotate(calc(var(--tilt) - 2deg)); }
}
@keyframes badge-bob {
  0%, 100% { transform: rotate(var(--tilt)) scale(1); }
  50%      { transform: rotate(var(--tilt-alt)) scale(1.06); }
}
/* Frameless video and Instagram embeds */
.embed { position: relative; width: 100%; aspect-ratio: 16 / 9; margin: 1.5rem 0; border-radius: var(--radius); overflow: hidden; background: #000; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
.embed--tall { aspect-ratio: 9 / 16; max-width: 26rem; margin-inline: auto; }
.embed--ig { aspect-ratio: 54 / 71; max-width: 34rem; margin-inline: auto; background: transparent; }
.embed--ig-tall { aspect-ratio: 5 / 8; }
@media (max-width: 700px) {
  .embed, .embed--tall, .embed--ig { width: calc(100% + 2 * var(--gutter)); max-width: none; margin-inline: calc(-1 * var(--gutter)); border-radius: 0; }
}
body { overflow-x: clip; }

/* Updates filter and paging */
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 1.75rem; }
.chips a { padding: 0.3rem 0.9rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); text-decoration: none; background: var(--card); }
.chips a:hover { border-color: var(--accent); }
.chips a[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem 1.5rem; margin-top: 2.5rem; }
.pager--post { justify-content: space-between; }

/* Phones: comfortable tap targets (about 44px) for the links people actually press */
@media (max-width: 700px) {
  .site-nav a, .hub-bar li a, .footer-nav a, .pager a, .more a {
    display: inline-flex; align-items: center; min-height: 44px; padding-inline: 0.5rem;
  }
  .more a { padding-inline: 0; }
  .book-row h2 a { display: inline-block; padding-block: 0.3rem; }
  .hub-title a { display: inline-flex; align-items: center; min-height: 44px; }
  .nav-icon { min-width: 40px; justify-content: center; padding-inline: 0.2rem !important; }
  .site-nav ul { gap: 0 0.1rem; }
  .btn, .chips a, .buy-menu a { min-height: 44px; display: inline-flex; align-items: center; }
  .buy summary.btn { display: inline-flex; }
  .buy-menu { left: 0; right: auto; max-width: calc(100vw - 2rem); }
  .carousel-ui button { width: 44px; height: 44px; }
}

/* Offer box: an invitation to buy a BOOK, shown on pages that are not the book itself (Argonne stories). Cover on the left,
   label, title, short blurb and buttons on the right. */
.book-offer {
  display: grid; grid-template-columns: clamp(6rem, 24vw, 9rem) 1fr; gap: 1rem 1.5rem; align-items: center;
  margin-block: 2.25rem; padding: 1.1rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.55);
}
.book-offer .cover-link { width: 100%; }
.book-offer .series { margin-bottom: 0.15rem; }
.book-offer h2.h3, .book-offer h3.h3, .book-offer h4.h3 { margin-bottom: 0.3em; }
.book-offer h2 a, .book-offer h3 a, .book-offer h4 a { color: var(--ink); text-decoration: none; }
.book-offer h2 a:hover, .book-offer h3 a:hover, .book-offer h4 a:hover { text-decoration: underline; }
.book-offer p { margin-bottom: 0.7em; }
.book-offer .actions { margin: 0.4rem 0 0; }

/* Hub bar: one book's universe (book, companion pages, extra link) */
.hub-bar { background: var(--bg-alt); border-block: 1px solid var(--line); }
.hub-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.25rem 1.5rem; padding-block: 0.6rem; }
.hub-title { margin: 0; font-family: var(--font-head); font-weight: 700; font-size: 1.2rem; }
.hub-title a { color: var(--ink); text-decoration: none; }
.hub-bar ul { display: flex; flex-wrap: wrap; gap: 0.1rem 1rem; list-style: none; margin: 0; padding: 0; }
.hub-bar li a { color: var(--link); font-size: 0.95rem; }
.hub-bar li a[aria-current="page"] { color: var(--ink); text-decoration-thickness: 2px; }
.hub-links { margin: 0; font-size: 0.95rem; }
/* Empty bar on shared pages: same height as a one-row hub bar (title line + padding) so the layout does not jump. */
.hub-bar--blank .hub-inner { min-height: 3.3rem; }

/* "Latest" ticker (home page only): fills the hub-bar band; colours and fonts come from the same variables the duo theme swap changes. */
.ticker-list { position: relative; flex: 1 1 18rem; max-width: 46rem; margin-inline: auto; height: 3.3rem; overflow: hidden; }
.ticker-item { position: absolute; inset: 0; display: flex; align-items: center; visibility: hidden; }
.ticker-item.is-active, .ticker-item.is-leaving { visibility: visible; }
.ticker-item a { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; min-width: 0; width: 100%; color: var(--link); text-decoration: none; }
.ticker-item a:hover .ticker-title, .ticker-item a:focus-visible .ticker-title { text-decoration: underline; }
.ticker-head { display: flex; align-items: baseline; justify-content: center; gap: 0.5rem; min-width: 0; }
.ticker-title { font-family: var(--font-head); font-weight: 800; font-size: 1.05rem; color: var(--ink); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ticker-date { flex: none; font-family: var(--font-head); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.02em; color: var(--link); }
.ticker-blurb { font-size: 0.8rem; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@keyframes ticker-in  { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes ticker-out { from { transform: translateX(0); } to { transform: translateX(-100%); } }
.hub-bar--ticker.is-rotating .ticker-item.is-active  { animation: ticker-in 0.6s ease-out both; }
.hub-bar--ticker.is-rotating .ticker-item.is-leaving { animation: ticker-out 0.6s ease-in both; }
@media (min-width: 40em) {
  .ticker-item a { flex-direction: row; align-items: baseline; justify-content: center; gap: 0.75rem; }
  .ticker-head { flex: 0 1 auto; max-width: 55%; }
}
@media (max-width: 39.99em) { .hub-inner:has(.ticker-list) { flex-wrap: nowrap; gap: 0.75rem; } .ticker-list { flex: 1 1 0; min-width: 0; } }

/* Books list page */
.book-row { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1.25rem 1.75rem; align-items: start; padding-block: 1.75rem; border-top: 1px solid var(--line); }
.book-row:first-of-type { border-top: 0; }
.book-row .cover-link { width: 100%; }
.book-row h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin-bottom: 0.3em; }
.book-row h2 a { color: var(--ink); text-decoration: none; }
.book-row h2 a:hover { text-decoration: underline; }
.book-row .tagline { margin-bottom: 0.5em; }
@media (min-width: 700px) { .book-row { grid-template-columns: 13rem 1fr; gap: 2.5rem; } }

/* Two-book home page: covers flank the text; hovering a cover swaps the text (JS enhances; all text shows without it) */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.duo { padding-block: 2rem 1rem; }
.duo-inner { display: grid; gap: 1.5rem; grid-template-columns: 1fr 1fr; grid-template-areas: "left right" "hint hint" "panels panels"; align-items: center; }
.duo-hint { grid-area: hint; display: none; margin: -0.5rem 0 0; text-align: center; font-size: 0.9rem; color: var(--muted); }
.duo.is-tapping .duo-hint { display: block; }
.duo-cover--left { grid-area: left; justify-self: end; }
.duo-cover--right { grid-area: right; justify-self: start; }
.duo-panels { grid-area: panels; text-align: center; }
.duo-inner { container-type: inline-size; }
.duo .cover-link { width: clamp(8.5rem, 38vw, 17rem); width: clamp(8.5rem, calc((100cqw - 1.5rem) / 2), 17rem); }
.duo-cover a[aria-current="true"] img { outline: 3px solid var(--accent); outline-offset: 4px; }
.duo-panel + .duo-panel { margin-top: 2.5rem; }
.duo-panel h2 { font-size: clamp(1.9rem, 4vw, 3rem); font-weight: 800; }
.duo-panel .prose { margin-inline: auto; font-size: 1.1rem; }
.duo-panel .actions { justify-content: center; }
/* With JS on a wide screen every panel sits in the same cell: the tallest one sets the height, so swapping never shifts the layout. */
.duo.is-swapping .duo-panels { display: grid; }
.duo.is-swapping .duo-panel { grid-area: 1 / 1; align-self: center; margin: 0; visibility: hidden; opacity: 0; transition: opacity 0.25s ease, visibility 0s linear 0.25s; }
.duo.is-swapping .duo-panel.is-active { visibility: visible; opacity: 1; transition: opacity 0.25s ease; }
@media (min-width: 900px) {
  .duo { padding-block: 3rem 1.5rem; }
  .duo-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr) minmax(0, 1fr); grid-template-areas: "left panels right"; gap: 2.5rem; }
  .duo-hint { display: none !important; }
  .duo .cover-link { width: clamp(11rem, 20vw, 17rem); }
}

/* Cover items with captions (several books) */
.cover-item { display: flex; flex-direction: column; align-items: center; width: clamp(9rem, 26vw, 15rem); }
.cover-item .cover-link { width: 100%; }
.cover-cap { margin-top: 1rem; text-align: center; }
.cover-cap p { margin: 0.2rem 0 0; font-size: 0.95rem; }
.series { margin: 0 0 0.3rem; font-family: var(--font-head); font-weight: 700; color: var(--link); text-transform: uppercase; letter-spacing: 0.02em; }
.cover-cap .series { margin: 0; font-size: 0.9rem; }
.hero .cover-link { width: clamp(10rem, 30vw, 19rem); }
.hero .prose { font-size: 1.15rem; }

/* Teaser box and signup strip */
.callout { text-align: center; }
.callout p { margin-inline: auto; max-width: 40rem; }
.signup { background: var(--bg-alt); border-block: 1px solid var(--line); margin-top: 3rem; }
.signup + .site-footer { margin-top: 0; }
.signup-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1.5rem 2.5rem; padding-block: 2.5rem; }
.signup-inner > div { flex: 1 1 22rem; max-width: 36rem; }
.signup h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); }
.signup-mascot { width: 7.5rem; height: 7.5rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; padding-block: 1.75rem; }
.footer-nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.2rem 1.1rem; list-style: none; margin: 0; padding: 0; }
.footer-nav a { color: var(--ink); font-size: 0.95rem; }
.copyright { margin: 0; display: flex; align-items: center; gap: 0.6rem; font-size: 0.95rem; }
.rss { color: var(--ink); display: inline-flex; padding: 0.3rem; }
.rss:hover { color: var(--accent); }
/* Reduced-motion setting: keep a small, gentle hop (no rotation, short travel) plus a highlight ring. */
@keyframes hop-soft {
  0%, 100% { transform: translateY(0); box-shadow: 0 6px 10px rgba(28, 26, 22, 0.3); }
  45%      { transform: translateY(-5px); box-shadow: 0 12px 14px -6px rgba(28, 26, 22, 0.22); }
}
@media (prefers-reduced-motion: reduce) {
  .cover-badge { animation: badge-sway calc(var(--speed) * 1.4) ease-in-out infinite; }
  .cover-link:hover img, .cover-link:focus-visible img, .cover-link:active img {
    animation: hop-soft 0.4s ease-out both; outline: 3px solid var(--accent); outline-offset: 3px;
  }
  .duo-panel { transition: none !important; }
  /* Ticker: newest update only, static (site.js also never starts the rotation). */
  .hub-bar--ticker .ticker-item { animation: none !important; }
  .hub-bar--ticker .ticker-item:not(:first-child) { display: none; }
  :root { transition: none; }
  .covers--carousel { scroll-behavior: auto; }
}
