/* ============================================================
   Brightroots Creations — redesign
   Palette: white base, warm off-white sections, brand brown
   Typography: Playfair Display (serif headings) + DM Sans (body)
   ============================================================ */

/* Google Fonts loaded in <head>: Playfair Display + DM Sans */

:root {
  --white:       #ffffff;
  --off-white:   #f8f5f0;
  --warm-gray:   #f0ebe3;
  --bg:          #ffffff;
  --surface:     #f8f5f0;
  --surface-2:   #f0ebe3;
  --dark:        #1a1a1a;
  --dark-hero:   #1e2d1f;   /* deep forest green for hero */
  --text:        #1a1a1a;
  --text-muted:  #6b6560;
  --text-light:  #9e9790;
  --brown:       #7b3f1e;   /* brand brown from logo */
  --brown-light: #a0522d;
  --brown-dim:   rgba(123, 63, 30, 0.1);
  --gold:        #c8860a;
  --border:      #e5ddd5;
  --border-dark: #d0c5ba;
  --shadow-sm:   0 1px 4px rgba(0,0,0,0.06);
  --shadow:      0 4px 20px rgba(0,0,0,0.08);
  --shadow-lg:   0 12px 48px rgba(0,0,0,0.12);
  --radius:      4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --font-serif:  "Playfair Display", Georgia, "Times New Roman", serif;
  --font-body:   "DM Sans", system-ui, -apple-system, sans-serif;
  --header-h:    4rem;
  --promo-h:     2.25rem;
}

body[data-theme="dark"] {
  --bg:          #141210;
  --surface:     #1e1b17;
  --surface-2:   #272219;
  --dark-hero:   #0f1a10;
  --text:        #f0ebe3;
  --text-muted:  #a09890;
  --text-light:  #6b6560;
  --brown:       #d4845a;
  --brown-light: #e8a070;
  --brown-dim:   rgba(212, 132, 90, 0.12);
  --gold:        #e8a010;
  --border:      #2e2820;
  --border-dark: #3d3428;
  --shadow:      0 4px 24px rgba(0,0,0,0.3);
  --shadow-lg:   0 12px 48px rgba(0,0,0,0.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

img { display: block; max-width: 100%; }
a { color: inherit; }
button { font-family: inherit; cursor: pointer; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.skip-link {
  position: absolute; left: -9999px; z-index: 999;
  padding: 0.5rem 1rem; background: var(--brown); color: #fff;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ============================================================
   PROMO BAR
   ============================================================ */
.promo-bar {
  background: var(--dark);
  color: #fff;
  text-align: center;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 0.55rem 1rem;
  height: var(--promo-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}
.promo-bar a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
}

.header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 1rem;
}

.brand-link {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
}
.brand-logo {
  width: 2.4rem;
  height: 2.4rem;
  object-fit: contain;
  flex-shrink: 0;
}
.brand-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.brand-tagline { display: none; }

.header-age-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 500;
}
.age-nav-link {
  text-decoration: none;
  color: var(--text-muted);
  padding: 0.4rem 0.65rem;
  border-radius: var(--radius);
  transition: color 0.15s;
  white-space: nowrap;
}
.age-nav-link:hover { color: var(--brown); }
.age-sub { display: none; }
.age-nav-sep { color: var(--border-dark); padding: 0 0.1rem; }

.header-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-end;
}
.header-search { position: relative; }
.search-input {
  width: 180px;
  padding: 0.45rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  transition: border-color 0.15s, width 0.2s;
}
.search-input:focus {
  outline: none;
  border-color: var(--brown);
  width: 220px;
}
.search-input::placeholder { color: var(--text-light); }

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.42rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 500;
  transition: border-color 0.15s, color 0.15s;
  white-space: nowrap;
}
.theme-toggle:hover { border-color: var(--brown); color: var(--brown); }
.theme-toggle-icon { font-size: 0.95rem; }

