:root {
  --brand-pink: #ff2f6e;
  --brand-green: #35d488;
  --header-gradient: linear-gradient(90deg, var(--brand-pink), var(--brand-green));
  --page-bg: #0d0d12;
  --surface: #17171f;
  --surface-2: #1e1e28;
  --text-light: #f5f5f7;
  --text-muted: #9a9aa8;
  --border: #2a2a34;
  --star: #f5b400;
}

* { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: -apple-system, "Helvetica Neue", Arial, sans-serif;
  background: var(--page-bg);
  color: var(--text-light);
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* Header */
.site-header {
  background: var(--header-gradient);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}
.site-logo { display: flex; align-items: center; height: 100%; }
.logo-img { height: 68px; width: auto; display: block; }
.header-search { display: flex; align-items: center; }
.header-search input {
  background: rgba(0,0,0,0.25);
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 14px;
}
.header-search input::placeholder { color: rgba(255,255,255,0.75); }

/* Section tag label (ribbon-style) */
.section { padding: 40px 0; }
.section-tag {
  display: inline-block;
  background: var(--brand-pink);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  padding: 8px 18px;
  border-radius: 4px 4px 4px 0;
  margin-bottom: 24px;
}

/* Hero slider: Popular Series */
.hero-slider { position: relative; background: var(--surface); padding: 30px 0; }
.hero-slider-head { display: flex; align-items: center; justify-content: space-between; }
.slider-arrows { display: flex; gap: 8px; }
.slider-arrows button {
  width: 34px; height: 34px; border-radius: 50%; border: none;
  background: var(--surface-2); color: #fff; font-size: 18px; cursor: pointer;
}
.slider-arrows button:hover { background: var(--brand-pink); }
.slides { position: relative; touch-action: pan-y; user-select: none; }
.slide { display: none; gap: 30px; }
.slide.active { display: flex; }
.slide-cover { width: 260px; flex-shrink: 0; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.slide-info { padding-top: 6px; }
.slide-badges { display: flex; gap: 10px; margin-bottom: 14px; }
.badge-hot {
  background: var(--brand-pink); color: #fff;
  font-size: 11px; font-weight: 800;
  padding: 5px 10px; border-radius: 4px; letter-spacing: 0.5px;
}
.badge-views {
  border: 1px solid var(--border); color: var(--text-muted);
  font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 4px;
}
.slide-info h2 { font-size: 30px; margin: 0 0 14px; }
.slide-desc { color: #cfcfd6; line-height: 1.6; font-size: 14px; margin-bottom: 20px; max-width: 640px; }
.chap-pills { display: flex; gap: 10px; margin-bottom: 22px; }
.chap-pills a {
  background: var(--surface-2); color: #fff; font-size: 13px; font-weight: 700;
  padding: 8px 16px; border-radius: 20px;
}
.chap-pills a:hover { background: var(--brand-pink); }
.view-details-btn {
  display: inline-block; background: var(--brand-pink); color: #fff;
  font-weight: 800; padding: 12px 26px; border-radius: 6px;
}
.dots { display: flex; justify-content: center; gap: 4px; margin-top: 24px; }
.dots .dot {
  width: 22px; height: 22px; padding: 7px; cursor: pointer;
  background: var(--border) content-box; background-clip: content-box;
  border-radius: 50%; border: none;
}
.dots .dot.active { background-color: var(--brand-pink); }
.dots .dot:hover { background-color: var(--text-muted); }
.dots .dot.active:hover { background-color: var(--brand-pink); }

/* Latest updates grid */
.updates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}
.update-card { }
.update-card .thumb { display: block; aspect-ratio: 3/4; overflow: hidden; border-radius: 6px; }
.update-card .thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.update-card:hover .thumb img { transform: scale(1.04); }
.update-card .info { padding: 10px 2px; }
.update-card h3 { font-size: 14px; margin: 0 0 6px; height: 2.6em; overflow: hidden; font-weight: 700; }
.update-card .rating { font-size: 12px; color: var(--star); margin-bottom: 8px; display: flex; align-items: center; gap: 6px; }
.update-card .rating .num { color: var(--text-muted); }
.update-card .chapters { display: flex; flex-direction: column; gap: 6px; margin-bottom: 6px; }
.update-card .chapters a {
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface-2); color: #e6e6ea; font-size: 12px; font-weight: 600;
  padding: 6px 10px; border-radius: 5px;
}
.update-card .chapters a:hover { background: var(--brand-pink); color: #fff; }
.update-card .chap-date { font-size: 11px; color: var(--text-muted); }
.badge-new {
  background: var(--brand-pink); color: #fff; font-size: 9px; font-weight: 800;
  padding: 2px 6px; border-radius: 3px; letter-spacing: 0.3px;
}

/* Pagination (static preview uses <button>, real WP paginate_links() outputs <a>/<span>) */
.pagination { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 36px; flex-wrap: wrap; }
.pagination button,
.pagination a,
.pagination span.page-numbers {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 38px; height: 38px; padding: 0 12px;
  border: none; border-radius: 6px; cursor: pointer;
  background: var(--surface-2); color: var(--text-light); font-size: 13px; font-weight: 700;
}
.pagination button:hover:not(:disabled),
.pagination a:hover { background: var(--brand-pink); color: #fff; }
.pagination button.active,
.pagination span.page-numbers.current { background: var(--brand-pink); color: #fff; }
.pagination button:disabled { opacity: 0.35; cursor: not-allowed; }
.pagination span.page-numbers.dots { background: transparent; }

/* Manga detail page */
.manga-hero { background: var(--page-bg); padding: 40px 0; }
.manga-hero .breadcrumb { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.manga-hero .breadcrumb a { color: var(--text-muted); }
.manga-hero-inner { display: flex; gap: 32px; align-items: flex-start; }
.manga-hero .cover { width: 220px; flex-shrink: 0; border-radius: 8px; overflow: hidden; box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.manga-hero h1 { font-size: 30px; margin: 0 0 12px; }
.status-pill {
  display: inline-block; background: var(--surface-2); color: #f0a; color: #ffb199;
  font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 20px; margin-bottom: 18px;
}
.status-pill.completed { color: #9ec8ff; }
.read-btn {
  display: inline-block; background: var(--brand-pink); color: #fff;
  font-weight: 800; padding: 12px 24px; border-radius: 6px; margin-bottom: 24px;
}
.star-row { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; color: var(--star); font-size: 16px; }
.star-row .num { color: var(--text-muted); font-size: 14px; }
.stat-row { display: flex; gap: 40px; margin-bottom: 24px; flex-wrap: wrap; }
.stat-row .stat { font-size: 12px; color: var(--text-muted); }
.stat-row .stat strong { display: block; color: var(--text-light); font-size: 15px; margin-bottom: 4px; }
.synopsis h2 { font-size: 16px; margin-bottom: 8px; }
.synopsis p { color: #cfcfd6; line-height: 1.6; font-size: 14px; }

.manga-body { display: grid; grid-template-columns: 2fr 1fr; gap: 30px; padding: 10px 0 50px; }
.chapter-list { background: var(--surface); border-radius: 8px; overflow: hidden; }
.chapter-list h2 { padding: 0; margin: 0 0 16px; }
.chapter-list ul { list-style: none; margin: 0; padding: 0; }
.chapter-list li { display: flex; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--border); font-size: 14px; }
.chapter-list li:hover { background: var(--surface-2); }
.chapter-list li a { font-weight: 700; }
.chapter-list li a:hover { color: var(--brand-pink); }
.chapter-list .date { color: var(--text-muted); font-size: 12px; }

.sidebar h2 { margin-bottom: 16px; }
.sidebar-list { display: flex; flex-direction: column; gap: 12px; }
.sidebar-item { display: flex; gap: 12px; background: var(--surface); border-radius: 8px; padding: 10px; }
.sidebar-item img { width: 54px; height: 76px; object-fit: cover; border-radius: 4px; }
.sidebar-item .meta h4 { font-size: 13px; margin: 0 0 6px; font-weight: 700; }
.sidebar-item .meta span { font-size: 12px; color: var(--brand-pink); font-weight: 700; }

/* Chapter reader */
.reader-page { background: #0a0a0d; min-height: 100vh; }
.reader-header { text-align: center; padding: 30px 0 10px; }
.reader-header .series-pill {
  display: inline-block; background: var(--surface-2); color: #ccc; font-size: 12px;
  padding: 4px 12px; border-radius: 20px; margin-bottom: 14px;
}
.reader-header h1 { color: #fff; font-size: 22px; margin: 0 0 16px; }
.reader-nav { display: flex; justify-content: center; gap: 10px; margin-bottom: 20px; }
.reader-nav a, .reader-nav span {
  background: var(--surface-2); color: #fff; font-size: 13px; font-weight: 700;
  padding: 8px 18px; border-radius: 6px;
}
.reader-nav .list-btn { background: var(--brand-pink); }
.reader-nav .disabled { opacity: 0.3; }
.reader-pages { max-width: 800px; margin: 0 auto; }
.reader-pages img { width: 100%; }
.reader-footer-nav { text-align: center; padding: 30px 0 60px; }

/* Footer */
/* margin-top: auto pins the footer to the bottom of the viewport on short
   pages (e.g. a manga detail page with little content) instead of it
   floating mid-page; body is a flex column so this "eats" the remaining
   space. On tall pages it just sits after the content as normal. */
.site-footer { background: var(--surface); color: var(--text-muted); text-align: center; padding: 24px 0; font-size: 13px; margin-top: auto; }

@media (max-width: 720px) {
  .manga-hero-inner { flex-direction: column; align-items: center; text-align: center; }
  .stat-row { justify-content: center; }
  .manga-body { grid-template-columns: 1fr; }
  .slide { flex-direction: column; align-items: center; text-align: center; }
  .slide-cover { width: 200px; }
  .slide-desc { margin-left: auto; margin-right: auto; }
  .chap-pills { justify-content: center; }
}

/* Simple slider behavior (no framework) */
.hero-slider-js .slide { display: none; }
.hero-slider-js .slide.active { display: flex; }
