/*
Theme Name: Doujinaxis Axis
Theme URI: https://doujinaxis.com/
Author: ny studio
Description: ธีม Doujinaxis แบบ mobile-first ต่อข้อมูลจริงจากปลั๊กอิน Manga Library Connector (หน้าแรก คลัง ค้นหา หน้าเรื่อง หน้าอ่าน ชั้นอ่านของฉัน)
Version: 1.1.0
Requires at least: 6.4
Requires PHP: 7.4
Text Domain: doujinaxis-axis
*/

@font-face {
  font-family: "Kanit Local";
  src: url("assets/fonts/kanit-400-thai.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0E00-0E7F;
}

.wp-fallback {
  min-height: 70vh;
  padding: 7rem 0 5rem;
  background: var(--ink);
  color: var(--cream);
}

.wp-fallback .article-list a {
  color: inherit;
}

@font-face {
  font-family: "Kanit Local";
  src: url("assets/fonts/kanit-400-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0000-024F;
}

@font-face {
  font-family: "Kanit Local";
  src: url("assets/fonts/kanit-600-thai.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0E00-0E7F;
}

@font-face {
  font-family: "Kanit Local";
  src: url("assets/fonts/kanit-600-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0000-024F;
}

@font-face {
  font-family: "Kanit Local";
  src: url("assets/fonts/kanit-800-thai.woff2") format("woff2");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  unicode-range: U+0E00-0E7F;
}

@font-face {
  font-family: "Kanit Local";
  src: url("assets/fonts/kanit-800-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  unicode-range: U+0000-024F;
}

:root {
  --ink: #11152c;
  --ink-raised: #171b36;
  --station: #1b2040;
  --station-soft: #242a4f;
  --paper: #f5f2ff;
  --paper-soft: #dedcf0;
  --muted: #b9bbd3;
  --coral: #ff6f91;
  --coral-soft: #ffb2c3;
  --cyan: #65e7ff;
  --cyan-soft: #c6f7ff;
  --violet: #a78bfa;
  --cream: #fff4dd;
  --dark-text: #16172a;
  --line: rgba(198, 247, 255, 0.16);
  --line-strong: rgba(198, 247, 255, 0.34);
  --shadow: 0 22px 70px rgba(3, 6, 24, 0.38);
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --shell: 1180px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 86px;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--paper);
  background: var(--ink);
  font-family: "Kanit Local", "Leelawadee UI", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
}

body.menu-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

img,
svg {
  display: block;
}

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

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--cyan);
  outline-offset: 4px;
}

::selection {
  color: var(--dark-text);
  background: var(--cyan);
}

.shell {
  width: min(calc(100% - 32px), var(--shell));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  z-index: 999;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  color: var(--dark-text);
  background: var(--cyan);
  border-radius: 8px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.signal-bar {
  position: relative;
  z-index: 30;
  color: var(--dark-text);
  background: var(--cyan);
}

.signal-bar__inner {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  font-size: 13px;
  line-height: 1.4;
}

.signal-bar p {
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.signal-bar a {
  display: none;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.signal-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  background: var(--coral);
  border: 2px solid var(--dark-text);
  border-radius: 50%;
}

.site-header {
  position: sticky;
  z-index: 25;
  top: 0;
  background: rgba(17, 21, 44, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

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

.brand {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 800;
}

.brand__mark {
  width: 40px;
  height: 40px;
  filter: drop-shadow(0 7px 12px rgba(3, 6, 24, 0.28));
}

.brand__mark .brand__d {
  fill: var(--coral);
}

.brand__mark .brand__fold {
  fill: var(--cyan);
}

.brand__mark .brand__page-lines {
  fill: none;
  stroke: var(--cream);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.brand__text {
  font-size: 22px;
  line-height: 1;
  letter-spacing: -0.035em;
}

.brand__text span {
  color: var(--coral);
}

.desktop-nav {
  display: none;
}

.icon-button {
  width: 46px;
  height: 46px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  background: var(--station);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  cursor: pointer;
}

.icon-button svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.mobile-menu {
  position: fixed;
  z-index: 24;
  top: 110px;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 22px 16px 48px;
  background: var(--ink);
}

.mobile-menu a {
  min-height: 58px;
  display: flex;
  align-items: center;
  padding-inline: 18px;
  font-size: 19px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 54px 0 66px;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    radial-gradient(circle at 80% 25%, rgba(167, 139, 250, 0.15), transparent 26%),
    var(--ink);
  background-size: 44px 44px, 44px 44px, auto, auto;
}

.hero::before {
  content: "";
  position: absolute;
  top: 84px;
  right: -82px;
  width: 190px;
  height: 190px;
  border: 1px solid rgba(101, 231, 255, 0.28);
  border-radius: 50%;
}

.hero-grid {
  position: relative;
}

.route-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 15px;
  color: var(--cyan-soft);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
}

.route-label span {
  display: inline-flex;
  align-items: center;
  min-height: 29px;
  padding: 3px 9px;
  color: var(--dark-text);
  background: var(--cyan);
  border-radius: 6px;
}

.hero h1 {
  max-width: 730px;
  margin: 0;
  font-size: clamp(34px, 11vw, 56px);
  line-height: 1.15;
  letter-spacing: -0.045em;
}

.hero-lead {
  max-width: 670px;
  margin: 20px 0 0;
  color: var(--paper-soft);
  font-size: 17px;
  line-height: 1.75;
}

.hero-search {
  position: relative;
  max-width: 680px;
  min-height: 62px;
  display: grid;
  grid-template-columns: 25px 1fr auto;
  align-items: center;
  gap: 10px;
  margin-top: 28px;
  padding: 6px 6px 6px 17px;
  background: var(--paper);
  border: 2px solid transparent;
  border-radius: 15px;
  box-shadow: 0 14px 36px rgba(3, 6, 24, 0.32);
}

.hero-search:focus-within {
  border-color: var(--cyan);
}

.hero-search svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: #61647d;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.hero-search input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0;
  color: var(--dark-text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 16px;
}

.hero-search input::placeholder {
  color: #6c6e85;
}

.hero-search button {
  min-width: 78px;
  min-height: 48px;
  padding: 0 18px;
  color: var(--dark-text);
  background: var(--coral);
  border: 0;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
}

.quick-routes {
  display: flex;
  gap: 8px;
  margin-top: 15px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.quick-routes::-webkit-scrollbar {
  display: none;
}

.route-chip {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 14px;
  color: var(--paper-soft);
  background: var(--station);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
}

.route-chip.is-active {
  color: var(--dark-text);
  background: var(--cyan);
  border-color: var(--cyan);
  font-weight: 600;
}

.cover-orbit {
  position: relative;
  width: min(100%, 440px);
  height: 430px;
  margin: 48px auto 0;
}

.orbit-axis {
  position: absolute;
  background: var(--line-strong);
}

.orbit-axis::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  background: var(--cyan);
  border: 3px solid var(--ink);
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--cyan);
}

.orbit-axis--x {
  top: 56%;
  right: 0;
  left: 0;
  height: 1px;
}

.orbit-axis--x::after {
  right: 0;
  top: -4px;
}

.orbit-axis--y {
  top: 0;
  bottom: 0;
  left: 49%;
  width: 1px;
}

.orbit-axis--y::after {
  top: 0;
  left: -4px;
}

.orbit-card {
  position: absolute;
  overflow: hidden;
  background: var(--station);
  border: 1px solid rgba(245, 242, 255, 0.42);
  border-radius: 15px;
  box-shadow: var(--shadow);
}

.orbit-card .cover {
  height: 100%;
}

.orbit-card--main {
  z-index: 3;
  top: 35px;
  left: 13%;
  width: 54%;
  aspect-ratio: 3 / 4;
  transform: rotate(-3deg);
}

.orbit-card--back {
  z-index: 1;
  top: 5px;
  right: 8%;
  width: 39%;
  aspect-ratio: 3 / 4;
  transform: rotate(8deg);
  filter: saturate(0.75) brightness(0.83);
}

.orbit-card--side {
  z-index: 2;
  right: 1%;
  bottom: 1px;
  width: 38%;
  aspect-ratio: 3 / 4;
  transform: rotate(5deg);
}

.orbit-card__meta {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 40px 13px 13px;
  background: linear-gradient(transparent, rgba(8, 10, 27, 0.95));
  transform: rotate(3deg);
}

.orbit-card__meta span,
.orbit-card__meta strong {
  display: block;
}

.orbit-card__meta span {
  color: var(--cyan);
  font-size: 11px;
}

.orbit-card__meta strong {
  font-size: 16px;
  line-height: 1.35;
}

.orbit-note {
  position: absolute;
  z-index: 4;
  padding: 3px 8px;
  color: var(--cyan-soft);
  background: var(--ink);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  font-size: 11px;
  line-height: 1.5;
}

.orbit-note--one {
  top: 52%;
  left: 0;
}

.orbit-note--two {
  top: 0;
  left: calc(49% + 8px);
}

/* 1.1.0: ถอดสไปรท์ปกตัวอย่าง (assets/cover-sprite.webp) กับคลาส .cover--1…8 ออก
   ปกทุกใบมาจากคลังจริงแล้ว (.cover--real) · ไม่มีปก = .cover--none ท้ายไฟล์ */
.cover {
  width: 100%;
  aspect-ratio: 3 / 4;
  background-repeat: no-repeat;
  background-color: var(--station-soft);
}

.catalog-section,
.updates-section {
  position: relative;
  padding: 72px 0;
  background: var(--ink-raised);
}

.catalog-section::before,
.updates-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: min(calc(100% - 32px), var(--shell));
  height: 1px;
  background: linear-gradient(90deg, var(--cyan), transparent 50%);
  transform: translateX(-50%);
}

.section-heading {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 30px;
}

.section-heading h2,
.genre-intro h2,
.article-sticky h2,
.closing-route h2 {
  margin: 0;
  font-size: clamp(30px, 8.5vw, 44px);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.section-heading__note {
  margin: 0;
  color: var(--muted);
}

.section-heading__note strong {
  color: var(--coral);
  font-size: 24px;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 26px 12px;
}

.story-card {
  position: relative;
  min-width: 0;
  border-radius: var(--radius-sm);
  transition: transform 180ms ease;
}

.story-card__cover {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--station-soft);
  border: 1px solid rgba(245, 242, 255, 0.17);
  border-radius: var(--radius-sm);
}

.story-card__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  border-radius: inherit;
  transition: border-color 180ms ease;
}

.story-card__cover .cover {
  transition: transform 220ms ease, filter 220ms ease;
}

.status-badge,
.coordinate {
  position: absolute;
  z-index: 2;
  line-height: 1.4;
}

.status-badge {
  top: 8px;
  left: 8px;
  min-height: 27px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  color: var(--dark-text);
  background: var(--coral);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.status-badge--cyan { background: var(--cyan); }
.status-badge--violet { background: var(--violet); }

.coordinate {
  right: 8px;
  bottom: 8px;
  padding: 3px 7px;
  color: var(--cyan-soft);
  background: rgba(17, 21, 44, 0.88);
  border: 1px solid rgba(198, 247, 255, 0.45);
  border-radius: 5px;
  font-size: 10px;
}

.story-card__body {
  padding: 12px 2px 0;
}

.story-card__genre {
  margin: 0 0 4px;
  color: var(--cyan);
  font-size: 12px;
  line-height: 1.5;
}

.story-card h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.45;
}

.story-card h3 a {
  display: -webkit-box;
  min-height: 49px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.story-card__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 8px;
  margin-top: 9px;
  padding-top: 8px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
  line-height: 1.5;
}

.story-card__footer span {
  color: var(--paper-soft);
}

.story-card.is-picked {
  animation: picked 1.2s ease;
}

@keyframes picked {
  0%, 100% { transform: translateY(0); }
  35% { transform: translateY(-9px); }
  50% { box-shadow: 0 0 0 5px var(--cyan); }
}

.empty-state {
  margin-top: 28px;
  padding: 34px 20px;
  text-align: center;
  background: var(--station);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
}

.empty-state svg {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 2;
}

.empty-state h3 {
  margin: 0;
  font-size: 22px;
}

.empty-state p {
  max-width: 520px;
  margin: 8px auto 18px;
  color: var(--muted);
}

.empty-state button {
  min-height: 46px;
  padding: 8px 18px;
  color: var(--dark-text);
  background: var(--cyan);
  border: 0;
  border-radius: 9px;
  font-weight: 600;
  cursor: pointer;
}

.genre-section {
  padding: 72px 0;
  color: var(--dark-text);
  background: var(--cyan-soft);
}

.route-label--dark {
  color: #3f4665;
}

.route-label--dark span {
  color: var(--paper);
  background: var(--ink);
}

.genre-intro > p:last-child {
  max-width: 600px;
  margin: 18px 0 0;
  color: #484d68;
}

.genre-map {
  display: grid;
  gap: 10px;
  margin-top: 30px;
}

.genre-map a {
  min-height: 88px;
  display: grid;
  grid-template-columns: 48px 1fr;
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  padding: 14px;
  color: var(--paper);
  background: var(--ink-raised);
  border: 1px solid rgba(17, 21, 44, 0.16);
  border-radius: 13px;
  box-shadow: 5px 5px 0 rgba(17, 21, 44, 0.16);
}

.genre-map__icon {
  grid-row: 1 / 3;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  color: var(--cyan);
  background: var(--station-soft);
  border-radius: 50%;
}

.genre-map__icon svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.genre-map strong {
  align-self: end;
  font-size: 17px;
}

.genre-map small {
  align-self: start;
  color: var(--muted);
  font-size: 13px;
}

.updates-section {
  background: var(--ink);
}

.status-filters {
  display: flex;
  gap: 7px;
  max-width: 100%;
  padding-bottom: 3px;
  overflow-x: auto;
}

.status-filters button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 13px;
  color: var(--paper-soft);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
}

.status-filters button.is-active {
  color: var(--dark-text);
  background: var(--coral);
  border-color: var(--coral);
  font-weight: 600;
}

.updates-layout {
  display: grid;
  gap: 28px;
}

.episode-list {
  border-top: 1px solid var(--line-strong);
}

.episode-row {
  display: grid;
  grid-template-columns: 47px 1fr;
  gap: 14px;
  padding: 19px 0;
  border-bottom: 1px solid var(--line);
}

.episode-row__time {
  width: 47px;
  height: 55px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--dark-text);
  background: var(--paper);
  border-radius: 8px;
  line-height: 1.1;
}

.episode-row__time strong {
  font-size: 20px;
}

.episode-row__time span {
  margin-top: 3px;
  font-size: 11px;
}

.episode-row__main {
  min-width: 0;
  display: grid;
  grid-template-columns: 9px 1fr;
  gap: 10px;
  align-items: start;
}

.episode-dot {
  width: 9px;
  height: 9px;
  margin-top: 9px;
  background: var(--coral);
  border-radius: 50%;
}

.episode-dot--cyan { background: var(--cyan); }
.episode-dot--violet { background: var(--violet); }

.episode-row h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
}

