/* the tale of the wind knight and the fire prince: novel index and chapter pages.
   Built on the blueprint look in css/site/index.css; this file only adds reading styles. */

/* ---------- title block ---------- */
.novel .hero h1.name,
.novel .page-head h1.name {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.novel .ch-title {
  font-family: "Noto Sans Thai", Inter, sans-serif;
  font-size: clamp(24px, 3.4vw, 36px);
}
.hero-kicker a {
  color: inherit;
}
.hero-kicker a:hover {
  color: var(--accent);
}
.authors {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 15px;
}
.author {
  display: block;
}
.kz,
.ny,
.mk {
  color: var(--txt);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--faint);
  text-underline-offset: 3px;
  transition: all 200ms;
}
.kz:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}
.ny:hover,
.mk:hover {
  color: var(--green);
  text-decoration-color: var(--green);
}

/* ---------- opening lines ---------- */
.poem {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 640px;
  margin: 0 auto;
  padding: 36px 28px;
  color: var(--muted);
  font-size: 15px;
  font-style: italic;
  line-height: 1.7;
  text-align: center;
}

/* ---------- reading column ---------- */
.reader-frame {
  box-sizing: border-box;
  max-width: 800px;
  margin: 0 auto;
  padding: 36px 28px 48px;
}
.reader-frame.note {
  padding-top: 28px;
}
.reader-frame.center {
  text-align: center;
}
.center-card {
  display: flex;
  justify-content: center;
}
.invis-card {
  width: 100%;
}
.p-text,
.p-text-h {
  display: block;
  margin: 0 0 14px;
  color: var(--txt);
  font-family: "Noto Sans Thai", Inter, sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 2;
}
.p-text-h {
  font-size: 18px;
  font-weight: 600;
}
.p-center {
  text-align: center;
}
.indent .p-text {
  text-indent: 40px;
}
.p-text-p {
  color: var(--txt);
  font-family: Sarabun, "Noto Sans Thai", Inter, sans-serif;
  font-size: 19px;
  font-weight: 300;
  line-height: 2;
  text-indent: 40px;
}
.p-text-p > div {
  margin-bottom: 22px;
}
.warning {
  color: var(--pink);
  font-weight: 700;
  text-decoration: underline;
}
.ch-name {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 600;
  text-align: center;
}
.raw {
  display: block;
  max-width: 100%;
  margin: 12px auto 0;
  border: 1px solid var(--line-2);
}
.reader-frame a:not(.btn) {
  color: var(--accent);
}
.reader-frame .p-text[style] {
  text-indent: 0;
}

/* ---------- chapter list ---------- */
.ch-meta {
  margin-top: 6px;
  color: var(--faint);
  font-size: 11px;
}
.row.compact .when {
  line-height: 1.7;
}
.list-end,
.copyright {
  padding: 18px 28px;
  color: var(--faint);
  text-align: center;
  line-height: 1.8;
  text-transform: none;
  border-top: 1px solid transparent;
  border-image: var(--dash-img) 1 repeat;
}
.copyright {
  border-top: 0;
  border-image: none;
}

/* ---------- prev / next ---------- */
.ch-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid transparent;
  border-image: var(--dash-img) 1 repeat;
}
.btn.off {
  color: var(--faint);
  opacity: 0.5;
  cursor: not-allowed;
}
.btn.off:hover {
  background-color: transparent;
  border-color: var(--line-2);
}
.g-control {
  position: fixed;
  bottom: 30px;
  left: 30px;
  z-index: 5;
  display: flex;
  border: 1px solid var(--line-2);
  background-color: rgba(255, 255, 255, 0.04);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}
.light-theme .g-control {
  background-color: rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
}
.control {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  color: var(--accent);
  font-size: 16px;
  transition: background-color 200ms;
}
.control + .control {
  border-left: 1px solid var(--line-2);
}
.control:hover {
  background-color: var(--hover);
}
.control.off {
  color: var(--faint);
  opacity: 0.5;
  pointer-events: none;
}
@media (max-width: 800px) {
  .g-control {
    bottom: 25px;
    left: 25px;
  }
}
@media (max-width: 600px) {
  .g-control {
    bottom: 20px;
    left: 20px;
  }
  .reader-frame {
    padding: 28px 18px 40px;
  }
  .p-text-p {
    font-size: 18px;
  }
}

