/* ============================================================
   Roaring Kids Press — design tokens
   Identity: a friendly independent press. Warm paper cream,
   deep ink for text, brand brown + gold as the "spine" accents.
   Display face Fraunces (characterful storybook serif),
   body Nunito (round, kid-friendly, highly legible),
   Space Grotesk for small caps labels/data.
   ============================================================ */
:root {
  /* Theme A — Bright & White; sunny primary, blue accent */
  --ink: #25324b;
  --ink-soft: #5a6b86;
  --paper: #ffffff;
  --paper-2: #fff8ea;
  --brown: #f08a24;        /* PRIMARY (warm orange) — nav, footer, buttons */
  --gold: #2f6fed;         /* ACCENT (blue) */
  --gold-deep: #2f6fed;    /* accent deep (blue) */
  --green: #2bb673;
  --clay: #ff5d8f;         /* pink */
  --line: #ffe6c2;
  --shadow: rgba(120, 80, 20, 0.14);

  --display: "Fraunces", Georgia, serif;
  --body: "Nunito", system-ui, sans-serif;
  --label: "Space Grotesk", system-ui, sans-serif;

  --wrap: 1120px;
  --radius: 14px;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  font-family: var(--body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  font-size: 1.05rem;
  -webkit-font-smoothing: antialiased;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

h1, h2, h3 { font-family: var(--display); line-height: 1.08; font-weight: 900; margin: 0 0 .5em; }
h1 { font-size: clamp(2.4rem, 6vw, 4.2rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.6rem); letter-spacing: -0.01em; }
h3 { font-size: 1.3rem; font-weight: 600; }
p { margin: 0 0 1rem; }
a { color: var(--gold-deep); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
a:hover { color: var(--brown); }
img { max-width: 100%; display: block; }

.label {
  font-family: var(--label);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--gold-deep);
}

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

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; border-radius: 4px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-block;
  font-family: var(--label);
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  padding: 0.7rem 1.4rem;
  border-radius: 999px;
  border: 2px solid var(--brown);
  background: var(--brown);
  color: var(--paper);
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .15s ease, background .15s ease, color .15s ease, border-color .15s ease;
}
/* Hover lift is a SHADOW only — the element's geometry never changes, so the
   cursor can't fall out of the button's hitbox at the edges (no flicker). */
.btn:hover { background: var(--gold-deep); border-color: var(--gold-deep); color: #fff; box-shadow: 0 6px 14px rgba(47,111,237,0.35); }
.btn--ghost { background: transparent; color: var(--brown); }
.btn--ghost:hover { background: var(--gold-deep); border-color: var(--gold-deep); color: #fff; box-shadow: 0 6px 14px rgba(47,111,237,0.35); }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 3px solid #d9dde3;   /* thicker grey rule under the whole header */
}
/* Two-row header: top = brand + search, bottom = nav. No divider between;
   reads as one unit. */
.header-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; padding-top: 0.9rem; padding-bottom: 0.55rem;
}
.header-bottom {
  display: flex; align-items: stretch;
  padding-top: 0.2rem; padding-bottom: 0; min-height: 40px;
}

/* Brand — enlarged per request */
.brand { display: flex; align-items: center; gap: 0.85rem; text-decoration: none; color: var(--ink); }
.brand-mark { display: inline-flex; gap: 4px; align-items: flex-end; height: 42px; }
.brand-mark .spine { width: 8px; border-radius: 2px 2px 0 0; }
.brand-mark .spine:nth-child(1) { height: 30px; background: var(--brown); }
.brand-mark .spine:nth-child(2) { height: 42px; background: var(--gold); }
.brand-mark .spine:nth-child(3) { height: 36px; background: var(--clay); }
.brand-mark .spine:nth-child(4) { height: 24px; background: var(--green); }
.brand-text { display: flex; flex-direction: column; line-height: 1.08; }
.brand-name { font-family: var(--display); font-weight: 900; font-size: 1.87rem; letter-spacing: -0.015em; }
.brand-tag { font-size: 0.99rem; color: var(--ink-soft); }

/* Nav */
.site-nav { display: flex; align-items: stretch; gap: 1.5rem; }
.nav-list { display: flex; gap: 1.3rem; list-style: none; margin: 0; padding: 0; align-items: stretch; }
.nav-item { position: relative; display: flex; align-items: center; }
.nav-item > a {
  position: relative;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 0.35rem 0;
  font-family: var(--label); font-weight: 600; font-size: 0.86rem;
  letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap;
  color: var(--ink); text-decoration: none;
}
.nav-item > a:hover,
.nav-item:focus-within > a { color: var(--brown); }

.nav-item .caret { font-size: 0.62rem; transition: transform .15s ease; }
.nav-item:hover .caret { transform: rotate(180deg); }

/* Dropdown submenus (hover on desktop). The colored bar is the TOP EDGE of the
   menu (spanning its full width), not an underline on the nav item — matches
   the Kids Can Press pattern. */
.submenu {
  position: absolute; top: 100%; left: 0; min-width: 220px;
  background: var(--paper); border: 0; border-top: 3px solid var(--gold-deep);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 14px 28px var(--shadow); padding: 0;
  list-style: none; margin: 0; z-index: 60;
  opacity: 0; visibility: hidden; transform: translateY(4px);
  transition: opacity .15s ease, transform .15s ease, visibility .15s;
}
/* small centered pointer sitting on the colored top edge */
.submenu::before {
  content: ""; position: absolute; top: -10px; left: 28px;
  width: 0; height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 8px solid var(--gold-deep);
}
.has-submenu:hover > .submenu,
.has-submenu:focus-within > .submenu { opacity: 1; visibility: visible; transform: translateY(0); }
.submenu li { border: 0; }
.submenu-head { display: none; }   /* mobile drill-down header only; hidden on desktop */
.submenu li + li a { border-top: 1px solid #d9dde3; }   /* dividers match the nav's grey rule */
.submenu-head + li a { border-top: 0; }   /* first real item has no divider above it */
.submenu a {
  display: block; padding: 0.7rem 1.1rem; border-radius: 0;
  font-family: var(--label); font-size: 0.88rem; color: var(--ink); text-decoration: none;
}
.submenu a:hover { background: var(--paper-2); color: var(--ink); }

/* Header search */
.nav-search { position: relative; display: flex; align-items: center; align-self: center; }
.nav-search input {
  width: 315px; padding: 0.5rem 2.2rem 0.5rem 0.9rem;
  border: 1.5px solid var(--line); border-radius: 999px;
  font-family: var(--body); font-size: 0.9rem; background: var(--paper); color: var(--ink);
  transition: border-color .15s ease, width .2s ease;
}
.nav-search input:focus { outline: none; border-color: var(--gold); width: 345px; }
.nav-search .search-go {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: 0; background: none; cursor: pointer;
  color: var(--gold-deep); display: grid; place-items: center; padding: 0;
}
.nav-search .search-go svg { width: 18px; height: 18px; }
.search-results {
  position: absolute; top: calc(100% + 6px); right: 0; width: 300px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 28px var(--shadow); list-style: none; margin: 0; padding: 0.4rem;
  z-index: 60; max-height: 60vh; overflow: auto;
}
.search-results a { display: flex; flex-direction: column; padding: 0.55rem 0.7rem; border-radius: 7px; text-decoration: none; color: var(--ink); }
.search-results a:hover { background: var(--paper-2); }
.search-results .r-title { font-family: var(--display); font-weight: 600; font-size: 0.98rem; }
.search-results .r-meta { font-family: var(--label); font-size: 0.72rem; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ink-soft); }

.nav-toggle { display: none; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; padding: 8px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; }

@media (max-width: 980px) {
  .nav-search input { width: 220px; }
  .nav-search input:focus { width: 240px; }
  .brand-name { font-size: 1.45rem; }
}

@media (max-width: 800px) {
  .nav-toggle { display: flex; }
  .header-top { flex-wrap: wrap; align-items: center; }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand-name { font-size: 1.5rem; }
  .brand-tag { font-size: 0.72rem; line-height: 1.2; }   /* smaller so it fits beside the menu button */
  .nav-toggle { order: 2; flex: 0 0 auto; margin-left: auto; }
  .nav-search { order: 3; width: 100%; margin-top: 0.6rem; }
  .nav-search input, .nav-search input:focus { width: 100%; }
  .search-results { width: 100%; }
  /* Bottom row collapses into a toggle-driven panel */
  .header-bottom { padding: 0; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 3px solid #d9dde3;
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    padding: 0; z-index: 55; overflow: hidden;
  }
  .site-nav.is-open { display: flex; }
  .nav-list { flex-direction: column; gap: 0; align-items: stretch; padding: 0.25rem 0; }
  .nav-item { border-bottom: 1px solid #d9dde3; display: block; }
  .nav-item:last-child { border-bottom: 0; }
  .nav-item > a { display: flex; width: 100%; padding: 0.95rem 1.25rem; justify-content: space-between; align-items: center; }
  .nav-item .caret { display: none; }              /* replaced by a chevron affordance */
  .has-submenu > a::after {
    content: "›"; font-size: 1.35rem; color: var(--ink-soft); line-height: 1;
    display: inline-block; transform: translateY(-0.08em);   /* optical vertical centering */
  }

  /* Drill-down: when a submenu is open, hide the main list and show the panel */
  .site-nav.submenu-open .nav-list > .nav-item { display: none; }
  .site-nav.submenu-open .nav-list > .nav-item.open { display: block; border-bottom: 0; }
  .site-nav.submenu-open .nav-list > .nav-item.open > a { display: none; }  /* hide parent row; back-arrow header replaces it */

  .submenu {
    position: static; opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: 0; border-top: 0; border-radius: 0; padding: 0;
    display: none;
  }
  .submenu::before { display: none; }
  .nav-item.open > .submenu { display: block; }

  /* Back-arrow header row (mobile only) */
  .submenu-head { display: block; border-bottom: 1px solid #d9dde3; }
  .submenu-back {
    display: flex; align-items: center; gap: 0.5rem; width: 100%;
    background: var(--paper-2); border: 0; cursor: pointer;
    padding: 0.95rem 1.25rem; text-align: left;
    font-family: var(--label); font-weight: 700; font-size: 0.86rem;
    letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink);
  }
  .submenu-back .back-arrow { font-size: 1.5rem; line-height: 1; color: var(--brown); display: inline-block; transform: translateY(-0.06em); }
  .submenu a { padding: 0.95rem 1.25rem; border-top: 0; }
  .submenu li + li a { border-top: 1px solid #d9dde3; }
  .submenu-head + li a { border-top: 0; }
}

/* ============================================================
   Hero (generic publisher, not series-specific)
   ============================================================ */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 6vw, 4rem); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--paper);
}
.hero-inner { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 span { color: var(--gold-deep); }
.hero .keywords { font-family: var(--label); letter-spacing: 0.22em; font-size: 0.78rem; color: var(--brown); margin-bottom: 1.4rem; }
.hero-lede { font-size: 1.2rem; color: var(--ink-soft); max-width: 46ch; }
.hero-cta { display: flex; gap: 0.8rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* Stacked-books illustration built from CSS "spines" as a placeholder */
.hero-art { display: block; }

/* ============================================================
   Mission slider (hero right half)
   ============================================================ */
.mission-slider { width: 100%; max-width: 520px; margin-left: auto; }
.mission-head { margin-bottom: 1rem; }
.mission-title { font-family: var(--display); font-weight: 900; font-size: clamp(1.5rem, 2.4vw, 2rem); margin: 0.15rem 0 0.5rem; }
.mission-sub { color: var(--ink-soft); font-size: 0.98rem; margin: 0; max-width: 46ch; }

/* Stage: slides stack in the same box; only active is shown */
.slides {
  position: relative; margin-top: 1.2rem;
  border-radius: 16px; overflow: hidden;
  min-height: 240px;
  box-shadow: 0 14px 34px var(--shadow);
}
.slide {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 1.6rem 1.7rem;
  color: #fff6ea;
  /* Colored panel now; a background image can be layered behind later.
     To add art later: set background-image and keep this gradient on top
     as a legibility scrim. */
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 55%, transparent) 0%, var(--accent) 78%),
    var(--accent);
  opacity: 0; visibility: hidden;
  transform: scale(1.03);
  transition: opacity .6s ease, transform .6s ease, visibility .6s;
}
.slide.is-active { opacity: 1; visibility: visible; transform: scale(1); }
.slide-index {
  position: absolute; top: 1.2rem; right: 1.5rem;
  font-family: var(--display); font-weight: 900; font-size: 3.2rem;
  opacity: 0.28; line-height: 1;
}
.slide-name { font-family: var(--display); font-weight: 900; font-size: 1.9rem; margin: 0 0 0.5rem; }
.slide-text { font-size: 1.02rem; line-height: 1.55; margin: 0; max-width: 40ch; }

