/* ═══════════════════════════════════════════════════════
   BIBLIOTHÈQUE ROYALE — main.css
   An old French royal library experience
═══════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&family=Cinzel:wght@400;600&family=Lora:ital,wght@0,400;1,400&family=Inter:wght@400;500;600&display=swap');

/* ── Reset ── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

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

button,
input {
  font-family: inherit;
}

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

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;600;700&family=Inter:wght@400;600;700&display=swap');

/* ── Design Tokens ── */
:root {
  /* Parchment */
  --parchment: #f4ecd8;
  --parchment-alt: #ece0c3;
  --parchment-deep: #dfd0a8;
  --cream: #fdf8ef;

  /* Burgundy */
  --burgundy-deep: #2e0a15;
  --burgundy: #4e1525;
  --burgundy-mid: #6d2038;

  /* Gold */
  --gold: #c9a227;
  --gold-dark: #9e7b14;
  --gold-light: #dfc050;
  --gold-pale: #f2e4b4;

  /* Ink */
  --ink: #1a1005;
  --ink-soft: #3a2a18;
  --ink-muted: #6a5540;

  /* System */
  --border: rgba(184, 135, 51, 0.18);
  --border-strong: rgba(184, 135, 51, 0.38);
  --shadow-card: 0 2px 8px rgba(30, 15, 5, 0.10), 0 8px 28px rgba(30, 15, 5, 0.08);
  --shadow-lift: 0 8px 32px rgba(30, 15, 5, 0.18), 0 2px 8px rgba(30, 15, 5, 0.12);
  --shadow-modal: 0 24px 80px rgba(10, 4, 2, 0.50);

  /* Radii */
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Typography */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-label: 'Cinzel', Georgia, serif;
  --font-body: 'Lora', Georgia, serif;
  --font-ui: 'Inter', system-ui, sans-serif;
  /* aliases kept for app.js template compatibility */
  --font-sans: var(--font-ui);
  --font-serif: var(--font-display);

  /* Status */
  --clr-unread: #c8bba0;
  --clr-reading: #c9a227;
  --clr-finished: #5a8c6e;

  /* Header */
  --header-bg: var(--burgundy-deep);
}

/* ── Dark theme ── */
[data-theme="dark"] {
  --parchment: #141010;
  --parchment-alt: #1c1714;
  --parchment-deep: #241e18;
  --cream: #0f0c08;
  --ink: #f2e8d6;
  --ink-soft: #d4c4a8;
  --ink-muted: #b0a088;
  --border: rgba(184, 135, 51, 0.14);
  --border-strong: rgba(184, 135, 51, 0.30);
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.6), 0 8px 28px rgba(0, 0, 0, 0.5);
  --shadow-lift: 0 8px 32px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.6);
  --gold: #d4ae2e;
  --gold-dark: #c9a227;
  --gold-light: #e8cc5a;
  --gold-pale: #f2e4b4;
  --burgundy-deep: #3a1220;
  --burgundy: #5a1e30;
  --burgundy-mid: #7a2e48;
  --clr-unread: #5a5040;
  --clr-reading: #d4ae2e;
  --clr-finished: #6aaa7e;
}

/* ── Base ── */
html {
  font-family: var(--font-ui);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  background-color: var(--parchment);
  color: var(--ink);
  min-height: 100vh;
  transition: background-color .35s, color .35s;
}

/* Screen-reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ════════════════════════════════════════
   PAGE SHELL
════════════════════════════════════════ */
.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px 20px 48px;
}

.app-container {
  width: 100%;
  max-width: 1120px;
  display: flex;
  flex-direction: column;
}

/* ════════════════════════════════════════
   HEADER
════════════════════════════════════════ */
.site-header {
  padding: 0 0 20px;
}

.header-pill {
  background: var(--header-bg);
  border-radius: var(--r-pill);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background .3s;
}

.logo {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.4px;
  text-decoration: none;
  font-family: var(--font-serif);
  color: var(--gold-light);
  white-space: nowrap;
  flex-shrink: 0;
}

.theme-toggle {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  flex-shrink: 0;
  transition: background .2s;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.18);
}

