.mnc-novel-content {
  letter-spacing: .035em !important;
  white-space: pre-wrap !important;
}

.mnc-novel-content,
.mnc-novel-content * {
  line-height: 1.8 !important;
}

body.single-novel .mnc-novel-reader-surface {
  position: relative;
  isolation: isolate;
}

/* Preserve line breaks entered in the synopsis field on the novel detail page. */
body.single-novel .synopsis {
  white-space: pre-line;
}

body.single-novel .detail-copy .tags span {
  font-size: 11px;
}

.novel-card .novel-card-tags span,
.series-archive-card .series-archive-tags span {
  font-size: 11px;
}

body.single-novel .detail-cover .mnc-detail-cover-reader-link {
  position: absolute;
  z-index: 2;
  inset: 0;
  cursor: pointer;
}

body.single-novel .detail-cover .mnc-detail-cover-reader-link:focus-visible {
  outline: 3px solid #fff;
  outline-offset: -7px;
}

body.mnc-reader-page .mnc-novel-reader-surface > .reader-header,
body.mnc-reader-page .mnc-novel-reader-surface > .reader-progress,
body.mnc-reader-page .mnc-novel-reader-surface > .reader-nav {
  position: relative;
  z-index: 1;
}

body.mnc-reader-page .reader-header > div {
  display: flex !important;
  flex-direction: row !important;
  align-items: baseline !important;
  justify-content: center !important;
  gap: 10px !important;
}

body.mnc-reader-page .reader-header small {
  font-size: 11px !important;
  color: var(--muted) !important;
  white-space: nowrap !important;
}

body.mnc-reader-page .reader-header small:empty {
  display: none !important;
}

body.mnc-reader-page .reader-header b {
  white-space: nowrap !important;
}

@media (max-width: 520px) {
  body.mnc-reader-page .reader-header small {
    font-size: 10px !important;
  }
}

body.single-novel .mnc-novel-reader-surface::before {
  content: "";
  position: fixed;
  z-index: -1;
  inset: 0;
  background-color: #e9ded0;
  background-image:
    linear-gradient(rgba(255, 252, 247, .08), rgba(255, 252, 247, .08)),
    url("papyrus-paper-sepia.jpg");
  background-repeat: repeat;
  background-size: auto, 720px 720px;
  opacity: .55;
  -webkit-mask-image:
    linear-gradient(
      to bottom,
      transparent,
      #000 12%,
      #000 88%,
      transparent
    ),
    linear-gradient(
      to right,
      transparent,
      #000 8%,
      #000 92%,
      transparent
    );
  -webkit-mask-composite: source-in;
  mask-image:
    linear-gradient(
      to bottom,
      transparent,
      #000 12%,
      #000 88%,
      transparent
    ),
    linear-gradient(
      to right,
      transparent,
      #000 8%,
      #000 92%,
      transparent
    );
  mask-composite: intersect;
  pointer-events: none;
}

/* Match the Top hero artwork when the dedicated reader is in dark mode. */
html[data-theme="dark"] body.mnc-reader-page .mnc-novel-reader-surface::before {
  background-color: #0b1712;
  background-image:
    linear-gradient(rgba(2, 8, 5, .62), rgba(2, 8, 5, .62)),
    linear-gradient(90deg, rgba(4, 14, 10, .96) 0%, rgba(5, 17, 12, .88) 38%, rgba(5, 17, 12, .5) 62%, rgba(3, 11, 8, .34) 82%, rgba(3, 10, 7, .46) 100%),
    var(--mnc-reader-dark-hero-image, none);
  background-position: center, center, center 72%;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 1;
  -webkit-mask-image: none;
  mask-image: none;
}

.mnc-novel-content p {
  margin: 0 !important;
  margin-block-end: 1.7em !important;
}

.mnc-novel-content br {
  display: block !important;
  content: "" !important;
  margin-block-end: 1.7em !important;
}

