/* Link after His Story fusion CSS. Room styling is progressive; the final
   book child rule also bounds the original page when JavaScript is off. */
body.story-rooms-ready[data-edit-page="his-story"] .carry-subnav { top: 64px; z-index: 30; }
body.story-rooms-ready[data-edit-page="his-story"] .carry-subnav__scroll { display: none; }
body.story-rooms-ready[data-edit-page="his-story"] .story-room-tabs {
  display: flex; gap: 8px; max-width: 100%; overflow-x: auto;
  padding: 12px var(--gutter); scrollbar-color: var(--canvas-gold) #191713;
  scroll-snap-type: x proximity;
}
body.story-rooms-ready[data-edit-page="his-story"] .story-room-tab {
  display: flex; align-items: center; gap: 10px;
  flex: 0 0 auto; min-width: min(47vw, 180px); min-height: 58px;
  padding: 8px 14px; color: #fffaf0; background: #1b1915;
  border: 1px solid #756f61; border-bottom: 4px solid var(--story-tone, #f4bd32);
  font: 700 15px/1.15 var(--body); text-align: left; cursor: pointer;
  scroll-snap-align: start;
}
body.story-rooms-ready[data-edit-page="his-story"] .story-room-tab[data-tone="red"] { --story-tone: #d94c53; }
body.story-rooms-ready[data-edit-page="his-story"] .story-room-tab[data-tone="green"] { --story-tone: #46b477; }
body.story-rooms-ready[data-edit-page="his-story"] .story-room-tab[data-tone="gold"] { --story-tone: #f4bd32; }
body.story-rooms-ready[data-edit-page="his-story"] .story-room-tab[aria-selected="true"] {
  color: #11100d; background: #f4bd32; border-color: #f4bd32;
  box-shadow: 0 5px 0 #16130e;
}
body.story-rooms-ready[data-edit-page="his-story"] .story-room-tab[aria-selected="true"][data-tone="red"] { background:#efc9c9; border-color:#d94c53; }
body.story-rooms-ready[data-edit-page="his-story"] .story-room-tab[aria-selected="true"][data-tone="green"] { background:#d3f2de; border-color:#46b477; }
body.story-rooms-ready[data-edit-page="his-story"] .story-room-tab:focus-visible { outline: 3px solid #fffaf0; outline-offset: 3px; }
body.story-rooms-ready[data-edit-page="his-story"] .story-room-index { font: 900 30px/.9 var(--display); }
body.story-rooms-ready[data-edit-page="his-story"] .story-room-panel[hidden] { display: none !important; }
body.story-rooms-ready[data-edit-page="his-story"] .story-room-panel {
  min-width: 0; padding-block: clamp(24px,4vw,60px) clamp(50px,7vw,100px);
  scroll-margin-top: 9rem;
}
body.story-rooms-ready[data-edit-page="his-story"] main > .sha-groove { display: none; }
body.story-rooms-ready[data-edit-page="his-story"] .gx-frame::after { content: none !important; }
body.story-rooms-ready[data-edit-page="his-story"] .story-room-panel > :first-child { margin-top: 0 !important; }
body.story-rooms-ready[data-edit-page="his-story"] .story-room-panel > :last-child { margin-bottom: 0 !important; }
body.story-rooms-ready[data-edit-page="his-story"] .story-edition-rail {
  display: flex; align-items: stretch; gap: clamp(18px, 3vw, 36px);
  max-width: 100%; overflow-x: auto; padding: 12px 2px 24px;
  scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-color: var(--canvas-gold) #191713;
}
body.story-rooms-ready[data-edit-page="his-story"] .story-edition-rail:focus-visible { outline: 3px solid var(--canvas-gold); outline-offset: 2px; }
body.story-rooms-ready[data-edit-page="his-story"] .story-edition-rail > .book {
  box-sizing: border-box; flex: 0 0 min(84vw, 700px);
  min-width: 0; height: auto; margin: 0 !important; padding: clamp(16px,2vw,26px) !important;
  scroll-snap-align: start; border: 1px solid #766b58 !important;
  border-top: 4px solid var(--canvas-gold) !important; background: #171510;
}
body.story-rooms-ready[data-edit-page="his-story"] .story-edition-rail > .book:nth-child(2) { border-top-color: #d94c53 !important; }
body.story-rooms-ready[data-edit-page="his-story"] .story-edition-rail > .book .cover img { max-height: 52svh; object-fit: contain; }
@media (min-width: 900px) {
  body.story-rooms-ready[data-edit-page="his-story"] .story-room-tab { min-width: 180px; }
}
/* His Story's header styling overrides the shared mobile menu display rule.
   Honor its closed state so the room tabs and reading links remain reachable. */
@media (max-width: 820px) {
  body.story-rooms-ready[data-edit-page="his-story"] .carry-subnav {
    scroll-margin-top: 64px;
  }
  body.story-rooms-ready[data-edit-page="his-story"] header.masthead:not([data-compact-nav])[data-open="false"] .nav {
    display: none;
  }
}
/* Let the book's cover and prose shrink within their grid track. The nested
   related-product rail retains its own horizontal scrolling. */
body[data-edit-page="his-story"] #book-editions .book > * { min-width: 0; }
