@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=DM+Sans:wght@400;500;600;700&display=swap");

/* Storybook section — self-contained styles */
.storybook-section {
  --wine: #320610;
  --wine-deep: #1c0309;
  --wine-light: #64152a;
  --gold: #d6a64d;
  --gold-light: #f5d58c;
  --paper: #f8ecd2;
  --ink: #3a1720;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(54px, 7vw, 100px) clamp(18px, 4vw, 64px) 58px;
  color: #fff7e9;
  background: #26040c url("adventure/assets/storybook-bg.svg") center/cover no-repeat;
  font-family: "DM Sans", sans-serif;
}

.storybook-section::before,
.storybook-section::after {
  content: "";
  position: absolute;
  pointer-events: none;
  z-index: -1;
}

.storybook-section::before {
  inset: 0;
  background:
    radial-gradient(ellipse at 73% 42%,
      rgba(177, 91, 50, 0.15),
      transparent 45%),
    linear-gradient(115deg,
      rgba(20, 0, 6, 0.28),
      transparent 48%,
      rgba(20, 0, 6, 0.24));
}

.storybook-section::after {
  width: 48vw;
  height: 48vw;
  right: -20vw;
  top: 4%;
  border: 1px solid rgba(224, 178, 92, 0.12);
  border-radius: 50%;
  box-shadow:
    0 0 0 28px rgba(224, 178, 92, 0.025),
    0 0 0 58px rgba(224, 178, 92, 0.018);
}

.storybook-heading {
  text-align: center;
  margin: 0 auto clamp(34px, 4vw, 58px);
  position: relative;
  z-index: 1;
}

.storybook-kicker {
  margin: 0 0 9px;
  color: #d7b77c;
  font-size: 10px;
  letter-spacing: 0.28em;
  font-weight: 700;
}

.storybook-heading h2 {
  margin: 0;
  font:
    500 clamp(42px, 5.2vw, 76px)/0.98 "Cormorant Garamond",
    serif;
  letter-spacing: -0.035em;
  color: #fff7e9;
}

.storybook-heading h2 em {
  color: #e5b95e;
  font-weight: 500;
}

.heading-ornament {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin: 17px auto 0;
  color: #e6b65c;
  font-size: 17px;
}

