/* Fonts are loaded from each page's <head> (preconnect + stylesheet
   link) rather than @import here, so the font request isn't queued
   behind this stylesheet's own download. */

:root {
  /* Warm near-black and warm cream rather than pure #000/#fff. Kept
     under the original token names so every existing usage still
     works; only the values changed. */
  --color-black: #12100f;
  --color-white: #faf7f3;

  /* Antique gold. The previous #ffd700 was a saturated novelty yellow,
     and its hover went darker (reading as disabled) - hover now
     brightens instead. The -rgb pair feeds rgba() tints below. */
  --color-gold: #d4af37;
  --color-gold-hover: #e8c56a;
  --color-gold-rgb: 212, 175, 55;

  /* Warm accent, used for the low-level page wash. */
  --color-plum: #6d2440;

  --font-heading: "Playfair Display", Georgia, serif;
  --font-body: "Manrope", sans-serif;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* 600 rather than 300: a high-contrast serif at display sizes goes
   spindly on a dark background at light weights. */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
}

a {
  text-decoration: none;
  color: inherit;
}

/* The browser default focus ring is near-invisible on this background.
   :focus-visible keeps it to keyboard use, so it never shows on tap. */
:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: 4px;
}

img {
  max-width: 100%;
  display: block;
}

/* Theme classes */
.theme-dark {
  background-color: var(--color-black);
  /* Two very soft washes - warm gold behind the masthead, plum low on
     the page - so the background has some depth instead of reading as
     a flat slab. Deliberately subtle; raise the alphas to taste. */
  background-image:
    radial-gradient(1100px 520px at 50% 0%, rgba(var(--color-gold-rgb), 0.08), transparent 68%),
    radial-gradient(900px 520px at 50% 100%, rgba(109, 36, 64, 0.18), transparent 70%);
  background-repeat: no-repeat;
  color: var(--color-white);
  min-height: 100vh;
}

/* Let the body wash show through, so the header and footer don't sit
   as solid rectangles on top of the gradient. */
.theme-dark .site-header,
.theme-dark .site-footer {
  background: transparent;
}

/* Index page: true black, no washes. */
.theme-black {
  background-color: #000;
  background-image: none;
}

.theme-light {
  background: #fff;
  color: var(--color-black);
  min-height: 100vh;
}

.theme-light .site-header,
.theme-light .site-footer {
  background: transparent;
  color: var(--color-black);
}

.theme-light .site-nav a {
  color: var(--color-black);
}

.theme-light .site-nav a:hover,
.theme-light .site-nav a[aria-current="page"],
.theme-light .footer-links a:hover,
.theme-light .back-link:hover {
  color: #8a6d12;
}

.theme-light .site-header .nav-toggle .bar {
  background: var(--color-black);
}

.theme-light .site-footer-meta {
  border-top-color: rgba(0, 0, 0, 0.15);
}