.btn-giveaway {
  display: inline-flex;
  align-items: center;
  padding: 0.42rem 0.9rem;
  border-radius: var(--radius);
  background: var(--brown);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-giveaway:hover { background: var(--brown-light); }

/* ============================================================
   HERO CAROUSEL — full-bleed dark panel
   ============================================================ */
.hero-carousel-section {
  background: var(--dark-hero);
  overflow: hidden;
}
.hero-carousel-inner {
  max-width: 1320px;
  margin: 0 auto;
  position: relative;
}
.hero-carousel {
  position: relative;
  min-height: 420px;
}
.hero-slides {
  position: relative;
  min-height: inherit;
}

.hero-slide {
  display: grid;
  grid-template-columns: 1fr minmax(200px, 260px);
  gap: 2rem 3rem;
  align-items: center;
  padding: 3.5rem 3rem 3rem 3.5rem;
  color: #fff;
}

.hero-slide[hidden] {
  display: none;
}

.hero-slide-visual {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  justify-content: flex-end;
  filter: drop-shadow(0 24px 48px rgba(0,0,0,0.5));
}
.hero-slide-copy {
  grid-column: 1;
  grid-row: 1;
}

.hero-slide-cover {
  width: 220px;
  height: auto;
  border-radius: var(--radius-md);
  object-fit: cover;
}

.hero-slide-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.85rem;
}
.hero-slide-title {
  font-family: var(--font-serif);
  font-size: clamp(1.6rem, 3.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
  margin-bottom: 0.9rem;
}
.hero-slide-blurb {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  max-width: 38rem;
  margin-bottom: 1.5rem;
}
.hero-slide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.btn-details {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.2rem;
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: var(--radius);
  background: transparent;
  color: #fff;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.btn-details:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.6); }

.btn-amazon--hero {
  background: var(--brown) !important;
  color: #fff !important;
  font-size: 0.88rem;
}
.btn-amazon--hero:hover { background: var(--brown-light) !important; filter: none !important; }

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1.3rem;
  line-height: 1;
  z-index: 2;
  backdrop-filter: blur(4px);
  transition: background 0.15s;
}
.carousel-btn:hover { background: rgba(255,255,255,0.2); }
.carousel-btn-prev { left: 1rem; }
.carousel-btn-next { right: 1rem; }

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
  padding: 0 1rem 1.25rem;
}
.carousel-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  border: none;
  padding: 0;
  background: rgba(255,255,255,0.3);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.carousel-dot.is-active {
  background: #fff;
  transform: scale(1.4);
}

/* ============================================================
   STATS STRIP
   ============================================================ */
.stats-strip {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.stats-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  divide-x: 1px solid var(--border);
}
.stat-card {
  padding: 1.25rem 1.5rem;
  text-align: center;
  border-right: 1px solid var(--border);
}
.stat-card:last-child { border-right: none; }
.stat-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.stat-value {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--brown);
  line-height: 1;
}

/* ============================================================
   SECTION SHARED
   ============================================================ */
main { overflow: hidden; }

.section-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-top: 2.5rem;
}
.section-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.section-title em {
  font-style: italic;
  color: var(--brown);
}
.section-sub {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-top: 0.25rem;
}
.section-see-all {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--brown);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid var(--brown-dim);
  padding-bottom: 1px;
  transition: border-color 0.15s;
  flex-shrink: 0;
}
.section-see-all:hover { border-color: var(--brown); }

/* ============================================================
   RAIL SECTIONS
   ============================================================ */
.rail-section {
  padding-bottom: 2.5rem;
  scroll-margin-top: var(--header-h);
}
.rail-section--alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.rail-track-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin: 0 -1.5rem;
  padding: 0 1.5rem 0.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--border-dark) transparent;
}
.rail-track {
  display: flex;
  gap: 1.25rem;
  padding-bottom: 0.25rem;
}

.rail-card {
  flex: 0 0 180px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}
.rail-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.rail-card-main {
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.rail-card-cover-wrap {
  aspect-ratio: 2/3;
  overflow: hidden;
  background: var(--surface);
}
.rail-card-cover {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.22s ease;
}
.rail-card:hover .rail-card-cover { transform: scale(1.03); }

.rail-card-title {
  font-family: var(--font-serif);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.3;
  padding: 0.65rem 0.75rem 0.3rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rail-card-blurb { display: none; }

.btn-amazon--rail {
  margin: auto 0.75rem 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  padding: 0.4rem 0.65rem;
  justify-content: center;
}

/* ============================================================
   SPOTLIGHT — editorial 3-col cards
   ============================================================ */
.spotlight-section {
  padding-bottom: 3rem;
  scroll-margin-top: var(--header-h);
}
.spotlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 1.25rem;
}
.spotlight-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: transform 0.18s, box-shadow 0.18s;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.spotlight-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.spotlight-card-image {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-family: var(--font-serif);
}
.spotlight-card-body { padding: 1.25rem 1.1rem 1.4rem; flex: 1; }
.spotlight-card-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
  line-height: 1.25;
}
.spotlight-card-desc {
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}
.spotlight-card-link {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brown);
  text-decoration: none;
  border-bottom: 1px solid var(--brown-dim);
}