/* Match the editor's exact one-line blank markers. */
.mnc-novel-content .mnc-blank-line {
  box-sizing: border-box !important;
  display: block !important;
  inline-size: 100% !important;
  min-inline-size: 100% !important;
  block-size: 1.8em !important;
  min-block-size: 1.8em !important;
  padding: 0 !important;
  margin: 0 !important;
}

.mnc-novel-content .mnc-blank-line br {
  margin: 0 !important;
}

/* The title ornament supplies the opening pause in both reader directions. */
body.single-novel [data-novel-reader] .mnc-novel-content > .mnc-leading-blank,
body.single-novel [data-novel-reader] .mnc-novel-content > .mnc-break-adjacent-blank {
  display: none !important;
}

.tcy {
  text-combine-upright: all;
  -webkit-text-combine: horizontal;
}

.mnc-novel-content .mnc-align-bottom,
.mnc-novel-content p.mnc-align-bottom {
  text-align: end !important;
}

.mnc-novel-content .mnc-end-mark {
  box-sizing: border-box !important;
  display: block !important;
  inline-size: 100% !important;
  min-inline-size: 100% !important;
  block-size: 1.8em !important;
  min-block-size: 1.8em !important;
  margin: 0 !important;
  text-align: end !important;
  white-space: nowrap !important;
}

ruby rt {
  font-size: .5em;
}

/* Give title readings a little more breathing room without changing body ruby. */
body.single-novel h1 ruby rt,
.entry-title ruby rt,
.wp-block-post-title ruby rt,
.post-title ruby rt,
.novel-title ruby rt,
.mnc-novel-display-title ruby rt,
.detail-cover ruby rt,
.detail-copy ruby rt {
  position: relative;
  inset-block-start: -.14em;
}

body.single-novel .entry-title,
body.single-novel .wp-block-post-title,
body.single-novel .post-title,
body.single-novel .novel-title,
body.single-novel .mnc-novel-display-title {
  position: relative;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  margin-block-end: 2em !important;
  padding: 0;
  padding-block-end: 2em;
  border: 0 !important;
  color: #183d32;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.5;
  text-wrap: balance;
}

/*
 * Give vertical novels a quiet visual pause between the title and the first
 * column. The long transparent canvas lets the moon-and-steam ornament follow
 * the page's reading axis without competing with the text.
 */
body.single-novel .mnc-title-is-vertical {
  --mnc-title-ornament-gap: 3em;
  --mnc-title-ornament-space: clamp(4.25rem, 7vw, 5.75rem);
  margin-block-end: 2.585em !important;
  padding-block-end: calc(var(--mnc-title-ornament-gap) + var(--mnc-title-ornament-space)) !important;
}

body.single-novel .mnc-novel-display-title:not(.mnc-title-is-vertical) {
  --mnc-title-ornament-space: clamp(3.75rem, 8vw, 5rem);
  margin-block-end: var(--mnc-body-three-lines, 6.4rem) !important;
  padding-block-end: calc(2em + var(--mnc-title-ornament-space)) !important;
}

body.single-novel .entry-title::after,
body.single-novel .wp-block-post-title::after,
body.single-novel .post-title::after,
body.single-novel .novel-title::after,
body.single-novel .mnc-novel-display-title::after {
  content: "";
  position: absolute;
  inset-block-end: 0;
  inset-inline-start: 0;
  inline-size: 100%;
  block-size: 1px;
  background: linear-gradient(
    to right,
    rgba(24, 61, 50, 0),
    rgba(24, 61, 50, .82) 18%,
    rgba(24, 61, 50, .82) 62%,
    rgba(24, 61, 50, 0)
  );
  pointer-events: none;
}

body.single-novel .mnc-title-is-vertical::after {
  inset-block-end: .25rem;
  inline-size: min(32rem, calc(100dvh - 8rem));
  max-inline-size: calc(100dvh - 8rem);
  block-size: calc(var(--mnc-title-ornament-space) - .5rem);
  background: url("novel-title-ornament-moon-steam-v3-gap.png") center top / contain no-repeat;
  opacity: .92;
}