@media (max-width: 768px) {
  .theme-light .site-header .site-nav {
    background: #fff;
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Header */
.site-header {
  background: var(--color-black);
  color: var(--color-white);
  width: 100%;
  position: relative;
  z-index: 20;
}

/* Doubled selector: .container (defined later) sets `padding: 0 24px`
   and would otherwise zero out the vertical padding here. */
.site-header-inner.site-header-inner {
  padding-top: 8px;
  padding-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-header .logo img {
  height: 96px;
  width: auto;
}

.site-header .nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.site-header .nav-toggle .bar {
  display: block;
  width: 26px;
  height: 2px;
  background: var(--color-white);
  margin: 5px 0;
}

.site-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 40px;
  margin: 0;
  padding: 0;
}

.site-nav a {
  color: var(--color-white);
  text-transform: uppercase;
  font-size: clamp(1.125rem, 1vw + 1rem, 1.375rem);
  letter-spacing: -0.28px;
  font-weight: 500;
}

.site-nav a:hover {
  color: var(--color-gold);
}

.site-nav a[aria-current="page"] {
  color: var(--color-gold);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Footer */
.site-footer {
  background: var(--color-black);
  color: var(--color-white);
  width: 100%;
  padding-bottom: 32px;
  margin-bottom: 60px;
}

.site-footer-inner {
  padding-top: 28px;
  padding-bottom: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-footer .logo img {
  height: 78px;
  width: auto;
}

.site-footer .site-nav {
  flex: 1;
  display: flex;
  justify-content: center;
}

/* Copyright / contact / social strip under the footer nav. */
.site-footer-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 32px;
  flex-wrap: wrap;
  padding-top: 20px;
  padding-bottom: 8px;
  border-top: 1px solid rgba(var(--color-gold-rgb), 0.16);
  font-size: 0.875rem;
}

.footer-copy {
  margin: 0;
  opacity: 0.65;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.footer-links a {
  opacity: 0.75;
  transition: color 0.15s ease, opacity 0.15s ease;
}

.footer-links a:hover {
  color: var(--color-gold);
  opacity: 1;
}

@media (max-width: 600px) {
  .site-footer-meta {
    flex-direction: column;
    text-align: center;
  }

  .footer-links {
    justify-content: center;
  }
}

/* Gold button */
.btn-gold {
  display: inline-block;
  background: linear-gradient(180deg, var(--color-gold-hover), var(--color-gold));
  color: var(--color-black);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  padding: 13px 26px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

/* Brightens and lifts on hover. The old hover dropped to a duller gold,
   which read as a disabled state. */
.btn-gold:hover {
  background: linear-gradient(180deg, #f2da97, var(--color-gold-hover));
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45),
              0 6px 18px rgba(var(--color-gold-rgb), 0.28);
}

.btn-gold:active {
  transform: translateY(0) scale(0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

/* Unreleased titles: same pill, outlined and non-interactive, so a book
   that can't be bought yet doesn't offer a buy button. Swap back to a
   plain .btn-gold link once the book is on sale. */
.btn-gold--soon {
  background: none;
  border: 1px solid var(--color-gold);
  color: var(--color-gold);
  cursor: default;
  box-shadow: none;
}

.btn-gold--soon:hover {
  background: none;
  transform: none;
  box-shadow: none;
}

/* Shared page container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Carousels */
.carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  gap: 15px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  cursor: grab;
  touch-action: pan-y;
  user-select: none;
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-track.is-dragging {
  cursor: grabbing;
}

.carousel-track img {
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

.carousel-slide {
  flex: 0 0 100%;
}

/* Circular chip rather than a bare glyph: the old 62px text arrow had
   no background and disappeared against pale cover art. */
.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  padding: 0 0 6px;
  background: rgba(18, 16, 15, 0.6);
  border: 1px solid rgba(var(--color-gold-rgb), 0.35);
  border-radius: 999px;
  color: var(--color-gold);
  font-size: 46px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.carousel-arrow:hover {
  background: rgba(18, 16, 15, 0.85);
  border-color: var(--color-gold);
  color: var(--color-gold-hover);
}

.carousel-arrow.prev {
  left: 8px;
}

.carousel-arrow.next {
  right: 8px;
}

.tags-carousel .carousel-arrow.prev {
  left: -8px;
}

.tags-carousel .carousel-arrow.next {
  right: -8px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

.carousel-dot {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  padding: 0;
  transition: width 0.35s ease, background-color 0.35s ease;
}

/* An 8px dot is far too small to hit with a thumb. This grows the tap
   target to ~24px without changing how the dot looks or how the row
   is spaced; adjacent targets meet exactly and never overlap. */
.carousel-dot::after {
  content: "";
  position: absolute;
  inset: -8px -6px;
}

.theme-light .carousel-dot {
  background: rgba(0, 0, 0, 0.25);
}

.carousel-dot.is-active {
  width: 26px;
  background: var(--color-gold);
}

/* Hero carousel: a centred, narrower card with rounded corners */
.hero-carousel {
  --hero-h: clamp(360px, 34vw, 500px);
  --hero-inset-x: 24px;
  --hero-inset-y: 24px;
  --hero-radius: var(--radius-lg);
  width: calc(100% - 48px);
  max-width: 1152px;
  margin: 24px auto 0;
}

/* Dots sit on the banner itself, above the slide title */
.hero-carousel .carousel-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 14px;
  z-index: 5;
  margin-top: 0;
}

.hero-carousel .carousel-track {
  height: var(--hero-h);
  gap: 0;
  overflow: hidden;
  border-radius: var(--hero-radius);
}

.hero-carousel .carousel-slide {
  position: relative;
  height: var(--hero-h);
  overflow: hidden;
}

/* Book title pinned to the bottom-right corner of each banner. Inset by
   --hero-inset-x/-y so it clears the rounded corners, and
   z-index 4 keeps it above the slides. */
.hero-slide-title {
  position: absolute;
  right: calc(var(--hero-inset-x) + 16px);
  bottom: calc(var(--hero-inset-y) + 16px);
  z-index: 4;
  margin: 0;
  max-width: min(380px, 48%);
  color: var(--color-white);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: clamp(1.3rem, 1.2vw + 0.9rem, 1.9rem);
  line-height: 1.2;
  text-align: right;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.85), 0 1px 4px rgba(0, 0, 0, 0.9);
}

/* White "Read" button with a book icon, bottom-left of each banner. */
.hero-read {
  position: absolute;
  left: calc(var(--hero-inset-x) + 16px);
  bottom: calc(var(--hero-inset-y) + 16px);
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 22px;
  background: #fff;
  color: #000;
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}

.hero-read svg {
  width: 22px;
  height: 22px;
}

/* Child combinator keeps this scoped to the banner photo only,
   so it doesn't also catch the small icon image nested inside
   .hero-footer further down the tree. object-position: center crops
   the top and bottom of the banner evenly instead of favouring the top. */
.hero-carousel .carousel-slide > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  filter: brightness(0.92) saturate(1.1);
  transition: transform 0.5s ease;
}

.hero-carousel .carousel-slide:hover > img {
  transform: scale(1.05);
}

/* The -heading/-text pair below keeps the "hero-overlay" name because
   that is what index.html still calls them, but the copy now lives in
   .welcome-section rather than on top of the banner. The former
   .hero-overlay container and its scrim were removed as dead. */
.hero-overlay-heading {
  margin: 0 0 18px;
  color: var(--color-white);
  font-family: var(--font-heading);
  font-size: clamp(2rem, 2.5vw + 1rem, 3rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1.1;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.7);
}

/* Short gold rule between the heading and the body copy */
.hero-overlay-heading::after {
  content: "";
  display: block;
  width: 56px;
  height: 3px;
  margin: 16px auto 0;
  border-radius: 999px;
  background: var(--color-gold);
}

.hero-overlay-text {
  margin: 0;
  max-width: 62ch;
  color: var(--color-white);
  font-size: clamp(1rem, 0.35vw + 0.9rem, 1.2rem);
  font-weight: 500;
  line-height: 1.6;
  text-wrap: pretty;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}

/* Gold hairline that fades out at both ends, rather than a hard
   edge-to-edge cream rule. */
.divider {
  border: none;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(var(--color-gold-rgb), 0.5), transparent);
  margin: 30px 0 50px;
}

.theme-light .divider {
  background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.35), transparent);
}

/* Section headings */
.section-heading {
  font-size: clamp(1.75rem, 2vw + 1rem, 2.15rem);
  text-align: left;
  margin: 20px 0;
}

.section-heading-sm {
  font-size: 1.75rem;
  margin: 10px 0 20px;
}

/* Book tiles */
.tags-carousel .carousel-slide {
  flex: 0 0 calc(100% - 15px);
}

.book-tile-media {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius-md);
  aspect-ratio: 2 / 3;
}

.book-tile-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, filter 0.3s ease;
}

/* Single warm scrim on hover. Previously this ran alongside a
   brightness(0.5) filter on the image, and the two together all but
   erased the artwork. The scrim alone still backs the tags. */
.book-tile-media::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(18, 16, 15, 0.62);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.book-tile-media:hover::before,
.book-tile-media:focus-visible::before {
  opacity: 1;
}

.tile-tags {
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  margin: 0;
  padding: 16px;
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 8px;
  transform: translateY(-50%) scale(0.9);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
  z-index: 2;
}

.book-tile-media:hover .tile-tags,
.book-tile-media:focus-visible .tile-tags {
  transform: translateY(-50%) scale(1);
  opacity: 1;
}

.tile-tags .tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(var(--color-gold-rgb), 0.16);
  border: 1px solid rgba(var(--color-gold-rgb), 0.6);
  color: var(--color-white);
  font-size: 0.75rem;
  letter-spacing: 0.02em;
}

