.bom-story { background: #fbf5e9; }
.bom-story [hidden] { display: none !important; }

.story-header {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.story-brand,
.story-header nav {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2.4vw, 24px);
}

.story-brand {
  gap: 9px;
  font: 700 1.24rem/1.15 var(--serif);
  text-decoration: none;
}

.story-header nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  font-size: .92rem;
  text-decoration: none;
}

.story-header nav .story-language {
  padding-inline: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.story-main { padding-bottom: clamp(40px, 7vw, 90px); }

.story-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, .9fr);
  grid-template-areas: "art intro" "art listen";
  align-items: end;
  gap: 0 clamp(26px, 5vw, 66px);
  padding-block: clamp(18px, 4.4vw, 56px);
  border-top: 1px solid var(--line);
}

.story-stage {
  grid-area: art;
  align-self: stretch;
  position: relative;
  min-width: 0;
}

.story-art {
  width: 100%;
  height: 100%;
  min-height: 390px;
  object-fit: cover;
  object-position: 47% center;
  border-radius: 24px;
}

.story-intro { grid-area: intro; align-self: end; padding-bottom: 24px; }

.story-series {
  font-size: .84rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.story-intro h1 { font-size: clamp(3.3rem, 7vw, 6rem); margin-top: 8px; }
.story-subtitle { font: 550 clamp(1.4rem, 2.55vw, 2.2rem)/1.15 var(--serif); color: var(--forest); }
.story-meta { margin-top: 14px; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.story-meta span:first-child {
  padding: 2px 10px;
  border-radius: 99px;
  background: #e6ebdf;
  color: var(--forest-deep);
}
.story-summary { margin-top: 12px; max-width: 34ch; color: var(--ink-soft); }

.story-listen { grid-area: listen; align-self: start; min-width: 0; }

.story-listen .rd-audio {
  display: grid;
  justify-items: stretch;
  gap: 13px;
  justify-content: stretch;
  padding: 16px 19px;
  border: 0;
  border-radius: 18px;
  background: var(--forest);
}

.story-listen .rd-audio[hidden] { display: none; }
.story-listen .rd-timeline { max-width: none; padding: 0; }
.story-listen .rd-transport { justify-content: center; }
.story-listen .rd-transport [data-play] { flex: 1; max-width: 260px; min-height: 48px; }
.story-listen .rd-auto { display: none; }
.is-reading .rd-auto { display: inline-flex; justify-self: center; min-height: 34px; }
.story-listen .rd-timeline-segment { background: #587b6f; }
.story-listen .rd-timeline-segment.is-current { background: #a49368; }

.story-view-actions,
.story-finished { display: flex; flex-wrap: wrap; gap: 5px 17px; align-items: center; }

.story-view-actions button,
.story-view-actions a,
.story-finished button,
.story-finished a {
  min-height: 44px;
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding-inline: 0;
  border: 0;
  background: transparent;
  font: 700 .97rem/1.2 var(--sans);
  color: var(--forest);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.story-view-actions { margin-top: 4px; }
.story-view-actions .story-open-book { text-decoration-thickness: 2px; }
.story-finished { padding: 7px 11px; border-radius: 10px; background: #e6ebdf; }
.story-finished span[role="status"] { flex-basis: 100%; font-weight: 700; }

.story-hero.is-reading {
  grid-template-columns: minmax(0, 1fr) minmax(0, .7fr);
  grid-template-areas: "intro listen" "art art";
  align-items: center;
  row-gap: 20px;
}

.is-reading .story-intro { padding-bottom: 0; }
.is-reading .story-intro h1 { font-size: clamp(2.2rem, 5vw, 4rem); }
.is-reading .story-summary { display: none; }

.story-pages {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-radius: 20px;
  background: #1f2a26;
}

.story-pages img {
  width: auto;
  max-width: 50%;
  max-height: min(68vh, 600px);
  object-fit: contain;
}

html:has(.story-expanded) { overflow: hidden; }

.story-hero.is-expanded {
  position: fixed;
  inset: 0;
  z-index: 50;
  height: 100dvh;
  background: #1f2a26;
  display: flex;
  flex-direction: column;
  padding: 12px 12px env(safe-area-inset-bottom);
  overflow: auto;
  gap: 8px;
}

.story-hero.is-expanded .story-intro { display: none; }
.story-hero.is-expanded .story-stage { flex: 1; align-self: stretch; min-height: 0; }
.story-hero.is-expanded .story-pages { height: 100%; padding: 0; }
.story-hero.is-expanded .story-pages img { max-height: 100%; }
.story-hero.is-expanded .story-listen { align-self: center; width: min(100%, 520px); }
.story-hero.is-expanded .story-view-actions :is(a, button) { color: var(--cream); }

.story-print {
  display: grid;
  grid-template-columns: 66px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: clamp(12px, 2.5vw, 23px);
  background: #f3e9d7;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.story-print img { border-radius: 5px; }
.story-print h2 { font-size: clamp(1.2rem, 2vw, 1.55rem); }
.story-print p { color: var(--ink-soft); font-size: .95rem; }
.story-print .btn { min-height: 44px; padding-inline: 16px; }

.story-related { margin-top: clamp(34px, 7vw, 78px); }
.story-related h2 { margin-bottom: 16px; font-size: clamp(1.8rem, 3.5vw, 2.7rem); }
.story-related-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.story-tile {
  display: grid;
  grid-template-columns: clamp(80px, 13vw, 153px) minmax(0, 1fr);
  align-items: stretch;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
}

.story-tile img { width: 100%; height: 100%; object-fit: cover; }
.story-tile div { align-self: center; padding: 13px 15px; }
.story-tile h3 { font-size: clamp(1.1rem, 2.4vw, 1.6rem); }
.story-tile p { line-height: 1.3; color: var(--ink-soft); margin-block: 5px 7px; }
.story-tile span { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

.story-transcript { margin-top: 30px; border-top: 1px solid var(--line); padding-top: 14px; }
.story-transcript summary { cursor: pointer; font-weight: 700; color: var(--forest); }
.story-transcript p { max-width: 64ch; margin-top: 10px; }

@media (max-width: 850px) {
  .story-hero, .story-hero.is-reading {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "art" "intro" "listen";
    row-gap: 14px;
  }
  .story-hero.is-reading { grid-template-areas: "intro" "art" "listen"; }
  .story-intro { padding-bottom: 0; }
  .story-art { aspect-ratio: 2.1; height: auto; min-height: 0; border-radius: 16px; }
  .story-summary { max-width: 59ch; }
  .story-related-grid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .story-header { min-height: 60px; }
  .story-header nav a:not(.story-language) { display: none; }
  .story-hero { padding-block: 14px 20px; }
  .story-intro h1 { font-size: clamp(2.8rem, 12vw, 4rem); }
  .story-pages img { max-width: 100%; max-height: 44vh; }
  .story-print { grid-template-columns: 58px 1fr; gap: 10px 12px; }
  .story-print .btn { grid-column: 2; justify-self: start; }
}
