/*
Theme Name: Azura Manga
Theme URI: https://example.com
Author: Custom
Description: A compact manga reader theme with series homepage and chapter image viewer.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Text Domain: azura-manga
*/

:root {
  --az-bg: #13111a;
  --az-bg-card: #1c1924;
  --az-bg-footer: #1d1b22;
  --az-purple: #913fe2;
  --az-purple-dark: #7c35c2;
  --az-purple-light: #a78bfa;
  --az-text: #ffffff;
  --az-text-muted: rgba(255, 255, 255, 0.6);
  --az-text-soft: rgba(255, 255, 255, 0.8);
  --az-border: rgba(255, 255, 255, 0.1);
  --az-max-width: 1285px;
  --az-radius: 8px;
  --az-header-height: 3.5rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--az-bg);
  color: var(--az-text);
  line-height: 1.5;
  min-height: 100vh;
}
.reader-shell{
	padding:20px 0 20px 0;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

.site {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: var(--az-max-width);
  margin: 0 auto;
  padding: 0 12px;
}

/* Header */
.site-header {
  position: relative;
  z-index: 50;
  height: var(--az-header-height);
  background: var(--az-purple);
  font-weight: 500;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--az-max-width);
  margin: 0 auto;
  padding: 0 12px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-brand__logo {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.2);
}

.site-nav {
  display: none;
  align-items: center;
  gap: 4px;
}

.site-nav a {
  padding: 8px 12px;
  border-radius: 6px;
  color: rgba(255, 255, 255, 0.9);
  transition: background 0.2s, color 0.2s;
}

.site-nav a:hover,
.site-nav a.is-active {
  background: rgba(0, 0, 0, 0.25);
  color: #fff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-form {
  display: none;
  align-items: center;
  gap: 8px;
  width: 260px;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--az-radius);
  background: var(--az-bg-card);
  border: 1px solid rgba(0, 0, 0, 0.5);
}

.search-form input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #fff;
}

.search-form input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.menu-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}

.menu-toggle:hover {
  background: rgba(0, 0, 0, 0.2);
}

.mobile-nav {
  display: none;
  padding: 12px;
  background: var(--az-bg-card);
  border-top: 1px solid var(--az-border);
}

.mobile-nav.is-open {
  display: block;
}

.mobile-nav a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
}

.mobile-nav a:hover {
  background: rgba(255, 255, 255, 0.08);
}

/* Series hero background */
.series-hero-bg {
  display: none;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 450px;
  overflow: hidden;
  z-index: 0;
}

.series-hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(6px);
  transform: scale(1.1);
}

.series-hero-bg__overlay,
.series-hero-bg__gradient {
  position: absolute;
  inset: 0;
}

.series-hero-bg__overlay {
  background: rgba(0, 0, 0, 0.5);
}

.series-hero-bg__gradient {
  background: linear-gradient(to bottom, transparent 40%, var(--az-bg) 100%);
}

.series-mobile-cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 300px;
  padding-top: 16px;
}

.series-mobile-cover__bg {
  position: absolute;
  inset: 0 0 auto 0;
  height: 500px;
  overflow: hidden;
  z-index: 0;
}

.series-mobile-cover__bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(4px);
  transform: scale(1.05);
}

.series-mobile-cover__card {
  position: relative;
  z-index: 1;
  width: 180px;
  aspect-ratio: 2 / 3;
  border-radius: var(--az-radius);
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.45);
}

/* Series layout */
.series-page {
  position: relative;
}

.series-content {
  position: relative;
  z-index: 1;
  padding-bottom: 28px;
}

.series-grid {
  display: grid;
  gap: 12px;
}

.series-sidebar {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cover-card {
  display: none;
  position: relative;
  aspect-ratio: 2 / 3;
  border-radius: var(--az-radius);
  overflow: hidden;
}

.cover-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.stats-card,
.info-card,
.chapter-panel,
.recommend-panel {
  background: var(--az-bg-card);
  border-radius: var(--az-radius);
}

.stats-card {
  padding: 16px;
  background: rgba(255, 255, 255, 0.05);
}

.stats-row {
  display: flex;
  justify-content: space-around;
  text-align: center;
  gap: 8px;
}

.stat-item + .stat-item {
  border-left: 1px solid var(--az-border);
}

.stat-value {
  font-size: 1.25rem;
  font-weight: 700;
}

.stat-label {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--az-text-muted);
}