/* ============================================================
   NEWSLETTER / GIVEAWAY
   ============================================================ */
.giveaway-section {
  background: var(--dark-hero);
  padding: 3.5rem 1.5rem;
  scroll-margin-top: var(--header-h);
}
.giveaway-inner {
  max-width: 580px;
  margin: 0 auto;
  text-align: center;
  color: #fff;
}
.giveaway-title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}
.giveaway-copy p {
  font-size: 0.95rem;
  color: rgba(255,255,255,0.7);
  margin-bottom: 1.5rem;
  line-height: 1.6;
}
.giveaway-form {
  display: flex;
  gap: 0.5rem;
  max-width: 440px;
  margin: 0 auto;
}
.giveaway-input {
  flex: 1;
  padding: 0.7rem 1rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
}
.giveaway-input::placeholder { color: rgba(255,255,255,0.4); }
.giveaway-input:focus { outline: none; border-color: var(--gold); }
.btn-giveaway-submit {
  padding: 0.7rem 1.35rem;
  border: none;
  border-radius: var(--radius);
  background: var(--brown);
  color: #fff;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s;
}
.btn-giveaway-submit:hover { background: var(--brown-light); }
.giveaway-note { margin-top: 0.85rem; font-size: 0.83rem; color: rgba(255,255,255,0.6); }

/* ============================================================
   OUR ROOTS / BRAND STORY
   ============================================================ */
.roots-section {
  padding-bottom: 3.5rem;
  scroll-margin-top: var(--header-h);
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.roots-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: start;
  max-width: none;
  padding-top: 2.5rem;
}
.roots-serif {
  font-family: var(--font-serif);
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}
.roots-text {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
}
.values-list {
  margin-top: 1.25rem;
  padding-left: 0;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
.values-list li {
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
  padding-left: 1rem;
  position: relative;
}
.values-list li::before {
  content: "–";
  position: absolute;
  left: 0;
  color: var(--brown);
}
.roots-author-card {
  padding: 1.75rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: var(--shadow);
}
.roots-author-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brown);
  margin-bottom: 0.65rem;
  display: block;
}
.roots-author-card p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.65;
}
.link-accent {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--brown);
  text-decoration: none;
  border-bottom: 1px solid var(--brown-dim);
  padding-bottom: 1px;
}
.link-accent:hover { border-color: var(--brown); }

/* ============================================================
   COMMUNITY
   ============================================================ */
.community-section {
  padding-bottom: 3rem;
  scroll-margin-top: var(--header-h);
}
.section-inner { max-width: 1320px; margin: 0 auto; padding: 0 1.5rem; }
.section-lead {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-top: 0.35rem;
  margin-bottom: 1.5rem;
  max-width: 54rem;
}
.social-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 1rem;
}
.social-tile {
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--surface);
  transition: box-shadow 0.15s;
}
.social-tile:hover { box-shadow: var(--shadow); }
.social-tile-title {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.4rem;
}
.social-tile-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
}
.social-tile-hash {
  display: inline-block;
  margin-top: 0.65rem;
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--brown);
}

/* ============================================================
   BROWSE (FULL CATALOG)
   ============================================================ */
.browse-section {
  scroll-margin-top: var(--header-h);
  border-top: 1px solid var(--border);
}
.browse-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 1.5rem 0;
}
.browse-header-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.5rem;
}
.browse-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.browse-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* Horizontal filter bar */
.filters-bar {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--header-h);
  z-index: 30;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filters-bar::-webkit-scrollbar { display: none; }
.filters-bar-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  flex-wrap: nowrap;
}

