/* Story video composition — loaded last so it can normalize the accumulated
   responsive story rules without changing the shared navigation. */
.story-page .story-full-copy {
  display: grid !important;
  grid-template-rows: auto minmax(0, 1fr) auto !important;
}

.story-page .story-media-copy-layout {
  box-sizing: border-box;
  width: 75%;
  min-width: 0;
  min-height: 0;
  margin: clamp(6px, 1.2vh, 16px) 0 0;
  padding: 0 clamp(10px, 1.8vw, 28px);
  display: grid;
  grid-template-columns: minmax(190px, .9fr) minmax(0, 1.25fr);
  align-items: stretch;
  gap: clamp(12px, 2vw, 30px);
  overflow: hidden;
}

.story-page .story-video-frame {
  width: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  aspect-ratio: 16 / 9;
  overflow: visible;
  border: 0;
  border-radius: clamp(14px, 1.7vw, 28px);
  background: transparent;
  box-shadow: none;
}

.story-page .story-video {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: inherit;
  background: transparent;
}

.story-page .story-media-copy-layout .story-full-lead {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 !important;
  padding: clamp(8px, 1.2vw, 18px) clamp(8px, 1.2vw, 18px) 24px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
}

.story-page .hero-actions {
  width: 75% !important;
  max-width: none !important;
  margin-right: 0 !important;
  margin-left: 0 !important;
  justify-content: center !important;
}

@media (orientation: portrait) {
  .story-page .story-full-copy {
    grid-template-rows: auto minmax(0, 1fr) auto !important;
  }

  .story-page .story-media-copy-layout {
    width: 100%;
    margin-top: clamp(8px, 1.5vh, 18px);
    padding: 0 clamp(12px, 3vw, 30px);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(10px, 1.5vh, 18px);
    overflow: hidden;
  }

  .story-page .story-video-frame {
    width: min(100%, 533px);
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: 16 / 9;
    flex: 0 0 auto;
  }

  .story-page .story-media-copy-layout .story-full-lead {
    width: min(100%, 820px) !important;
    height: auto !important;
    flex: 1 1 auto;
    /* Keep the final lines above the bottom-right mascot while the copy
       remains independently scrollable beneath the video. */
    padding-bottom: clamp(190px, 34svh, 390px) !important;
  }

  .story-page .hero-actions {
    width: min(70%, 520px) !important;
    max-width: calc(100% - clamp(150px, 38vw, 320px)) !important;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  .story-page .story-full-copy {
    width: 75% !important;
    min-height: 0 !important;
    padding: 6px 8px 8px 14px !important;
    grid-template-rows: auto minmax(0, 1fr) auto !important;
  }

  .story-page .story-media-copy-layout {
    width: 100%;
    margin-top: 2px;
    padding: 0 6px;
    grid-template-columns: minmax(150px, .85fr) minmax(0, 1.25fr);
    gap: 10px;
  }

  .story-page .story-video-frame {
    border-radius: 12px;
  }

  .story-page .story-media-copy-layout .story-full-lead {
    padding: 3px 5px 12px !important;
  }

  .story-page .hero-actions {
    width: 100% !important;
    margin: 4px 0 0 !important;
  }
}

@media (max-width: 430px) and (orientation: portrait) {
  .story-page .story-video-frame {
    height: auto;
    min-height: 0;
    max-height: none;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
  }
}

/* /* Center the story content as a group, reserving the right quarter for the mascot. */
@media (orientation: landscape) and (min-height: 561px) {
  .story-page .story-full-copy {
    box-sizing: border-box !important;
    width: 75% !important;
    padding-inline: clamp(16px, 2vw, 36px) !important;
    justify-items: center !important;
  }

  .story-page .story-media-copy-layout {
    width: 100%;
    margin-inline: auto;
  }

  .story-page .story-full-copy > h1 {
    position: relative;
    top: 0;
    left: 0;
    transform: none;
  }

  .story-page .hero-actions {
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: auto !important;
    justify-self: center !important;
    justify-content: center !important;
    transform: none;
  }
}
Thai heading sizes for narrow screens. Each range stays within the
   available story width while preserving the intended portrait line break. */
@media (orientation: portrait) and (max-width: 560px) {
  html[lang="th"] body .story-page .story-full-copy > h1 {
    font-size: clamp(27px, 9vw, 36px) !important;
  }
}

@media (orientation: portrait) and (min-width: 561px) and (max-width: 1024px) {
  html[lang="th"] body .story-page .story-full-copy > h1 {
    font-size: clamp(48px, 7vw, 58px) !important;
  }
}

@media (orientation: landscape) and (max-height: 560px) {
  html[lang="th"] body .story-page .story-full-copy > h1 {
    font-size: clamp(22px, 4.7vw, 42px) !important;
  }
}

@media (orientation: landscape) and (min-height: 561px) and (max-width: 1199px) {
  html[lang="th"] body .story-page .story-full-copy > h1 {
    font-size: clamp(44px, 6vw, 70px) !important;
  }
}

/* Keep automatic text fitting active after the language-specific legacy rules. */
@media (orientation: landscape) and (min-height: 561px) {
  .story-page .story-full-copy > h1,
  html[lang="th"] body .story-page .story-full-copy > h1,
  html[lang="en"] body .story-page .story-full-copy > h1,
  html[lang="ja"] body .story-page .story-full-copy > h1 {
    width: 100% !important;
    max-width: 100% !important;
    justify-self: center !important;
    margin-inline: auto !important;
    text-align: center !important;
    font-size: var(--story-heading-size, clamp(24px, 4vw, 64px)) !important;
    line-height: 1.28 !important;
  }
}