/*
Theme Name: MangaRaw Neon
Theme URI: https://example.com/mangaraw-neon
Author: Codex
Author URI: https://example.com
Description: A dark manga reader theme inspired by modern raw manga listing sites, with featured series, chapter lists, archive grids, and reader-friendly single pages.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mangaraw-neon
Tags: blog, entertainment, custom-logo, featured-images, threaded-comments, translation-ready
*/

:root {
  --site-bg: #242424;
  --panel-bg: #171717;
  --panel-soft: #2b2b2b;
  --card-bg: #303030;
  --text: #f4f4f4;
  --muted: #a5a5a5;
  --line: rgba(255, 255, 255, 0.09);
  --brand: #eb3349;
  --brand-2: #f45c43;
  --accent: #fff;
  --container: 1180px;
  --radius: 4px;
  --shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--site-bg);
  color: var(--text);
  font-family: "Poppins", "Segoe UI", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
}

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

a:hover,
a:focus {
  color: var(--brand);
}

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

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal;
}

.site-wrap {
  min-height: 100vh;
}

.container {
  margin: 0 auto;
  max-width: var(--container);
  padding: 0 20px;
}

.site-header {
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.16);
  color: #fff;
  position: relative;
  z-index: 20;
}

.header-inner {
  align-items: center;
  display: grid;
  gap: 24px;
  grid-template-columns: 214px 1fr auto;
  min-height: 96px;
}

.site-branding {
  align-items: center;
  background: #fff;
  border-radius: 0;
  color: #d7192d;
  display: flex;
  height: 66px;
  justify-content: center;
  padding: 10px 16px;
  width: 214px;
}

.custom-logo-link,
.custom-logo-link img {
  max-height: 52px;
  width: auto;
}

.text-logo {
  color: #d7192d;
  font-family: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
  font-size: 34px;
  letter-spacing: 0;
  line-height: 0.9;
  text-align: center;
  text-transform: uppercase;
}

