/* The Stories index is allowed to grow when a phone viewport or text zoom
   cannot fit its content. No other room or the home viewport scrolls. */
html.story-index-layout {
 height:auto; min-height:100%; overflow-x:hidden; overflow-y:auto;
 overscroll-behavior-y:auto;
}
.story-index-layout body.scene-room {
 height:auto; min-height:100vh; min-height:100dvh; overflow:visible;
}
.story-index-layout .scene-room .story-main {
 width:min(1120px,calc(100% - clamp(32px,9vw,96px)));
 flex:1 0 auto; min-width:0; overflow:visible;
}
.story-index-layout .scene-room .story-library {
 flex:1 0 auto; overflow:visible; padding:clamp(16px,3vw,34px) 0;
}
.story-index-layout .story-library>.eyebrow {
 display:block; font-size:.75rem; line-height:1.4; margin-bottom:.32rem;
}
.story-index-layout .scene-room .story-library>h1 {
 font-size:clamp(2rem,5vw,3.5rem); max-width:24ch; line-height:1.14;
 overflow-wrap:anywhere;
}
.story-index-layout .story-library>.story-intro {
 font-size:clamp(1rem,2.1vw,1.2rem); line-height:1.52; margin:0 0 1.1rem;
}
.story-index-layout .scene-room .story-categories {
 flex:0 0 auto; min-height:0; max-width:none; grid-auto-rows:auto;
 grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:none;
 align-content:start; align-items:stretch; gap:clamp(18px,4.2vw,42px);
}
.story-index-layout .scene-room .story-category {
 min-width:0; min-height:min-content; overflow:visible; justify-content:flex-start;
 align-items:flex-start; gap:.3rem; padding:0; text-decoration:none;
}
.story-index-layout .story-category-mark {
 display:block; width:min(100%,15rem); height:auto;
 aspect-ratio:16/9; object-fit:contain; object-position:left center;
 margin:0 0 .28rem; border-radius:.3rem;
}
.story-index-layout .scene-room .story-number {
 display:block; font-size:.7rem; line-height:1.3;
}
.story-index-layout .scene-room .story-category h2 {
 font-size:clamp(1.3rem,2.5vw,2rem); line-height:1.18;
 margin:.04rem 0 .18rem; overflow-wrap:anywhere;
}
.story-index-layout .scene-room .story-category p {
 display:block; max-width:38ch; font-size:clamp(1rem,1.8vw,1.1rem);
 line-height:1.47; margin:0; overflow-wrap:anywhere;
}
.story-index-layout .scene-room .story-category .story-arrow {
 display:block; margin-top:auto; padding-top:.34rem; font-size:.875rem;
 line-height:1.4; color:#ffe9bc;
}
.story-index-layout .story-coming {margin-top:1.5rem}
.story-index-layout .story-coming p {display:block; font-size:1rem; line-height:1.5}
.story-index-layout .story-prayer {margin-top:.85rem}
.story-index-layout .story-prayer h2 {font-size:1rem; line-height:1.4}
.story-index-layout .story-prayer a {display:inline-flex; align-items:center; gap:.35rem; min-height:44px}
@media(max-width:380px) {
 .story-index-layout .scene-room .story-categories {grid-template-columns:minmax(0,1fr)}
 .story-index-layout .story-category-mark {width:min(100%,12.5rem)}
}

/* The library entrance has room to breathe; these rules don't follow visitors
   into the reading rooms. The original scenery and book marks remain intact. */