/* Dots with per-slide timer fill */
.slider-dots { display: flex; gap: 0.6rem; margin-top: 1.1rem; }
.dot {
  position: relative; flex: 0 0 auto;
  width: 46px; height: 6px; border-radius: 999px;
  border: 0; padding: 0; cursor: pointer;
  background: color-mix(in srgb, var(--brown) 20%, transparent);
  overflow: hidden;
}
.dot-fill {
  position: absolute; inset: 0; width: 0%;
  background: var(--gold-deep); border-radius: 999px;
}
.dot.is-active .dot-fill { background: var(--gold-deep); }
/* The active dot's fill is animated to full over the slide duration via JS
   toggling this class. */
.dot.is-active.is-timing .dot-fill {
  width: 100%;
  transition: width var(--slide-ms, 5000ms) linear;
}

/* ============================================================
   Sections
   ============================================================ */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section--alt { background: var(--paper-2); }
.section-head { max-width: 60ch; margin-bottom: 2rem; }
.section-head p { color: var(--ink-soft); }

/* Series cards */
.series-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.4rem; }
.series-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.6rem; text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: 0.5rem;
  border-top: 5px solid var(--accent, var(--gold));
  transition: transform .15s ease, box-shadow .15s ease;
}
.series-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px var(--shadow); color: var(--ink); }
.series-card .ages { font-family: var(--label); font-size: 0.72rem; letter-spacing: 0.12em; color: var(--ink-soft); text-transform: uppercase; }
.series-card h3 { font-family: var(--display); font-size: 1.4rem; font-weight: 900; }
.series-card .more { font-family: var(--label); font-size: 0.85rem; margin-top: auto; color: var(--gold-deep); }

