/* Mangasak theme — supplemental styles */

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  background-color: #f6f3ee;
  color: #14111f;
  background-image: radial-gradient(circle at 1px 1px, rgba(20, 17, 31, 0.04) 1px, transparent 0);
  background-size: 24px 24px;
}

a { transition: color 0.2s; }

/* Header */
.site-header {
  position: static;
  background: rgba(20, 17, 31, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 30px rgba(20, 17, 31, 0.2);
}

.site-header__bar {
  min-height: var(--mangasak-header-height, 50px);
  height: var(--mangasak-header-height, 50px);
}

.site-header__bar--centered {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  position: relative;
}

.site-header__brand {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 0;
  text-align: center;
}

.site-header__end {
  grid-column: 3;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.375rem;
  min-width: 0;
}

.site-header__nav {
  display: none;
  align-items: center;
  justify-content: center;
}

.site-header__nav .menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 1024px) {
  .site-header__nav .menu {
    gap: 2rem;
  }
}

@media (min-width: 768px) {
  .site-header__bar--centered {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .site-header__brand {
    grid-column: auto;
    justify-content: flex-start;
    text-align: left;
    flex-shrink: 0;
    z-index: 2;
  }

  .site-header__nav {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    z-index: 1;
    max-width: calc(100% - 16rem);
  }

  .site-header__end {
    grid-column: auto;
    flex-shrink: 0;
    z-index: 2;
  }
}

.site-header__search-toggle {
  color: #fff;
}

.site-header__search-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

.site-header__search-panel {
  padding-bottom: 0.75rem;
}

.site-header__search-panel:not(.hidden) {
  display: block;
}

.manga-search-form--toggle {
  width: 100%;
}

.site-header__brand .site-branding-title,
.site-header__brand > a {
  max-width: min(12rem, 42vw);
}

.site-header .manga-search-form input {
  padding-top: 0.375rem;
  padding-bottom: 0.375rem;
}

.site-header .menu a,
.site-header nav a,
.site-header__nav a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  position: relative;
}

.site-header .menu a:hover,
.site-header nav a:hover,
.site-header__nav a:hover { color: #fff; }

.site-header .menu a::after,
.site-header nav a::after,
.site-header__nav a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -0.25rem;
  width: 0;
  height: 2px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #e11d74 0%, #7c3aed 100%);
  transition: width 0.3s;
}

.site-header .menu a:hover::after,
.site-header nav a:hover::after,
.site-header__nav a:hover::after { width: 100%; }

.site-header .site-branding {
  min-width: 0;
  justify-content: center;
}

@media (min-width: 768px) {
  .site-header .site-branding,
  .site-header__brand {
    justify-content: flex-start;
  }
}

.site-header .site-logo {
  display: flex;
  align-items: center;
  line-height: 0;
}

.site-header .site-logo a {
  display: inline-flex;
  align-items: center;
  line-height: 0;
  background: transparent;
  border: 0;
  padding: 0;
}

.site-header .site-logo img,
.site-header .site-logo .mangasak-header-logo-image {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: min(200px, 42vw);
  max-height: var(--mangasak-logo-height, 40px);
  object-fit: contain;
  background: transparent;
  vertical-align: middle;
}

.site-header .site-branding-title {
  max-width: 12rem;
  margin: 0 auto;
}

@media (min-width: 768px) {
  .site-header .site-branding-title {
    margin: 0;
  }
}

/* Manga card */
.manga-archive-grid {
  align-items: stretch;
}

.manga-card {
  height: 100%;
}

.manga-card a,
.manga-card .manga-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #fffcf8;
  border: 1px solid #e4ddd2;
  border-radius: 1rem;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(20, 17, 31, 0.06);
  transition: all 0.3s;
}

.manga-card a:hover {
  transform: translateY(-4px);
  border-color: rgba(225, 29, 116, 0.25);
  box-shadow: 0 12px 32px rgba(225, 29, 116, 0.12);
}

/* NEW badge — chapters updated within 3 days */
.mangasak-new-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.1rem 0.4rem;
	margin-left: 0.35rem;
	font-size: 0.6rem;
	font-weight: 800;
	line-height: 1.2;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #fff;
	background: linear-gradient(135deg, #e11d74 0%, #f43f8a 100%);
	border-radius: 4px;
	box-shadow: 0 1px 4px rgba(225, 29, 116, 0.35);
	vertical-align: middle;
	flex-shrink: 0;
}

.manga-card-new-badge {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 4;
	margin: 0;
	padding: 0.2rem 0.45rem;
	font-size: 0.65rem;
	box-shadow: 0 2px 8px rgba(225, 29, 116, 0.45);
}

.mangasak-chapter-name .mangasak-new-badge {
	margin-left: 0.5rem;
}

.c-popular .mangasak-new-badge,
.widget-manga-recent .mangasak-new-badge {
	margin-right: 0.25rem;
	margin-left: 0;
	font-size: 0.55rem;
	padding: 0.05rem 0.3rem;
}

.manga-card .manga-card-cover {
  position: relative;
  overflow: hidden;
  flex: 0 0 auto;
  width: 100%;
  display: block;
}

.manga-card .manga-card-cover::before {
  content: '';
  display: block;
  width: 100%;
  padding-bottom: 133.333333%;
}

.manga-card .manga-card-cover > .mangasak-new-badge {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  margin: 0;
  z-index: 4;
}

.manga-card .manga-card-cover::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 40%;
  background: linear-gradient(to top, rgba(20, 17, 31, 0.9) 0%, rgba(20, 17, 31, 0.35) 55%, transparent 100%);
  opacity: 1;
  pointer-events: none;
  z-index: 2;
}

.manga-card:hover .manga-card-cover::after {
  background: linear-gradient(to top, rgba(20, 17, 31, 0.95) 0%, rgba(20, 17, 31, 0.45) 60%, transparent 100%);
}