.episode-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.episode-row > a {
  grid-column: 2;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  color: var(--dark-text);
  background: var(--cyan);
  border-radius: 8px;
  font-weight: 600;
}

.episode-row > a svg,
.text-link svg,
.closing-route a svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ranking {
  padding: 22px;
  background: var(--station);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
}

.ranking__heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--line-strong);
}

.ranking__heading h3 {
  margin: 0;
  font-size: 19px;
}

.ranking__heading span {
  flex: 0 0 auto;
  color: var(--cyan);
  font-size: 12px;
}

.ranking ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranking li {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.ranking li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.ranking li > span {
  color: var(--coral);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.2;
}

.ranking strong,
.ranking small {
  display: block;
}

.ranking strong {
  line-height: 1.45;
}

.ranking small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.article-section {
  padding: 78px 0;
  color: var(--dark-text);
  background: var(--cream);
}

.article-sticky .route-label {
  color: #50536a;
}

.article-sticky .route-label span {
  color: var(--paper);
  background: var(--ink);
}

.article-sticky > p:not(.route-label) {
  max-width: 560px;
  margin: 18px 0 0;
  color: #56586e;
}

.text-link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 20px;
  color: var(--dark-text);
  font-weight: 600;
  border-bottom: 2px solid var(--coral);
}