/* ============================================================
   Book grid + cards
   ============================================================ */
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.8rem; }
.filters button {
  font-family: var(--label); font-size: 0.85rem; padding: 0.45rem 1rem;
  border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper);
  color: var(--ink-soft); cursor: pointer; transition: all .15s ease;
}
.filters button.is-active, .filters button:hover { border-color: var(--brown); background: var(--brown); color: var(--paper); }

.book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1.6rem; }
.book-card { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 0.6rem; }
.book-cover {
  aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; position: relative;
  background: var(--paper-2); border: 1px solid var(--line);
  box-shadow: 0 6px 16px var(--shadow); transition: transform .15s ease;
  display: grid; place-items: center; text-align: center; padding: 1rem;
}
.book-card:hover .book-cover { transform: translateY(-5px) rotate(-1deg); }
.book-cover .ph-title { font-family: var(--display); font-weight: 900; font-size: 1.1rem; color: var(--brown); }
.book-cover .ph-tag { font-family: var(--label); font-size: 0.62rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--gold-deep); margin-top: 0.4rem; }
.book-cover::after { content: "Cover art coming soon"; position: absolute; bottom: 8px; left: 0; right: 0; font-family: var(--label); font-size: 0.58rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft); opacity: 0.7; }
.book-card h3 { font-family: var(--display); font-size: 1.05rem; font-weight: 600; margin: 0; }
.book-card .book-meta { font-family: var(--label); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }

/* ============================================================
   Book detail page
   ============================================================ */
.book-detail { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; padding-top: 2.5rem; }
.book-detail .cover-lg { aspect-ratio: 3 / 4; border-radius: 12px; background: var(--paper-2); border: 1px solid var(--line); box-shadow: 0 12px 30px var(--shadow); display: grid; place-items: center; text-align: center; padding: 2rem; position: relative; }
.book-detail .cover-lg .ph-title { font-family: var(--display); font-weight: 900; font-size: 1.6rem; color: var(--brown); }
.book-detail .cover-lg::after { content: "Cover art coming soon"; position: absolute; bottom: 14px; left: 0; right: 0; font-family: var(--label); font-size: 0.65rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-soft); }
.book-detail .series-pill { display: inline-block; font-family: var(--label); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-deep); margin-bottom: 0.6rem; }
.spec { display: flex; gap: 1.4rem; flex-wrap: wrap; margin: 1.2rem 0 1.6rem; }
.spec div { font-size: 0.9rem; }
.spec .label { display: block; margin-bottom: 2px; }

/* Availability table */
.availability { margin-top: 2rem; }
.availability h2 { font-size: 1.4rem; }
.buy-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.7rem; }
.buy-row {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
  padding: 0.9rem 1.1rem;
}
.buy-row .buy-info { display: flex; flex-direction: column; }
.buy-row .fmt { font-weight: 700; }
.buy-row .via { font-family: var(--label); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }
.buy-row .fmt-badge {
  font-family: var(--label); font-size: 0.62rem; letter-spacing: 0.1em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 999px; margin-left: 8px; vertical-align: middle;
}
.fmt-badge.hardcover { background: color-mix(in srgb, var(--brown) 18%, transparent); color: var(--brown); }
.fmt-badge.softcover { background: color-mix(in srgb, var(--green) 25%, transparent); color: #3f5b43; }
.fmt-badge.ebook { background: color-mix(in srgb, var(--gold) 30%, transparent); color: var(--gold-deep); }

/* ============================================================
   Footer
   ============================================================ */
.site-footer { background: var(--brown); color: #fff6ea; margin-top: 4rem; padding: 3rem 0 1.5rem; }
.site-footer a { color: #ffffff; }
.site-footer a:hover { color: #eaf3ff; }
.footer-grid { display: grid; grid-template-columns: 1.2fr 1.4fr 1fr; gap: 2.5rem; }
.footer-brand .brand-name { font-family: var(--display); font-size: 1.5rem; font-weight: 900; color: #ffffff; }
.footer-keywords { font-family: var(--label); font-size: 0.7rem; letter-spacing: 0.16em; margin-top: 0.4rem; }
.site-footer h2 { font-size: 1.15rem; color: #ffffff; }
.signup { display: flex; gap: 0.5rem; margin-top: 0.8rem; flex-wrap: wrap; }
.signup input { flex: 1 1 180px; padding: 0.65rem 0.9rem; border-radius: 999px; border: 1px solid rgba(255,255,255,0.5); font-family: var(--body); }
.signup button { border: 0; border-radius: 999px; padding: 0.65rem 1.2rem; background: #fff; color: var(--brown); font-family: var(--label); font-weight: 600; cursor: pointer; transition: background .15s ease, color .15s ease; }
.signup button:hover { background: var(--gold-deep); color: #fff; }
.footer-legal { border-top: 1px solid color-mix(in srgb, #fff 18%, transparent); margin-top: 2.2rem; padding-top: 1.2rem; }
.footer-legal p { font-size: 0.8rem; margin: 0; color: #ffe4c2; }

@media (max-width: 800px) {
  .hero-inner, .book-detail { grid-template-columns: 1fr; }
  .hero-art { order: 1; margin-top: 2rem; }
  .mission-slider { margin-left: 0; max-width: none; }
  .footer-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   Prose pages (about / retailers / contact)
   ============================================================ */
.prose { max-width: 68ch; }
.prose h2 { margin-top: 2rem; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: 0.4rem; }
.page-head { padding: clamp(2.5rem, 6vw, 4rem) 0 1rem; }
.page-head .label { display: block; margin-bottom: 0.6rem; }

/* ============================================================
   "Latest books" carousel — contained, draggable, hover arrows
   ============================================================ */
.carousel { position: relative; }
.carousel-viewport {
  overflow-x: auto; overflow-y: hidden;
  scrollbar-width: none;                 /* Firefox */
  -ms-overflow-style: none;              /* IE/Edge */
  cursor: grab;
  touch-action: pan-y;                   /* let us handle horizontal drag; page still scrolls vertically */
  /* Fades aligned to the container edges (same margins as the section text) */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 4%, #000 96%, transparent 100%);
}
.carousel-viewport::-webkit-scrollbar { display: none; } /* Chrome/Safari */
.carousel-viewport.is-dragging { cursor: grabbing; }
.carousel-track {
  display: flex; gap: 1.6rem; width: max-content; padding: 0.5rem 0 0.75rem;
}
.carousel-card {
  width: 200px; flex: 0 0 auto;
  -webkit-user-select: none; user-select: none;
}
.carousel-card .book-cover { pointer-events: none; } /* so drag doesn't fight the image */

/* Arrows — hidden until the section is hovered */
.carousel-arrow {
  position: absolute; top: calc(50% - 12px); transform: translateY(-50%);
  z-index: 5; width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--paper); color: var(--brown);
  display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 6px 16px var(--shadow);
  opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s, background .15s ease, transform .15s ease;
}
.carousel-arrow svg { width: 22px; height: 22px; }
.carousel-arrow:hover { background: var(--brown); color: var(--paper); }
.carousel-prev { left: -6px; }
.carousel-next { right: -6px; }
.carousel:hover .carousel-arrow,
.carousel:focus-within .carousel-arrow { opacity: 1; visibility: visible; }
@media (hover: none) {                    /* always show on touch devices */
  .carousel-arrow { opacity: 1; visibility: visible; }
}

/* ============================================================
   Footer social icons — colored by default, ~10% larger glyphs
   ============================================================ */
.social-row {
  display: flex; gap: 0.6rem; list-style: none; margin: 1.1rem 0 0; padding: 0; flex-wrap: wrap;
}
.social-link {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
  color: #fff !important;   /* override footer's gold link color so glyphs stay crisp white */
  transition: transform .15s ease, filter .15s ease;
}
.social-link svg { width: 24px; height: 24px; fill: #fff; }
.social-link:hover { transform: translateY(-2px); filter: brightness(1.08); }
/* Brand colors applied by default */
.social-facebook  { background: #3b5998; }
.social-instagram { background: #d6336c; }
.social-x         { background: #000; }
.social-pinterest { background: #bd081c; }
.social-youtube   { background: #c4302b; }
.social-linkedin  { background: #0a66c2; }
.social-tiktok    { background: #010101; }

/* Large signup (newsletter page) */
.signup--lg { max-width: 480px; }
.signup--lg input { flex: 1 1 100%; border: 1.5px solid var(--line); }
.signup--lg input:focus { outline: none; border-color: var(--gold-deep); }
.signup--lg button { background: var(--brown); color: #fff; }
.signup--lg button:hover { background: var(--gold-deep); color: #fff; }

/* Series page: accent underline beneath the title (replaces the old top border
   that collided with the nav underline) */
.series-title { display: inline-block; padding-bottom: 0.25rem; border-bottom: 6px solid var(--series-accent, var(--gold)); }