.meta-pair {
  display: flex;
  gap: 12px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--az-border);
}

.meta-box {
  flex: 1;
  padding: 12px 16px;
  border-radius: 6px;
  background: var(--az-bg-card);
}

.meta-box__label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 4px;
}

.meta-box__value {
  font-weight: 700;
  text-transform: capitalize;
}

.meta-box__value.is-status {
  color: var(--az-purple-light);
}

.meta-box__value.is-type {
  color: var(--az-purple);
  text-transform: uppercase;
}

.artist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 10px 16px;
  border-radius: 6px;
  background: var(--az-bg-card);
}

.genre-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.genre-tag {
  display: inline-flex;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: var(--az-radius);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: border-color 0.2s, color 0.2s;
}

.genre-tag:hover {
  border-color: var(--az-purple);
  color: var(--az-purple);
}

.info-card {
  padding: 16px 24px;
}

.series-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.2;
}

.series-description {
  margin-top: 12px;
  color: var(--az-text-soft);
  font-weight: 300;
  line-height: 1.7;
}

.series-description.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.expand-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  padding: 4px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--az-purple);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
}

.expand-btn:hover {
  background: rgba(255, 255, 255, 0.05);
}

.action-row {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.action-row--desktop {
  display: none;
  grid-template-columns: repeat(3, 1fr);
  height: 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 16px;
  border: 0;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
}

.btn-primary {
  background: linear-gradient(to right, var(--az-purple), var(--az-purple-dark));
  color: #fff;
  box-shadow: 0 4px 16px rgba(145, 63, 226, 0.2);
}

.btn-primary:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 16px rgba(145, 63, 226, 0.4);
}

.btn-light {
  background: #e8e8e8;
  color: #000;
}

.btn-light:hover {
  background: #d4d4d4;
}

.chapter-panel {
  margin-top: 16px;
  overflow: hidden;
}

.chapter-panel__head {
  padding: 16px;
  border-bottom: 1px solid var(--az-border);
}

.chapter-panel__title {
  margin: 0;
  font-size: 1.125rem;
}

.chapter-search {
  width: 100%;
  margin-top: 12px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--az-radius);
  background: var(--az-bg);
  color: #fff;
  outline: none;
}

.chapter-search:focus {
  box-shadow: 0 0 0 2px rgba(145, 63, 226, 0.5);
}

.chapter-list {
  max-height: 500px;
  overflow-y: auto;
}

.chapter-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s;
}

.chapter-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

.chapter-item__title {
  font-weight: 500;
  transition: color 0.2s;
}

.chapter-item:hover .chapter-item__title {
  color: var(--az-purple);
}

.chapter-item__date {
  flex-shrink: 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.4);
}

/* Manga cards */
.manga-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.manga-card__cover {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 6px;
}

.manga-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  transition: opacity 0.2s;
}

.manga-card:hover .manga-card__cover img {
  opacity: 0.6;
}

.manga-card__badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  padding: 2px 6px;
  border-radius: 3px;
  background: var(--az-purple);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}