/* the cover is a 2000x190 banner: full width under the title, not a square beside it */
.novel .hero {
  grid-template-columns: 1fr;
}
.novel .hero-figure {
  display: block;
  padding: 28px 40px 36px;
  border-left: 0;
  border-top: 1px solid var(--line);
}
.novel .hero-figure .fig {
  position: static;
  display: block;
  margin-bottom: 14px;
}
.novel .portrait {
  width: 100%;
  padding: 10px;
}
.novel .portrait img {
  aspect-ratio: auto;
  object-fit: contain;
  filter: none;
}
@media (max-width: 600px) {
  .novel .hero-figure {
    padding: 22px 18px 28px;
  }
}

/* ---------- shared by the other novels ---------- */
.novel .portrait.narrow {
  max-width: 520px;
  margin: 0 auto;
}
.bo,
.pui {
  color: var(--txt);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--faint);
  text-underline-offset: 3px;
  transition: all 200ms;
}
.bo:hover {
  color: var(--purple);
  text-decoration-color: var(--purple);
}
.pui:hover {
  color: var(--pink);
  text-decoration-color: var(--pink);
}
/* footnote markers in chapter text */
.fn {
  color: var(--accent);
  text-decoration: none;
  vertical-align: super;
  font-size: 0.7em;
}
.reader-frame .reader-frame {
  padding: 0;
}
.reader-frame.center + .reader-frame.center {
  padding-top: 0;
}
/* chapters that are not open yet */
.row.closed {
  grid-template-columns: 210px 1fr auto;
  align-items: center;
  opacity: 0.55;
}
.row.closed h3 {
  font-size: 16px;
}
.closed-tag {
  color: var(--faint);
  white-space: nowrap;
}
.closed-tag i {
  margin-right: 6px;
}

/* ---------- chapter list popup (js/novel-list.js) ---------- */
.chlist {
  box-sizing: border-box;
  width: min(560px, calc(100vw - 32px));
  max-height: min(78vh, 720px);
  margin: auto;
  padding: 0;
  border: 1px solid var(--line-2);
  color: var(--txt);
  background-color: var(--panel);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}
.chlist[open] {
  display: flex;
  flex-direction: column;
}
.chlist::backdrop {
  background-color: rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.chlist-head,
.chlist-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
}
.chlist-head {
  border-bottom: 1px solid var(--line-2);
}
.chlist-head .mono {
  color: var(--faint);
}
.chlist-foot {
  border-top: 1px solid var(--line-2);
}
.chlist-x {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line-2);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: all 200ms;
}
.chlist-x:hover {
  color: var(--txt);
  border-color: var(--txt);
}
.chlist-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.chlist-row {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: baseline;
  gap: 12px;
  padding: 12px 18px;
  border-top: 1px solid transparent;
  border-image: var(--dash-img) 1 repeat;
  font-size: 15px;
  line-height: 1.5;
  transition: background-color 200ms;
}
.chlist-row:first-child {
  border-top: 0;
  border-image: none;
}
a.chlist-row:hover {
  background-color: var(--hover);
}
.chlist-no {
  white-space: nowrap;
  color: var(--faint);
}
.chlist-row.current {
  background-color: var(--hover);
  box-shadow: inset 2px 0 0 var(--accent);
}
.chlist-row.current .chlist-title {
  color: var(--accent);
}
.chlist-row.closed {
  opacity: 0.5;
}

/* 200yrs: three verses and a teaser */
.poem + .poem {
  padding-top: 0;
}
.cover-box {
  max-width: 560px;
  margin: 28px auto 0;
  padding: 10px;
  background-color: var(--panel);
}
.cover-box img {
  display: block;
  width: 100%;
  height: auto;
}
