/* ===== BOOK APP — book-summaries hub redesigned as a reading app ===== */
/* Dark + gold aesthetic, real covers via Open Library. Layered on style.css. */

body.book-app {
  background: #09090b;
  color: #f3f1ea;
  --ba-bg: #09090b;
  --ba-card: #161619;
  --ba-card2: #1d1d22;
  --ba-gold: #d8ad5a;
  --ba-gold2: #f0cd83;
  --ba-text: #f3f1ea;
  --ba-dim: #9c988e;
  --ba-mute: #6a675f;
  --ba-line: rgba(255,255,255,0.07);
  --ba-red: #ff5c6c;
}
body.book-app::before {
  content: ''; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 80% 40% at 50% -5%, rgba(216,173,90,0.10), transparent 60%);
}

/* keep shared nav; recolour brand accent */
body.book-app .nav { background: rgba(9,9,11,0.82); }

.ba { position: relative; z-index: 1; max-width: 1040px; margin: 0 auto; padding: 14px 18px 120px; }

/* ---- search header ---- */
.ba-searchbar { display: flex; gap: 12px; align-items: center; margin: 6px 0 20px; }
.ba-search { flex: 1; display: flex; align-items: center; gap: 10px; background: var(--ba-card);
  border: 1px solid var(--ba-line); border-radius: 14px; padding: 12px 16px; }
.ba-search svg { width: 18px; height: 18px; color: var(--ba-mute); flex: none; }
.ba-search input { flex: 1; background: none; border: 0; outline: none; color: var(--ba-text);
  font-family: 'Inter', sans-serif; font-size: 15px; }