.manga-card__title {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.manga-card:hover .manga-card__title {
  color: var(--az-purple);
}

.manga-card__chapter {
  display: block;
  font-size: 0.875rem;
  color: #999;
  font-weight: 500;
}

.recommend-panel {
  margin-top: 24px;
  padding: 16px 24px;
}

.recommend-panel h2 {
  margin: 0 0 16px;
  font-size: 1.25rem;
}

/* Chapter reader */
.reader-body {
  background: #000;
  color: #fff;
}

.reader-topbar,
.reader-bottombar {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(24, 24, 27, 0.95);
  backdrop-filter: blur(8px);
  border-color: rgba(39, 39, 42, 0.5);
  transition: transform 0.3s, opacity 0.3s;
}

.reader-topbar {
  top: 0;
  border-bottom: 1px solid rgba(39, 39, 42, 0.5);
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
}

.reader-bottombar {
  bottom: 0;
  border-top: 1px solid rgba(39, 39, 42, 0.5);
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

.reader-topbar.is-visible,
.reader-bottombar.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.reader-topbar__inner,
.reader-bottombar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: var(--az-max-width);
  margin: 0 auto;
  padding: 16px 12px;
  position: relative;
}

.flex {
  display: flex;
}

.items-center {
  align-items: center;
}

.justify-start {
  justify-content: flex-start;
}

.shrink-0 {
  flex-shrink: 0;
}

.mr-3 {
  margin-right: 0.75rem;
}

.px-2\.5 {
  padding-left: 0.625rem;
  padding-right: 0.625rem;
}

.py-2\.5 {
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
}

.bg-zinc-800 {
  background-color: #18181b;
}

.hover\:bg-zinc-700:hover {
  background-color: #3f3f46;
}

.rounded-xl {
  border-radius: 0.75rem;
}

.transition-colors {
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease, fill 0.2s ease, stroke 0.2s ease;
}

.w-6 {
  width: 1.5rem;
}

.h-6 {
  height: 1.5rem;
}

.text-zinc-300 {
  color: #d4d4d8;
}

.gap-1\.5 {
  gap: 0.375rem;
}

.sm\:gap-2 {
  gap: 0.5rem;
}

.px-3 {
  padding-left: 0.75rem;
  padding-right: 0.75rem;
}

.sm\:px-4 {
  padding-left: 1rem;
  padding-right: 1rem;
}

.py-2 {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
}

.text-sm {
  font-size: 0.875rem;
}

.sm\:text-base {
  font-size: 1rem;
}

.font-medium {
  font-weight: 500;
}

.text-zinc-100 {
  color: #f5f5f5;
}

.w-3\.5 {
  width: 0.875rem;
}

.h-3\.5 {
  height: 0.875rem;
}

.sm\:w-4 {
  width: 1rem;
}

.sm\:h-4 {
  height: 1rem;
}

@media (min-width: 640px) {
  .sm\:gap-2 { gap: 0.5rem; }
  .sm\:px-4 { padding-left: 1rem; padding-right: 1rem; }
  .sm\:text-base { font-size: 0.8rem; }
  .sm\:w-4 { width: 1rem; }
  .sm\:h-4 { height: 1rem; }
}

.rotate-180 {
  transform: rotate(180deg);
}

.nav-zinc {
  background-color: #913fe2 !important;
  color: #fff !important;
}

.nav-zinc:hover {
  background-color: #7c35c2 !important;
}

.reader-series-link {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.reader-series-link img {
  width: 40px;
  height: 40px;
  border-radius: var(--az-radius);
  object-fit: cover;
}

.reader-series-link__meta {
  min-width: 0;
}

.reader-series-link__name {
  font-size: 0.875rem;
  color: #a1a1aa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.reader-series-link__chapter {
  font-weight: 600;
}

.reader-pages {
  max-width: 720px;
  margin: 0 auto;
  line-height: 0;
}

.reader-page {
  width: 100%;
}

.reader-page img {
  width: 100%;
}

.reader-nav-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--az-max-width);
  margin: 0 auto;
  padding: 32px 16px;
}

.reader-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 12px;
  font-weight: 600;
  min-width: 0;
}

.reader-bottombar .reader-nav-btn {
  flex: 0 0 auto;
}

.reader-bottombar .reader-nav-btn.is-prev,
.reader-bottombar .reader-nav-btn.is-next {
  flex: 0 1 120px;
  width: 120px;
  min-width: 100px;
  max-width: 140px;
}

.reader-nav-btn.is-disabled {
  background: #222;
  color: #555;
  pointer-events: none;
}

.reader-nav-btn.is-next {
  background: var(--az-purple);
}

.reader-nav-btn.is-next:hover {
  background: var(--az-purple-dark);
}

.reader-chapter-selector {
  position: relative;
  flex: 1 1 220px;
  min-width: 120px;
  max-width: 260px;
  margin: 0 12px;
}

.reader-chapter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: #27272a;
  color: #fff;
}