/* ════════════════════════════════════════
   SEARCH
════════════════════════════════════════ */
.search-section {
  padding: 0 0 18px;
}

.search-tagline {
  text-align: center;
  font-family: var(--font-body);
  font-size: 1.15rem;
  font-style: italic;
  color: var(--ink-muted);
  margin-bottom: 16px;
  line-height: 1.5;
}

.search-wrap {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  background: var(--cream);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-pill);
  padding: 14px 100px 14px 22px;
  font-size: 1.05rem;
  font-family: var(--font-body);
  font-style: italic;
  color: var(--ink);
  outline: none;
  box-shadow: inset 0 2px 8px rgba(30, 15, 5, 0.04);
  transition: box-shadow .2s, border-color .2s;
  appearance: none;
  -webkit-appearance: none;
}

.search-input::placeholder {
  color: var(--ink-muted);
  font-style: italic;
}

.search-input::-webkit-search-cancel-button {
  display: none;
}

.search-input:focus {
  border-color: var(--gold);
  box-shadow: inset 0 2px 8px rgba(30, 15, 5, 0.04), 0 0 0 3px rgba(201, 162, 39, 0.14);
}

.search-icon {
  position: absolute;
  right: 62px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-muted);
  pointer-events: none;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
}

.search-kbd {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--parchment);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  padding: 3px 7px;
  font-size: 0.58rem;
  font-family: var(--font-ui);
  color: var(--ink-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  pointer-events: none;
  white-space: nowrap;
}

/* ════════════════════════════════════════
   GENRE PILLS
════════════════════════════════════════ */
.genre-section {
  padding: 0 0 16px;
}

.genre-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.genre-pill {
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-pill);
  padding: 10px 24px;
  font-family: var(--font-label);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  background: var(--cream);
  color: var(--ink-soft);
  transition: background .18s, border-color .18s, color .18s, box-shadow .18s;
  outline: none;
}

.genre-pill:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
  background: var(--gold-pale);
}

.genre-pill:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.genre-pill--all {
  background: var(--burgundy-deep);
  color: var(--gold-pale);
  border-color: var(--burgundy-deep);
}

.genre-pill--all:hover {
  background: var(--burgundy);
  border-color: var(--burgundy);
  color: var(--gold-light);
}

.genre-pill.active {
  background: var(--burgundy-deep);
  color: var(--gold-pale);
  border-color: var(--burgundy-deep);
  box-shadow: 0 3px 12px rgba(46, 10, 21, 0.25);
}

/* ════════════════════════════════════════
   STATS BAR
════════════════════════════════════════ */
.stats-bar {
  margin: 0 0 24px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
  position: relative;
  overflow: hidden;
}

/* ornamental gold top border */
.stats-bar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 25%, var(--gold-light) 50%, var(--gold) 75%, transparent 100%);
  opacity: 0.6;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  flex-shrink: 0;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}

.stat-value--reading {
  color: var(--gold-dark);
}

.stat-value--done {
  color: #4a7a5a;
}

.stat-label {
  font-family: var(--font-label);
  font-size: 0.85rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  white-space: nowrap;
}

.stat-divider {
  width: 1px;
  height: 30px;
  background: var(--border-strong);
  flex-shrink: 0;
}

.stat-item--progress {
  flex: 1;
  min-width: 120px;
  align-items: flex-start;
  gap: 6px;
}

.stat-bar {
  width: 100%;
  height: 4px;
  background: var(--parchment-alt);
  border-radius: var(--r-pill);
  overflow: hidden;
}

.stat-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--gold-dark), var(--gold));
  border-radius: var(--r-pill);
  transition: width .6s cubic-bezier(.4, 0, .2, 1);
}

/* ════════════════════════════════════════
   BOOK GRID
════════════════════════════════════════ */
.books-section {
  flex: 1;
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 24px;
}

.empty-msg {
  text-align: center;
  color: var(--ink-muted);
  padding: 64px 0;
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1rem;
}

.hidden {
  display: none !important;
}

/* ════════════════════════════════════════
   BOOK CARD
════════════════════════════════════════ */
.book-card {
  background: var(--cream);
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  outline: none;
  transition: transform .22s cubic-bezier(.4, 0, .2, 1), box-shadow .22s, border-color .22s;
  position: relative;
}