.manga-card .manga-card-cover .mangasak-img-guard,
.manga-card .manga-card-cover > div {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 1;
}

.manga-card .manga-card-cover .mangasak-img-guard[data-lazy]:not(.is-loaded) {
  min-height: 0;
}

.manga-card .manga-card-cover img,
.manga-card .manga-card-cover .mangasak-img-guard__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.manga-card:hover .manga-card-cover .mangasak-img-guard__img,
.manga-card:hover .manga-card-cover img { transform: scale(1.05); }

.manga-card .manga-card-cover > .manga-card-meta,
.manga-card .manga-card-cover > .manga-card-chapters {
  position: absolute;
  left: 0.75rem;
  bottom: 0.65rem;
  top: auto;
  right: auto;
  margin: 0;
  z-index: 5;
  pointer-events: none;
}

.manga-card .manga-card-cover > .manga-card-meta {
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
}

.manga-card .manga-card-chapters {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.95);
  background: rgba(225, 29, 116, 0.92);
  padding: 0.2rem 0.55rem;
  border-radius: 9999px;
  box-shadow: 0 2px 8px rgba(20, 17, 31, 0.25);
}

.manga-card .manga-card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 3.85rem;
  padding: 0.75rem 0.875rem;
  border-top: 1px solid rgba(228, 221, 210, 0.6);
}

