/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --border: #e5e7eb;
  --muted: #6b7280;
  --text: #111827;
  --accent: #2563eb;
  --accent-light: #eff6ff;
  --green: #16a34a;
  --green-light: #dcfce7;
  --purple: #7c3aed;
  --purple-light: #ede9fe;
  --orange: #ea580c;
  --orange-light: #fff7ed;
  --radius: 12px;
  --shadow: 0 1px 4px rgba(0,0,0,.07);
}

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

body {
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

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

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* ── Navbar ────────────────────────────────────────────────── */
.navbar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar-inner {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 1.25rem;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: .5rem;
}

.navbar-title {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.nav-link {
  font-size: .9rem;
  color: var(--muted);
  padding: .4rem .75rem;
  border-radius: 8px;
  transition: background .15s;
}
.nav-link:hover { background: var(--bg); color: var(--text); }

.btn-primary {
  background: #111827;
  color: #fff;
  font-size: .875rem;
  font-weight: 500;
  padding: .45rem 1rem;
  border-radius: 8px;
  transition: background .15s;
}
.btn-primary:hover { background: #374151; }

/* ── Hero ──────────────────────────────────────────────────── */
.hero {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 2.5rem 0 2rem;
}

.hero-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .5rem;
}

.hero-sub {
  color: var(--muted);
  max-width: 620px;
  margin-bottom: 1.5rem;
  font-size: .975rem;
}

/* Search */
.search-wrap {
  position: relative;
  max-width: 560px;
  margin-bottom: 1.25rem;
}

.search-icon {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--muted);
  pointer-events: none;
}

#search {
  width: 100%;
  padding: .65rem 1rem .65rem 2.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .95rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
#search:focus {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
  background: #fff;
}

/* Hero badges */
.hero-badges {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}

.hero-badge {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .875rem;
  color: var(--muted);
}

.dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}

.badge-pill {
  background: #111827;
  color: #fff;
  font-size: .8rem;
  font-weight: 500;
  padding: .3rem .75rem;
  border-radius: 999px;
}

/* ── Filters bar ───────────────────────────────────────────── */
.filters-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: .75rem 0;
  position: sticky;
  top: 60px;
  z-index: 90;
}

.filters-inner {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}

.filter-group {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.filter-btn {
  padding: .35rem .9rem;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-size: .85rem;
  font-weight: 500;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
}
.filter-btn:hover { border-color: #9ca3af; }
.filter-btn.active {
  background: #111827;
  color: #fff;
  border-color: #111827;
}

/* ── Sections ──────────────────────────────────────────────── */
.section-block {
  padding: 2rem 0;
}
.section-block--alt {
  background: #fff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .5rem;
  margin-bottom: .25rem;
}

.section-icon { font-size: 1.1rem; }

.section-sub {
  font-size: .875rem;
  color: var(--muted);
}

.live-badge {
  flex-shrink: 0;
  background: var(--green-light);
  color: var(--green);
  font-size: .75rem;
  font-weight: 600;
  padding: .25rem .65rem;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: .35rem;
}
.live-badge::before {
  content: '';
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: .3; }
}

/* ── Books grid ────────────────────────────────────────────── */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.classics-grid {
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
}

/* ── Book card ─────────────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: row;
  gap: 0;
  overflow: hidden;
  transition: box-shadow .15s;
}
.card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }

.card--classic {
  border-left: 3px solid #f59e0b;
}

/* Cover */
.card-cover {
  width: 80px;
  min-width: 80px;
  object-fit: cover;
  background: var(--bg);
  display: block;
}

.card-cover--placeholder {
  width: 80px;
  min-width: 80px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
  font-size: 1.5rem;
  font-weight: 700;
  color: #6366f1;
  text-transform: uppercase;
}

.card-body {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
  flex: 1;
  min-width: 0;
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
}

.book-title {
  font-weight: 700;
  font-size: .95rem;
  color: var(--text);
  line-height: 1.3;
}

.type-badge {
  flex-shrink: 0;
  font-size: .7rem;
  font-weight: 600;
  padding: .18rem .5rem;
  border-radius: 6px;
  white-space: nowrap;
}
.type-badge.classic  { background: #fef3c7; color: #b45309; }
.type-badge.nouveauté { background: var(--green-light); color: var(--green); }

.book-author {
  font-size: .82rem;
  color: var(--muted);
}

.book-desc {
  font-size: .875rem;
  color: #374151;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags {
  display: flex;
  gap: .4rem;
  flex-wrap: wrap;
}

.tag {
  background: var(--accent-light);
  color: var(--accent);
  font-size: .72rem;
  font-weight: 500;
  padding: .18rem .5rem;
  border-radius: 999px;
}

.card-footer {
  margin-top: .25rem;
}

.card-link {
  font-size: .825rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .25rem;
}
.card-link:hover { text-decoration: underline; }

/* ── Spinner ───────────────────────────────────────────────── */
.spinner-wrap {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  padding: 3rem 1rem;
  color: var(--muted);
  font-size: .9rem;
}

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Empty state ───────────────────────────────────────────── */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

/* ── Footer ────────────────────────────────────────────────── */
.site-footer {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .82rem;
  color: var(--muted);
  line-height: 1.6;
}

.footer-links {
  display: flex;
  gap: 1.25rem;
}
.footer-links a:hover { color: var(--text); }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
  .hero-title { font-size: 1.4rem; }
  .navbar-links .nav-link { display: none; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}
