/* ==================================================
   BOOKS CATALOG (/books)
   Loaded only on the catalog page, after light-shell.css
   (see includes/head.php). Uses its own cat-* classes so
   the older dark-theme .book-card rules never apply here.
================================================== */

body.light-shell .catalog {
  --cat-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --cat-radius: 6px;
  max-width: 1120px;
}

body.light-shell .catalog .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

body.light-shell .catalog .cat-kicker {
  margin: 0 0 10px;
  font-family: var(--cat-sans);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ls-accent-deep);
}

/* ---------- Hero ---------- */

body.light-shell .cat-hero {
  max-width: 720px;
  margin: 0 auto 56px;
  text-align: center;
}

body.light-shell .cat-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(2.1rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}

body.light-shell .cat-lede {
  margin: 0 auto;
  max-width: 560px;
  font-size: 1.12rem;
  line-height: 1.6;
  color: var(--ls-muted);
}

body.light-shell .cat-jump {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 26px;
}

body.light-shell .cat-jump a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border: 1px solid var(--ls-hairline);
  border-radius: 999px;
  background: rgba(255,248,236,0.6);
  color: var(--ls-ink-soft);
  font-family: var(--cat-sans);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

body.light-shell .cat-jump a span {
  color: var(--ls-accent-deep);
  font-weight: 700;
}

body.light-shell .cat-jump a:hover,
body.light-shell .cat-jump a:focus-visible {
  border-color: var(--ls-accent-deep);
  background: var(--ls-field-bg);
}

/* ---------- Start-here guide ---------- */

body.light-shell .cat-guide {
  margin: 0 0 72px;
  padding: 36px;
  border: 1px solid var(--ls-hairline);
  border-radius: var(--cat-radius);
  background: rgba(255,248,236,0.45);
}

body.light-shell .cat-guide-intro {
  max-width: 620px;
  margin: 0 auto 26px;
  text-align: center;
}

body.light-shell .cat-guide-intro h2 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
}

body.light-shell .cat-guide-intro p:last-child {
  margin: 0;
  color: var(--ls-muted);
}

body.light-shell .cat-guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

body.light-shell .cat-guide-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px;
  border: 1px solid var(--ls-hairline);
  border-left: 3px solid var(--ls-accent);
  border-radius: var(--cat-radius);
  background: var(--ls-paper);
  text-decoration: none;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

body.light-shell .cat-guide-label {
  font-family: var(--cat-sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ls-accent-deep);
}

body.light-shell .cat-guide-card strong {
  color: var(--ls-ink);
  font-size: 1.08rem;
  font-style: italic;
}

body.light-shell .cat-guide-copy {
  color: var(--ls-ink-soft);
  font-size: 0.92rem;
  line-height: 1.55;
}

body.light-shell .cat-guide-card:hover,
body.light-shell .cat-guide-card:focus-visible {
  border-color: rgba(138,78,34,0.66);
  border-left-color: var(--ls-accent-deep);
  box-shadow: 0 12px 28px rgba(43,33,24,0.1);
  transform: translateY(-2px);
}

/* ---------- Sections ---------- */

body.light-shell .cat-section {
  margin: 0 0 80px;
  scroll-margin-top: 24px;
}

body.light-shell .cat-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 24px;
  margin: 0 0 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--ls-hairline);
}

body.light-shell .cat-section-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 3.6vw, 2.1rem);
}

body.light-shell .cat-section-head p {
  margin: 0;
  color: var(--ls-muted);
  font-size: 0.95rem;
}

/* ---------- Book grid ---------- */

body.light-shell .cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 40px 28px;
}

body.light-shell .cat-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

body.light-shell .cat-cover {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 3px;
  background: var(--ls-paper-card);
  box-shadow: 0 1px 2px rgba(43,33,24,0.18), 0 14px 30px rgba(43,33,24,0.18);
  transition: transform .2s ease, box-shadow .2s ease;
}

body.light-shell .cat-cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.light-shell .cat-card:hover .cat-cover {
  transform: translateY(-3px);
  box-shadow: 0 2px 4px rgba(43,33,24,0.18), 0 20px 40px rgba(43,33,24,0.24);
}

body.light-shell .cat-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 5px 9px;
  border-radius: 3px;
  background: var(--ls-ink);
  color: #f6f0e4;
  font-family: var(--cat-sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

body.light-shell .cat-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding-top: 18px;
}

body.light-shell .cat-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 8px;
  font-family: var(--cat-sans);
  font-size: 0.72rem;
}

body.light-shell .cat-status {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(168,98,44,0.12);
  color: var(--ls-accent-deep);
  font-weight: 700;
  letter-spacing: 0.04em;
}

body.light-shell .cat-status--free {
  background: rgba(74,107,58,0.14);
  color: #3f5d31;
}