.filter-group-inline {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-shrink: 0;
}
.filter-group-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  white-space: nowrap;
  padding-right: 0.25rem;
}
.filter-divider {
  width: 1px;
  height: 1.5rem;
  background: var(--border);
  flex-shrink: 0;
  margin: 0 0.35rem;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.12s, background 0.12s, color 0.12s;
  flex-shrink: 0;
}
.filter-chip:hover { border-color: var(--brown); color: var(--brown); }
.filter-chip[aria-pressed="true"] {
  background: var(--brown);
  border-color: var(--brown);
  color: #fff;
}
.filter-chip:focus-visible { outline: 2px solid var(--brown); outline-offset: 2px; }

.btn-reset {
  margin-left: auto;
  flex-shrink: 0;
  padding: 0.3rem 0.7rem;
  border: 1px dashed var(--border-dark);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.12s, border-color 0.12s;
}
.btn-reset:hover { color: var(--brown); border-color: var(--brown); }

/* hidden sidebar filters panel (kept for JS compat, rendered as flat bar) */
.filters-panel { display: none; }
.filters-heading, .filters-copy { display: none; }
#filterGroups { display: contents; }
.filter-group { display: contents; }
.filter-group-title { display: none; }
.filter-chips { display: contents; }

/* Catalog grid */
.catalog-wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3.5rem;
}
.layout { display: block; }
.main { min-width: 0; }

.results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.results-count { font-size: 0.85rem; color: var(--text-muted); }
.results-count strong { color: var(--text); font-weight: 600; }
.sort-wrap {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}
.sort-label { white-space: nowrap; }
.sort-select {
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 0.82rem;
}

.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1.75rem 1.25rem;
}

