﻿:root {
  --bg: #f4f7fb;
  --surface: #ffffff;
  --line: #dbe6f3;
  --ink: #132c4b;
  --muted: #5f7593;
  --brand-700: #173a63;
  --brand-600: #1f4a7d;
  --brand-500: #2f6aa8;
  --accent: #2aa06a;
  --shadow: 0 12px 30px rgba(19, 44, 75, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0 !important; padding: 0 !important; min-height: 100%; }
header { margin: 0; padding: 0; }
body {
  font-family: "Plus Jakarta Sans", "Inter", Arial, sans-serif;
  background: radial-gradient(circle at 10% 0%, #f7fbff 0%, var(--bg) 38%, #f3f6fb 100%);
  color: var(--ink);
  min-height: 100vh;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

.container {
  width: min(1140px, calc(100% - 32px));
  margin: 0 auto;
}

.pub-top {
  position: relative;
  background: #ffffff;
  border-bottom: 1px solid #e3e8ef;
  margin-top: 0 !important;
  top: 0;
}

.pub-wrap {
  height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pub-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #1f1f1f;
  font-weight: 700;
  letter-spacing: 0;
}

.pub-logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  background: #1a73e8;
  box-shadow: none;
}

.pub-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pub-nav a {
  text-decoration: none;
  color: #3c4043;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 10px;
  border-radius: 8px;
  transition: .2s ease;
}

.pub-nav a:hover { background: #f1f3f4; color: #202124; }
.pub-nav a.active { background: #e8f0fe; color: #1a73e8; }

.page-shell { padding: 20px 0 40px; }
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.hero-center {
  min-height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  text-align: center;
  gap: 16px;
  padding-top: 64px;
  padding-bottom: 24px;
}

.home-main {
  height: calc(100vh - 70px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.home-hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding-top: 0;
}

.home-hero .hero-center {
  min-height: 0;
  width: min(980px, 100%);
  padding: 0;
  justify-content: center;
}

.home-cards {
  width: min(980px, 100%);
  margin: 0 auto;
  margin-top: 0;
  padding: 0 0 18px;
}

.hero-title {
  margin: 0;
  font-size: clamp(38px, 6vw, 70px);
  line-height: 1.05;
  letter-spacing: -0.8px;
  color: #102946;
}

.hero-sub {
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 18px;
}

.search-row {
  width: min(900px, 100%);
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.search-input {
  flex: 1;
  height: 54px;
  border: 1px solid #c8d8eb;
  border-radius: 999px;
  padding: 0 20px;
  font-size: 16px;
  outline: none;
  transition: .2s;
}

.search-input:focus {
  border-color: var(--brand-500);
  box-shadow: 0 0 0 4px rgba(47, 106, 168, 0.12);
}

.btn-main {
  border: 0;
  height: 54px;
  border-radius: 999px;
  padding: 0 26px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(135deg, var(--brand-700), var(--brand-500));
  cursor: pointer;
}

.section-title { margin: 0 0 14px; font-size: 28px; color: #102946; letter-spacing: -0.3px; }

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

.book-card {
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  transition: .2s ease;
}

.book-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.book-cover {
  height: 150px;
  background: linear-gradient(140deg, #173a63, #2f6aa8);
  background-size: cover;
  background-position: center;
}
.book-body { padding: 12px; }
.book-title { margin: 0 0 5px; font-size: 14px; font-weight: 800; line-height: 1.35; }
.book-meta { font-size: 12px; color: var(--muted); }
.badge {
  display: inline-flex;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
}
.badge-ebook { background: #e6f6ee; color: #1f7a4d; }
.badge-fisik { background: #eaf1ff; color: #345d98; }

.list-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.list-grid .book-card { height: 100%; display: flex; flex-direction: column; }
.list-grid .book-body { flex: 1; }

.catalog-shell { display: flex; flex-direction: column; gap: 14px; }
.catalog-search-panel { padding: 14px; }
.catalog-search-row {
  width: 100%;
  margin-top: 0;
}
.catalog-topbar-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.filter-modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 100;
}
.filter-modal.is-open {
  display: block;
}
.filter-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 33, 54, 0.46);
}
.filter-modal-dialog {
  position: relative;
  width: min(920px, calc(100% - 24px));
  margin: 72px auto 0;
  padding: 14px;
}
.filter-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 10px;
}
.filter-close-btn {
  border: 1px solid #c9d9ec;
  background: #ffffff;
  color: #365a8c;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  line-height: 1;
  font-size: 20px;
  cursor: pointer;
}
.catalog-filter-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}
.filter-group {
  border: 1px solid #d6e3f2;
  border-radius: 12px;
  padding: 10px 11px;
  background: #f9fcff;
}
.filter-title {
  font-size: 12px;
  font-weight: 800;
  color: #244b7d;
  margin-bottom: 8px;
}
.filter-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #2d4769;
  margin-bottom: 7px;
}
.filter-check:last-child { margin-bottom: 0; }
.filter-category-group { grid-column: span 2; }
.filter-category-list {
  columns: 2;
  column-gap: 16px;
}
.filter-category-list .filter-check {
  break-inside: avoid;
}
.filter-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.btn-filter {
  height: 42px;
  border-radius: 12px;
  padding: 0 16px;
  font-size: 13px;
}
.filter-reset-link {
  font-size: 13px;
  font-weight: 700;
  color: #2f5b92;
  text-decoration: none;
}
.catalog-meta {
  color: #4f6584;
  font-weight: 600;
  font-size: 13px;
}
.catalog-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.view-toggle-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #c9d9ec;
  background: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #264d80;
  text-decoration: none;
}
.view-toggle-btn:hover {
  border-color: #2f6aa8;
  background: #edf4ff;
}
.view-toggle-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}
.catalog-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.catalog-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.catalog-row {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 14px;
  align-items: center;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  padding: 10px 12px;
  transition: .18s ease;
}
.catalog-row:hover {
  border-color: #bfd5ec;
  box-shadow: 0 10px 22px rgba(19, 44, 75, 0.08);
}
.catalog-row-cover {
  height: 104px;
  border-radius: 10px;
  background: linear-gradient(140deg, #173a63, #2f6aa8);
  background-size: cover;
  background-position: center;
}
.catalog-row-main { min-width: 0; }
.catalog-row-title {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.25;
  color: #0f2d4f;
}
.catalog-row-sub {
  font-size: 13px;
  color: #5f7593;
  line-height: 1.45;
}
.catalog-row-right {
  display: flex;
  align-items: center;
}
.catalog-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pg-link {
  text-decoration: none;
  border: 1px solid #c9d9ec;
  color: #264d80;
  background: #ffffff;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
}
.pg-link.active {
  color: #ffffff;
  border-color: #2f6aa8;
  background: #2f6aa8;
}

.detail-panel { overflow: hidden; }
.detail-hero {
  height: 210px;
  background-size: cover;
  background-position: center;
}
.detail-body { padding: 18px; }
.detail-main-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 18px;
}
.detail-cover {
  height: 240px;
  border-radius: 12px;
}
.detail-cover-btn {
  border: 0;
  cursor: zoom-in;
}
.detail-sinopsis {
  margin-top: 14px;
  border: 1px solid #dbe6f3;
  border-radius: 12px;
  background: #f9fcff;
  padding: 10px 12px;
}
.detail-sinopsis p {
  margin: 0;
  color: #436287;
  font-size: 14px;
  line-height: 1.7;
}
.related-wrap {
  margin-top: 18px;
}
.related-carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(170px, 170px);
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.related-card {
  text-decoration: none;
  color: inherit;
  border: 1px solid #dbe6f3;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
.related-cover {
  height: 130px;
  background-size: cover;
  background-position: center;
}
.related-body { padding: 9px; }
.related-title {
  margin: 0 0 4px;
  color: #163659;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.35;
}

.cover-modal {
  position: fixed;
  inset: 0;
  z-index: 140;
  display: none;
}
.cover-modal.is-open { display: block; }
.cover-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 23, 38, 0.72);
}
.cover-modal-dialog {
  position: relative;
  width: min(760px, calc(100% - 24px));
  margin: 40px auto 0;
  display: flex;
  justify-content: center;
}
.cover-modal-image {
  width: auto;
  max-width: 100%;
  max-height: calc(100vh - 90px);
  border-radius: 12px;
  border: 1px solid #d6e3f2;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.34);
  background: #fff;
}
.cover-modal-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 32px;
  height: 32px;
  border: 1px solid #c9d9ec;
  border-radius: 999px;
  background: #fff;
  color: #284d7f;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.reader-wrap { margin-top: 18px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.reader-head { padding: 10px 12px; background: #f1f6ff; font-weight: 800; font-size: 13px; color: #29466f; border-bottom: 1px solid var(--line); }
.reader-frame { width: 100%; height: 560px; border: 0; }

.meta-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0 14px; }
.meta-chip { padding: 6px 10px; border-radius: 999px; background: #edf3ff; color: #365d96; font-weight: 700; font-size: 12px; }

@media (max-width: 1024px) {
  .book-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .pub-brand { font-size: 15px; }
  .pub-nav a { font-size: 12px; padding: 7px 9px; }
  .hero-sub { font-size: 15px; }
  .search-row { flex-direction: column; }
  .btn-main { width: 100%; }
  .book-grid, .list-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home-main {
    height: auto;
    min-height: calc(100vh - 70px);
    overflow: visible;
    padding: 0 0 18px;
  }
  .home-hero {
    min-height: auto;
    padding-top: 34px;
  }
  .home-cards {
    margin-top: 20px;
    padding-bottom: 8px;
  }
  .page-shell { padding: 14px 0 28px; }
  .catalog-search-panel { padding: 10px; }
  .filter-modal-dialog {
    width: calc(100% - 16px);
    margin-top: 18px;
    padding: 10px;
  }
  .catalog-filter-form {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .filter-category-group { grid-column: auto; }
  .filter-category-list { columns: 1; }
  .catalog-list { gap: 10px; }
  .catalog-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-main-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .detail-cover {
    width: 180px;
  }
  .detail-hero { height: 170px; }
  .cover-modal-dialog {
    width: calc(100% - 16px);
    margin-top: 22px;
  }
  .catalog-row {
    grid-template-columns: 70px 1fr;
    gap: 10px;
    padding: 9px;
  }
  .catalog-row-cover { height: 90px; }
  .catalog-row-title { font-size: 16px; margin-bottom: 4px; }
  .catalog-row-sub { font-size: 12px; }
  .catalog-row-right {
    grid-column: 2;
    justify-content: flex-start;
  }
}
@media (max-width: 520px) {
  .book-grid, .list-grid { grid-template-columns: 1fr; }
  .catalog-card-grid { grid-template-columns: 1fr; }
}