/* Touch devices never fire :hover, so on a phone the trope tags - the
   thing a romance reader actually shops by - were invisible to roughly
   everyone. Pin them to the bottom of the cover over a gradient so the
   artwork still reads through. */
@media (hover: none) {
  .book-tile-media::before {
    opacity: 1;
    background: linear-gradient(to top,
      rgba(18, 16, 15, 0.94) 0%,
      rgba(18, 16, 15, 0.78) 28%,
      rgba(18, 16, 15, 0) 62%);
  }

  .book-tile-media .tile-tags {
    top: auto;
    bottom: 0;
    transform: none;
    opacity: 1;
    justify-content: flex-start;
    gap: 5px 6px;
    padding: 12px 10px;
  }

  .book-tile-media .tile-tags .tag {
    font-size: 0.7rem;
    padding: 3px 9px;
  }

  /* Not on the books list: those rows already carry the title, spice
     level and blurb, and the cover there is too small to hold tags. */
  .book-row .tile-tags {
    display: none;
  }
}

/* Title under each cover on the home page. Sits outside
   .book-tile-media, which is aspect-ratio boxed with overflow hidden
   and would clip it. */
.book-tile-title {
  margin: 14px 0 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  text-align: center;
  text-wrap: balance;
}

.book-tile-title a {
  transition: color 0.15s ease;
}

