/* One childhood chapter, illustrated by photographs moving through a shared scene. */
:root {
  --childhood-topbar-height: 98px;
}

.wordmark .hindi {
  font-size: 24px;
  line-height: 1.4;
  letter-spacing: 0;
}

body.reading-childhood .topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--paper);
}

body.reading-childhood .story-shell,
body.reading-childhood #main {
  overflow: visible;
}

.childhood-scene {
  width: 100%;
  min-height: calc(100svh - var(--childhood-topbar-height));
  padding: 0;
  justify-content: flex-start;
  overflow: visible;
  animation: none;
  transform: none;
}

.childhood-scene.active {
  display: block;
}

.story-flow {
  position: relative;
  width: 100%;
  height: auto;
  overflow: visible;
}

/* The complete passage and an unhurried collage are the default reading mode. */
.story-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 32px 6% 54px;
  background: var(--paper);
}

.story-heading {
  position: relative;
  z-index: 5;
  order: 0;
  text-align: center;
}

.story-heading .eyebrow {
  font-size: 11px;
  letter-spacing: .2em;
  color: #927460;
}

.story-heading h2 {
  margin: 11px 0 0;
  font-size: clamp(38px, 4.5vw, 59px);
  line-height: 1.05;
  letter-spacing: -1.4px;
}

.story-heading h2[lang="hi"] {
  font-family: var(--hindi);
  line-height: 1.4;
  letter-spacing: 0;
}

.story-heading h2[lang="hi"] em {
  font-style: normal;
}

.story-heading h2 em,
.story-line em {
  font-weight: 400;
  color: #9c5d69;
}

.story-narrative {
  position: relative;
  z-index: 5;
  order: 1;
  width: min(620px, 100%);
  margin: 27px auto 0;
  text-align: center;
}

.story-line {
  margin: 0;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(27px, 3.2vw, 35px);
  font-weight: 400;
  line-height: 1.28;
  letter-spacing: -.35px;
  text-wrap: pretty;
}

.story-flow:not(.is-enhanced) .story-line {
  display: inline;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
}

.story-flow:not(.is-enhanced) .story-line + .story-line::before {
  content: " ";
}

.story-composition {
  position: relative;
  order: 2;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  column-gap: clamp(9px, 1.4vw, 19px);
  width: min(830px, 100%);
  margin: 43px auto 39px;
}

.story-photo {
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 5px;
  background: #fffdf7;
  box-shadow: 0 7px 20px #52382b1a, 0 1px 3px #52382b13;
  pointer-events: none;
}

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

.story-flow:not(.is-enhanced) .story-photo {
  width: 100% !important;
  opacity: 1 !important;
  visibility: visible !important;
  transform: none !important;
  z-index: auto !important;
  rotate: var(--still-angle, 0deg);
}

.story-flow:not(.is-enhanced) .story-pink {
  --still-angle: -3deg;
  grid-column: 2 / span 5;
  grid-row: 1;
}

.story-flow:not(.is-enhanced) .story-cap {
  --still-angle: 3deg;
  grid-column: 8 / span 4;
  grid-row: 1;
  align-self: end;
  margin-bottom: -8%;
}

.story-flow:not(.is-enhanced) .story-together {
  --still-angle: 2deg;
  grid-column: 4 / span 6;
  grid-row: 2;
  margin-top: 12%;
}

.story-controls {
  position: relative;
  z-index: 6;
  order: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 58px;
}

.story-continue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 7px 4px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
  letter-spacing: .01em;
}

.story-continue:hover {
  color: var(--wine);
}