.story-index-layout .scene-room .story-main {
  width:min(1040px,calc(100% - clamp(32px,9vw,104px)));
}
.story-index-layout .scene-room .story-library {
  padding:clamp(25px,6vw,68px) 0 clamp(26px,4vw,48px);
}
.story-index-layout .story-library>.eyebrow {
  color:#fee4af; letter-spacing:.20em;
}
.story-index-layout .scene-room .story-library>h1 {
  font-size:clamp(2.05rem,6vw,3.95rem);
  max-width:21ch; margin:.36rem 0 .72rem;
  line-height:1.1; text-wrap:balance;
  text-shadow:0 2px 18px #020d1bf0;
}
.story-index-layout .story-library>.story-intro {
  max-width:39ch; margin:0 0 clamp(1.55rem,4vw,2.8rem);
  color:#f5e9d4; line-height:1.55;
}
.story-index-layout .scene-room .story-categories {
  gap:clamp(13px,2.3vw,25px); margin:0;
}
.story-index-layout .scene-room .story-category {
  --shelf-glow:43,95,99;
  display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:auto auto auto 1fr auto;
  align-content:start; align-items:start; gap:.32rem;
  padding:clamp(.85rem,2.5vw,1.35rem);
  border:1px solid #efd69d52;
  border-radius:clamp(12px,2vw,20px);
  background:radial-gradient(ellipse at 16% 0,rgba(var(--shelf-glow),.42),transparent 73%),linear-gradient(155deg,#071e2cea,#071520ec);
  box-shadow:0 10px 22px #040b1845, inset 0 1px 0 #ffe5ab14;
}
.story-index-layout .scene-room .story-category:nth-child(2){--shelf-glow:60,74,137}
.story-index-layout .scene-room .story-category:nth-child(3){--shelf-glow:111,61,85}
.story-index-layout .scene-room .story-category:nth-child(4){--shelf-glow:48,101,91}
.story-index-layout .scene-room .story-category:hover,
.story-index-layout .scene-room .story-category:focus-visible {border-color:#ffdf94}
.story-index-layout .story-category-mark {
  width:min(100%,15.5rem); margin:.02rem 0 .55rem; height:auto;
  border-radius:.32rem; filter:drop-shadow(0 4px 12px #020b1780);
}
.story-index-layout .scene-room .story-number {
  color:#eecf91; letter-spacing:.18em;
}
.story-index-layout .scene-room .story-category h2 {
  margin:.05rem 0 .15rem; font-size:clamp(1.5rem,3vw,2.12rem); line-height:1.15;
}
.story-index-layout .scene-room .story-category p {
  color:#f3e7d5; font-size:1.06rem; line-height:1.57;
}
.story-index-layout .scene-room .story-category .story-arrow {
  align-self:end; width:fit-content; margin-top:.26rem;
  font-size:.87rem; letter-spacing:.02em;
}
.story-index-layout .story-coming {
  margin:clamp(1.4rem,4vw,2.6rem) 0 0;
  gap:clamp(.65rem,3vw,1.4rem);
  padding:1rem 0;
  border-color:#ebd4a448;
}
.story-index-layout .story-prayer {margin-top:.95rem;}
@media (max-width:700px) {
  .story-index-layout .scene-room .story-categories {grid-template-columns:minmax(0,1fr);}
  .story-index-layout .scene-room .story-library {padding-top:clamp(1.3rem,6vw,3rem);}
  .story-index-layout .scene-room .story-category {
    grid-template-columns:minmax(0,1fr) minmax(75px,30%); grid-template-rows:auto auto auto auto;
    column-gap:clamp(.55rem,3vw,.9rem);
  }
  .story-index-layout .story-category-mark {
    grid-column:2; grid-row:1 / span 2; align-self:center;
    width:100%; min-width:0; margin:0;
  }
  .story-index-layout .scene-room .story-category :is(.story-number,h2) {grid-column:1;}
  .story-index-layout .scene-room .story-category p,
  .story-index-layout .scene-room .story-category .story-arrow {grid-column:1 / -1;}
}
@media (max-width:330px) {
  .story-index-layout .scene-room .story-category {grid-template-columns:minmax(0,1fr);}
  .story-index-layout .story-category-mark {grid-column:1;grid-row:auto;width:min(100%,9rem);margin-bottom:.3rem;}
}
/* Keep introductions with their actual paths, not below decoration. */
.story-index-layout .scene-room .story-library{padding-block:clamp(.55rem,2.5vh,1.8rem)}
.story-index-layout .scene-room .story-library>h1{font-size:clamp(1.5rem,6vw,2.75rem);margin:.18rem 0 .55rem}
.story-index-layout .scene-room .story-intro{font-size:clamp(.9rem,3vw,1.15rem);margin:0 0 .6rem}
.story-index-layout .scene-room .story-categories{grid-template-columns:repeat(2,minmax(0,1fr));gap:clamp(.45rem,3vw,1.5rem)}
.story-index-layout .scene-room .story-category{gap:.23rem}
.story-index-layout .story-category-mark{max-height:clamp(4.25rem,15vh,9rem)}
.story-index-layout .scene-room .story-category h2{font-size:clamp(1rem,4.3vw,1.65rem)}
.story-index-layout .scene-room .story-category p{font-size:clamp(.84rem,3vw,1rem)}
.story-index-layout .scene-room .story-category .story-arrow{font-size:.75rem;padding-top:.18rem}
.story-index-layout .wonder-footer{display:none}