.book-tile-title a:hover {
  color: var(--color-gold);
}

.single-slide-wrap {
  max-width: 280px;
}

/* The Guard, The Thief... cover is taller-than-2:3; match its native
   ratio here too (see .book-row--tall .book-row-image) so the
   Scripts tile grows to fit the whole poster instead of cropping it. */
.single-slide-wrap .book-tile-media {
  aspect-ratio: 937 / 1678;
}

/* Welcome copy, relocated from the hero overlay to sit above the
   footer. Reuses the hero-overlay-heading/-text typography so it
   still reads as the same "Welcome!" block, just not on top of a photo. */
.welcome-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 60px;
}

.scripts-section {
  margin-bottom: 50px;
}

@media (max-width: 767px) {
  .scripts-section {
    margin-bottom: 100px;
  }
}

@media (min-width: 768px) {
  .tags-carousel .carousel-slide {
    flex: 0 0 calc(25% - 12px);
  }
}

/* Page title */
.page-title {
  text-align: center;
  font-size: 2rem;
  margin: 56px 0 32px;
}

.page-title--spaced {
  margin-bottom: 80px;
}

/* 404 page */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 80px auto 120px;
}

.error-code {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(4rem, 12vw, 7rem);
  font-weight: 700;
  line-height: 1;
  color: var(--color-gold);
  opacity: 0.35;
}

.error-title {
  margin: 8px 0 16px;
  font-size: clamp(1.6rem, 3vw + 1rem, 2.4rem);
}

.error-text {
  margin: 0 0 32px;
  max-width: 46ch;
  text-wrap: pretty;
  opacity: 0.8;
}

.contact-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 0 auto 100px;
}