.article-list {
  margin-top: 38px;
  border-top: 2px solid var(--dark-text);
}

.article-list article {
  padding: 28px 0;
  border-bottom: 1px solid rgba(22, 23, 42, 0.22);
}

.article-index {
  color: #6b6881;
  font-size: 12px;
  font-weight: 600;
}

.article-list h3 {
  max-width: 700px;
  margin: 8px 0 0;
  font-size: 23px;
  line-height: 1.45;
  letter-spacing: -0.02em;
}

.article-list p {
  max-width: 720px;
  margin: 14px 0 0;
  color: #4d4f63;
  line-height: 1.85;
}

.article-list a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  margin-top: 13px;
  color: #39305f;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--violet);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

.closing-route {
  padding: 50px 0;
  background:
    linear-gradient(90deg, rgba(101, 231, 255, 0.09) 1px, transparent 1px),
    var(--coral);
  background-size: 28px 100%, auto;
}

.closing-route__inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  color: var(--dark-text);
}

.closing-route p {
  margin: 0 0 5px;
  font-weight: 600;
}

.closing-route a {
  min-height: 50px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 17px;
  color: var(--paper);
  background: var(--ink);
  border-radius: 10px;
  font-weight: 600;
}

.site-footer {
  padding: 62px 0 24px;
  background: #0e1125;
}

