/* ==========================================================================
   Halaman pustaka — gaya "ComicVerse".
   Semua aturan dilingkupi .cv-page agar halaman lain tidak terpengaruh.
   ========================================================================== */

body.cv-page {
  --cv-gold: #f2b544;
  --cv-bg: #10141d;
  --cv-panel: #141a24;
  --cv-card: #242c39;
  --cv-line: #303947;
  --cv-text: #f4ebd8;
  --cv-muted: #8995a4;
  background: var(--cv-bg);
}

body.cv-page .topbar {
  background: rgba(20, 26, 36, .94);
  border-bottom-color: var(--cv-line);
}

body.cv-page .brand { color: var(--cv-gold); }
body.cv-page .nav a { color: #bfc6cf; }
body.cv-page .nav a:hover { color: var(--cv-gold); }

/* kontainer utama sudah diatur oleh `main` di style.css */

/* ------------------------------------------------------- utilitas (a11y) */
/* Sembunyikan secara visual, tetap terbaca pembaca layar / mesin pencari. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------------------------------------------------------------- hero */
.cv-hero {
  min-height: 320px;
  border-radius: 20px;
  padding: clamp(24px, 4vw, 55px);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background-color: #18212d;
  /* Gambar banner tanpa lapisan gelap (tanpa shadow). Cadangan JPEG, lalu
     WebP (lebih ringan) untuk peramban modern. */
  background-image: url('/static/hero-banner.jpg');
  background-image: image-set(url('/static/hero-banner.webp') type('image/webp'), url('/static/hero-banner.jpg') type('image/jpeg'));
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.cv-hero::after {
  content: 'COMICS';
  position: absolute;
  right: -10px;
  top: 34px;
  font-size: clamp(90px, 17vw, 260px);
  font-weight: 900;
  color: #ffffff0c;
  transform: rotate(-12deg);
  pointer-events: none;
}

.cv-hero-content { position: relative; z-index: 1; max-width: 620px; }

.cv-eyebrow {
  color: var(--cv-gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.cv-hero h1 {
  font-size: clamp(30px, 4.6vw, 56px);
  line-height: 1.07;
  letter-spacing: -1.8px;
  margin: 14px 0;
  color: #fff;
}

.cv-hero p { color: #b8c0ca; line-height: 1.65; margin: 0; }

.cv-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.cv-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  border-radius: 10px;
  padding: 11px 16px;
  background: var(--cv-gold);
  color: #171a20;
  font-weight: 750;
  font-size: 14.5px;
  text-decoration: none;
}

.cv-btn:hover { text-decoration: none; filter: brightness(1.08); }
.cv-btn.secondary { background: #29313e; color: #fff; }
.cv-btn.secondary:hover { filter: brightness(1.2); }

/* Bayangan halus pada teks tombol — hanya di dalam hero (di atas gambar),
   agar tulisan tetap tegas tanpa perlu lapisan gelap pada banner. */
.cv-hero .cv-btn {
  text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
}

/* --------------------------------------------------------------- chips */
.cv-chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 24px 0 6px;
  scrollbar-width: thin;
}

.cv-chip {
  background: var(--cv-card);
  color: #d7dce5;
  white-space: nowrap;
  border: 1px solid #374253;
  border-radius: 10px;
  padding: 9px 15px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.cv-chip.active {
  background: var(--cv-gold);
  border-color: var(--cv-gold);
  color: #10141d;
}

/* ------------------------------------------------------------ sections */
.cv-section { margin-top: 32px; }

.cv-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.cv-section-title h2 { font-size: 22px; margin: 0; color: #fff; }
.cv-section-title small { color: var(--cv-gold); }

.cv-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

/* --------------------------------------------------------------- kartu */
.cv-comic { display: block; color: var(--cv-text); text-decoration: none; }
.cv-comic:hover { text-decoration: none; }

.cv-cover {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #ffffff19;
  background: linear-gradient(145deg, #375e67, #181f36);
}

.cv-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}

.cv-comic:hover .cv-cover img { transform: scale(1.045); }

.cv-tag {
  position: absolute;
  left: 10px;
  top: 10px;
  font-size: 10px;
  font-weight: 600;
  background: #10141ddd;
  border-radius: 5px;
  padding: 5px 8px;
  color: var(--cv-text);
}

.cv-resume {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  font-size: 11px;
  background: #10141ddd;
  border-radius: 5px;
  padding: 5px 8px;
  color: var(--cv-gold);
}

.cv-comic h3 { font-size: 15px; margin: 10px 0 3px; color: #fff; }
.cv-meta { color: var(--cv-muted); font-size: 12px; }

/* badge rating di atas sampul */
.cv-rate {
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 11px;
  font-weight: 700;
  background: #10141ddd;
  border-radius: 5px;
  padding: 4px 8px;
  color: var(--cv-gold);
}

/* ------------------------------------------------------- pilihan editor */
.cv-feature {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.cv-feature-card {
  display: flex;
  gap: 18px;
  background: var(--cv-card);
  border: 1px solid #374253;
  border-radius: 16px;
  padding: 16px;
  text-decoration: none;
  color: var(--cv-text);
}

.cv-feature-card:hover { text-decoration: none; border-color: var(--cv-gold); }

.cv-feature-cover {
  flex: 0 0 120px;
  aspect-ratio: 3 / 4;
  border-radius: 10px;
  overflow: hidden;
  background: linear-gradient(145deg, #375e67, #181f36);
}

.cv-feature-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cv-feature-body { min-width: 0; }
.cv-feature-body h3 { margin: 8px 0 4px; color: #fff; font-size: 19px; }
.cv-tag.inline { position: static; display: inline-block; }

.cv-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; }
.cv-tags span {
  font-size: 11px;
  background: #2c3543;
  color: #cfd6e0;
  border-radius: 999px;
  padding: 3px 9px;
}

.cv-desc { color: #aab3bf; font-size: 13px; line-height: 1.55; margin: 10px 0 12px; }

/* ----------------------------------------------------------- filter bar */
.cv-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin: 0 0 14px;
}

.cv-filter label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--cv-muted);
}

.cv-filter select {
  background: var(--cv-card);
  color: var(--cv-text);
  border: 1px solid #374253;
  border-radius: 9px;
  padding: 9px 11px;
  font-size: 13.5px;
  min-width: 130px;
}

.cv-sortbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  margin: 0 0 16px;
}

.cv-sort {
  font-size: 12.5px;
  color: #cfd6e0;
  background: #242c39;
  border: 1px solid #374253;
  border-radius: 999px;
  padding: 6px 12px;
  text-decoration: none;
}

.cv-sort:hover { text-decoration: none; color: var(--cv-gold); }
.cv-sort.active { background: var(--cv-gold); border-color: var(--cv-gold); color: #10141d; font-weight: 700; }

/* -------------------------------------------------------------- banner */
.cv-banner {
  margin: 38px 0 4px;
  background: var(--cv-card);
  border: 1px solid #3b3d40;
  padding: 25px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.cv-banner h2 { margin: 0 0 6px; color: #fff; font-size: 21px; }
.cv-banner p { margin: 0; color: #b8c0ca; line-height: 1.6; }

/* ------------------------------------------------------- pencarian/kosong */
body.cv-page .cv-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

body.cv-page .cv-note h1 { font-size: 22px; margin: 0; color: #fff; }

.cv-hidden { display: none !important; }

/* ------------------------------------------------------------- responsif */
@media (max-width: 1000px) {
  .cv-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 800px) {
  .cv-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
  .cv-hero {
    min-height: 280px;
    /* Layar sempit: pakai gambar versi lebih kecil (hemat kuota), tanpa overlay. */
    background-image: url('/static/hero-banner.jpg');
    background-image: image-set(url('/static/hero-banner-sm.webp') type('image/webp'), url('/static/hero-banner.jpg') type('image/jpeg'));
    background-position: center;
    background-size: cover;
  }
  .cv-banner { flex-direction: column; align-items: flex-start; }
  .cv-feature { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .cv-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cv-hero { padding: 24px; min-height: 260px; }
  .cv-hero h1 { letter-spacing: -1px; }
  .cv-feature-card { flex-direction: column; }
  .cv-feature-cover { flex: 0 0 auto; width: 140px; }
  .cv-filter label, .cv-filter select { width: 100%; }
}