.heading-ornament span {
  width: 95px;
  height: 1px;
  background: linear-gradient(90deg, transparent, #d6a64d);
}

.heading-ornament span:last-child {
  transform: scaleX(-1);
}

.storybook-layout {
  width: min(1440px, 100%);
  margin: auto;
  display: grid;
  grid-template-columns: minmax(190px, 245px) minmax(0, 1fr);
  gap: clamp(22px, 3vw, 48px);
  align-items: center;
  position: relative;
  z-index: 1;
}

.chapter-rail {
  padding: 20px 0;
}

.rail-title {
  color: #e8c987;
  font-size: 11px;
  letter-spacing: 0.24em;
  font-weight: 700;
  margin: 0 0 24px 8px;
}

.chapter-list {
  display: grid;
  gap: 12px;
}

.chapter-button {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px 1fr 16px;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 7px 14px 7px 8px;
  border: 1px solid rgba(226, 187, 111, 0.32);
  border-radius: 999px;
  color: #f8ead1;
  background: linear-gradient(100deg,
      rgba(255, 255, 255, 0.09),
      rgba(255, 255, 255, 0.025));
  cursor: pointer;
  font:
    600 14px "DM Sans",
    sans-serif;
  transition:
    transform 0.35s,
    border-color 0.35s,
    background 0.35s,
    box-shadow 0.35s;
}

.chapter-button:hover {
  transform: translateX(5px);
  border-color: #e7bd69;
}

.chapter-button.is-active {
  color: #32101a;
  background: linear-gradient(100deg, #f7e4bd, #d9ae62);
  border-color: #ffe0a0;
  box-shadow:
    0 0 0 1px rgba(255, 220, 145, 0.35),
    0 0 24px rgba(223, 169, 73, 0.35);
  transform: translateX(8px);
}

.chapter-index {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: #f5d58c;
  border: 1px solid #c99949;
  background: #390b17;
  font:
    600 15px "Cormorant Garamond",
    serif;
}

.chapter-button.is-active .chapter-index {
  color: #fff1d1;
  background: #6d1a2c;
  border-color: #6d1a2c;
}

.chapter-button i {
  color: #e2b55f;
  font-style: normal;
  font-size: 12px;
  opacity: 0.75;
}

.chapter-button.is-active i {
  animation: starPulse 1.8s ease-in-out infinite;
}

.rail-note {
  margin: 27px 0 0 8px;
  color: rgba(238, 211, 162, 0.58);
  font-size: 9px;
  letter-spacing: 0.2em;
}

.book-stage {
  position: relative;
  min-width: 0;
  padding: 18px 26px 42px;
  perspective: 1800px;
}

.book-glow {
  position: absolute;
  width: 78%;
  height: 72%;
  left: 11%;
  top: 13%;
  border-radius: 50%;
  background: rgba(212, 155, 68, 0.12);
  filter: blur(58px);
  pointer-events: none;
  animation: glowBreathe 5s ease-in-out infinite;
}

.book-object {
  position: relative;
  width: 100%;
  min-height: 570px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 20px 20px 28px;
  border: 1px solid #8f5b2c;
  border-radius: 13px 17px 20px 13px;
  background: linear-gradient(100deg,
      #4b0d1b 0 1.8%,
      #7d2d2d 2%,
      #f2d8a7 2.7%,
      #fff0d2 4%,
      #f5e4c2 49.3%,
      #b9864d 50%,
      #f6e4c2 51%,
      #fff0d2 96%,
      #a96d37 98%,
      #390714 100%);
  box-shadow:
    0 24px 50px rgba(0, 0, 0, 0.5),
    0 5px 0 #5b271f,
    0 9px 0 #281018;
  transform: rotateX(1deg);
  transform-style: preserve-3d;
  transition: transform 0.7s;
}

.book-object::before {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(149, 91, 39, 0.42);
  border-radius: 7px 11px 14px 7px;
  pointer-events: none;
}

.book-cover-edge {
  position: absolute;
  inset: -9px -8px -7px -10px;
  border: 5px solid #551326;
  border-radius: 16px 20px 22px 16px;
  box-shadow:
    inset 0 0 0 1px #c18a43,
    0 8px 0 #21040a,
    0 17px 26px rgba(0, 0, 0, 0.35);
  z-index: -1;
}

.book-page {
  position: relative;
  min-width: 0;
  padding: 30px clamp(18px, 2.5vw, 38px) 25px;
  color: var(--ink);
  background:
    linear-gradient(90deg,
      rgba(173, 119, 55, 0.13),
      transparent 12%,
      rgba(255, 255, 255, 0.18) 50%,
      transparent 90%,
      rgba(173, 119, 55, 0.12)),
    #f8ecd2;
  box-shadow: inset 0 0 24px rgba(125, 73, 30, 0.12);
  overflow: hidden;
}

.page-left {
  border-radius: 7px 0 0 5px;
  padding-right: clamp(16px, 2vw, 30px);
}

.page-right {
  border-radius: 0 8px 6px 0;
  padding-left: clamp(18px, 2.2vw, 34px);
}

.page-left::after,
.page-right::after {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px solid rgba(172, 121, 58, 0.28);
  pointer-events: none;
}

.book-gutter {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 15px;
  bottom: 22px;
  width: 22px;
  transform: translateX(-50%);
  background: linear-gradient(90deg,
      rgba(91, 46, 24, 0.24),
      rgba(255, 255, 255, 0.35) 45%,
      rgba(91, 46, 24, 0.18));
  filter: blur(2px);
  pointer-events: none;
}

.page-topline {
  text-align: center;
  color: #8b4b2d;
  font:
    700 10px "DM Sans",
    sans-serif;
  letter-spacing: 0.24em;
  margin: 0 0 22px;
}

.photo-mat {
  position: relative;
  margin: 0 auto;
  width: min(100%, 390px);
  padding: 10px 10px 27px;
  background: #fff9eb;
  box-shadow: 0 9px 20px rgba(76, 37, 20, 0.22);
  transform: rotate(-2deg);
}

.photo-mat:hover {
  transform: rotate(0) scale(1.025);
  box-shadow: 0 14px 28px rgba(76, 37, 20, 0.28);
}

.photo-mat img {
  display: block;
  width: 100%;
  height: 440px;
  object-fit: cover;
  object-position: center 35%;
}

.photo-tape {
  position: absolute;
  z-index: 2;
  width: 74px;
  height: 22px;
  background: rgba(220, 184, 119, 0.55);
  top: -8px;
  box-shadow: 0 1px 2px rgba(80, 50, 20, 0.1);
}

.tape-one {
  left: 18px;
  transform: rotate(-22deg);
}

.tape-two {
  right: 17px;
  transform: rotate(17deg);
}

.photo-caption {
  text-align: center;
  color: #9b7149;
  font:
    italic 16px "Cormorant Garamond",
    serif;
  margin: 19px 0 0;
}

.page-stamp {
  position: absolute;
  bottom: 26px;
  left: 30px;
  color: rgba(126, 80, 44, 0.6);
  font:
    600 21px "Cormorant Garamond",
    serif;
  line-height: 0.85;
  transform: rotate(-8deg);
}

.page-stamp small {
  font:
    600 6px "DM Sans",
    sans-serif;
  letter-spacing: 0.12em;
}

.story-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.story-number {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #9c6a35;
  margin-bottom: 7px;
}

.story-number span {
  font:
    700 8px "DM Sans",
    sans-serif;
  letter-spacing: 0.23em;
}

.story-number strong {
  color: #6e1930;
  font:
    600 40px/0.8 "Cormorant Garamond",
    serif;
}

.story-label {
  margin: 0 0 5px;
  color: #a87943;
  font:
    700 9px "DM Sans",
    sans-serif;
  letter-spacing: 0.22em;
}

.story-content h3 {
  margin: 0;
  color: #491323;
  font: 700 28px "Cormorant Garamond", serif;
  letter-spacing: -0.02em;
}

.story-rule {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #b17a3d;
  margin: 12px 0 11px;
}

.story-rule::before,
.story-rule::after {
  content: "";
  height: 1px;
  background: linear-gradient(90deg, transparent, #bb8a4d);
  flex: 1;
}

.story-rule::after {
  transform: scaleX(-1);
}

.story-copy strong {
  color: #741d32;
}

.moral-ribbon {
  position: relative;
  margin: 10px 0 8px;
  padding: 10px 15px;
  text-align: center;
  color: #fff0d2;
  background: linear-gradient(100deg, #4c0c20, #7b2438, #4c0c20);
  border: 1px solid #c79a50;
  box-shadow: 0 4px 9px rgba(74, 30, 16, 0.18);
}

.moral-ribbon::before,
.moral-ribbon::after {
  content: "✦";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #e6bd6b;
  font-size: 16px;
}

.moral-ribbon::before {
  left: 8px;
}

.moral-ribbon::after {
  right: 8px;
}

.moral-ribbon span {
  display: block;
  color: #e7c477;
  font:
    700 8px "DM Sans",
    sans-serif;
  letter-spacing: 0.2em;
  margin-bottom: 3px;
}

.moral-ribbon strong {
  font:
    600 italic 17px "Cormorant Garamond",
    serif;
}

.page-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(139, 94, 49, 0.28);
  display: flex;
  justify-content: space-between;
  color: #a07a50;
  font:
    700 8px "DM Sans",
    sans-serif;
  letter-spacing: 0.16em;
}

.page-corner {
  position: absolute;
  width: 30px;
  height: 30px;
  border-color: #b9894c;
  opacity: 0.55;
  z-index: 2;
}

.corner-tl {
  top: 19px;
  left: 19px;
  border-top: 1px solid;
  border-left: 1px solid;
}

.corner-bl {
  bottom: 19px;
  left: 19px;
  border-bottom: 1px solid;
  border-left: 1px solid;
}

.corner-tr {
  top: 19px;
  right: 19px;
  border-top: 1px solid;
  border-right: 1px solid;
}

.corner-br {
  bottom: 19px;
  right: 19px;
  border-bottom: 1px solid;
  border-right: 1px solid;
}

.book-bottom-pages {
  position: absolute;
  left: 25px;
  right: 25px;
  bottom: 13px;
  height: 11px;
  border-radius: 0 0 12px 12px;
  background: repeating-linear-gradient(180deg, #d5b47c 0 1px, #f3dfb8 1px 3px);
  box-shadow: 0 4px 0 #70402a;
}

.bookmark {
  position: absolute;
  bottom: -28px;
  left: 49%;
  width: 24px;
  height: 68px;
  background: linear-gradient(90deg, #76172f, #bd4660, #72142b);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 82%, 0 100%);
  filter: drop-shadow(2px 3px 2px rgba(0, 0, 0, 0.3));
}

.book-arrow {
  position: absolute;
  z-index: 5;
  top: 48%;
  width: 43px;
  height: 43px;
  border-radius: 50%;
  border: 1px solid #d5a34f;
  color: #f9dfaa;
  background: #4b0c1c;
  box-shadow:
    0 0 0 4px rgba(58, 8, 20, 0.4),
    0 5px 16px rgba(0, 0, 0, 0.3);
  font:
    400 32px/35px "Cormorant Garamond",
    serif;
  cursor: pointer;
  transition:
    transform 0.25s,
    background 0.25s;
}

.book-arrow:hover {
  transform: scale(1.1);
  background: #7b1d35;
}

.arrow-prev {
  left: 0;
}

.arrow-next {
  right: 0;
}

.book-stage-caption {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  color: rgba(238, 209, 155, 0.72);
  font:
    700 8px "DM Sans",
    sans-serif;
  letter-spacing: 0.2em;
}

.caption-line {
  width: 35px;
  height: 1px;
  background: #b88949;
  opacity: 0.7;
}

.book-object.is-turning .page-right {
  animation: pageTurn 0.72s ease both;
  transform-origin: left center;
}

.book-object.is-turning .page-left {
  animation: pageSettle 0.72s ease both;
}

.story-content.is-changing {
  animation: storyReveal 0.55s ease both;
}

@keyframes pageTurn {
  0% {
    transform: rotateY(0);
    filter: brightness(1);
  }

  45% {
    transform: rotateY(-11deg);
    filter: brightness(0.84);
  }

  100% {
    transform: rotateY(0);
    filter: brightness(1);
  }
}

@keyframes pageSettle {
  0% {
    transform: translateX(0);
  }

  45% {
    transform: translateX(-5px);
  }

  100% {
    transform: translateX(0);
  }
}

@keyframes storyReveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes glowBreathe {

  0%,
  100% {
    opacity: 0.55;
    transform: scale(0.96);
  }

  50% {
    opacity: 1;
    transform: scale(1.04);
  }
}

@keyframes starPulse {

  0%,
  100% {
    opacity: 0.6;
    transform: scale(0.9);
  }

  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

@media (max-width: 1050px) {
  .storybook-layout {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .chapter-rail {
    padding: 0;
  }

  .rail-title {
    margin-bottom: 12px;
  }

  .chapter-list {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
  }

  .chapter-button {
    grid-template-columns: 32px 1fr;
    gap: 7px;
    padding: 6px;
    min-height: 50px;
    font-size: 11px;
  }

  .chapter-button:hover,
  .chapter-button.is-active {
    transform: none;
  }

  .chapter-index {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .chapter-button i {
    display: none;
  }

  .rail-note {
    display: none;
  }

  .book-stage {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (max-width: 700px) {
  .storybook-section {
    padding: 52px 12px 42px;
  }

  .storybook-heading {
    margin-bottom: 25px;
  }

  .storybook-heading h2 {
    font-size: 43px;
  }

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

  .chapter-button {
    font-size: 11px;
  }

  .book-stage {
    padding: 10px 0 34px;
  }

  .book-object {
    min-height: 0;
    grid-template-columns: 1fr;
    padding: 12px 12px 20px;
    border-radius: 10px;
  }

  .book-cover-edge {
    inset: -5px;
  }

  .book-page {
    padding: 24px 22px;
  }

  .page-left {
    border-radius: 7px 7px 0 0;
    padding-bottom: 18px;
  }

  .page-right {
    border-radius: 0 0 7px 7px;
    padding-top: 22px;
  }

  .book-gutter {
    left: 12px;
    right: 12px;
    top: 50%;
    bottom: auto;
    width: auto;
    height: 12px;
    transform: translateY(-50%);
    background: linear-gradient(180deg,
        rgba(91, 46, 24, 0.2),
        rgba(255, 255, 255, 0.25),
        rgba(91, 46, 24, 0.15));
  }

  .photo-mat {
    width: min(78%, 320px);
  }

  .photo-mat img {
    height: 230px;
  }

  .page-stamp {
    display: none;
  }

  .story-content h3 {
    font-size: 24px;
  }

  .story-copy {
    font-size: 12px;
  }

  .moral-ribbon {
    margin-top: 14px;
  }

  .book-bottom-pages {
    left: 17px;
    right: 17px;
    bottom: 10px;
  }

  .bookmark {
    left: 49%;
    bottom: -24px;
    height: 52px;
  }

  .book-arrow {
    top: 34%;
    width: 34px;
    height: 34px;
    font-size: 26px;
    line-height: 27px;
  }

  .arrow-prev {
    left: -4px;
  }

  .arrow-next {
    right: -4px;
  }

  .book-stage-caption {
    font-size: 7px;
    bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .storybook-section * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* FIX: make the two pages a true side-by-side spread.
   The previous version placed .book-spread in the first grid cell of .book-object,
   which stacked both pages on the left and left the right half empty. */
.book-object {
  display: block !important;
  min-height: 0;
  padding: 20px 20px 28px;
}

.book-spread {
  position: relative;
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 22px minmax(0, 1fr);
  align-items: stretch;
  width: 100%;
  min-height: 640px;
  perspective: 2200px;
  transform-style: preserve-3d;
}

.book-page {
  min-width: 0;
  min-height: 640px;
  height: 100%;
}

.book-underlay {
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc(50% - 11px);
  z-index: 8;
  pointer-events: none;
  overflow: hidden;
}

.book-underlay.is-left {
  left: 0;
}

.book-underlay.is-right {
  right: 0;
}

.book-underlay .book-page,
.book-flip-face .book-page {
  width: 100%;
  height: 100%;
  min-height: 0;
}

.book-flip-shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc(50% - 11px);
  z-index: 12;
  pointer-events: none;
  opacity: 0;
}

.book-flip-shadow.is-right {
  right: 0;
  background: linear-gradient(90deg, rgba(28, 7, 11, 0.42), rgba(28, 7, 11, 0.14) 38%, transparent 78%);
}

.book-flip-shadow.is-left {
  left: 0;
  background: linear-gradient(-90deg, rgba(28, 7, 11, 0.42), rgba(28, 7, 11, 0.14) 38%, transparent 78%);
}

.book-flip-leaf {
  position: absolute;
  top: 0;
  bottom: 0;
  width: calc(50% - 11px);
  z-index: 20;
  pointer-events: none;
  transform-style: preserve-3d;
  will-change: transform;
}

.book-flip-leaf.is-forward {
  left: calc(50% + 11px);
  transform-origin: -11px 50%;
}

.book-flip-leaf.is-backward {
  left: 0;
  transform-origin: calc(100% + 11px) 50%;
}

.book-flip-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  transform-style: preserve-3d;
  overflow: hidden;
  box-shadow: 0 12px 34px rgba(20, 4, 8, 0.28);
}

.book-flip-face.is-front {
  transform: rotateY(0deg);
}

.book-flip-face.is-back {
  transform: rotateY(180deg);
}

.book-flip-face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  animation: foldShade 0.68s ease-in-out both;
}

@keyframes foldShade {

  0%,
  100% {
    opacity: 0;
  }

  50% {
    opacity: 1;
  }
}

.book-flip-leaf.is-forward .book-flip-face.is-front::after {
  background: linear-gradient(90deg, rgba(44, 15, 10, 0.24), transparent 36%, rgba(255, 252, 240, 0.22) 80%, transparent);
}

.book-flip-leaf.is-forward .book-flip-face.is-back::after {
  background: linear-gradient(-90deg, rgba(44, 15, 10, 0.24), transparent 36%, rgba(255, 252, 240, 0.22) 80%, transparent);
}

.book-flip-leaf.is-backward .book-flip-face.is-front::after {
  background: linear-gradient(-90deg, rgba(44, 15, 10, 0.24), transparent 36%, rgba(255, 252, 240, 0.22) 80%, transparent);
}

.book-flip-leaf.is-backward .book-flip-face.is-back::after {
  background: linear-gradient(90deg, rgba(44, 15, 10, 0.24), transparent 36%, rgba(255, 252, 240, 0.22) 80%, transparent);
}

@media (max-width: 700px) {
  .book-underlay.is-mobile {
    inset: 0;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    background: #f8ecd2;
    border-radius: 8px;
  }

  .book-flip-shadow.is-mobile {
    inset: 0;
    width: 100%;
    background: linear-gradient(90deg, rgba(28, 7, 11, 0.45), rgba(28, 7, 11, 0.16) 42%, transparent 82%);
    border-radius: 8px;
  }

  .book-flip-leaf.is-mobile,
  .book-flip-leaf.is-mobile.is-forward,
  .book-flip-leaf.is-mobile.is-backward {
    left: 0;
    right: 0;
    width: 100%;
    transform-origin: 0% 50%;
  }

  .book-flip-leaf.is-mobile .book-flip-face {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-content: start;
    background: #f8ecd2;
    border-radius: 8px;
  }

  .book-flip-leaf.is-mobile .book-flip-face::after {
    background: linear-gradient(90deg, rgba(44, 15, 10, 0.22), transparent 36%, rgba(255, 252, 240, 0.24) 80%, transparent);
  }

  .book-underlay.is-mobile .book-page,
  .book-flip-leaf.is-mobile .book-page {
    height: auto;
    min-height: 0;
  }
}

.page-left {
  grid-column: 1;
}

.book-gutter {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 22px;
  transform: translateX(-50%);
}

.page-right {
  grid-column: 3;
}

.story-content {
  min-height: 100%;
}

.moral-ribbon {
  margin-top: auto;
}

@media (max-width: 700px) {
  .book-object {
    display: block !important;
    padding: 12px 12px 20px;
  }

  .book-spread {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    gap: 0;
  }

  .book-page {
    grid-column: 1;
    min-height: 0;
    height: auto;
  }

  .page-left {
    grid-row: 1;
  }

  .page-right {
    grid-row: 2;
  }

  .book-gutter {
    left: 12px;
    right: 12px;
    top: auto;
    bottom: auto;
    width: auto;
    height: 12px;
    transform: translateY(-50%);
  }

  .story-content {
    min-height: 0;
  }

  .moral-ribbon {
    margin-top: 14px;
  }
}

/* Complete adventure copy: compact editorial typography for the right page. */
.story-copy {
  font-size: 14px;
  margin-bottom: 12px;
}

.story-copy p {
  margin: 0 0 12px;
}

.story-copy .story-emphasis {
  color: #741d32;
  font-weight: 700;
}

.story-content.is-compact h3 {
  font-size: clamp(24px, 2.1vw, 32px);
  line-height: 1;
}

.story-content.is-compact .story-number strong {
  font-size: 34px;
}

.story-content.is-compact .moral-ribbon {
  padding: 7px 12px;
  margin-top: 8px;
}

.story-content.is-compact .moral-ribbon strong {
  font-size: 15px;
}

@media (max-width: 700px) {
  .story-content.is-compact h3 {
    font-size: 30px;
  }
}

/* Embedded-image fallback state */
.photo-mat img.image-missing {
  opacity: 0;
}

.photo-mat:has(img.image-missing)::after {
  content: "Adventure photo unavailable";
  display: grid;
  place-items: center;
  min-height: 220px;
  color: #8b4b2d;
  font:
    600 12px "DM Sans",
    sans-serif;
  letter-spacing: 0.08em;
}