.footer-grid {
  display: grid;
  gap: 34px;
}

.brand--footer {
  margin-bottom: 13px;
}

.footer-brand p {
  max-width: 470px;
  margin: 0;
  color: var(--muted);
}

.footer-column {
  display: grid;
  gap: 4px;
}

.footer-column h2 {
  margin: 0 0 8px;
  color: var(--cyan);
  font-size: 15px;
}

.footer-column a {
  min-height: 44px;
  display: flex;
  align-items: center;
  color: var(--paper-soft);
}

.footer-note {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  padding: 17px;
  background: var(--station);
  border-left: 3px solid var(--coral);
  border-radius: 8px;
}

.footer-note svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: var(--coral-soft);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.footer-note p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.footer-note strong {
  display: block;
  color: var(--paper);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 42px;
  padding-top: 20px;
  color: #9598b6;
  border-top: 1px solid var(--line);
  font-size: 12px;
}

.footer-bottom p {
  margin: 0;
}

.footer-bottom a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--paper-soft);
}

.footer-bottom a svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (hover: hover) {
  .desktop-nav a:hover,
  .footer-column a:hover,
  .footer-bottom a:hover {
    color: var(--cyan);
  }

  .icon-button:hover,
  .route-chip:hover,
  .status-filters button:hover {
    border-color: var(--cyan);
  }

  .story-card:hover {
    transform: translateY(-4px);
  }

  .story-card:hover .story-card__cover::after {
    border-color: var(--cyan);
  }

  .story-card:hover .cover {
    transform: scale(1.025);
    filter: saturate(1.08);
  }

  .genre-map a:hover {
    transform: translate(-2px, -2px);
    box-shadow: 7px 7px 0 rgba(17, 21, 44, 0.18);
  }

  .episode-row > a:hover,
  .hero-search button:hover {
    background: var(--coral-soft);
  }
}