body.light-shell .cat-status--ku {
  background: rgba(43,33,24,0.08);
  color: var(--ls-ink-soft);
}

body.light-shell .cat-year {
  color: var(--ls-muted);
}

body.light-shell .cat-title {
  margin: 0 0 4px;
  font-size: 1.25rem;
  line-height: 1.25;
}

body.light-shell .cat-title a {
  color: var(--ls-ink);
  text-decoration: none;
}

body.light-shell .cat-title a:hover {
  color: var(--ls-link);
}

body.light-shell .cat-sub {
  margin: 0 0 10px;
  color: var(--ls-muted);
  font-size: 0.92rem;
  font-style: italic;
}

body.light-shell .cat-excerpt {
  margin: 0 0 18px;
  color: var(--ls-ink-soft);
  font-size: 0.93rem;
  line-height: 1.6;
}

/* Button above, "Details" below, on every card, so rows line up
   whatever the button label length. */
body.light-shell .cat-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: auto;
}

body.light-shell .cat-btn {
  display: inline-block;
  padding: 9px 16px;
  border: 1px solid var(--ls-ink);
  border-radius: 3px;
  background: transparent;
  color: var(--ls-ink);
  font-family: var(--cat-sans);
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

body.light-shell .cat-btn:hover,
body.light-shell .cat-btn:focus-visible {
  background: var(--ls-ink);
  color: var(--ls-paper);
}

body.light-shell .cat-btn--primary {
  background: var(--ls-ink);
  color: var(--ls-paper);
}

body.light-shell .cat-btn--primary:hover,
body.light-shell .cat-btn--primary:focus-visible {
  border-color: var(--ls-accent-deep);
  background: var(--ls-accent-deep);
  color: #fff;
}

body.light-shell .cat-more {
  color: var(--ls-link);
  font-family: var(--cat-sans);
  font-size: 0.84rem;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

body.light-shell .cat-more::after {
  content: " →";
}

body.light-shell .cat-more:hover {
  border-bottom-color: currentColor;
}

/* Forthcoming: smaller covers, title only */

body.light-shell .cat-grid--compact {
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 32px 22px;
}

body.light-shell .cat-card--compact .cat-body {
  padding-top: 12px;
}

body.light-shell .cat-card--compact .cat-title {
  font-size: 1rem;
}

body.light-shell .cat-card--compact .cat-sub {
  margin: 0;
  font-size: 0.85rem;
}

/* ---------- Why buy direct ---------- */

body.light-shell .cat-direct {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 32px 48px;
  margin: 0 0 40px;
  padding: 40px 44px;
  border-radius: var(--cat-radius);
  background: var(--ls-ink);
  scroll-margin-top: 24px;
}

body.light-shell .cat-direct .cat-kicker {
  color: #d6a173;
}

body.light-shell .cat-direct h2 {
  margin: 0 0 12px;
  color: #f6f0e4;
  font-size: clamp(1.6rem, 3.6vw, 2.1rem);
}

body.light-shell .cat-direct p {
  margin: 0;
  color: #d9cbb7;
  line-height: 1.65;
}

body.light-shell .cat-direct ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

body.light-shell .cat-direct li {
  position: relative;
  padding: 10px 0 10px 28px;
  border-bottom: 1px solid rgba(246,240,228,0.12);
  color: #efe6d4;
}

body.light-shell .cat-direct li:last-child {
  border-bottom: 0;
}

body.light-shell .cat-direct li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 17px;
  width: 9px;
  height: 5px;
  border-left: 2px solid #d6a173;
  border-bottom: 2px solid #d6a173;
  transform: rotate(-45deg);
}

/* ---------- Small screens ---------- */

@media (max-width: 760px) {
  body.light-shell .cat-hero {
    margin-bottom: 40px;
  }

  body.light-shell .cat-guide {
    margin-bottom: 56px;
    padding: 24px 18px;
  }

  body.light-shell .cat-guide-grid {
    grid-template-columns: 1fr;
  }

  body.light-shell .cat-direct {
    grid-template-columns: 1fr;
    padding: 30px 22px;
  }
}

@media (max-width: 640px) {
  /* Two columns of books on phones; covers carry the page. */
  body.light-shell .cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 16px;
  }

  body.light-shell .cat-excerpt {
    display: none;
  }

  body.light-shell .cat-title {
    font-size: 1.05rem;
  }

  body.light-shell .cat-btn {
    padding: 8px 10px;
    font-size: 0.78rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.light-shell .cat-cover,
  body.light-shell .cat-guide-card {
    transition: none;
  }
  body.light-shell .cat-card:hover .cat-cover,
  body.light-shell .cat-guide-card:hover {
    transform: none;
  }
}