.ba-search input::placeholder { color: var(--ba-mute); }
.ba-filter { flex: none; width: 46px; height: 46px; border-radius: 14px; border: 0; cursor: pointer;
  background: var(--ba-gold); color: #1a1408; display: grid; place-items: center; }
.ba-filter svg { width: 20px; height: 20px; }

/* ---- popular hero ---- */
.ba-hero { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center;
  border-radius: 20px; padding: 22px 24px; margin-bottom: 26px; text-decoration: none; overflow: hidden;
  background: linear-gradient(115deg, #2a2415 0%, #191712 55%, #141210 100%);
  border: 1px solid rgba(216,173,90,0.28); position: relative; }
.ba-hero::after { content: ''; position: absolute; right: -40px; top: -40px; width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(216,173,90,0.18), transparent 70%); pointer-events: none; }
.ba-hero-badge { display: inline-flex; align-items: center; gap: 6px; font-family: 'JetBrains Mono', monospace;
  font-size: 11px; font-weight: 700; letter-spacing: 0.05em; color: var(--ba-gold2);
  background: rgba(216,173,90,0.14); border: 1px solid rgba(216,173,90,0.3); border-radius: 999px; padding: 5px 12px; }
.ba-hero h2 { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; font-size: clamp(24px, 3.6vw, 34px);
  line-height: 1.1; color: var(--ba-gold2); margin: 14px 0 6px; }
.ba-hero .auth { font-size: 13.5px; color: var(--ba-dim); margin: 0 0 16px; }
.ba-hero-cta { display: inline-flex; align-items: center; gap: 7px; font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px; font-weight: 700; color: #1a1408; background: var(--ba-gold); border-radius: 10px; padding: 9px 16px; }
.ba-hero-covers { display: flex; align-items: flex-end; position: relative; z-index: 1; }
.ba-hero-covers img { width: 96px; height: 142px; object-fit: cover; border-radius: 8px;
  box-shadow: 0 18px 40px -14px rgba(0,0,0,0.8); }
.ba-hero-covers img:first-child { transform: rotate(-6deg) translateX(14px); width: 84px; height: 126px; opacity: 0.85; }

/* ---- genre tabs ---- */
.ba-genres { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 20px;
  scrollbar-width: none; }
.ba-genres::-webkit-scrollbar { display: none; }
.ba-genre { flex: none; font-family: 'Inter', sans-serif; font-size: 13.5px; font-weight: 500; cursor: pointer;
  color: var(--ba-dim); background: none; border: 0; padding: 7px 4px; position: relative; white-space: nowrap; }
.ba-genre.on { color: var(--ba-gold2); font-weight: 700; }
.ba-genre.on::after { content: ''; position: absolute; left: 4px; right: 4px; bottom: 0; height: 2px;
  background: var(--ba-gold); border-radius: 2px; }

/* ---- section head ---- */
.ba-h { display: flex; align-items: baseline; justify-content: space-between; margin: 28px 0 16px; }
.ba-h h3 { font-size: 18px; font-weight: 800; letter-spacing: -0.01em; margin: 0; }
.ba-h a { font-size: 12.5px; color: var(--ba-gold); font-family: 'JetBrains Mono', monospace; }

/* ---- grid ---- */
.ba-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px 16px; }
.ba-card { text-decoration: none; color: inherit; display: flex; flex-direction: column; }
.ba-card.hide { display: none; }
.ba-cover { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden;
  background: linear-gradient(150deg, #23201a, #14130f); border: 1px solid var(--ba-line); }
.ba-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s; }
.ba-card:hover .ba-cover img { transform: scale(1.05); }
.ba-fallback { position: absolute; inset: 0; display: none; align-items: center; justify-content: center;
  text-align: center; padding: 16px; font-family: 'Cormorant Garamond', Georgia, serif; font-size: 17px;
  font-weight: 600; color: var(--ba-gold2); background: linear-gradient(150deg, #2a2416, #16130d); line-height: 1.25; }
.ba-cover.noimg .ba-fallback { display: flex; }
.ba-readnow { position: absolute; top: 9px; left: 9px; font-family: 'JetBrains Mono', monospace;
  font-size: 8.5px; font-weight: 700; letter-spacing: 0.08em; color: #fff; background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px); border-radius: 6px; padding: 4px 7px; }
.ba-rate { position: absolute; top: 9px; left: 9px; display: none; }
.ba-heart { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%;
  border: 0; cursor: pointer; background: rgba(0,0,0,0.5); backdrop-filter: blur(4px); color: #fff;
  display: grid; place-items: center; font-size: 14px; transition: transform 0.15s, color 0.15s; }
.ba-heart:hover { transform: scale(1.12); }
.ba-heart.on { color: var(--ba-red); }
.ba-badge-rate { position: absolute; bottom: 9px; left: 9px; display: inline-flex; align-items: center; gap: 4px;
  font-family: 'JetBrains Mono', monospace; font-size: 11px; font-weight: 700; color: #1a1408;
  background: var(--ba-gold); border-radius: 7px; padding: 3px 7px; }
.ba-meta { padding: 10px 2px 0; }
.ba-title { font-size: 13.5px; font-weight: 700; line-height: 1.3; color: var(--ba-text);
  display: flex; align-items: center; gap: 5px; }
.ba-title .crown { color: var(--ba-gold); font-size: 11px; }
.ba-author { font-size: 12px; color: var(--ba-dim); margin-top: 3px; }
.ba-empty { grid-column: 1 / -1; text-align: center; color: var(--ba-mute); font-size: 14px; padding: 30px; }

/* ---- continue reading ---- */
.ba-cont { display: grid; grid-template-columns: auto 1fr auto; gap: 15px; align-items: center;
  text-decoration: none; color: inherit; background: var(--ba-card); border: 1px solid var(--ba-line);
  border-radius: 16px; padding: 12px 16px 12px 12px; }
.ba-cont img { width: 52px; height: 74px; object-fit: cover; border-radius: 8px; }
.ba-cont .ct-badge { font-family: 'JetBrains Mono', monospace; font-size: 8.5px; font-weight: 700;
  letter-spacing: 0.08em; color: var(--ba-gold2); }
.ba-cont .ct-title { font-size: 14.5px; font-weight: 700; margin: 4px 0 3px; }
.ba-cont .ct-auth { font-size: 12px; color: var(--ba-dim); }
.ba-cont .ct-rate { font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 700; color: var(--ba-gold); white-space: nowrap; }

/* ---- credit ---- */
.ba-credit { text-align: center; color: var(--ba-mute); font-family: 'JetBrains Mono', monospace;
  font-size: 11px; margin-top: 40px; line-height: 1.7; }
.ba-credit a { color: var(--ba-dim); }

/* ---- bottom nav ---- */
.ba-bottom { position: fixed; left: 50%; transform: translateX(-50%); bottom: 16px; z-index: 60;
  display: flex; align-items: center; gap: 6px; background: rgba(22,22,26,0.92); backdrop-filter: blur(16px);
  border: 1px solid var(--ba-line); border-radius: 999px; padding: 8px 10px; box-shadow: 0 20px 50px -18px rgba(0,0,0,0.8); }
.ba-nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; text-decoration: none;
  color: var(--ba-mute); font-family: 'Inter', sans-serif; font-size: 9.5px; padding: 6px 14px; border-radius: 999px;
  transition: color 0.15s; }
.ba-nav-item svg { width: 20px; height: 20px; }
.ba-nav-item.on, .ba-nav-item:hover { color: var(--ba-gold2); }
.ba-nav-item.center { background: var(--ba-gold); color: #1a1408; padding: 12px; border-radius: 50%;
  margin: 0 2px; box-shadow: 0 8px 20px -6px rgba(216,173,90,0.7); }
.ba-nav-item.center span { display: none; }

@media (max-width: 480px) {
  .ba { padding: 12px 14px 110px; }
  .ba-hero { grid-template-columns: 1fr; }
  .ba-hero-covers { margin-top: 8px; }
  .ba-grid { grid-template-columns: repeat(2, 1fr); gap: 16px 12px; }
  .ba-nav-item span:not(.center span) { font-size: 9px; }
}