@media (min-width: 680px) {
  .shell {
    width: min(calc(100% - 48px), var(--shell));
  }

  .signal-bar a {
    display: inline;
  }

  .hero {
    padding-top: 70px;
  }

  .hero h1 {
    font-size: 52px;
  }

  .cover-orbit {
    height: 500px;
  }

  .orbit-card--main {
    width: 50%;
  }

  .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 32px 18px;
  }

  .section-heading {
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
  }

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

  .episode-row {
    grid-template-columns: 58px 1fr auto;
    align-items: center;
  }

  .episode-row__time {
    width: 55px;
  }

  .episode-row > a {
    grid-column: 3;
    min-width: 126px;
  }

  .closing-route__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
  }

  .footer-note {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (min-width: 920px) {
  body.menu-open {
    overflow: auto;
  }

  .header-inner {
    min-height: 78px;
  }

  .menu-button,
  .mobile-menu {
    display: none !important;
  }

  .desktop-nav {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .desktop-nav a {
    min-height: 46px;
    display: flex;
    align-items: center;
    padding: 0 13px;
    color: var(--muted);
    border-radius: 8px;
  }

  .desktop-nav a.is-active {
    color: var(--paper);
    background: var(--station);
  }

  .hero {
    padding: 84px 0 96px;
  }

  .hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.16fr) minmax(360px, 0.84fr);
    gap: 48px;
    align-items: center;
  }

  .hero h1 {
    font-size: clamp(52px, 5.2vw, 72px);
  }

  .cover-orbit {
    height: 500px;
    margin-top: 0;
  }

  .catalog-section,
  .updates-section {
    padding: 96px 0;
  }

  .catalog-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 38px 20px;
  }

  .story-card h3 {
    font-size: 18px;
  }

  .genre-section {
    padding: 92px 0;
  }

  .genre-layout {
    display: grid;
    grid-template-columns: minmax(300px, 0.8fr) minmax(0, 1.2fr);
    gap: 68px;
    align-items: center;
  }

  .genre-map {
    margin-top: 0;
  }

  .updates-layout {
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.55fr);
    gap: 42px;
    align-items: start;
  }

  .ranking {
    position: sticky;
    top: 104px;
  }

  .article-section {
    padding: 104px 0;
  }

  .article-grid {
    display: grid;
    grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
    gap: 76px;
    align-items: start;
  }

  .article-sticky {
    position: sticky;
    top: 112px;
  }

  .article-list {
    margin-top: 0;
  }

  .closing-route {
    padding: 64px 0;
  }

  .footer-grid {
    grid-template-columns: 1.4fr 0.7fr 0.9fr 1.25fr;
    align-items: start;
  }

  .footer-note {
    grid-column: auto;
  }
}

