/*
 * 福爺の誕生秘話
 * 既存のアートブック案を土台に、長い文章をゆったり読める構成にする。
 * 原画は加工せず、全体が見える状態で掲載する。
 */

.layout-story {
  background: var(--paper-light);
}

.layout-story ruby {
  ruby-position: over;
}

.layout-story rt {
  font-size: 0.45em;
  letter-spacing: 0.08em;
}

.story-main {
  overflow: clip;
}

.story-hero,
.story-chapter,
.story-ending {
  position: relative;
}

.story-hero {
  min-height: min(52rem, calc(100svh - 4.5rem));
  padding: clamp(7rem, 14vw, 13rem) var(--gutter) clamp(9rem, 16vw, 15rem);
  background: var(--paper);
}

.story-hero-inner,
.story-chapter-inner,
.story-ending-inner {
  width: min(100%, var(--content));
  margin-inline: auto;
}

.story-hero h1 {
  max-width: 10em;
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(3.1rem, 8vw, 7.4rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.35;
}

.story-article {
  background: var(--paper-light);
}

.story-chapter {
  padding: clamp(8rem, 14vw, 13rem) var(--gutter);
}

.story-chapter + .story-chapter {
  border-top: 1px solid var(--line);
}

.story-chapter-inner {
  max-width: 52rem;
}

.story-chapter-offset .story-chapter-inner {
  padding-left: clamp(0rem, 8vw, 8rem);
}

.story-chapter h2 {
  max-width: 15em;
  margin: 0;
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(2rem, 4.8vw, 4rem);
  font-weight: 500;
  letter-spacing: 0.035em;
  line-height: 1.55;
  text-wrap: balance;
}

.story-copy {
  max-width: 43rem;
  margin-top: clamp(4.5rem, 8vw, 7rem);
}

.story-copy p {
  margin: 0;
  overflow-wrap: anywhere;
}

.story-copy p + p {
  margin-top: 1.15rem;
}

.story-copy .story-quote {
  margin-top: 2.2rem;
  margin-bottom: 2.2rem;
  padding-left: clamp(1rem, 5vw, 4rem);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.15rem, 2.4vw, 1.55rem);
  letter-spacing: 0.04em;
  line-height: 2;
}

.story-copy .story-key {
  margin-top: clamp(2.5rem, 5vw, 4.25rem);
  margin-bottom: clamp(2.5rem, 5vw, 4.25rem);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(1.35rem, 3vw, 2.15rem);
  font-weight: 500;
  letter-spacing: 0.035em;
  line-height: 1.85;
}

.story-copy strong {
  font-weight: 600;
}

.story-media,
.story-media-pair,
.story-illustration-grid {
  min-width: 0;
}

.story-media {
  margin: 0;
  padding: clamp(0.5rem, 1vw, 0.8rem);
  border: 1px solid var(--line);
  background: white;
}

.story-media img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.story-media-mask {
  width: min(82%, 31rem);
  margin-top: clamp(6rem, 12vw, 10rem);
  margin-left: auto;
}

.story-media-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(1rem, 3vw, 2.5rem);
  margin-top: clamp(6rem, 11vw, 9rem);
}

.story-illustration-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(0.75rem, 2vw, 1.5rem);
  margin-top: clamp(6rem, 11vw, 9rem);
}

.story-chapter-final {
  padding-bottom: clamp(11rem, 18vw, 17rem);
}

.story-ending {
  padding: clamp(10rem, 16vw, 15rem) var(--gutter) clamp(9rem, 14vw, 13rem);
  background: var(--paper);
}

.story-ending-inner {
  display: grid;
  justify-items: center;
}

.story-ending-art {
  width: min(78vw, 30rem);
  margin: 0 0 clamp(6rem, 11vw, 9rem);
}

.story-ending-art img {
  width: 100%;
  height: auto;
  object-fit: contain;
}

.story-back-link {
  display: inline-flex;
  min-height: 3rem;
  align-items: center;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid currentColor;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.story-back-link:hover,
.story-back-link:focus-visible {
  color: var(--muted);
}

@media (min-width: 60rem) {
  .story-chapter:nth-of-type(3n + 2) .story-chapter-inner {
    transform: translateX(3vw);
  }

  .story-chapter:nth-of-type(3n) .story-chapter-inner {
    transform: translateX(-2vw);
  }
}

@media (max-width: 52rem) {
  .story-hero {
    min-height: auto;
    padding-top: 8rem;
    padding-bottom: 9rem;
  }

  .story-chapter {
    padding-top: 8rem;
    padding-bottom: 8rem;
  }

  .story-chapter-offset .story-chapter-inner {
    padding-left: 0;
  }

  .story-media-mask {
    width: 88%;
  }

  .story-illustration-grid {
    grid-template-columns: 1fr;
    width: 88%;
    margin-left: auto;
  }

  .story-illustration-grid .story-media:nth-child(2) {
    margin-left: -8%;
  }
}

@media (max-width: 34rem) {
  .story-hero {
    padding-top: 6.5rem;
    padding-bottom: 7rem;
  }

  .story-chapter {
    padding-top: 6.5rem;
    padding-bottom: 6.5rem;
  }

  .story-copy {
    margin-top: 3.5rem;
  }

  .story-media-pair {
    grid-template-columns: 1fr;
  }

  .story-media-pair .story-media {
    width: 88%;
  }

  .story-media-pair .story-media:nth-child(2) {
    margin-left: auto;
  }

  .story-chapter-final {
    padding-bottom: 10rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-back-link,
  .origin-story-link {
    transition: none;
  }
}