body.single-novel .mnc-novel-display-title:not(.mnc-title-is-vertical)::after {
  inset-block-end: 0;
  inline-size: min(32rem, calc(100vw - 4rem));
  block-size: var(--mnc-title-ornament-space);
  background: url("novel-title-ornament-moon-steam-horizontal-from-vertical-gap.png") center / contain no-repeat;
  opacity: .92;
}

body.single-novel .mnc-novel-content hr,
body.single-novel .mnc-novel-content .chapter-break {
  box-sizing: border-box !important;
  display: block !important;
  inline-size: auto !important;
  min-inline-size: 0 !important;
  block-size: auto !important;
  min-block-size: 0 !important;
  aspect-ratio: auto;
  padding: 0 !important;
  margin-block: var(--mnc-body-three-lines, 5.4em) !important;
  margin-inline: 0 !important;
  border: 0 !important;
  background: transparent !important;
  -webkit-mask: none !important;
  mask: none !important;
  color: #183d32 !important;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif !important;
  font-size: 0.85em !important;
  line-height: 1 !important;
  text-align: start !important;
  white-space: nowrap !important;
  opacity: .85;
}

body.single-novel .mnc-novel-content hr::before,
body.single-novel .mnc-novel-content .chapter-break::before {
  content: "　　　　†　†　†" !important;
  display: inline-block !important;
}

body.single-novel [data-novel-reader].vertical .mnc-novel-content hr,
body.single-novel [data-novel-reader].vertical .mnc-novel-content .chapter-break {
  inline-size: auto !important;
  block-size: auto !important;
  margin-inline: 0 !important;
  text-align: start !important;
  -webkit-mask: none !important;
  mask: none !important;
}

html[data-theme="dark"] body.single-novel .entry-title,
html[data-theme="dark"] body.single-novel .wp-block-post-title,
html[data-theme="dark"] body.single-novel .post-title,
html[data-theme="dark"] body.single-novel .novel-title,
html[data-theme="dark"] body.single-novel .mnc-novel-display-title {
  color: #f3eee3;
}

html[data-theme="dark"] body.single-novel .entry-title::after,
html[data-theme="dark"] body.single-novel .wp-block-post-title::after,
html[data-theme="dark"] body.single-novel .post-title::after,
html[data-theme="dark"] body.single-novel .novel-title::after,
html[data-theme="dark"] body.single-novel .mnc-novel-display-title::after {
  background: linear-gradient(
    to right,
    rgba(243, 238, 227, 0),
    rgba(243, 238, 227, .82) 18%,
    rgba(243, 238, 227, .82) 62%,
    rgba(243, 238, 227, 0)
  );
}

html[data-theme="dark"] body.single-novel .mnc-novel-content hr,
html[data-theme="dark"] body.single-novel .mnc-novel-content .chapter-break {
  color: #f3eee3 !important;
  background: transparent !important;
}

html[data-theme="dark"] body.single-novel .mnc-title-is-vertical::after {
  background: url("novel-title-ornament-moon-steam-v3-gap.png") center top / contain no-repeat !important;
  filter: brightness(0) saturate(100%) invert(93%) sepia(11%) saturate(243%) hue-rotate(350deg) brightness(104%) contrast(91%);
  opacity: .82;
}

html[data-theme="dark"] body.single-novel .mnc-novel-display-title:not(.mnc-title-is-vertical)::after {
  background: url("novel-title-ornament-moon-steam-horizontal-from-vertical-gap.png") center / contain no-repeat !important;
  filter: brightness(0) saturate(100%) invert(93%) sepia(11%) saturate(243%) hue-rotate(350deg) brightness(104%) contrast(91%);
  opacity: .82;
}