.manga-card h3 {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.375;
  min-height: calc(1.375em * 2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.manga-card:hover h3 { color: #e11d74; }

/* Section labels */
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  color: #e11d74;
  margin-bottom: 1rem;
}

.section-label::before {
  content: '';
  width: 4px;
  height: 1rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #e11d74 0%, #7c3aed 100%);
}

.section-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: #14111f;
}

.content-panel {
  background: #fffcf8;
  border: 1px solid #e4ddd2;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(20, 17, 31, 0.06);
}

@media (min-width: 640px) {
  .content-panel { padding: 1.75rem; }
}

/* Site container */
.mangasak-container {
  width: 100%;
  max-width: 72rem;
  margin-left: auto;
  margin-right: auto;
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

@media (min-width: 640px) {
  .mangasak-container {
    padding-left: max(1.5rem, env(safe-area-inset-left, 0px));
    padding-right: max(1.5rem, env(safe-area-inset-right, 0px));
  }
}

/* Protected images — lazy load + save-as guard */
.mangasak-img-guard {
  position: relative;
  display: block;
  overflow: hidden;
  background: #ebe6de;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.mangasak-img-guard[data-lazy]:not(.is-loaded) {
  min-height: 12rem;
}

.mangasak-img-guard--reader[data-lazy]:not(.is-loaded) {
  min-height: 55vh;
  width: 100%;
  max-width: min(100%, 820px);
  margin: 0 auto;
}

.mangasak-img-guard__img {
  display: block;
  width: 100%;
  height: auto;
  opacity: 0;
  transition: opacity 0.35s ease;
  -webkit-user-drag: none;
  user-drag: none;
  pointer-events: none;
}

.mangasak-img-guard.is-loaded .mangasak-img-guard__img {
  opacity: 1;
}

.mangasak-img-guard--lcp .mangasak-img-guard__img {
  opacity: 1;
}

.mangasak-img-guard--lcp .mangasak-img-guard__loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mangasak-img-guard__loader {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(110deg, #ebe6de 8%, #f5f1ea 18%, #ebe6de 33%);
  background-size: 200% 100%;
  animation: mangasak-img-shimmer 1.4s linear infinite;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mangasak-img-guard.is-loaded .mangasak-img-guard__loader,
.mangasak-img-guard.is-error .mangasak-img-guard__loader {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.mangasak-img-guard__spinner {
  width: 1.5rem;
  height: 1.5rem;
  border: 2px solid rgba(20, 17, 31, 0.12);
  border-top-color: #e11d74;
  border-radius: 50%;
  animation: mangasak-img-spin 0.75s linear infinite;
}

.mangasak-img-guard__loading-text {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #7a7268;
}

.mangasak-img-guard__shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
  cursor: default;
}

.mangasak-img-guard.is-error {
  background: #f0ece4;
}

.mangasak-img-guard.is-blocked .mangasak-img-guard__loader {
  opacity: 1;
  visibility: visible;
  background: #1a1528;
  animation: none;
}

.mangasak-img-guard.is-blocked .mangasak-img-guard__spinner {
  display: none;
}

.mangasak-img-guard.is-blocked .mangasak-img-guard__loading-text {
  color: rgba(255, 255, 255, 0.7);
}

.mangasak-bot-blocked .mangasak-reader__canvas {
  pointer-events: none;
}

.mangasak-img-guard.is-error::after {
  content: attr(data-error-text);
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: #7a7268;
  text-align: center;
  padding: 0.5rem;
}

.mangasak-img-guard--reader {
  background: #1a1528;
}

.mangasak-img-guard--reader .mangasak-img-guard__loader {
  background: linear-gradient(110deg, #1a1528 8%, #252033 18%, #1a1528 33%);
  background-size: 200% 100%;
}

.mangasak-img-guard--reader .mangasak-img-guard__spinner {
  border-color: rgba(255, 255, 255, 0.15);
  border-top-color: #e11d74;
}

.mangasak-img-guard--reader .mangasak-img-guard__loading-text {
  color: rgba(255, 255, 255, 0.55);
}

.mangasak-img-guard--reader .mangasak-img-guard__img {
  width: auto;
  max-width: min(100%, 820px);
  margin: 0 auto;
}

@keyframes mangasak-img-shimmer {
  to { background-position-x: -200%; }
}

@keyframes mangasak-img-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .mangasak-img-guard__loader {
    animation: none;
    background: #ebe6de;
  }

  .mangasak-img-guard--reader .mangasak-img-guard__loader {
    background: #1a1528;
  }

  .mangasak-img-guard__spinner {
    animation: none;
    border-top-color: #e11d74;
  }

  .mangasak-img-guard__img {
    transition: none;
  }
}

/* Manga hero */
.manga-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(225, 29, 116, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(124, 58, 237, 0.14) 0%, transparent 55%),
    linear-gradient(180deg, #1a1528 0%, #14111f 100%);
}

.manga-hero-cover {
  border-radius: 1rem;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 20px 50px rgba(20, 17, 31, 0.25);
}

.manga-stat-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
}

.manga-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  background: linear-gradient(135deg, #e11d74 0%, #7c3aed 100%);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  box-shadow: 0 0 0 1px rgba(225, 29, 116, 0.15), 0 8px 24px rgba(225, 29, 116, 0.12);
}

.genre-tag {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  background: #f0ece4;
  color: #7a7268;
  border: 1px solid #e4ddd2;
  text-decoration: none;
}

.status-badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  border: 1px solid #e4ddd2;
}

.status-badge--ongoing { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.status-badge--completed { background: rgba(124, 58, 237, 0.1); color: #7c3aed; }

/* Home hero */
.home-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  color: #fff;
  padding: 2rem;
  margin-bottom: 2.5rem;
  background-image:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(225, 29, 116, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 20%, rgba(124, 58, 237, 0.14) 0%, transparent 55%),
    linear-gradient(180deg, #1a1528 0%, #14111f 100%);
  box-shadow: 0 20px 50px rgba(20, 17, 31, 0.25);
}

/* Footer */
.site-footer {
  background: #14111f;
  color: rgba(255, 255, 255, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.site-footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
}

/* Sidebar widgets */
.sidebar { position: sticky; top: 5rem; align-self: start; }

.sidebar .widget {
  background: #fffcf8;
  border: 1px solid #e4ddd2;
  border-radius: 1rem;
  overflow: hidden;
  margin-bottom: 1.25rem;
  box-shadow: 0 2px 8px rgba(20, 17, 31, 0.06);
}

.sidebar .widget-title,
.site-footer .manga-genres-class-name .widget-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 1.25rem 1.25rem 0.75rem;
  margin: 0;
  border-bottom: 1px solid #e4ddd2;
}

.sidebar .widget-title::before,
.site-footer .manga-genres-class-name .widget-title::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #e11d74 0%, #7c3aed 100%);
}

/* Genre grid widget */
.mangasak-genre-grid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
}

@media (min-width: 640px) { .mangasak-genre-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 768px) { .mangasak-genre-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .mangasak-genre-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.mangasak-genre-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  text-decoration: none;
  color: #14111f;
  background: #f0ece4;
  border: 1px solid #e4ddd2;
  transition: all 0.2s;
}

.mangasak-genre-link:hover {
  color: #e11d74;
  background: rgba(225, 29, 116, 0.05);
  border-color: rgba(225, 29, 116, 0.3);
}

.mangasak-genre-count { font-size: 0.75rem; color: #7a7268; }

.site-footer .mangasak-genre-link {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.site-footer .mangasak-genre-link:hover {
  color: #fff;
  background: rgba(225, 29, 116, 0.15);
  border-color: rgba(225, 29, 116, 0.4);
}

.site-footer .mangasak-genre-count { color: rgba(255, 255, 255, 0.4); }
.site-footer .manga-genres-class-name .widget-title { color: #fff; border-color: rgba(255, 255, 255, 0.1); }

/* Comments */
.comments-area .comment-respond {
  margin-top: 0;
  padding: 1rem;
  border-radius: 0.75rem;
  background: rgba(240, 236, 228, 0.6);
  border: 1px solid #e4ddd2;
}

.comments-area .form-submit input[type="submit"],
.comments-area .submit-btn {
  padding: 0.625rem 1.5rem;
  border-radius: 0.75rem;
  border: 0;
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  cursor: pointer;
  background: linear-gradient(135deg, #e11d74 0%, #7c3aed 100%);
}

.comment-list .children {
  list-style: none;
  margin: 0.75rem 0 0 1.5rem;
  padding-left: 1rem;
  border-left: 2px solid rgba(225, 29, 116, 0.15);
}

/* Pagination */
.manga-archive-pagination .page-numbers,
.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.875rem;
  border-radius: 0.75rem;
  border: 1px solid #e4ddd2;
  font-size: 0.875rem;
  color: #7a7268;
  text-decoration: none;
}

.page-numbers.current {
  color: #fff;
  border-color: transparent;
  background: linear-gradient(135deg, #e11d74 0%, #7c3aed 100%);
}

/* Chapter list pagination */
.chapter-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 1.5rem;
  padding-top: 0.5rem;
}

.chapter-pagination__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #e4ddd2;
  background: #fffcf8;
  color: #7a7268;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.chapter-pagination__link:hover {
  border-color: #e11d74;
  color: #e11d74;
  background: rgba(225, 29, 116, 0.05);
}

.chapter-pagination__current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  background: linear-gradient(135deg, #e11d74 0%, #7c3aed 100%);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(225, 29, 116, 0.25);
}

.chapter-pagination__dots {
  padding: 0 0.25rem;
  color: #7a7268;
  font-size: 0.875rem;
  line-height: 2.25rem;
}

.chapter-pagination__info {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  color: #7a7268;
}

.mangasak-chapters-loading {
  color: #7a7268;
  font-size: 0.875rem;
  text-align: center;
  padding: 1.5rem 0;
  animation: mangasak-pulse 1.5s ease-in-out infinite;
}

.mangasak-chapters-holder.is-loading {
  opacity: 0.55;
  pointer-events: none;
  transition: opacity 0.2s;
}

/* Continue reading bar (localStorage) */
.mangasak-reading-continue {
  margin-bottom: 0.875rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(225, 29, 116, 0.18);
  background: rgba(225, 29, 116, 0.06);
}

.mangasak-reading-continue__label {
  margin: 0 0 0.5rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7a7268;
}

.mangasak-reading-continue__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  text-decoration: none;
}

.mangasak-reading-continue__name {
  font-size: 0.875rem;
  font-weight: 600;
  color: #14111f;
}

.mangasak-reading-continue__btn {
  flex-shrink: 0;
  padding: 0.25rem 0.625rem;
  font-size: 0.7rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #e11d74 0%, #f43f8a 100%);
  border-radius: 999px;
}

.mangasak-read-status {
  display: inline-flex;
  align-items: center;
  margin-left: 0.4rem;
  padding: 0.1rem 0.4rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: 4px;
  vertical-align: middle;
}

.mangasak-read-status--current {
  color: #fff;
  background: #e11d74;
}

.mangasak-read-status--read {
  color: #7a7268;
  background: #ebe6de;
}

/* Chapter list read states (localStorage) */
.chapter-item.is-current {
  background: rgba(225, 29, 116, 0.06) !important;
  border-color: rgba(225, 29, 116, 0.2) !important;
}

.chapter-item.is-current > a {
  color: #e11d74 !important;
  font-weight: 600 !important;
}

.chapter-item.is-read {
  opacity: 0.82;
}

.chapter-item.is-read > a {
  color: #7a7268 !important;
}

.chapter-item.is-unread > a {
  font-weight: 600;
}

.chapter-num--current {
  background: #e11d74 !important;
  color: #fff !important;
  border-color: #e11d74 !important;
}

.chapter-num--read {
  background: #e8e4dc !important;
  color: #9a9288 !important;
  border-color: #ddd6cb !important;
}

.chapter-num--unread {
  background: #f0ece4 !important;
  color: #7a7268 !important;
  border-color: #e4ddd2 !important;
}

@keyframes mangasak-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ===== Manga Reader ===== */
body.reading-manga {
  background: #0d0b14;
}

body.reading-manga .site-header {
  position: relative;
  z-index: 50;
}

body.reading-manga .site-footer {
  background: #14111f;
  border-top-color: rgba(255, 255, 255, 0.06);
}

body.reading-manga .site-footer .manga-genres-class-name {
  display: none;
}

.mangasak-reader {
  min-height: calc(100vh - 4rem);
}

.mangasak-reader__topbar {
  display: block;
  padding: 0;
  background: rgba(20, 17, 31, 0.97);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 45;
}

.mangasak-reader__topbar-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  padding-top: 0.75rem;
  padding-bottom: 0.75rem;
}

.mangasak-reader__back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.2s;
  white-space: nowrap;
}

.mangasak-reader__back:hover {
  color: #fff;
  background: rgba(225, 29, 116, 0.2);
  border-color: rgba(225, 29, 116, 0.35);
}

.mangasak-reader__heading {
  text-align: center;
  min-width: 0;
}

.mangasak-reader__manga-title {
  margin: 0;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mangasak-reader__chapter-title {
  margin: 0.15rem 0 0;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mangasak-reader__topbar-spacer {
  width: 5.5rem;
}

.mangasak-reader__toolbar {
  background: #fffcf8;
  border-bottom: 1px solid #e4ddd2;
  padding: 0;
}

.mangasak-reader__toolbar > .mangasak-container {
  padding-top: 0.65rem;
  padding-bottom: 0.65rem;
}

.mangasak-reader__toolbar--bottom {
  border-bottom: 0;
  border-top: 1px solid #e4ddd2;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  box-shadow: 0 -8px 24px rgba(20, 17, 31, 0.08);
  transform: translateY(0);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.mangasak-reader__toolbar--bottom.is-hidden {
  transform: translateY(100%);
  pointer-events: none;
}

.mangasak-go-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  z-index: 100;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.1rem;
  width: 3.25rem;
  height: 3.25rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9999px;
  color: #fff;
  background: linear-gradient(145deg, #e11d74 0%, #9d1b6a 45%, #7c3aed 100%);
  box-shadow: 0 8px 28px rgba(225, 29, 116, 0.4), 0 2px 8px rgba(20, 17, 31, 0.2);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(1rem) scale(0.9);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, box-shadow 0.2s ease;
}

.mangasak-go-top.is-visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.mangasak-go-top:hover {
  box-shadow: 0 12px 32px rgba(225, 29, 116, 0.5), 0 4px 12px rgba(20, 17, 31, 0.25);
  transform: translateY(-3px) scale(1.02);
}

.mangasak-go-top svg {
  width: 1.125rem;
  height: 1.125rem;
}

.mangasak-go-top__label {
  font-size: 0.5625rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1;
}

body.reading-manga .mangasak-go-top {
  bottom: calc(5.75rem + env(safe-area-inset-bottom, 0px));
}

body.reading-manga.mangasak-bottom-nav-hidden .mangasak-go-top {
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
}

@media (max-width: 639px) {
  .mangasak-go-top {
    width: 3rem;
    height: 3rem;
    right: max(0.75rem, env(safe-area-inset-right, 0px));
  }
}

/* Popular Manga widget */
.widget.c-popular.manga-widget,
.widget.widget-manga-recent {
  background: #fffcf8;
  border: 1px solid #e4ddd2;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(20, 17, 31, 0.06);
}

.widget.c-popular > .widget-title,
.widget.widget-manga-recent > .widget-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  padding: 1.25rem 1.25rem 0.75rem;
  margin: 0;
  border-bottom: 1px solid #e4ddd2;
  color: #14111f;
}

.widget.c-popular > .widget-title::before,
.widget.widget-manga-recent > .widget-title::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: linear-gradient(135deg, #e11d74 0%, #7c3aed 100%);
  flex-shrink: 0;
}

.widget.c-popular .c-widget-content,
.widget.widget-manga-recent .c-widget-content {
  padding: 0.25rem 1rem 1rem;
}

.widget.c-popular .popular-item-wrap {
  padding: 0;
  margin: 0;
  border: 0;
}

.mangasak-popular-item {
  display: flex;
  gap: 0.875rem;
  align-items: flex-start;
  padding: 0.875rem 0;
  border-bottom: 1px solid #e4ddd2;
  margin: 0;
}

.mangasak-popular-item:last-child,
.widget.c-popular .popular-item-wrap:last-child .mangasak-popular-item {
  border-bottom: 0;
  padding-bottom: 0.25rem;
}

.mangasak-popular-item__cover {
  position: relative;
  flex: 0 0 4rem;
  width: 4rem;
  display: block;
  overflow: hidden;
  border-radius: 0.625rem;
  border: 1px solid #e4ddd2;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(20, 17, 31, 0.08);
  transition: transform 0.25s, box-shadow 0.25s;
}

.mangasak-popular-item__cover:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px rgba(225, 29, 116, 0.15);
}

.mangasak-popular-item__cover .mangasak-img-guard,
.mangasak-popular-item__cover img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.mangasak-popular-item__cover .mangasak-img-guard__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mangasak-popular-item__body,
.widget.c-popular .popular-content {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.mangasak-popular-item__title {
  margin: 0 0 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.35;
  text-transform: none;
  letter-spacing: normal;
}

.mangasak-popular-item__title a {
  color: #14111f;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.mangasak-popular-item__title a:hover {
  color: #e11d74;
}

.mangasak-popular-item__chapters {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.mangasak-popular-chapter {
  display: block;
}

.mangasak-popular-chapter__link {
  display: block;
  min-width: 0;
  padding: 0.25rem 0.6rem;
  border-radius: 9999px;
  background: #f0ece4;
  color: #14111f;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.2s, color 0.2s;
}

.mangasak-popular-chapter__link:hover {
  background: rgba(225, 29, 116, 0.12);
  color: #e11d74;
}

.widget.c-popular .popular-content .widget-title {
  text-transform: none;
  letter-spacing: normal;
  border: 0;
  padding: 0;
}

.widget.c-popular .popular-content .widget-title::before {
  display: none;
}

.widget.c-popular .widget-view-more,
.widget.c-popular .c-wg-button-wrap .widget-view-more {
  display: block;
  margin-top: 0.75rem;
  padding: 0.55rem 1rem;
  border-radius: 0.75rem;
  text-align: center;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #e11d74;
  background: rgba(225, 29, 116, 0.08);
  border: 1px solid rgba(225, 29, 116, 0.2);
  text-decoration: none;
  transition: all 0.2s;
}

.widget.c-popular .widget-view-more:hover {
  color: #fff;
  background: linear-gradient(135deg, #e11d74 0%, #7c3aed 100%);
  border-color: transparent;
}

.mangasak-reader__toolbar .entry-header_wrap {
  margin-bottom: 0.5rem;
}

.mangasak-reader__toolbar--bottom .entry-header_wrap,
.mangasak-reader__toolbar--bottom .mangasak-reader__breadcrumb {
  display: none;
}

.mangasak-reader__breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.75rem;
}

.mangasak-reader__breadcrumb-list li {
  display: inline-flex;
  align-items: center;
  color: #7a7268;
}

.mangasak-reader__breadcrumb-list li + li::before {
  content: '/';
  margin-right: 0.5rem;
  color: #c4bdb3;
}

.mangasak-reader__breadcrumb-list a {
  color: #7a7268;
  text-decoration: none;
  transition: color 0.2s;
}

.mangasak-reader__breadcrumb-list a:hover {
  color: #e11d74;
}

.mangasak-reader__breadcrumb-list li[aria-current="page"] {
  color: #14111f;
  font-weight: 600;
}

.mangasak-reader .wp-manga-nav {
  display: flex;
  flex-wrap: wrap;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 0.65rem;
}

.mangasak-reader .wp-manga-nav > .entry-header_wrap {
  flex: 0 0 100%;
  width: 100%;
  margin-bottom: 0.35rem;
}

.mangasak-reader .wp-manga-nav .c-breadcrumb-wrapper,
.mangasak-reader .wp-manga-nav .action-icon,
.mangasak-reader .wp-manga-nav .mobile-nav-btn {
  display: none !important;
}

.mangasak-reader .select-view,
.mangasak-reader .select-pagination {
  display: inline-flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: auto;
}

.mangasak-reader .select-view .c-selectpicker,
.mangasak-reader .select-pagination .c-selectpicker,
.mangasak-reader .select-view .chapters_selectbox_holder,
.mangasak-reader .select-view .selectpicker_chapter {
  display: inline-flex;
  flex: 0 0 auto;
}

.mangasak-reader .select-pagination .nav-links {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.5rem;
}

.mangasak-reader .wp-manga-nav > script {
  display: none;
}

.mangasak-reader .c-selectpicker label {
  margin: 0;
}

.mangasak-reader .wp-manga-nav select,
.mangasak-reader #single-pager,
.mangasak-reader .single-chapter-select,
.mangasak-reader .host-select,
.mangasak-reader .reading-style-select,
.mangasak-reader .volume-select {
  appearance: none;
  min-width: 8rem;
  max-width: 14rem;
  padding: 0.5rem 2rem 0.5rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid #e4ddd2;
  background: #fffcf8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a7268' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.65rem center;
  color: #14111f;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.mangasak-reader .wp-manga-nav select:hover,
.mangasak-reader .wp-manga-nav select:focus {
  outline: none;
  border-color: rgba(225, 29, 116, 0.45);
  box-shadow: 0 0 0 3px rgba(225, 29, 116, 0.12);
}

.mangasak-reader .nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.mangasak-reader .nav-links a.btn,
.mangasak-reader .nav-links a.prev_page,
.mangasak-reader .nav-links a.next_page,
.mangasak-reader .nav-links a.back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 5.5rem;
  padding: 0.5rem 1.1rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #e11d74 0%, #7c3aed 100%);
  box-shadow: 0 2px 10px rgba(225, 29, 116, 0.25);
  transition: opacity 0.2s, transform 0.2s;
}

.mangasak-reader .nav-links a.btn:hover,
.mangasak-reader .nav-links a.prev_page:hover,
.mangasak-reader .nav-links a.next_page:hover,
.mangasak-reader .nav-links a.back:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.mangasak-reader .nav-links a.back {
  background: #f0ece4;
  color: #14111f;
  border: 1px solid #e4ddd2;
  box-shadow: none;
}

.mangasak-show-all-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-width: 6.5rem;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  color: #e11d74;
  background: rgba(225, 29, 116, 0.08);
  border: 1px solid rgba(225, 29, 116, 0.25);
  transition: all 0.2s;
  white-space: nowrap;
}

.mangasak-show-all-btn:hover {
  color: #fff;
  background: linear-gradient(135deg, #e11d74 0%, #7c3aed 100%);
  border-color: transparent;
  box-shadow: 0 2px 10px rgba(225, 29, 116, 0.25);
}

.mangasak-show-all-btn--paged {
  color: #7a7268;
  background: #fffcf8;
  border-color: #e4ddd2;
}

.mangasak-show-all-btn--paged:hover {
  color: #e11d74;
  background: rgba(225, 29, 116, 0.05);
  border-color: rgba(225, 29, 116, 0.35);
  box-shadow: none;
}

.mangasak-reader__canvas {
  background: #0d0b14;
  padding: 0;
}

.mangasak-reader__canvas-inner {
  padding-top: 1rem;
  padding-bottom: 1.5rem;
}

.mangasak-reader__post {
  background: transparent;
  border: 0;
  box-shadow: none;
  border-radius: 0;
}

.mangasak-reader .reading-content,
.mangasak-page-viewer {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  background: #0d0b14;
  padding: 1rem 0 1.5rem;
}

.mangasak-page-frame {
  position: relative;
  margin: 0;
  max-width: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.mangasak-page-frame .mangasak-img-guard,
.mangasak-page-frame img,
.mangasak-reader .wp-manga-chapter-img {
  display: block;
  max-width: min(100%, 820px);
  width: auto;
  height: auto;
  margin: 0 auto;
  border-radius: 0.25rem;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
  cursor: default;
}

.mangasak-page-frame .mangasak-img-guard__img,
.mangasak-reader .mangasak-img-guard__img {
  box-shadow: none;
  border-radius: 0.25rem;
}

.mangasak-page-badge {
  margin-top: 0.75rem;
  padding: 0.3rem 0.85rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.mangasak-list-viewer .mangasak-page-frame {
  margin-bottom: 0.25rem;
}

.mangasak-list-viewer .mangasak-page-frame:last-child {
  margin-bottom: 0;
}

.mangasak-reader__after-nav {
  background: #0d0b14;
  padding: 1.25rem 0 1.75rem;
}

.mangasak-reader__after-nav-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  max-width: 42rem;
  margin: 0 auto;
}

.mangasak-after-nav-chapters {
  flex: 0 1 auto;
  min-width: 10rem;
  max-width: 16rem;
}

.mangasak-after-nav-chapters__loading {
  display: block;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.55);
  text-align: center;
  padding: 0.5rem 0.85rem;
}

.mangasak-after-nav-chapters .c-selectpicker,
.mangasak-after-nav-chapters .selectpicker_chapter {
  display: block;
  width: 100%;
}

.mangasak-after-nav-chapters select,
.mangasak-after-nav-chapters .single-chapter-select {
  width: 100%;
  min-width: 10rem;
  max-width: 16rem;
  padding: 0.5rem 2rem 0.5rem 0.85rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,.7)' stroke-width='2.5'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.65rem center;
  color: #fff;
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: pointer;
  appearance: none;
}

.mangasak-after-nav-chapters select:hover,
.mangasak-after-nav-chapters select:focus {
  outline: none;
  border-color: rgba(225, 29, 116, 0.55);
  box-shadow: 0 0 0 3px rgba(225, 29, 116, 0.18);
}

.mangasak-reader__after-nav a.btn,
.mangasak-reader__after-nav a.prev_page,
.mangasak-reader__after-nav a.next_page,
.mangasak-reader__after-nav a.back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 7rem;
  padding: 0.65rem 1.35rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(135deg, #e11d74 0%, #7c3aed 100%);
  box-shadow: 0 2px 10px rgba(225, 29, 116, 0.25);
  transition: opacity 0.2s, transform 0.2s;
}

.mangasak-reader__after-nav a.btn:hover,
.mangasak-reader__after-nav a.prev_page:hover,
.mangasak-reader__after-nav a.next_page:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.mangasak-reader__after-nav a.back {
  background: #fffcf8;
  color: #14111f;
  border: 1px solid #e4ddd2;
  box-shadow: none;
}

.mangasak-reader__comments {
  background: #f6f3ee;
  padding: 2rem 0 3rem;
}

.mangasak-reader__comments-inner {
  max-width: 42rem;
  margin: 0 auto;
  background: #fffcf8;
  border: 1px solid #e4ddd2;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 2px 8px rgba(20, 17, 31, 0.06);
}

@media (min-width: 640px) {
  .mangasak-reader__topbar-inner {
    padding-top: 0.85rem;
    padding-bottom: 0.85rem;
  }

  .mangasak-reader__toolbar > .mangasak-container {
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }

  .mangasak-reader__comments-inner { padding: 1.75rem; }
  .mangasak-reader__chapter-title { font-size: 1.0625rem; }
}

@media (max-width: 639px) {
  .mangasak-reader__back span { display: none; }
  .mangasak-reader__topbar-spacer { width: 2.5rem; }

  .mangasak-reader .wp-manga-nav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.15rem;
  }

  .mangasak-reader .wp-manga-nav::-webkit-scrollbar {
    display: none;
  }

  .mangasak-reader .wp-manga-nav > .entry-header_wrap {
    flex: 0 0 100%;
  }

  .mangasak-reader .wp-manga-nav select,
  .mangasak-reader #single-pager,
  .mangasak-reader .single-chapter-select {
    min-width: 7rem;
    max-width: none;
  }

  .mangasak-reader .nav-links a.btn,
  .mangasak-reader .nav-links a.prev_page,
  .mangasak-reader .nav-links a.next_page {
    min-width: 4.5rem;
    padding: 0.5rem 0.85rem;
  }
}

/* Hide plugin leftovers */
.c-blog__heading,
.btn-reverse-order,
.c-chapter-readmore { display: none !important; }

/* ===== Responsive — all screens ===== */

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

img,
video,
svg {
  max-width: 100%;
  height: auto;
}

html {
  overflow-x: hidden;
  width: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

#content,
main,
.min-h-screen {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

.site-header > div {
  width: 100%;
  max-width: 100%;
}

.wp-manga-page .grid > *,
.mangasak-chapters-holder,
.content-panel,
.listing-chapters_wrap,
.page-content-listing,
.manga-hero {
  min-width: 0;
}

.manga-search-form,
.manga-search-form input {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.manga-hero .prose,
.prose img,
.prose pre,
.prose table,
.prose iframe {
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mangasak-reader .wp-manga-nav,
.mangasak-reader__toolbar {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* Header search */
.manga-search-form input {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #fff;
}

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

.manga-search-form input:focus {
  border-color: rgba(225, 29, 116, 0.5);
  box-shadow: 0 0 0 3px rgba(225, 29, 116, 0.15);
}

.manga-search-form--toggle {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 0.5rem;
}

/* Yoast SEO breadcrumbs */
.mangasak-yoast-breadcrumbs {
  margin-bottom: 1.5rem;
  font-size: 0.75rem;
  line-height: 1.5;
}

.mangasak-yoast-breadcrumbs__trail {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.mangasak-yoast-breadcrumbs__trail a {
  color: rgba(255, 255, 255, 0.55);
  text-decoration: none;
  transition: color 0.2s;
}

.mangasak-yoast-breadcrumbs__trail a:hover {
  color: #fff;
}

.mangasak-yoast-breadcrumbs__trail .breadcrumb_last,
.mangasak-yoast-breadcrumbs__trail > span:last-child {
  color: rgba(255, 255, 255, 0.85);
}

.mangasak-yoast-breadcrumbs__sep {
  color: rgba(255, 255, 255, 0.35);
}

.mangasak-yoast-breadcrumbs--archive .mangasak-yoast-breadcrumbs__trail a,
.mangasak-yoast-breadcrumbs--content .mangasak-yoast-breadcrumbs__trail a {
  color: #7a7268;
}

.mangasak-yoast-breadcrumbs--archive .mangasak-yoast-breadcrumbs__trail a:hover,
.mangasak-yoast-breadcrumbs--content .mangasak-yoast-breadcrumbs__trail a:hover {
  color: #e11d74;
}

.mangasak-yoast-breadcrumbs--archive .mangasak-yoast-breadcrumbs__trail .breadcrumb_last,
.mangasak-yoast-breadcrumbs--archive .mangasak-yoast-breadcrumbs__trail > span:last-child,
.mangasak-yoast-breadcrumbs--content .mangasak-yoast-breadcrumbs__trail .breadcrumb_last,
.mangasak-yoast-breadcrumbs--content .mangasak-yoast-breadcrumbs__trail > span:last-child {
  color: #14111f;
}

.mangasak-yoast-breadcrumbs--archive .mangasak-yoast-breadcrumbs__sep,
.mangasak-yoast-breadcrumbs--content .mangasak-yoast-breadcrumbs__sep {
  color: #c8c0b4;
}

/* Manga archive grid fallback */
.manga-archive-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  align-items: stretch;
}

@media (min-width: 640px) {
  .manga-archive-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
  }
}

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

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

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

/* Home hero */
@media (max-width: 639px) {
  .home-hero {
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 1rem;
  }

  .home-hero h1 {
    font-size: 1.375rem;
    line-height: 1.3;
  }

  .home-hero p {
    font-size: 0.875rem;
  }

  .section-heading {
    font-size: 1.0625rem;
  }
}

/* Manga detail hero */
@media (max-width: 639px) {
  .manga-hero .relative {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .manga-hero nav {
    margin-bottom: 1.25rem;
    font-size: 0.6875rem;
  }

  .manga-hero h1 {
    font-size: 1.375rem;
    line-height: 1.25;
    word-break: break-word;
  }

  .manga-stat-pill {
    font-size: 0.75rem;
    padding: 0.3rem 0.6rem;
  }

  .manga-read-btn {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.25rem;
  }

  .manga-hero .prose {
    font-size: 0.875rem;
    text-align: left;
  }
}

/* Content panels */
@media (max-width: 639px) {
  .content-panel {
    padding: 0.75rem;
    border-radius: 0.75rem;
    overflow: hidden;
  }

  .wp-manga-page .mangasak-container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
  }

  .manga-hero .mangasak-container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .site-header > .mangasak-container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .section-label {
    letter-spacing: 0.12em;
    font-size: 0.6875rem;
  }
}

/* Sidebar — no sticky on mobile */
@media (max-width: 1023px) {
  .sidebar {
    position: static;
    top: auto;
  }
}

/* Chapter rows */
.mangasak-chapter-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid transparent;
  transition: background 0.2s, border-color 0.2s;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.mangasak-chapter-row:hover {
  background: #f0ece4;
  border-color: rgba(228, 221, 210, 0.8);
}

.mangasak-chapter-row__link {
  flex: 1;
  min-width: 0;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  color: #14111f;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mangasak-chapter-row__link:hover {
  color: #e11d74;
}

.mangasak-chapter-row__date {
  flex-shrink: 1;
  min-width: 0;
  font-size: 0.75rem;
  color: #7a7268;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chapter-item.is-current > .mangasak-chapter-row__link {
  color: #e11d74 !important;
  font-weight: 600 !important;
}

.chapter-item.is-read > .mangasak-chapter-row__link {
  color: #7a7268 !important;
}

.chapter-item.is-unread > .mangasak-chapter-row__link {
  font-weight: 600;
}

@media (max-width: 639px) {
  .mangasak-chapter-row {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    grid-template-rows: auto auto;
    column-gap: 0.6rem;
    row-gap: 0.2rem;
    align-items: start;
    padding: 0.6rem 0.35rem;
  }

  .mangasak-chapter-row > .chapter-num {
    grid-column: 1;
    grid-row: 1 / span 2;
    align-self: start;
    width: 2rem;
    height: 2rem;
    font-size: 0.6875rem;
  }

  .mangasak-chapter-row__link {
    grid-column: 2;
    grid-row: 1;
    flex: none;
    white-space: normal;
    overflow: hidden;
    text-overflow: unset;
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
  }

  .mangasak-chapter-row__date {
    grid-column: 2;
    grid-row: 2;
    flex: none;
    padding-left: 0;
    font-size: 0.625rem;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
  }

  .mangasak-read-status {
    display: inline-flex;
    margin-left: 0.2rem;
    font-size: 0.5rem;
    padding: 0.05rem 0.25rem;
  }

  .mangasak-new-badge {
    font-size: 0.5rem;
    padding: 0.05rem 0.25rem;
    margin-left: 0.2rem;
  }
}

/* Continue reading bar */
@media (max-width: 639px) {
  .mangasak-reading-continue {
    padding: 0.6rem;
    overflow: hidden;
  }

  .mangasak-reading-continue__inner {
    min-width: 0;
  }

  .mangasak-reading-continue__link {
    flex-wrap: wrap;
    gap: 0.4rem;
    min-width: 0;
  }

  .mangasak-reading-continue__name {
    flex: 1 1 100%;
    font-size: 0.8125rem;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .mangasak-reading-continue__btn {
    margin-left: auto;
  }
}

/* Chapter pagination */
@media (max-width: 639px) {
  .chapter-pagination {
    gap: 0.25rem;
  }

  .chapter-pagination__link,
  .chapter-pagination__current {
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    font-size: 0.8125rem;
  }

  .chapter-pagination__info {
    font-size: 0.6875rem;
    padding: 0 0.5rem;
  }
}

/* Reader images */
.mangasak-list-viewer,
.mangasak-page-viewer {
  width: 100%;
  max-width: 100%;
}

.mangasak-page-frame {
  width: 100%;
  max-width: 100%;
}

.mangasak-reader .wp-manga-chapter-img,
.mangasak-reader .mangasak-img-guard--reader {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.mangasak-reader .mangasak-img-guard--reader .mangasak-img-guard__img {
  width: 100%;
  max-width: 100%;
}

.mangasak-reader__canvas {
  padding-bottom: calc(5rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
  .mangasak-reader .wp-manga-chapter-img {
    max-width: min(100%, 820px);
  }
}

@media (min-width: 1024px) {
  .mangasak-reader .wp-manga-chapter-img {
    max-width: min(100%, 900px);
  }
}

/* Reader after-nav mobile */
@media (max-width: 639px) {
  .mangasak-reader__after-nav {
    padding: 1rem 0 1.5rem;
  }

  .mangasak-reader__after-nav-inner {
    flex-direction: column;
    align-items: stretch;
  }

  .mangasak-after-nav-chapters {
    max-width: none;
    width: 100%;
  }

  .mangasak-reader__after-nav a.btn,
  .mangasak-reader__after-nav a.prev_page,
  .mangasak-reader__after-nav a.next_page,
  .mangasak-reader__after-nav a.back {
    width: 100%;
    min-width: 0;
  }
}

/* Comments */
@media (max-width: 639px) {
  .comment-list .children {
    margin-left: 0.75rem;
    padding-left: 0.75rem;
  }

  .mangasak-reader__comments {
    padding: 1.25rem 0 2rem;
  }
}

/* Footer */
@media (max-width: 639px) {
  .site-footer .mangasak-container {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
  }

  .site-footer nav .menu {
    flex-direction: column;
    gap: 0.5rem;
  }
}

/* Mobile nav dropdown */
@media (max-width: 767px) {
  [data-mobile-nav-menu] {
    width: min(16rem, calc(100vw - 2rem));
    max-height: calc(100vh - 5rem);
    overflow-y: auto;
  }
}

/* Sidebar widgets — prevent overflow */
.sidebar .widget,
.widget.c-popular,
.widget.widget-manga-recent {
  max-width: 100%;
  overflow: hidden;
}

/* Very narrow screens (e.g. 380px) */
@media (max-width: 420px) {
  .manga-hero-cover {
    width: 9.5rem !important;
    max-width: 55vw;
  }

  .manga-stat-pill {
    font-size: 0.6875rem;
    padding: 0.25rem 0.5rem;
  }

  .genre-tag {
    font-size: 0.6875rem;
    padding: 0.2rem 0.55rem;
  }

  .chapter-pagination__dots {
    display: none;
  }

  .mangasak-popular-item__cover {
    flex: 0 0 3.5rem;
    width: 3.5rem;
  }

  .mangasak-popular-item__title {
    font-size: 0.75rem;
  }
}