/* Gold shimmer on hover */
.book-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity .22s;
}

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

.book-card:hover,
.book-card:focus-visible {
  transform: translateY(-7px);
  box-shadow: var(--shadow-lift);
  border-color: var(--border-strong);
}

.book-card:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* Cover */
.card-cover-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--parchment-alt);
  flex-shrink: 0;
}

.card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .38s ease;
}

.book-card:hover .card-cover {
  transform: scale(1.07);
}

/* Status dot */
.card-status-dot {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 2px solid var(--cream);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.22);
  background: var(--clr-unread);
  transition: background .3s;
}

.card-status-dot[data-status="reading"] {
  background: var(--clr-reading);
}

.card-status-dot[data-status="finished"] {
  background: var(--clr-finished);
}

/* Card body */
.card-body {
  padding: 12px 13px 14px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1;
}

.card-genre-tag {
  display: inline-block;
  border-radius: var(--r-pill);
  padding: 3px 10px;
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  width: fit-content;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-author {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--ink-muted);
}

/* Progress bar */
.card-prog-bar {
  height: 2px;
  background: var(--parchment-alt);
  border-radius: var(--r-pill);
  overflow: hidden;
  margin-top: 3px;
}

.card-prog-fill {
  height: 100%;
  border-radius: var(--r-pill);
  background: var(--clr-reading);
  width: 0%;
  transition: width .4s ease, background .3s;
}

/* Card actions */
.card-actions {
  display: flex;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
}

.btn-summary {
  flex: 1;
  display: block;
  text-align: center;
  background: var(--burgundy-deep);
  color: var(--gold-pale);
  border-radius: var(--r-pill);
  padding: 10px 12px;
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(46, 10, 21, 0.2);
  transition: background .2s, box-shadow .2s;
}

.btn-summary:hover {
  background: var(--burgundy-mid);
  box-shadow: 0 4px 14px rgba(46, 10, 21, 0.3);
}

.btn-summary[data-disabled] {
  opacity: 0.35;
  pointer-events: none;
}

.card-actions .btn-secondary {
  flex-shrink: 0;
  background: transparent;
  border: 1.5px solid var(--border-strong);
  color: var(--ink-soft);
  border-radius: var(--r-pill);
  padding: 7px 11px;
  font-family: var(--font-label);
  font-size: 0.58rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}

.card-actions .btn-secondary:hover {
  background: var(--gold-pale);
  border-color: var(--gold);
  color: var(--gold-dark);
}

/* ════════════════════════════════════════
   FOOTER
════════════════════════════════════════ */
.site-footer {
  margin-top: 40px;
  padding: 22px 0;
  text-align: center;
  border-top: 1px solid var(--border);
  font-family: var(--font-label);
  font-size: 0.8rem;
  color: var(--ink-muted);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.site-footer::before {
  content: '❧';
  display: block;
  font-size: 1.3rem;
  color: var(--gold);
  opacity: 0.5;
  margin-bottom: 10px;
  font-family: Georgia, serif;
}

/* ════════════════════════════════════════
   MODAL
════════════════════════════════════════ */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(20, 8, 5, 0.72);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-panel {
  background: var(--cream);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 440px;
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  position: relative;
  border: 1px solid var(--border-strong);
  animation: modal-in .22s cubic-bezier(.34, 1.56, .64, 1);
  overscroll-behavior: contain;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: scale(.94) translateY(12px);
  }

  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-panel::-webkit-scrollbar {
  width: 5px;
}

.modal-panel::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-pill);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  background: rgba(20, 8, 5, 0.42);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(201, 162, 39, 0.22);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-pale);
  font-size: 1.1rem;
  transition: background .2s;
}

.modal-close:hover {
  background: rgba(46, 10, 21, 0.75);
}

/* Hero */
.modal-hero {
  position: relative;
  height: 200px;
  overflow: hidden;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  background: var(--burgundy-deep);
}

.modal-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.modal-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(46, 10, 21, 0.08) 20%, rgba(46, 10, 21, 0.72) 100%);
}

/* Modal body */
.modal-body {
  padding: 20px 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border-top: 2px solid transparent;
  border-image: linear-gradient(90deg, transparent, var(--gold), transparent) 1;
}

