

/* Lightbox share button */
.lb-share { position: absolute; top: 16px; right: 76px; background: rgba(20,20,24,0.7); color: #fff; border: none; cursor: pointer; font-size: 22px; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: background 0.15s ease; }
.lb-share:hover { background: rgba(255,45,122,0.9); }
@media (pointer: coarse) { .lb-share { width: 52px !important; height: 52px !important; right: 84px !important; } }

/* prefers-reduced-motion - disable animations for users who request it */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Safe area insets for iPhone notch / Android punch-holes */
.site-header, .sticky-cta { padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.sticky-cta { padding-bottom: max(10px, env(safe-area-inset-bottom)); }
.lb-prev { left: max(16px, env(safe-area-inset-left)); }
.lb-next { right: max(16px, env(safe-area-inset-right)); }
.lb-close, .lb-share { top: max(16px, env(safe-area-inset-top)); }
.lb-share { right: max(76px, calc(env(safe-area-inset-right) + 60px)); }


/* Larger mobile lightbox tap zones */
@media (pointer: coarse) {
  .lb-prev, .lb-next { width: 60px !important; height: 60px !important; font-size: 28px !important; }
  .lb-close { width: 52px !important; height: 52px !important; font-size: 26px !important; }
}


/* A11y skip link */
.skip-to-main { position: absolute; left: -9999px; top: 0; background: var(--accent, #ff2d7a); color: #fff; padding: 10px 16px; text-decoration: none; font-weight: 700; z-index: 100000; }
.skip-to-main:focus { left: 8px; top: 8px; }

/* Visible focus indicators */
a:focus-visible, button:focus-visible, input:focus-visible, .tile:focus-visible { outline: 2px solid var(--accent, #ff2d7a); outline-offset: 3px; }
.chip:focus-visible { outline-offset: 1px; }


/* Stats badges row */
.stats-row { display: flex; gap: 12px; flex-wrap: wrap; padding: 0 16px 16px; max-width: 1200px; margin: 0 auto; }
.stat-badge { flex: 1; min-width: 110px; background: var(--bg-card, #1c1c22); border: 1px solid var(--border, #2a2a32); border-radius: 10px; padding: 12px 14px; text-align: center; }
.stat-badge strong { display: block; font-size: 22px; font-weight: 800; color: var(--accent, #ff2d7a); line-height: 1; margin-bottom: 4px; }
.stat-badge span { font-size: 11px; color: var(--fg-dim, #c8c8d0); letter-spacing: 0.5px; text-transform: uppercase; }
@media (max-width: 480px) { .stat-badge { min-width: 0; padding: 10px 8px; } .stat-badge strong { font-size: 18px; } .stat-badge span { font-size: 10px; } }


/* Print stylesheet - clean save-as-PDF */
@media print {
  .freebie-overlay, .sticky-cta, .lb-overlay, .lb-footer-cta, .search-bar, .search-chips, .free-teaser, .save-btn, .share-btn, .read-next, .related-section, .ad-label, .featured-book { display: none !important; }
  body { background: #fff !important; color: #000 !important; }
  .container, .static-page { max-width: 100% !important; padding: 0 !important; }
  .thumbs .tile { break-inside: avoid; page-break-inside: avoid; }
  .tile.ad { display: none !important; }
  a { color: #000 !important; text-decoration: underline; }
}


/* Read Next cross-recommendation */
.read-next { max-width: 820px; margin: 32px auto 0; padding: 0 16px; }
.read-next-label { display: inline-block; background: var(--accent, #ff2d7a); color: #fff; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; margin-bottom: 10px; }
.read-next-link { display: block; padding: 20px 22px; background: var(--bg-card, #1c1c22); border: 1px solid var(--border, #2a2a32); border-radius: 10px; text-decoration: none; color: var(--fg, #ececf0); transition: transform 0.15s ease, border-color 0.15s ease; }
.read-next-link:hover { transform: translateY(-2px); border-color: var(--accent, #ff2d7a); }
.read-next-link h3 { margin: 0 0 6px; font-size: 22px; color: var(--accent, #ff2d7a); }
.read-next-link p { margin: 0; color: var(--fg-dim, #c8c8d0); font-size: 14px; }


/* Featured book card */
.featured-book { max-width: 1200px; margin: 18px auto 8px; padding: 0 16px; }
.featured-card { display: flex; gap: 18px; background: linear-gradient(135deg, rgba(255,45,122,0.10), rgba(20,20,28,0.6)); border: 1px solid rgba(255,45,122,0.3); border-radius: 12px; padding: 18px; text-decoration: none; color: inherit; transition: transform 0.15s ease, border-color 0.15s ease; align-items: center; }
.featured-card:hover { transform: translateY(-2px); border-color: var(--accent, #ff2d7a); }
.featured-card img { width: 100px; height: auto; aspect-ratio: 2/3; object-fit: cover; border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,0.5); flex-shrink: 0; }
.featured-meta { flex: 1; min-width: 0; }
.featured-tag { display: inline-block; background: var(--accent, #ff2d7a); color: #fff; padding: 3px 9px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 8px; }
.featured-meta h2 { margin: 0 0 6px; font-size: 20px; }
.featured-meta p { margin: 0 0 10px; font-size: 13px; color: var(--fg-dim, #c8c8d0); line-height: 1.4; }
.featured-cta { color: var(--accent, #ff2d7a); font-weight: 700; font-size: 14px; }
@media (max-width: 480px) { .featured-card { padding: 12px; gap: 12px; } .featured-card img { width: 70px; } .featured-meta h2 { font-size: 16px; } }


/* Persistent lightbox CTA - moved to top to avoid overlapping next button */
.lb-footer-cta { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); z-index: 10; background: rgba(255,45,122,0.95); padding: 8px 18px; border-radius: 999px; box-shadow: 0 6px 24px rgba(255,45,122,0.45); }
.lb-footer-cta a { color: #fff; text-decoration: none; font-size: 13px; font-weight: 700; }
.lb-footer-cta:hover { background: rgba(255,77,142,1); }
@media (max-width: 600px) { .lb-footer-cta { top: 8px; padding: 6px 12px; } .lb-footer-cta a { font-size: 11px; } }

/* Bigger more prominent next/prev buttons */
.lb-prev, .lb-next { width: 56px !important; height: 56px !important; font-size: 28px !important; background: rgba(255,45,122,0.5) !important; }
.lb-prev:hover, .lb-next:hover { background: rgba(255,45,122,0.9) !important; }
@media (max-width: 600px) { .lb-prev, .lb-next { width: 48px !important; height: 48px !important; font-size: 24px !important; } }

/* Counter back to bottom-center */
.lb-counter { bottom: 24px !important; }

:root {
  --bg: #0e0e11;
  --bg-elev: #17171c;
  --bg-card: #1c1c22;
  --fg: #ececf0;
  --fg-dim: #9a9aa6;
  --accent: #b8336a;
  --border: #2a2a32;
  --grid-gap: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--fg); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--fg); text-decoration: none; }
a:hover { color: var(--accent); }

.container { max-width: 1400px; margin: 0 auto; padding: 32px 16px 80px; }
.site-header { background: #0a0a0a; line-height: 0; }
.site-header a.banner-link { display: block; text-decoration: none; }
.site-header .banner-svg { display: block; width: 100%; height: auto; max-width: 1600px; margin: 0 auto; }
.sr-only { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

.crumbs { padding: 16px; color: var(--fg-dim); font-size: 13px; }
.crumbs a { color: var(--fg-dim); }

.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.cat-card { display: block; background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; transition: transform 0.15s ease, border-color 0.15s ease; }
.cat-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.cat-card .label { padding: 12px 14px 8px; font-size: 16px; font-weight: 700; letter-spacing: 0.5px; color: var(--fg); text-transform: uppercase; background: var(--bg-card); }
.cat-card .cover { aspect-ratio: 4/5; background-size: cover; background-position: center; background-color: var(--bg-elev); }
.cat-card .meta { padding: 8px 14px 12px; }
.cat-card .meta .count { display: inline-block; margin: 0; padding: 2px 8px; background: var(--bg-elev); border-radius: 999px; color: var(--fg-dim); font-size: 11px; letter-spacing: 0.5px; }
.cat-card:hover .label { color: var(--accent); }

.gallery-head { padding: 0 16px 24px; }
.gallery-head h1, .gallery-head h2 { margin: 0 0 6px; font-size: 28px; font-weight: 600; }
.gallery-head .subline { color: var(--fg-dim); font-size: 14px; margin-bottom: 14px; }
.gallery-head .intro { color: var(--fg); font-size: 15px; line-height: 1.55; max-width: 820px; margin: 0; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--grid-gap); }
.thumbs .tile { position: relative; aspect-ratio: 3/4; overflow: hidden; background: var(--bg-card); cursor: pointer; }
.thumbs .tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.25s ease; }
.thumbs .tile:hover img { transform: scale(1.04); }
.thumbs .tile.ad { background: linear-gradient(180deg, var(--bg-elev), var(--bg-card)); border: 1px solid var(--border); }
.thumbs .tile.ad .ad-inner { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px; text-align: center; }
.thumbs .tile.ad img.ad-cover { width: 80%; height: auto; aspect-ratio: 2/3; object-fit: cover; border: 1px solid var(--border); box-shadow: 0 4px 18px rgba(0,0,0,0.5); }
.thumbs .tile.ad .ad-label { position: absolute; top: 8px; left: 8px; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--fg-dim); background: rgba(0,0,0,0.4); padding: 2px 6px; border-radius: 3px; }
.thumbs .tile.ad .ad-cta { margin-top: 10px; font-size: 12px; color: var(--fg); background: var(--accent); padding: 6px 12px; border-radius: 4px; }

.site-foot { padding: 40px 16px 60px; text-align: center; color: var(--fg-dim); font-size: 12px; border-top: 1px solid var(--border); margin-top: 60px; }
.site-foot a { color: var(--fg-dim); }
.site-foot a:hover { color: var(--accent); }
.site-foot .nav-links { margin-top: 8px; }
.site-foot .nav-links a { margin: 0 6px; }

@media (max-width: 600px) {
  .thumbs { grid-template-columns: repeat(2, 1fr); }
  .container { padding: 16px 8px 60px; }
  .site-header h1 { font-size: 22px; }
}

/* Hero + featured category cards (landing page) */
.hero-row { margin-bottom: 16px; }
.cat-card.hero { display: block; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; transition: transform 0.15s ease, border-color 0.15s ease; }
.cat-card.hero:hover { transform: translateY(-2px); border-color: var(--accent); }
.cat-card.hero .cover { aspect-ratio: 16/7; background-size: cover; background-position: center; background-color: var(--bg-elev); }
.cat-card.hero .meta { padding: 22px 24px 26px; }
.cat-card.hero .meta h2 { margin: 0 0 8px; font-size: 26px; font-weight: 700; }
.cat-card.hero .meta p { margin: 0; color: var(--fg-dim); font-size: 15px; line-height: 1.5; }
.cat-card.hero .meta .count { display: inline-block; margin-top: 12px; padding: 4px 12px; background: var(--accent); color: #fff; border-radius: 999px; font-size: 12px; letter-spacing: 0.5px; font-weight: 500; }

.featured-row { margin-bottom: 28px; }
.cat-card.featured { display: block; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; overflow: hidden; transition: transform 0.15s ease, border-color 0.15s ease; }
.cat-card.featured:hover { transform: translateY(-2px); border-color: var(--accent); }
.cat-card.featured .cover { aspect-ratio: 16/6; background-size: cover; background-position: center; background-color: var(--bg-elev); }
.cat-card.featured .meta { padding: 18px 22px 20px; }
.cat-card.featured .meta h2 { margin: 0 0 6px; font-size: 22px; font-weight: 600; }
.cat-card.featured .meta p { margin: 0; color: var(--fg-dim); font-size: 14px; }
.cat-card.featured .meta .count { display: inline-block; margin-top: 10px; padding: 3px 10px; background: var(--bg-elev); color: var(--fg-dim); border-radius: 999px; font-size: 11px; letter-spacing: 0.5px; }

@media (max-width: 600px) {
  .cat-card.hero .cover { aspect-ratio: 4/3; }
  .cat-card.hero .meta h2 { font-size: 22px; }
  .cat-card.featured .cover { aspect-ratio: 4/3; }
  .cat-card.featured .meta h2 { font-size: 19px; }
}

/* Books section (home page) */
.books-section { margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--border); }
.books-section .books-head { margin-bottom: 8px; padding: 0 4px; }
.books-section .books-head h2 { margin: 0 0 4px; font-size: 22px; font-weight: 600; }
.books-section .books-head .sub { color: var(--fg-dim); font-size: 13px; }
.book-row { margin-top: 24px; padding: 0 4px; }
.book-row h3 { margin: 0 0 10px; font-size: 14px; font-weight: 600; color: var(--fg); letter-spacing: 0.5px; text-transform: uppercase; opacity: 0.85; }
.book-row .row-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.book-row .row-scroll::-webkit-scrollbar { height: 6px; }
.book-row .row-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.book-row a.book-tile { flex: 0 0 auto; width: 110px; text-align: center; }
.book-row a.book-tile img { width: 110px; aspect-ratio: 2/3; object-fit: cover; border-radius: 4px; border: 1px solid var(--border); transition: transform 0.15s ease, border-color 0.15s ease; }
.book-row a.book-tile:hover img { transform: translateY(-2px); border-color: var(--accent); }
.book-row a.book-tile .title { display: block; margin-top: 6px; font-size: 11px; color: var(--fg-dim); line-height: 1.3; }
.book-row a.book-tile:hover .title { color: var(--fg); }
@media (max-width: 600px) {
  .book-row a.book-tile { width: 90px; }
  .book-row a.book-tile img { width: 90px; }
  .books-section { margin-top: 48px; }
}


.freebie-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.85); display: none; align-items: center; justify-content: center; z-index: 9999; padding: 20px; }
.freebie-overlay.show { display: flex; }
.freebie-card { background: #15151a; border: 2px solid #ff2d7a; border-radius: 12px; max-width: 480px; width: 100%; padding: 32px 28px; text-align: center; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
.freebie-close { position: absolute; top: 10px; right: 14px; background: none; border: none; color: #888; font-size: 28px; line-height: 1; cursor: pointer; padding: 4px 8px; }
.freebie-close:hover { color: #fff; }
.freebie-tag { display: inline-block; background: #ff2d7a; color: #fff; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 14px; }
.freebie-card h2 { margin: 0 0 10px; font-size: 26px; font-weight: 800; color: #fff; line-height: 1.2; }
.freebie-card p { margin: 0 0 22px; color: #c8c8d0; font-size: 15px; line-height: 1.5; }
.freebie-btn { display: inline-block; background: #ff2d7a; color: #fff; padding: 14px 28px; border-radius: 8px; text-decoration: none; font-size: 16px; font-weight: 700; letter-spacing: 0.5px; transition: transform 0.15s ease, background 0.15s ease; }
.freebie-btn:hover { background: #ff4d8e; transform: translateY(-1px); }
.freebie-sub { display: block; margin-top: 14px; color: #888; font-size: 12px; }
@media (max-width: 480px) { .freebie-card { padding: 26px 20px; } .freebie-card h2 { font-size: 22px; } }