.book-card {
  margin: 0;
  background: var(--bg);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
  display: flex;
  flex-direction: column;
}
.book-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.book-card-open {
  border: none;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.book-card-cover-wrap {
  aspect-ratio: 2/3;
  overflow: hidden;
  background: var(--surface);
}
.book-card-cover {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.22s ease;
}
.book-card:hover .book-card-cover { transform: scale(1.03); }

.book-card-body { padding: 0.75rem 0.85rem 0.5rem; flex: 1; }
.book-card-title {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.25rem;
}
.book-card-blurb { display: none; }
.book-card-meta { display: none; }

/* author line shown via pill reuse — repurposed below */
.book-card-pill {
  display: inline-block;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.book-card-pill + .book-card-pill::before {
  content: " · ";
}

.book-card-actions { padding: 0 0.85rem 0.85rem; }
.btn-amazon--card {
  width: 100%;
  justify-content: center;
  font-size: 0.78rem;
  padding: 0.45rem 0.65rem;
}
.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 4rem 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Language tabs */
.lang-tab-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding: 1rem 0 0.85rem;
  border-bottom: 1px solid var(--border);
}
.lang-tab {
  padding: 0.4rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.lang-tab:hover { border-color: var(--brown); color: var(--brown); }
.lang-tab.is-active {
  background: var(--brown);
  border-color: var(--brown);
  color: #fff;
  font-weight: 600;
}

/* Group-by tabs */
.groupby-bar {
  display: flex;
  gap: 0.25rem;
  margin-bottom: 1.1rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.groupby-tab {
  padding: 0.55rem 1rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: -1px;
  border-radius: 0;
  transition: color 0.15s, border-color 0.15s;
}
.groupby-tab:hover { color: var(--text); }
.groupby-tab.is-active {
  color: var(--brown);
  border-bottom-color: var(--brown);
  font-weight: 600;
}

/* Catalog group section heading */
.catalog-group-heading {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
  padding: 1.75rem 0 0.85rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.1rem;
}
.catalog-group-heading:first-child { padding-top: 0.25rem; }

/* #bookGrid becomes a container for groups */
#bookGrid > .book-grid { margin-bottom: 0.5rem; }

/* Format edition links on card */
.book-card-author {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.book-card-formats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.book-card-format-link {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.book-card-format-link:hover {
  border-color: var(--brown);
  color: var(--brown);
  background: var(--brown-dim);
}

/* ============================================================
   MODAL
   ============================================================ */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 100;
  backdrop-filter: blur(4px);
}
.book-modal {
  position: fixed;
  z-index: 101;
  max-width: min(560px, calc(100vw - 2rem));
  max-height: calc(100vh - 3rem);
  overflow: auto;
  margin: auto;
  inset: 0;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--bg);
  color: var(--text);
  box-shadow: var(--shadow-lg);
}
.book-modal::backdrop { background: transparent; }
.modal-close {
  position: sticky;
  top: 0.75rem;
  float: right;
  z-index: 2;
  margin: 0.75rem 0.75rem 0 0;
  width: 2rem; height: 2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
}
.modal-close:hover { background: var(--border); color: var(--text); }
.modal-body { padding: 0 1.5rem 1.75rem; display: flow-root; }
.modal-cover {
  width: 130px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  float: left;
  margin: 0 1.25rem 0.5rem 0;
}
.modal-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}
.modal-author { font-size: 0.85rem; color: var(--brown); margin-bottom: 0.75rem; }
.modal-meta-grid {
  display: grid; gap: 0.3rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
.modal-description {
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
}
.modal-actions { margin-top: 1.25rem; display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ============================================================
   BUY ON AMAZON BUTTON — universal
   ============================================================ */
.btn-amazon {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 1.1rem;
  border-radius: var(--radius);
  background: #f0c040;
  color: #111;
  font-family: inherit;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.88rem;
  border: none;
  transition: background 0.15s;
}
.btn-amazon:hover { background: #e8b830; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--dark);
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
}
.footer-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 3rem 1.5rem 2rem;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.5fr;
  gap: 2.5rem;
}
.footer-col-brand .brand-link { color: #fff; margin-bottom: 0.75rem; display: inline-flex; }
.footer-col-brand .brand-title { font-size: 1.1rem; color: #fff; }
.footer-mission {
  font-size: 0.82rem;
  line-height: 1.65;
  color: rgba(255,255,255,0.5);
  margin-top: 0.65rem;
}
.footer-col-nav h4 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.85rem;
}
.footer-nav-links {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.footer-nav-links a {
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.12s;
}
.footer-nav-links a:hover { color: #fff; }
.footer-col-newsletter h4 {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.4);
  margin-bottom: 0.85rem;
}
.footer-newsletter-form {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.footer-newsletter-input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.07);
  color: #fff;
  font: inherit;
  font-size: 0.82rem;
}
.footer-newsletter-input::placeholder { color: rgba(255,255,255,0.3); }
.footer-newsletter-btn {
  padding: 0.5rem 0.85rem;
  border: none;
  border-radius: var(--radius);
  background: var(--brown);
  color: #fff;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.footer-newsletter-btn:hover { background: var(--brown-light); }
.footer-bottom {
  max-width: 1320px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.35);
}
.footer-bottom a { color: rgba(255,255,255,0.45); text-decoration: none; }
.footer-bottom a:hover { color: rgba(255,255,255,0.75); }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1050px) {
  .spotlight-grid { grid-template-columns: 1fr 1fr; }
  .social-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-col-newsletter { grid-column: 1 / -1; }
}

@media (max-width: 800px) {
  .header-inner { grid-template-columns: auto 1fr; }
  .header-age-nav { display: none; }
  .roots-grid { grid-template-columns: 1fr; }
  .spotlight-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --header-h: 3.5rem; }
  .brand-title { font-size: 1rem; }
  .hero-slide {
    grid-template-columns: 1fr;
    padding: 2rem 1.5rem 1.5rem;
    text-align: center;
  }
  .hero-slide-visual { grid-column: 1; grid-row: 1; justify-content: center; margin-bottom: 1rem; }
  .hero-slide-copy { grid-column: 1; grid-row: 2; }
  .hero-slide-actions { justify-content: center; }
  .hero-slide-cover { width: 140px; }
  .stats-inner { grid-template-columns: 1fr 1fr; }
  .stat-card { border-right: none; border-bottom: 1px solid var(--border); }
  .social-grid { grid-template-columns: 1fr 1fr; }
  .footer-inner { grid-template-columns: 1fr; gap: 1.5rem; }
  .giveaway-form { flex-direction: column; }
  .search-input { width: 120px; }
  .search-input:focus { width: 150px; }
  .btn-giveaway { display: none; }
  .promo-bar { font-size: 0.72rem; }
}

@media (max-width: 480px) {
  .book-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 1rem; }
  .rail-card { flex: 0 0 145px; }
  .stats-inner { grid-template-columns: repeat(2,1fr); }
  .modal-cover { float: none; width: 100px; margin: 0 0 1rem; }
}

/* btn-text kept for hero detail button */
.btn-text {
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.8);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0.6rem 1.2rem;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
  transition: background 0.15s;
}
.btn-text:hover { background: rgba(255,255,255,0.08); }