@media (min-width: 1240px) {
  .shell {
    width: min(calc(100% - 64px), var(--shell));
  }

  .catalog-grid {
    gap: 42px 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* =========================================================================
   ข้อมูลจริงจากคลัง (1.1.0)
   เพิ่มเพื่อรองรับปกจริง + หน้าเรื่อง + หน้าอ่าน + หน้ารวม/ค้นหา/ชั้นอ่าน
   ใช้ token ชุดเดิมทั้งหมด ไม่เปลี่ยนสี ฟอนต์ หรือโครงหน้าที่ตกลงกันไว้
   ========================================================================= */

.cover--real,
.cover--none {
  position: relative;
  overflow: hidden;
  background-image: none;
  background-color: var(--station-soft);
}

.cover--real img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* ปกสำรอง: ไล่สีจาก hash ของ slug (ส่วนหนึ่งของคลังไม่มีปก) */
.cover--none {
  display: grid;
  place-items: center;
  background-size: cover;
}

.cover--none span {
  color: var(--cream);
  font-size: clamp(34px, 9vw, 54px);
  font-weight: 800;
  line-height: 1;
  opacity: 0.85;
}

.orbit-card > a {
  display: block;
  height: 100%;
}

/* ชิปเส้นทางเป็นลิงก์จริงที่มี URL ของตัวเอง ไม่ใช่ปุ่ม JS */
a.route-chip {
  display: inline-flex;
  align-items: center;
}

.quick-routes--page {
  flex-wrap: wrap;
  overflow: visible;
}

.page-main {
  padding: 34px 0 64px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.breadcrumbs a {
  color: var(--cyan-soft);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.section-heading--page h1 {
  margin: 0;
  font-size: clamp(28px, 8vw, 44px);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.page-lead {
  max-width: 640px;
  margin: 14px 0 0;
  color: var(--paper-soft);
}

.hero-search--page {
  margin-top: 4px;
  margin-bottom: 20px;
}

.status-filters--page {
  flex-wrap: wrap;
  margin-bottom: 26px;
}

.status-filters--page a {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 7px 15px;
  color: var(--paper-soft);
  background: var(--station);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.status-filters--page a.is-active {
  color: var(--dark-text);
  background: var(--cyan);
  border-color: var(--cyan);
  font-weight: 600;
}

.section-more {
  margin: 26px 0 0;
}

.empty-state__link {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  color: var(--dark-text);
  background: var(--cyan);
  border-radius: 9px;
  font-weight: 600;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 36px;
}

/* WordPress พ่น .screen-reader-text ในตัวแบ่งหน้าของ core */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pagination .nav-links,
.page-main .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.pagination .page-numbers,
.page-main .nav-links .page-numbers {
  min-width: 46px;
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  color: var(--paper-soft);
  background: var(--station);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}

.pagination .page-numbers.current,
.page-main .nav-links .page-numbers.current {
  color: var(--dark-text);
  background: var(--cyan);
  border-color: var(--cyan);
  font-weight: 600;
}

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 20px;
  color: var(--paper);
  background: var(--station);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  font-weight: 600;
  cursor: pointer;
}

.button svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
}

.button--primary {
  color: var(--dark-text);
  background: var(--coral);
  border-color: var(--coral);
}

.button--ghost svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.button--ghost.is-saved {
  color: var(--dark-text);
  background: var(--cyan);
  border-color: var(--cyan);
}

.button--ghost.is-saved svg {
  fill: currentColor;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.series-hero {
  display: grid;
  gap: 26px;
  margin-bottom: 54px;
}

.series-hero__cover {
  position: relative;
  width: min(100%, 300px);
  overflow: hidden;
  border: 1px solid rgba(245, 242, 255, 0.17);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.series-hero__copy h1 {
  margin: 0;
  font-size: clamp(28px, 8vw, 42px);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.series-hero__alt {
  margin: 8px 0 0;
  color: var(--cyan-soft);
  font-size: 17px;
  line-height: 1.6;
}

.series-hero__warning {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin: 18px 0 0;
  padding: 10px 14px;
  color: var(--paper-soft);
  background: var(--station);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.6;
}

.series-hero__warning strong {
  padding: 2px 8px;
  color: var(--dark-text);
  background: var(--coral);
  border-radius: 5px;
  font-size: 12px;
}

.series-synopsis {
  margin-top: 24px;
  color: var(--paper-soft);
}

.series-synopsis h2 {
  margin: 0 0 6px;
  color: var(--paper);
  font-size: 18px;
}

.series-synopsis p {
  margin: 0 0 10px;
}

.series-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0 0;
  padding: 0;
}

.series-fact {
  padding: 12px 14px;
  background: var(--station);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.series-fact dt {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.series-fact dd {
  margin: 2px 0 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.chapter-section {
  margin-bottom: 54px;
}

.chapter-toolbar {
  margin-bottom: 16px;
}

.chapter-search {
  position: relative;
  max-width: 420px;
  min-height: 52px;
  display: grid;
  grid-template-columns: 22px 1fr;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  background: var(--station);
  border: 1px solid var(--line-strong);
  border-radius: 13px;
}

.chapter-search svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--cyan);
  stroke-width: 1.8;
  stroke-linecap: round;
}

.chapter-search input {
  width: 100%;
  min-width: 0;
  height: 40px;
  color: var(--paper);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 15px;
}

/* เรื่องที่มีตอนหลายร้อยตอนต้องอยู่ในกล่องเลื่อน ไม่ยาวลงไปทั้งหน้า */
.chapter-list {
  max-height: 540px;
  display: grid;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.chapter-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 12px;
  padding: 12px 14px;
  background: var(--station);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.chapter-row strong {
  font-size: 15px;
  line-height: 1.5;
}

.chapter-row small {
  grid-column: 1;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.chapter-row__number {
  grid-row: 1 / span 2;
  grid-column: 2;
  min-width: 48px;
  padding: 5px 9px;
  color: var(--cyan-soft);
  background: rgba(17, 21, 44, 0.88);
  border: 1px solid rgba(198, 247, 255, 0.45);
  border-radius: 6px;
  font-size: 12px;
  text-align: center;
}

/* ตอนที่รูปยังไม่พร้อม — แถวจาง ๆ ไม่ใช่ลิงก์ */
.chapter-row--pending {
  opacity: 0.55;
}

.chapter-row--pending .chapter-row__number {
  color: var(--muted);
  border-color: var(--line);
}

.catalog-section--inline {
  padding: 0;
  background: transparent;
}

.catalog-section--inline::before {
  display: none;
}

.reader-main {
  padding: 28px 0 86px;
}

.reader-head {
  margin-bottom: 26px;
}

.reader-head h1 {
  margin: 0;
  font-size: clamp(24px, 7vw, 36px);
  line-height: 1.25;
  letter-spacing: -0.03em;
}

.reader-head__note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.reader-panels {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto 28px;
  background: #05060f;
}

.reader-panel {
  width: 100%;
  max-width: 900px;
  margin: 0;
}

.reader-panel img {
  width: 100%;
  height: auto;
  display: block;
}

.reader-wait {
  margin-bottom: 28px;
  padding: 18px;
  background: var(--station);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  text-align: center;
}

.reader-wait h2 {
  margin: 0 0 6px;
  font-size: 21px;
}

.reader-wait .mlc-bar {
  background: rgba(198, 247, 255, 0.2);
}

.reader-wait .mlc-bar i {
  background: var(--cyan);
}

.reader-end {
  padding: 24px 20px;
  background: var(--ink-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-align: center;
}

.reader-end h2 {
  margin: 0;
  font-size: 23px;
}

.reader-end p {
  margin: 8px 0 18px;
  color: var(--muted);
}

.reader-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.reader-bottom-nav {
  position: sticky;
  z-index: 20;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  margin-top: 22px;
  background: rgba(17, 21, 44, 0.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.reader-bottom-nav a {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
}

.history-panel {
  margin-bottom: 44px;
}

.history-panel .episode-list:empty {
  display: none;
}

.episode-row__action {
  white-space: nowrap;
}

.episode-row h3 a,
.ranking strong a {
  color: inherit;
}

.prose {
  max-width: 760px;
  color: var(--paper-soft);
}

.prose h2,
.prose h3 {
  color: var(--paper);
  letter-spacing: -0.02em;
}

.prose a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

@media (hover: hover) {
  a.chapter-row:hover {
    background: var(--station-soft);
    border-color: var(--line-strong);
  }

  .status-filters--page a:hover,
  .pagination .page-numbers:hover,
  .button:hover {
    border-color: var(--cyan);
  }
}

@media (min-width: 768px) {
  .page-main {
    padding: 42px 0 80px;
  }

  .series-hero {
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 38px;
  }

  .series-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .reader-bottom-nav {
    display: none;
  }

  .reader-main {
    padding-bottom: 64px;
  }
}

@media (min-width: 1024px) {
  .footer-grid--3 {
    grid-template-columns: 1.4fr 0.9fr 1.25fr;
  }

  .series-hero {
    grid-template-columns: 340px minmax(0, 1fr);
  }

  .series-hero__cover {
    width: 100%;
  }
}