.text-logo span {
  color: #222;
  display: block;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.main-navigation ul {
  align-items: center;
  display: flex;
  gap: 0;
  justify-content: flex-start;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-navigation a {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  padding: 38px 18px;
}

.main-navigation a:hover,
.main-navigation a:focus {
  background: rgba(0, 0, 0, 0.12);
  color: #fff;
}

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

.search-toggle,
.menu-toggle,
.back-to-top {
  align-items: center;
  border: 0;
  cursor: pointer;
  display: inline-flex;
  justify-content: center;
}

.search-toggle {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 50%;
  color: #202020;
  height: 34px;
  width: 34px;
}

.advanced-link {
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  padding: 35px 0;
}

.menu-toggle {
  background: rgba(0, 0, 0, 0.18);
  color: #fff;
  display: none;
  height: 40px;
  width: 44px;
}

.search-panel {
  background: rgba(16, 16, 16, 0.98);
  border-bottom: 1px solid var(--line);
  display: none;
  padding: 18px 0;
}

.search-panel.is-open {
  display: block;
}

.search-form {
  display: flex;
  gap: 10px;
}

.search-form input[type="search"] {
  background: #f4f4f4;
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #111;
  flex: 1;
  font: inherit;
  min-height: 46px;
  padding: 0 16px;
}

.search-form button,
.button,
.wp-block-button__link {
  background: var(--brand);
  border: 0;
  border-radius: var(--radius);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
  min-height: 42px;
  padding: 0 18px;
}

.button {
  align-items: center;
  display: inline-flex;
  justify-content: center;
  text-align: center;
}

.search-form button:hover,
.search-form button:focus,
.button:hover,
.button:focus,
.wp-block-button__link:hover,
.wp-block-button__link:focus {
  background: var(--brand-2);
  color: #fff;
}

.button-secondary {
  background: #2f2f2f;
  border: 1px solid var(--line);
}

.button-secondary:hover,
.button-secondary:focus {
  background: #3a3a3a;
  color: #fff;
}

.button-disabled {
  background: #242424;
  border: 1px solid var(--line);
  color: #777;
  cursor: not-allowed;
}

.section-band {
  padding: 30px 0 44px;
}

.search-page {
  background: var(--site-bg);
}

.search-hero {
  background: #141414;
  border-bottom: 1px solid var(--line);
  padding: 34px 0 30px;
}

.search-eyebrow {
  color: #ffdf5d;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0 0 8px;
  text-transform: uppercase;
}

.search-hero h1 {
  color: #fff;
  font-size: clamp(30px, 5vw, 54px);
  line-height: 1;
  margin: 0;
}

.search-count {
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  margin: 10px 0 22px;
}

.search-hero-form {
  max-width: 720px;
}

.search-results-list {
  display: grid;
  gap: 14px;
  margin-top: 4px;
  max-width: 860px;
}

.search-result-card {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: 112px minmax(0, 1fr);
  padding: 12px;
}

.search-result-card .cover {
  aspect-ratio: 3 / 4.2;
  background: #151515;
  display: block;
  overflow: hidden;
}

.search-result-card .cover img {
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
  width: 100%;
}

.search-result-card:hover .cover img {
  transform: scale(1.035);
}

.search-result-card .info {
  align-content: center;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.result-meta {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
}

.search-result-card h2 {
  color: #fff;
  font-size: 22px;
  line-height: 1.18;
  margin: 0;
}

.search-result-card p {
  color: #d5d5d5;
  display: -webkit-box;
  font-size: 14px;
  line-height: 1.45;
  margin: 0;
  max-width: 620px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}

.result-actions .button {
  min-height: 34px;
  padding: 0 12px;
}

.empty-state {
  background: #1b1b1b;
  border: 1px solid var(--line);
  padding: 34px;
  text-align: center;
}

.empty-state h2 {
  color: #fff;
  margin: 0 0 8px;
}

.empty-state p {
  color: var(--muted);
  margin: 0;
}

.popular-band {
  background: #111;
  border-bottom: 1px solid var(--line);
  padding: 16px 0 30px;
}

.section-title {
  background: var(--brand);
  color: #fff;
  display: inline-block;
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
  margin: 0 0 18px;
  padding: 9px 13px;
  position: relative;
}

.section-title::after {
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 9px solid var(--brand);
  bottom: -9px;
  content: "";
  left: 16px;
  position: absolute;
}

.section-heading-row {
  align-items: center;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.section-heading-row .section-title {
  margin-bottom: 0;
}

.popular-controls {
  align-items: center;
  display: flex;
  gap: 8px;
}

.popular-controls button {
  align-items: center;
  background: #2b2b2b;
  border: 1px solid var(--line);
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 28px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  line-height: 1;
  width: 38px;
}

.popular-controls button:hover,
.popular-controls button:focus {
  background: var(--brand);
}

.popular-slider {
  overflow: hidden;
}

.popular-track {
  display: flex;
  transition: transform 260ms ease;
  will-change: transform;
}

.popular-card {
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: grid;
  flex: 0 0 100%;
  grid-template-columns: minmax(220px, 32%) minmax(0, 1fr);
  min-height: 360px;
  overflow: hidden;
}

.popular-card .cover {
  background: #151515;
  display: block;
  min-height: 360px;
  overflow: hidden;
}

.popular-card .cover img {
  height: 100%;
  object-fit: cover;
  transform: scale(1.001);
  transition: transform 220ms ease;
  width: 100%;
}

.popular-card:hover .cover img {
  transform: scale(1.035);
}

.popular-card .info {
  align-content: center;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 34px;
}

.popular-kicker {
  color: #ffdf5d;
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 900;
  gap: 8px;
  text-transform: uppercase;
}

.popular-kicker span {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  padding: 6px 8px;
}

.popular-card h3 {
  color: #fff;
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 900;
  line-height: 1.05;
  margin: 0;
  max-width: 760px;
}

.popular-card h3 a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.popular-summary {
  color: #d8d8d8;
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
  max-width: 680px;
}

.popular-card .chapter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 0;
}

.popular-card .chapter-pill {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #f5f5f5;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  max-width: 170px;
  min-height: 30px;
  padding: 8px 11px;
  width: auto;
}

.popular-card .chapter-pill:hover,
.popular-card .chapter-pill:focus {
  background: rgba(235, 51, 73, 0.18);
  border-color: rgba(235, 51, 73, 0.55);
  color: #fff;
}

.popular-read {
  justify-self: start;
  margin-top: 4px;
}

.popular-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-top: 16px;
}

.popular-dots button {
  background: rgba(255, 255, 255, 0.32);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  height: 8px;
  padding: 0;
  width: 26px;
}

.popular-dots button.is-active {
  background: var(--brand);
}

.meta-date,
.manga-meta,
.entry-meta {
  color: var(--muted);
  font-size: 12px;
}

.chapter-pills {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.chapter-pill {
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 2px;
  color: #f7f7f7;
  display: block;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  overflow: hidden;
  padding: 5px 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.manga-grid {
  display: grid;
  gap: 34px 26px;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  align-items: start;
}

.manga-card {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  display: block;
  min-width: 0;
  overflow: hidden;
}

.manga-card .cover {
  aspect-ratio: 3 / 4.35;
  background: #202020;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04);
  display: block;
  overflow: hidden;
  position: relative;
  z-index: 1;
}

.manga-card .cover img {
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
  width: 100%;
}

.manga-card:hover .cover img {
  transform: scale(1.035);
}

.manga-card-body {
  background: var(--panel-bg);
  display: grid;
  gap: 6px;
  grid-template-rows: minmax(58px, auto) auto 1fr;
  min-height: 150px;
  min-width: 0;
  padding: 12px 12px 14px;
  position: relative;
  z-index: 2;
}

.manga-card h3 {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  min-height: 52px;
  overflow: hidden;
}

.manga-card h3 a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.rating {
  color: #fff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  gap: 5px;
  margin-bottom: 7px;
}

.rating::before {
  color: #ffc54a;
  content: "\2605\2605\2605\2605\2605";
  font-size: 11px;
}

.latest-links {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.chapter-entry {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-width: 0;
}

.latest-links .chapter-name {
  border: 1px solid #747474;
  border-radius: 9px;
  color: #f1f1f1;
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  max-width: 58%;
  overflow: hidden;
  padding: 6px 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.latest-links .chapter-name:hover,
.latest-links .chapter-name:focus {
  border-color: var(--brand);
  color: #fff;
}

.chapter-entry time {
  color: var(--muted);
  font-size: 10px;
  font-weight: 400;
  margin-left: auto;
  white-space: nowrap;
}

.chapter-new {
  background: var(--brand);
  color: #fff;
  font-size: 8px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  margin-left: auto;
  padding: 5px 6px;
  text-transform: uppercase;
}

.content-layout {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1fr) 300px;
}

.content-main,
.content-sidebar {
  min-width: 0;
}

.breadcrumb,
.breadcrumb a {
  color: var(--muted);
  font-size: 13px;
}

.manga-hero {
  background: #171717;
  border-bottom: 1px solid var(--line);
  padding: 34px 0;
}

.manga-hero-inner {
  display: grid;
  gap: 36px;
  grid-template-columns: 320px minmax(0, 1fr);
}

.manga-hero .cover {
  aspect-ratio: 3 / 4.2;
  background: #f2f2f2;
  box-shadow: var(--shadow);
  max-width: 320px;
  overflow: hidden;
}

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

.manga-title {
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.1;
  margin: 12px 0 12px;
}

.manga-badges,
.manga-rating-row {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.manga-read-button {
  margin: 18px 0 4px;
  min-width: 160px;
}

.manga-rating-row {
  margin: 18px 0 4px;
}

.status-pill,
.genre-pill {
  border-radius: 999px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  padding: 8px 11px;
}

.status-pill {
  background: rgba(235, 51, 73, 0.16);
  color: #ff8794;
}

.genre-pill {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  color: #f4f4f4;
}

.stats {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 22px 0;
  max-width: 760px;
}

.stat {
  border-bottom: 1px solid var(--line);
  padding: 12px 12px 12px 0;
}

.stat strong {
  color: #fff;
  display: block;
  font-size: 14px;
}

.stat span {
  color: var(--muted);
  font-size: 12px;
}

.entry-content {
  color: #d7d7d7;
}

.manga-summary {
  max-width: 780px;
}

.manga-summary h2 {
  color: #fff;
  font-size: 18px;
  margin: 0 0 8px;
}

.rating-widget {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 42px;
  padding: 6px 10px;
}

.rating-stars {
  display: inline-flex;
  gap: 2px;
}

.rating-stars span {
  color: #ffc54a;
  font-size: 18px;
  line-height: 1;
  padding: 3px;
}

.rating-widget-score {
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}

.rating-widget-count {
  color: var(--muted);
  font-size: 12px;
}

.chapter-list {
  background: var(--panel-bg);
  border: 1px solid var(--line);
}

.chapter-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 13px 16px;
}

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

.chapter-row a {
  color: #fff;
  font-weight: 800;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.chapter-row time {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 12px;
}

.reader {
  background: #101010;
  padding: 24px 0 48px;
}

.reader-title {
  margin: 0;
  text-align: center;
}

.reader-heading {
  display: grid;
  gap: 10px;
  margin: 0 auto 20px;
  max-width: 980px;
}

.reader-series-link {
  margin-bottom: 12px;
  text-align: center;
}

.reader-series-link a {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 13px;
  font-weight: 900;
  padding: 8px 13px;
}

.reader-content {
  margin: 0 auto;
  max-width: 980px;
}

.chapter-navigation {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin: 22px auto;
  max-width: 760px;
}

.chapter-navigation .button {
  border-radius: 999px;
  font-size: 13px;
  min-height: 34px;
  min-width: 108px;
  padding: 0 13px;
}

.chapter-navigation-top {
  align-items: center;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  border-radius: 999px;
  display: inline-flex;
  gap: 4px;
  justify-content: flex-end;
  justify-self: center;
  margin: 0;
  max-width: none;
  padding: 4px;
}

.chapter-navigation-top .button {
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 12px;
  min-height: 28px;
  min-width: 44px;
  padding: 0 9px;
}

.chapter-navigation-top .button:hover,
.chapter-navigation-top .button:focus {
  background: rgba(255, 255, 255, 0.1);
}

.chapter-navigation-top .button:not(.button-secondary) {
  background: var(--brand);
}

.chapter-navigation-bottom {
  margin-top: 28px;
}

.reader-content .chapter-demo-panel {
  background: #191919;
  border: 1px solid var(--line);
  margin: 0 auto 18px;
  max-width: 760px;
  padding: 22px;
}

.reader-content .chapter-demo-art {
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 24% 28%, rgba(255, 255, 255, 0.28), transparent 15%),
    linear-gradient(135deg, #121212 0%, #312641 50%, #eb3349 100%);
  border: 1px solid var(--line);
  margin-bottom: 18px;
}

.reader-content img {
  display: block;
  margin: 0 auto 12px;
  max-width: 100%;
}

.reader-images,
.reader-content > .d-flex.flex-column {
  display: grid;
  gap: 10px;
  justify-items: center;
  margin: 0 auto;
  width: min(100%, 760px);
}

.reader-images img,
.reader-content > .d-flex.flex-column > img {
  height: auto;
  margin: 0;
  max-width: none;
  width: 100%;
}

.post-navigation,
.pagination {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 30px;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-numbers,
.post-page-numbers,
.nav-previous a,
.nav-next a {
  background: #333;
  color: #fff;
  display: inline-flex;
  font-weight: 800;
  min-height: 38px;
  min-width: 38px;
  padding: 8px 12px;
}

.page-numbers.current {
  background: var(--brand);
}

.manga-home-pagination {
  margin-top: 34px;
}

.sidebar-widget {
  background: var(--panel-bg);
  border: 1px solid var(--line);
  margin-bottom: 22px;
  padding: 18px;
}

.sidebar-widget h2,
.sidebar-widget h3 {
  border-bottom: 1px solid var(--line);
  font-size: 15px;
  margin: 0 0 14px;
  padding-bottom: 10px;
}

.sidebar-widget .latest-links a {
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  padding: 8px 0;
}

.sidebar-widget .latest-links a:last-child {
  border-bottom: 0;
}

.sidebar-manga-grid {
  display: grid;
  gap: 14px;
}

.sidebar-manga-card {
  background: #242424;
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: 78px minmax(0, 1fr);
  overflow: hidden;
  padding: 10px;
}

.sidebar-manga-card .cover {
  aspect-ratio: 3 / 4.2;
  background: #171717;
  display: block;
  overflow: hidden;
}

.sidebar-manga-card .cover img {
  height: 100%;
  object-fit: cover;
  transition: transform 180ms ease;
  width: 100%;
}

.sidebar-manga-card:hover .cover img {
  transform: scale(1.035);
}

.sidebar-manga-card .info {
  align-content: center;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.sidebar-manga-card h3 {
  border: 0;
  font-size: 13px;
  line-height: 1.25;
  margin: 0;
  padding: 0;
}

.sidebar-manga-card h3 a {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.sidebar-manga-card .chapter-link {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-footer {
  background: #111;
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 34px 0;
  text-align: center;
}

.back-to-top {
  background: #111;
  border: 1px solid var(--line);
  bottom: 18px;
  color: #fff;
  display: none;
  height: 36px;
  position: fixed;
  right: 18px;
  width: 36px;
  z-index: 50;
}

.back-to-top.is-visible {
  display: inline-flex;
}

@media (max-width: 1024px) {
  .header-inner {
    grid-template-columns: 210px 1fr auto;
  }

  .popular-card {
    grid-template-columns: minmax(190px, 34%) minmax(0, 1fr);
  }
}

@media (max-width: 780px) {
  .header-inner {
    gap: 16px;
    grid-template-columns: 1fr auto;
    min-height: 82px;
  }

  .site-branding {
    height: 64px;
    width: 190px;
  }

  .text-logo {
    font-size: 30px;
  }

  .main-navigation {
    background: rgba(0, 0, 0, 0.94);
    display: none;
    grid-column: 1 / -1;
    margin: 0 -20px;
    order: 4;
    padding: 10px 20px 18px;
  }

  .main-navigation.is-open {
    display: block;
  }

  .main-navigation ul {
    align-items: stretch;
    display: grid;
    gap: 0;
  }

  .main-navigation a {
    border-bottom: 1px solid var(--line);
    display: block;
    padding: 12px 0;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .advanced-link {
    display: none;
  }

  .manga-grid {
    gap: 26px 18px;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  }

  .content-layout,
  .manga-hero-inner {
    grid-template-columns: 1fr;
  }

  .manga-hero .cover {
    margin: 0 auto;
    max-width: min(300px, 100%);
  }

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

  .reader-title {
    text-align: center;
  }
}

@media (max-width: 560px) {
  .container {
    padding: 0 16px;
  }

  .header-actions {
    gap: 10px;
  }

  .popular-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .popular-card .cover {
    aspect-ratio: 16 / 9;
    min-height: 0;
  }

  .popular-card .info {
    gap: 12px;
    padding: 20px;
  }

  .popular-card h3 {
    font-size: 26px;
  }

  .popular-summary {
    font-size: 14px;
  }

  .popular-card .chapter-pill {
    max-width: 148px;
    min-height: 28px;
    padding: 7px 10px;
  }

  .popular-read {
    width: 100%;
  }

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

  .search-result-card {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 12px;
    padding: 10px;
  }

  .search-result-card h2 {
    font-size: 16px;
  }

  .search-result-card p {
    -webkit-line-clamp: 1;
    font-size: 12px;
  }

  .result-actions .button {
    min-height: 30px;
    padding: 0 10px;
  }

  .manga-card h3 {
    font-size: 14px;
    min-height: 52px;
  }

  .manga-card-body {
    min-height: 142px;
    padding: 10px;
  }

  .latest-links a {
    font-size: 12px;
  }

  .search-form {
    display: grid;
  }

  .chapter-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .chapter-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 6px;
    width: 100%;
  }

  .chapter-navigation .button {
    font-size: 11px;
    min-height: 30px;
    min-width: 0;
    padding: 0 6px;
  }

  .chapter-navigation-bottom {
    grid-template-columns: 1fr;
  }

  .reader-heading {
    display: grid;
    gap: 10px;
  }

  .reader-title {
    padding: 0;
    text-align: center;
  }

  .chapter-navigation-top {
    justify-self: center;
    position: static;
    justify-content: center;
    width: auto;
  }

  .chapter-navigation-top .button {
    min-width: 44px;
  }
}