.reader-chapter-toggle:hover {
  background: rgba(145, 63, 226, 0.15);
}

.reader-chapter-toggle__icon {
  margin-left: 12px;
  opacity: 0.8;
}

.reader-chapter-list {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 12px);
  transform: translateX(-50%);
  width: 100%;
  max-height: 250px;
  overflow-y: auto;
  background: rgba(20, 20, 24, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
  z-index: 60;
}

.reader-chapter-list.is-open {
  display: flex;
  flex-direction: column;
}

@media (max-width: 560px) {
  .reader-bottombar .reader-nav-btn.is-prev,
  .reader-bottombar .reader-nav-btn.is-next {
    width: 100px;
    min-width: 80px;
    max-width: 110px;
    padding: 12px 10px;
  }

  .reader-chapter-selector {
    max-width: 200px;
  }

  .reader-chapter-toggle {
    padding: 12px 10px;
  }
}

.reader-chapter-item {
  display: block;
  width: 100%;
  padding: 12px 16px;
  color: #ddd;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.reader-chapter-item:last-child {
  border-bottom: 0;
}

.reader-chapter-item:hover {
  background: rgba(145, 63, 226, 0.12);
  color: #fff;
}

.reader-chapter-item.is-active {
  background: rgba(145, 63, 226, 0.18);
  color: #fff;
  font-weight: 700;
}

/* Make Prev button match Next's purple styling */
.reader-nav-btn.is-prev {
  background: var(--az-purple);
  color: #fff;
}

.reader-nav-btn.is-prev:hover {
  background: #7c35c2 !important;
}

/* Stronger rules to override any lingering styles (use only for reader nav buttons) */
.reader-bottombar .reader-nav-btn.is-prev,
.reader-nav-inline .reader-nav-btn.is-prev,
.reader-nav-btn.is-prev {
  background: #913fe2 !important;
  color: #fff !important;
  background-image: none !important;
}

.reader-bottombar .reader-nav-btn.is-prev:hover,
.reader-nav-inline .reader-nav-btn.is-prev:hover,
.reader-nav-btn.is-prev:hover {
  background: var(--az-purple-dark) !important;
}

.reader-hint {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 40;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.8);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.75rem;
  pointer-events: none;
}

/* Footer */
.site-footer {
  margin-top: auto;
  background: var(--az-bg-footer);
}

.site-footer__inner {
  padding: 24px 12px;
  text-align: center;
}

.site-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.site-footer__name {
  font-size: 1.25rem;
  font-weight: 600;
  background: linear-gradient(to right, var(--az-purple), var(--az-purple-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px 24px;
  margin-bottom: 16px;
  font-size: 0.875rem;
}

.site-footer__links a {
  color: rgba(255, 255, 255, 0.7);
}

.site-footer__links a:hover {
  color: #fff;
}

.site-footer__copy {
  opacity: 0.6;
  font-size: 0.75rem;
}

.scroll-top {
  position: fixed;
  right: 24px;
  bottom: 110px;
  z-index: 40;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #913fe2;
  color: #fff;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, transform 0.3s, background 0.2s;
  transform: translateY(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.14);
}

.scroll-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.scroll-top:hover {
  background: #7c35c2;
}

.empty-state {
  padding: 48px 16px;
  text-align: center;
  color: var(--az-text-muted);
}

/* Responsive */
@media (min-width: 768px) {
  .manga-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .series-title {
    font-size: 2rem;
  }
}

@media (min-width: 901px) {
  .site-header {
    height: 4rem;
  }

  .site-nav,
  .search-form {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .series-hero-bg {
    display: block;
  }

  .series-mobile-cover {
    display: none;
  }

  .series-content {
    padding-top: 32px;
  }

  .series-grid {
    grid-template-columns: minmax(280px, 400px) minmax(0, 1fr);
    gap: 36px;
    align-items: start;
  }

  .cover-card,
  .stats-card--desktop,
  .genre-list--desktop {
    display: block;
  }

  .stats-card--mobile,
  .action-row--mobile {
    display: none;
  }

  .action-row--desktop {
    display: grid;
  }

  .manga-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (min-width: 1280px) {
  .manga-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}