.contact-lead {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 300;
  opacity: 0.85;
  margin: 0 0 48px;
}

.contact-body {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 64px;
  width: 100%;
}

.contact-links {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 24px;
  text-align: left;
}

.contact-image {
  flex: 0 0 auto;
  width: 360px;
  max-width: 40%;
}

.contact-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

@media (max-width: 767px) {
  .contact-body {
    flex-direction: column;
    gap: 40px;
  }

  .contact-links {
    align-items: stretch;
    text-align: center;
    width: 100%;
  }

  .contact-image {
    max-width: 80%;
  }
}

.contact-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  min-width: 340px;
  background: rgba(var(--color-gold-rgb), 0.14);
  border: 1px solid rgba(var(--color-gold-rgb), 0.55);
  color: var(--color-black);
  font-size: 1.125rem;
  font-weight: 500;
  border-radius: 999px;
  padding: 14px 28px;
  letter-spacing: 0.02em;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.contact-link:hover {
  background: rgba(var(--color-gold-rgb), 0.28);
  border-color: var(--color-gold);
}

.contact-icon {
  display: inline-flex;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.contact-icon svg {
  width: 100%;
  height: 100%;
}

@media (max-width: 600px) {
  .contact-link {
    font-size: 0.95rem;
    padding: 12px 20px;
    min-width: 0;
  }

  /* Smaller chips, tucked just inside the edge rather than hanging off
     it, now that the tiles run full-bleed on a phone. */
  .carousel-arrow {
    width: 52px;
    height: 52px;
    font-size: 36px;
  }

  .tags-carousel .carousel-arrow.prev {
    left: 6px;
  }

  .tags-carousel .carousel-arrow.next {
    right: 6px;
  }
}

/* Decorative rounded bracket shapes framing the books list.
   top/height/left/right are set in JS to hug the actual book
   content (image-to-text bounds) with an equal gap on both sides;
   the values below are just the pre-JS fallback position. */
/* Gold hairline rather than the original 12px solid cream, which
   framed the list more loudly than the books themselves. */
.side-bracket {
  display: none;
  position: absolute;
  width: 28px;
  border: 4px solid var(--color-gold);
  border-radius: var(--radius-lg);
  pointer-events: none;
  z-index: 10;
}

.side-bracket-left {
  left: calc((100% - 1200px) / 2 - 56px);
  border-right: none;
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.side-bracket-right {
  right: calc((100% - 1200px) / 2 - 56px);
  border-left: none;
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.theme-light .books-list {
  background: #000;
  color: var(--color-white);
  max-width: 800px;
  margin: 24px auto 80px;
  padding: 52px 0 40px;
  border: 8px solid #1a1a1a;
  border-radius: 40px;
  position: relative;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}


.theme-light .books-list::before {
  content: "";
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 24px;
  border-radius: 0 0 20px 20px;
  background: #000;
}

.theme-light .books-list::after {
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
}

@media (min-width: 1360px) {
  .side-bracket {
    display: block;
  }
}

/* Books list page */
.books-list {
  display: flex;
  flex-direction: column;
  gap: 96px;
  margin: 24px auto 80px;
}

/* Grid with two empty outer tracks, which is what the twelve empty
   .book-row-spacer divs used to do by hand. */
.book-row {
  display: grid;
  grid-template-columns: 1.5fr auto 7fr 1.5fr;
  align-items: stretch;
  gap: 48px;
  color: inherit;
}

.book-row-image {
  grid-column: 2;
  display: block;
  position: relative;
  height: 340px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

/* As with .book-tile-media, one scrim instead of a scrim plus a
   brightness filter. */
.book-row-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(18, 16, 15, 0.58);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.book-row:hover .book-row-image::before {
  opacity: 1;
}

.book-row:hover .tile-tags {
  transform: translateY(-50%) scale(1);
  opacity: 1;
}

/* The Guard, The Thief... cover is a taller-than-2:3 image; match its
   native ratio so cover-fit doesn't clip it. Targeted by class rather
   than :last-child since the row order is spice-ranked, not fixed. */
.book-row--tall .book-row-image {
  height: 406px;
  aspect-ratio: 937 / 1678;
}

.book-row-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-sm);
  transition: transform 0.3s ease, filter 0.3s ease;
}

.book-row-title {
  font-size: 2rem;
  margin: 0;
  text-align: center;
}

/* Normal flow rather than absolute positioning. The description used
   to be pinned at top:50% and the button at bottom:20px, which meant
   any longer title or larger type could collide with them - the old
   .book-row--push-desc rule existed to patch exactly that. The desc
   now takes `margin: auto 0` so it centres itself in whatever space is
   left between the title block and the button, at any content length. */
.book-row-content {
  grid-column: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 24px 0 20px;
}

/* Left-aligned, not justified: justified text in a column this narrow
   opens rivers of whitespace and hurts readability. The auto block
   margins centre it in the free space (see .book-row-content). */
.book-row-desc {
  width: 100%;
  margin: auto 0;
  text-align: left;
  text-wrap: pretty;
}

/* Spice meter: five peppers, filled dark-to-gold left to right to show
   how many of five the book earns. Sits centered under the title, in
   the same flow slot (the desc/buy elements below are absolutely
   positioned so this doesn't push them around). */
.spice-meter {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: -4px;
}

/* Unfilled peppers: dimmed and desaturated but slightly lifted, so
   they read as "empty slot" rather than as muddy grey blobs. */
.spice-star {
  font-size: 1.3rem;
  line-height: 1;
  color: #e0b91c;
  opacity: 0.3;
}

/* Filled stars are red: the row is the spice level. */
.spice-star.is-filled {
  color: #e02424;
  opacity: 1;
}

.spice-meter-label {
  margin-right: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-white);
}

.book-row-buy {
  flex-shrink: 0;
}

.book-row-more:hover {
  color: var(--color-gold);
}

@media (max-width: 600px) {
  /* Stack on phones. Side by side, the text column was down to about
     170px - roughly twenty characters a line - which reads as a ribbon.
     Stacking gives the blurb the full width. */
  .book-row {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 20px;
  }

  .book-row-image {
    grid-column: 1;
    height: 300px;
  }

  .book-row-content {
    grid-column: 1;
    width: 100%;
    padding: 0;
  }

  /* No free space to absorb once the row is a single auto-height
     column, so the auto centring margins come off. */
  .book-row-desc {
    margin: 0;
  }

  .books-list {
    gap: 56px;
  }

  .book-row--tall .book-row-image {
    height: 356px;
  }

  .book-row-title {
    font-size: 1.4rem;
  }

  .book-row-content {
    gap: 12px;
  }
}

/* Back-to-books link on book detail pages */
.back-link {
  display: inline-block;
  margin: 24px 0 0;
  font-weight: 500;
}

.back-link:hover {
  color: var(--color-gold);
}

/* Book detail page (two-column poster + copy) */
.book-detail {
  display: flex;
  gap: 48px;
  align-items: center;
  margin: 24px auto 56px;
}

.book-detail-image {
  flex: 0 0 45%;
}

.book-detail-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
  transition: transform 0.3s ease;
}