.modal-genre {
  display: inline-block;
  border-radius: var(--r-pill);
  padding: 4px 12px;
  font-family: var(--font-label);
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--ink);
}

.modal-author {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--gold-dark);
  margin-top: -4px;
}

.modal-desc {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--ink-soft);
  line-height: 1.72;
}

/* Progress tracker */
.prog-tracker {
  background: var(--parchment);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
}

.prog-tracker-label {
  font-family: var(--font-label);
  font-size: 0.7rem;
  color: var(--ink-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 10px;
}

.prog-btns {
  display: flex;
  gap: 8px;
}

.prog-btn {
  flex: 1;
  padding: 10px 6px;
  font-family: var(--font-label);
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--cream);
  color: var(--ink-soft);
  cursor: pointer;
  text-align: center;
  transition: border-color .2s, background .2s, color .2s;
}

.prog-btn:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
}

.prog-btn:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.prog-btn.active[data-status="unread"] {
  border-color: var(--ink-muted);
  background: var(--parchment);
  color: var(--ink-soft);
}

.prog-btn.active[data-status="reading"] {
  border-color: var(--gold);
  background: var(--gold-pale);
  color: #7a5a10;
}

.prog-btn.active[data-status="finished"] {
  border-color: #5a8c6e;
  background: #dff0e8;
  color: #2e5a40;
}

[data-theme="dark"] .prog-btn.active[data-status="unread"] {
  background: var(--parchment-deep);
  color: var(--ink-soft);
}

[data-theme="dark"] .prog-btn.active[data-status="reading"] {
  background: #3a2c0a;
  color: var(--gold-light);
}

[data-theme="dark"] .prog-btn.active[data-status="finished"] {
  background: #0e2c1c;
  color: #8acc9e;
}

/* Modal actions */
.modal-actions {
  display: flex;
  gap: 10px;
}

.btn-primary {
  flex: 1;
  text-align: center;
  background: linear-gradient(160deg, var(--burgundy-mid) 0%, var(--burgundy-deep) 100%);
  color: var(--gold-pale);
  border-radius: var(--r-pill);
  padding: 12px 16px;
  font-family: var(--font-label);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid rgba(201, 162, 39, 0.18);
  box-shadow: 0 4px 18px rgba(46, 10, 21, 0.26);
  transition: transform .15s ease, box-shadow .15s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(46, 10, 21, 0.34);
}

.btn-secondary {
  flex: 1;
  text-align: center;
  background: transparent;
  border: 1.5px solid var(--border-strong);
  color: var(--ink-soft);
  border-radius: var(--r-pill);
  padding: 12px 16px;
  font-family: var(--font-label);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: none;
  transition: background .2s, border-color .2s, color .2s;
}

.btn-secondary:hover {
  background: var(--gold-pale);
  border-color: var(--gold);
  color: var(--gold-dark);
}

/* ════════════════════════════════════════
   RESPONSIVE
════════════════════════════════════════ */
@media (max-width: 540px) {
  .page-shell {
    padding: 12px 10px 36px;
  }

  .header-pill {
    padding: 0 16px;
    height: 52px;
  }

  .logo {
    font-size: 1.15rem;
  }

  .search-section {
    padding-bottom: 14px;
  }

  .search-tagline {
    font-size: 0.85rem;
    margin-bottom: 12px;
  }

  .stats-bar {
    padding: 12px 16px;
    gap: 12px;
  }

  .stat-value {
    font-size: 1.1rem;
  }

  .books-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .modal-panel {
    border-radius: var(--r-lg);
  }

  .search-kbd {
    display: none;
  }

  .search-input {
    padding-right: 48px;
  }

  .library-banner {
    padding: 20px 16px 24px;
  }

  .banner-title {
    font-size: 1.4rem;
  }

  .stat-item--progress {
    width: 100%;
  }

  .prog-btns {
    flex-direction: column;
  }
}

@media (min-width: 900px) {
  .books-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1100px) {
  .books-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

/* ── Global scrollbar ── */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  border-radius: var(--r-pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dark);
}

/* ── Focus ring ── */
:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}