@media (max-height: 700px) {
  body.single-novel .mnc-title-is-vertical::after {
    inline-size: min(32rem, calc(100dvh - 7rem));
  }
}

body.single-novel .entry-meta .byline,
body.single-novel .entry-meta .author,
body.single-novel .post-meta .byline,
body.single-novel .post-meta .author,
body.single-novel .byline,
body.single-novel .author-name,
body.single-novel .posted-by,
body.single-novel .post-byline,
body.single-novel .meta-author,
body.single-novel .wp-block-post-author,
body.single-novel .wp-block-post-author-name,
body.single-novel .post-author,
body.single-novel .novel-author,
body.single-novel article .author,
body.single-novel article .username,
body.single-novel article .user-name,
body.single-novel article .display-name,
body.single-novel article [class*="author-name"],
body.single-novel article [class*="user-name"],
body.single-novel [rel="author"] {
  display: none !important;
}

/* Keep every wrapper around the badge from being compressed by the guide row. */
body.single-novel .mnc-writing-direction-badge-part {
  flex-shrink: 0 !important;
}

/* The raster badge keeps its own square ratio while the row is allowed to shrink it. */
body.single-novel .mnc-writing-direction-badge {
  --mnc-writing-direction-badge-size: clamp(3rem, 8vw, 3.75rem);
  box-sizing: border-box !important;
  display: inline-block !important;
  flex: 0 1 var(--mnc-writing-direction-badge-size) !important;
  width: var(--mnc-writing-direction-badge-size) !important;
  height: auto !important;
  min-width: 2.5rem !important;
  max-width: var(--mnc-writing-direction-badge-size) !important;
  min-height: 0 !important;
  max-height: none !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: none !important;
  line-height: 0 !important;
}

body.single-novel .mnc-writing-direction-badge::before,
body.single-novel .mnc-writing-direction-badge::after {
  display: none !important;
}

body.single-novel .mnc-writing-direction-badge img {
  display: block !important;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: contain !important;
}

@media (hover: none) and (pointer: coarse) {
  body.mnc-reader-page [data-novel-reader] {
    -webkit-overflow-scrolling: touch;
  }

  /* Let phones use their native reading gesture on the text's physical axis. */
  body.mnc-reader-page [data-novel-reader].vertical {
    overflow-x: auto;
    overflow-y: hidden;
    touch-action: pan-x pinch-zoom;
    overscroll-behavior-x: contain;
  }

  body.mnc-reader-page [data-novel-reader]:not(.vertical) {
    overflow-x: hidden;
    overflow-y: auto;
    touch-action: pan-y pinch-zoom;
    overscroll-behavior-y: contain;
  }
}

@media (max-width: 850px) {

  html[data-theme="dark"] body.mnc-reader-page .mnc-novel-reader-surface::before {
    background-image:
      linear-gradient(90deg, rgba(3, 12, 8, .96), rgba(3, 12, 8, .76)),
      var(--mnc-reader-dark-hero-image, none);
    background-position: center, left 68%;
    background-size: cover, auto 105%;
  }
}

@media (max-width: 782px) {
  body.single-novel .mnc-reading-display-guide {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: nowrap !important;
    gap: 1.25rem !important;
  }

  body.single-novel .mnc-writing-direction-badge {
    --mnc-writing-direction-badge-size: clamp(2.75rem, 14vw, 3.5rem);
  }

  body.single-novel .mnc-reading-display-guide > :not(.mnc-writing-direction-badge):not(.mnc-writing-direction-badge-shell):not(.mnc-writing-direction-badge-part) {
    flex: 1 1 0% !important;
    text-align: left !important;
  }
}

@media (max-width: 520px) {
  html[data-theme="dark"] body.mnc-reader-page .mnc-novel-reader-surface::before {
    background-image:
      linear-gradient(180deg, rgba(3, 12, 8, .86), rgba(3, 12, 8, .96)),
      var(--mnc-reader-dark-hero-image, none);
    background-position: center, left 68%;
  }
}