/* Grows slightly on hover. It previously shrank to 0.97, which read as
   the cover recoiling from the cursor. */
.book-detail-image:hover img {
  transform: scale(1.02);
}

.book-detail-content {
  flex: 0 0 55%;
}

/* Committed to the phone conceit rather than leaving it as a stray
   outline: a faintly lit screen with a gold rim and a drop shadow, so
   it reads as a handset showing the blurb. */
.phone-frame {
  width: 100%;
  max-width: 380px;
  height: 640px;
  margin: 0 auto;
  padding: 52px 0 40px;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  border-radius: 40px;
  position: relative;
  box-sizing: border-box;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
}

/* Fixed-size screen: longer blurbs scroll inside it. */
.phone-screen {
  height: 100%;
  overflow-y: auto;
  padding: 0 32px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}

.phone-frame::before {
  content: "";
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  width: 56px;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
}

.phone-frame::after {
  content: "";
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.3);
}

.book-detail-title {
  font-size: 1.875rem;
  text-align: center;
  margin: 0 0 24px;
}

.book-detail-subtitle {
  font-family: var(--font-heading);
  font-weight: 700;
  text-align: center;
  margin: -12px 0 24px;
}

.book-detail-content p {
  margin: 0 0 20px;
}

.book-detail-tagline {
  text-align: center;
  font-weight: 700;
}