.story-scroll-line {
  display: block;
  width: 1px;
  height: 26px;
  background: linear-gradient(#b4987c, #b4987c20);
}

.story-flow:not(.is-enhanced) .story-continue {
  display: none;
}

.story-controls .primary {
  min-width: 166px;
  font-size: 14px;
}

.story-accessible {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Clip moving photographs inside the stage; its ancestors remain scrollable. */
.story-flow.is-enhanced {
  height: var(--story-runway, 330svh);
}

.story-flow.is-enhanced .story-stage {
  position: sticky;
  top: var(--childhood-topbar-height);
  display: block;
  height: calc(100svh - var(--childhood-topbar-height));
  min-height: 0;
  padding: 0;
  overflow: hidden;
  overflow: clip;
}

.story-flow.is-enhanced .story-heading {
  position: absolute;
  top: clamp(26px, 5vh, 48px);
  left: 6%;
  width: 33%;
  text-align: left;
}

.story-flow.is-enhanced .story-composition {
  position: absolute;
  top: 8%;
  left: 42%;
  display: block;
  width: 52%;
  height: 78%;
  margin: 0;
  overflow: hidden;
  overflow: clip;
}

.story-flow.is-enhanced .story-photo {
  position: absolute;
  top: 0;
  left: 0;
  margin: 0;
  opacity: 0;
  rotate: none;
  will-change: transform, opacity;
}

.story-flow.is-enhanced .story-narrative {
  position: absolute;
  top: 29%;
  left: 6%;
  display: grid;
  align-items: center;
  width: 30%;
  height: 43%;
  margin: 0;
  text-align: left;
}

.story-flow.is-enhanced .story-line {
  display: block;
  grid-area: 1 / 1;
  width: 100%;
  font-size: clamp(42px, 4vw, 52px);
  line-height: 1.13;
  letter-spacing: -.75px;
  opacity: 0;
  visibility: hidden;
  will-change: transform, opacity;
}

.story-flow.is-enhanced .story-line:first-child {
  opacity: 1;
  visibility: visible;
}

.story-flow.is-enhanced .story-controls {
  position: absolute;
  bottom: 7%;
  left: 6%;
  width: 30%;
  align-items: flex-start;
}

.story-flow.is-enhanced .story-continue {
  align-items: flex-start;
  padding-left: 0;
}

/* Preserve the complete real photographs already used inside and beside the book. */
.floating-print img {
  object-fit: contain;
  background: #e9dfd1;
}

.leaf-postcards {
  grid-template-columns: 88px 88px;
  gap: 13px;
  margin: 8px 0 27px;
}

.leaf-postcards > img {
  height: 117px;
  object-fit: contain;
  background: #e9dfd1;
}

@media (max-width: 1000px) {
  :root {
    --childhood-topbar-height: 85px;
  }

  .story-flow.is-enhanced .story-heading h2 {
    font-size: 48px;
  }

  .story-flow.is-enhanced .story-narrative {
    width: 32%;
  }

  .story-flow.is-enhanced .story-line {
    font-size: 42px;
  }
}

@media (max-width: 700px) {
  :root {
    --childhood-topbar-height: 76px;
  }

  .story-stage {
    padding: 23px 23px 38px;
  }

  .story-heading h2 {
    font-size: clamp(38px, 10.5vw, 47px);
    letter-spacing: -1px;
  }

  .story-narrative {
    margin-top: 24px;
  }

  .story-line {
    font-size: clamp(27px, 7.3vw, 32px);
    line-height: 1.3;
  }

  .story-composition {
    column-gap: 8px;
    margin-top: 35px;
    margin-bottom: 34px;
  }

  .story-photo {
    padding: 4px;
    box-shadow: 0 5px 13px #52382b1a, 0 1px 2px #52382b13;
  }

  .story-flow:not(.is-enhanced) .story-pink {
    grid-column: 1 / span 6;
  }

  .story-flow:not(.is-enhanced) .story-cap {
    grid-column: 8 / span 5;
  }

  .story-flow:not(.is-enhanced) .story-together {
    grid-column: 3 / span 8;
  }

  .story-flow.is-enhanced .story-heading {
    top: 16px;
    left: 16px;
    width: calc(100% - 32px);
    text-align: center;
  }

  .story-flow.is-enhanced .story-heading h2 {
    margin-top: 6px;
    font-size: clamp(36px, 10.5vw, 45px);
  }

  .story-flow.is-enhanced .story-composition {
    top: 95px;
    left: 8px;
    width: calc(100% - 16px);
    height: min(54%, calc(100% - 320px));
  }

  .story-flow.is-enhanced .story-narrative {
    top: auto;
    bottom: 100px;
    left: 24px;
    width: calc(100% - 48px);
    height: 116px;
    text-align: center;
  }

  .story-flow.is-enhanced .story-line {
    font-size: clamp(28px, 7.6vw, 34px);
    line-height: 1.15;
    letter-spacing: -.35px;
  }

  .story-flow.is-enhanced .story-controls {
    left: 20px;
    bottom: max(20px, env(safe-area-inset-bottom));
    width: calc(100% - 40px);
    align-items: center;
  }

  .story-flow.is-enhanced .story-continue {
    align-items: center;
    padding-left: 4px;
  }
}

@media (max-width: 360px) {
  .story-stage {
    padding-right: 19px;
    padding-left: 19px;
  }

  .story-flow.is-enhanced .story-narrative {
    left: 20px;
    width: calc(100% - 40px);
  }

  .story-photo {
    padding: 3px;
  }
}

/* JavaScript selects the natural reading layout for short or reduced-motion views. */
@media (max-height: 620px) and (min-width: 701px) {
  .story-flow:not(.is-enhanced) .story-stage {
    padding-top: 22px;
  }

  .story-flow:not(.is-enhanced) .story-composition {
    width: min(700px, 88%);
    margin-top: 32px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .childhood-scene *,
  .childhood-scene *::before,
  .childhood-scene *::after {
    animation: none !important;
    transition: none !important;
    will-change: auto !important;
  }
}