.book-detail-cta {
  text-align: center;
  margin-top: 32px;
}

@media (max-width: 767px) {
  .book-detail {
    flex-direction: column;
  }

  .book-detail-image,
  .book-detail-content {
    flex: 0 0 auto;
    width: 100%;
  }
}

/* About page columns */
.about-columns {
  display: flex;
  gap: 48px;
  align-items: center;
  margin: 100px auto 40px;
}

.about-photo {
  flex: 0 0 33%;
}

.about-photo img {
  width: 100%;
  height: auto;
  display: block;
}

.about-text {
  flex: 1;
}

.intro-line {
  font-style: italic;
  text-align: left;
  margin: 0 0 20px;
}

@media (max-width: 767px) {
  .about-columns {
    flex-direction: column;
  }

  .about-photo {
    flex: 0 0 auto;
    width: 100%;
  }
}

/* FAQ accordion */
.faq-section {
  margin: 0 auto 60px;
}

.faq-divider {
  border: none;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
  margin: 0;
}

.theme-light .faq-divider {
  background: rgba(0, 0, 0, 0.15);
}

.theme-light .faq-chevron {
  color: #8a6d12;
}

.faq-item {
  padding: 8px 0;
}

.faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: none;
  border: none;
  padding: 12px 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.faq-question-text {
  font-weight: 700;
}

.faq-chevron {
  flex-shrink: 0;
  color: var(--color-gold);
  font-size: 0.8rem;
  transition: transform 0.2s ease;
}

.faq-item.is-open .faq-chevron {
  transform: rotate(-90deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-answer p {
  margin: 0 0 16px;
  padding-right: 32px;
}

@media (max-width: 767px) {
  .hero-carousel {
    --hero-h: 280px;
    --hero-inset-x: 16px;
    --hero-inset-y: 36px;
    --hero-radius: 18px;
    margin: 16px auto 0;
  }

  .hero-slide-title {
    right: calc(var(--hero-inset-x) + 8px);
    bottom: calc(var(--hero-inset-y) + 8px);
    max-width: 50%;
    font-size: 1.1rem;
  }

  .hero-read {
    left: calc(var(--hero-inset-x) + 8px);
    bottom: calc(var(--hero-inset-y) + 8px);
    padding: 8px 14px;
    font-size: 0.95rem;
  }

  .hero-overlay-heading {
    margin-bottom: 14px;
  }

  .hero-overlay-heading::after {
    margin-top: 12px;
  }

  .hero-overlay-text {
    font-size: 0.95rem;
    line-height: 1.5;
  }
}

/* Responsive nav */
@media (max-width: 768px) {
  .site-header .nav-toggle {
    display: block;
  }

  /* Scoped to the header: the footer nav has no toggle, so it must stay
     visible and in normal flow. An unscoped .site-nav rule here also
     leaked position:absolute onto the footer nav, which then escaped to
     the initial containing block (.site-footer isn't positioned). */
  .site-header .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--color-black);
  }

  .site-header .site-nav.is-open {
    display: block;
  }

  .site-header .site-nav ul {
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 24px 0;
  }

  .site-footer .site-nav ul {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .site-footer-inner {
    flex-direction: column;
    gap: 16px;
  }
}

/* Respect reduced-motion preference: collapse all CSS animations/transitions
   to effectively instant. Carousel JS has its own matching check. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
