/* SACRIA · THE WORLD — gallery layout, 2026-11-11.
   Keeps the existing spread art, accessible text and book page-turn logic.
   HOME and server-side functionality are not changed. */
#page-world {
  overflow-x: clip;
  background:
    linear-gradient(180deg,rgba(5,12,23,.50) 0%,rgba(6,16,29,.78) 390px,rgba(6,14,26,.96) 980px,#08111f 100%),
    url('../sacria-forest-cosmos.webp') center top / 100% auto no-repeat,
    #091420;
}
#page-world .page-header {
  padding: 8px 0 0;
  border-bottom: 0;
  background: transparent;
  text-align:center;
}
#page-world .page-header .shell {max-width: 1200px;}
#page-world .world-emblem {
  display:block;
  width: min(100%, 1010px);
  margin:0 auto;
  line-height:0;
}
#page-world .world-emblem picture,
#page-world .world-emblem img {display:block; width:100%; height:auto;}
#page-world .page-header .lede {
  margin: -14px auto 12px;
  max-width: 820px;
  color:#ede1d2;
  font-size: clamp(12px, 1.08vw, 15px);
  line-height:1.65;
  text-shadow: 0 2px 9px #000,0 0 15px #0009;
}
/* Open volume is the primary object, secondary books are two selectable objects beneath it. */
#page-world .world-book-shelf,
#page-world .world-book-shelf.has-open {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  column-gap:clamp(14px,4vw,65px);
  row-gap: 0;
  align-items:center;
  justify-content:center;
  width:min(100%, 940px);
  margin:0 auto;
  padding:0 0 14px;
  transform:none;
  overflow-anchor:none;
}
#page-world .world-book-shelf.has-open .world-book.is-open {
  grid-column:1 / -1;
  grid-row:1;
  width: min(100%, 600px);
  margin-inline:auto;
}
#page-world .world-book-shelf.has-open .world-book:not(.is-open) {justify-self:center;}
#page-world .world-book {min-width:0;padding:0;position:relative;}
#page-world .world-book-summary {justify-items:center;}
#page-world .world-book-toggle {
  display:block;
  border:0;
  background:none;
  padding:3px 7px 7px;
  color:inherit;
  cursor:pointer;
}
#page-world .world-book-title, #page-world .world-book-label {display:none!important;}
#page-world .world-book-shelf.has-open .world-book-model {
  width:clamp(102px,9vw,126px);
  height:auto;
  aspect-ratio:247 / 324;
  filter:drop-shadow(0 14px 17px #000b);
  transition:transform .26s ease,filter .26s ease;
}
#page-world .world-book-model:hover {filter:drop-shadow(0 0 20px #ddad6670) drop-shadow(0 14px 17px #000c);}
#page-world .world-book[data-world-book="third"] .world-book-model:hover {filter:drop-shadow(0 0 20px #7cecf084) drop-shadow(0 14px 17px #000c);}
@media (hover:hover) {
  #page-world .world-book-toggle:hover .world-book-model {transform: translateY(-8px) scale(1.045);}
}
#page-world .world-book-shelf:not(.has-open) {grid-template-columns:repeat(3,minmax(0,1fr));width:min(100%,760px);column-gap:18px;padding-top:18px;}
#page-world .world-book-shelf:not(.has-open) .world-book {justify-self:center;}
#page-world .world-book-shelf:not(.has-open) .world-book-model {width:clamp(130px,18vw,230px);}
#page-world .world-book-spread {width:100%;max-width:none;overflow:visible;}
#page-world .world-book-top {display:none!important;}
#page-world .world-book-stage {
  width:100%;
  aspect-ratio:912 / 477;
  position:relative;
  isolation:isolate;
  padding:0;
  border:0;
  background:var(--spread-photo) center / 100% 100% no-repeat;
  box-shadow:none;
  overflow:visible;
}
#page-world .world-book-stage::after {pointer-events:none;}
#page-world .world-book-reading {
  position:relative;
  color:#352518;
  background:none;
  box-shadow:none;
  border:0;
  border-radius:0;
  min-width:0;
}
#page-world .world-book-reading .world-age-copy {
  inset:14% 13% 15% 10%;
  scrollbar-width:thin;
  scrollbar-color:#a4845770 transparent;
  text-align:left;
}
#page-world .world-book-reading .period {font-size:clamp(9px,1vw,11px);}
#page-world .world-book-reading h2 {font-size:clamp(22px,2vw,30px);margin:7px 0 13px;}
#page-world .world-book-reading p {font-size:clamp(11px,0.96vw,14px);line-height:1.73;margin:0 0 12px;overflow-wrap:normal;}
#page-world .world-book-folio {opacity:.83;}
/* Art-directed clickable gilded CLOSE plaque at the actual bottom of the opened book. */
#page-world .world-book-close {
  position:absolute;
  z-index:4;
  left:50%;bottom:-14px;
  transform:translateX(-50%);
  display:flex;
  justify-content:center;
  align-items:center;
  width:184px;height:64px;
  padding:0 0 13px;
  border:0;
  background: url('world-close-plaque.svg') center / contain no-repeat;
  color:#ffe5b2;
  text-shadow:0 1px 2px #000, 0 0 9px #eaa74b40;
  font: 500 18px/1 Georgia, 'Times New Roman',serif;
  letter-spacing:.15em;
  cursor:pointer;
  transition:filter .22s ease, transform .22s ease;
}
#page-world .world-book-close:hover,
#page-world .world-book-close:focus-visible {
  filter:drop-shadow(0 0 15px #e8bb62a8);
  transform:translateX(-50%) scale(1.06);
}
#page-world .world-book-close:focus-visible {outline:2px solid #f9da91;outline-offset:1px; border-radius:35px;}
#page-world .world-book-close span {pointer-events:none;}
#page-world .world-book-shelf.has-open > .world-book:not(.is-open) {margin-top:0;}
#page-world .story-note {
  max-width: 740px;
  margin:23px auto 48px;
  padding:14px 18px;
  border:0;
  border-top:1px solid #bba77638;
  background:transparent;
  color:#b5c0ce;
  font-size:12px;
  line-height:1.9;
  text-align:center;
}
/* Keep the page immersive without ever trapping scrolling / preventing access to secondary eras. */
@media (min-width: 761px) {
  #page-world .world-book-shelf {row-gap:0;}
  #page-world .world-book-shelf.has-open .world-book:not(.is-open) {align-self:start;}
}
@media (max-width: 760px) {
  #page-world {
    background:
      linear-gradient(180deg,rgba(6,15,27,.44) 0%,rgba(6,15,27,.80) 400px,rgba(6,15,27,.98) 1040px,#08111f 100%),
      url('../sacria-forest-cosmos.webp') 67% top / auto 760px no-repeat,
      #08111f;
  }
  #page-world .page-header {padding-top:2px;}
  #page-world .world-emblem {max-width:560px;}
  #page-world .page-header .lede {margin:-9px auto 19px;max-width:540px;padding:0 5px;font-size:clamp(12px,1.95vw,15px);line-height:1.75;}
  #page-world .world-book-shelf, #page-world .world-book-shelf.has-open {grid-template-columns:repeat(2,minmax(0,1fr));column-gap:10px;row-gap:0;max-width:540px;padding:0 0 15px;}
  #page-world .world-book-shelf.has-open .world-book.is-open {grid-column:1/-1; width:100%;}
  #page-world .world-book-stage {
    grid-template-columns:1fr;
    width:100%;
    aspect-ratio:auto;
    padding:10px 10px 17px;
    border:2px solid #c39858;
    border-radius:25px 25px 18px 18px;
    background:
       linear-gradient(90deg,#3c281a,#73512d 3%,#3d2b1d 5%,#6c4927 50%,#342416 96%,#997244);
    box-shadow:inset 0 0 0 3px #25160d, 0 20px 24px #000b, 0 0 25px #b8782c22;
  }
  #page-world .world-book-stage::after {display:none;}
  #page-world .world-book-art {
    display:block;
    min-height:0;
    width:100%;
    aspect-ratio:1.18;
    border:3px solid #cc9b5c;
    border-radius:14px 14px 3px 3px;
    background:url('illustration-first.bb4e7ca2.png') center 43% / cover no-repeat;
    box-shadow:inset 0 0 28px #0007, 0 0 0 1px #301d0f;
  }
  #page-world .world-book[data-world-book="second"] .world-book-art {background-image:url('illustration-second.385e3f34.png');}
  #page-world .world-book[data-world-book="third"] .world-book-art {background-image:url('illustration-third.dbc5064e.png');}
  #page-world .world-book-folio {left:13px;top:13px;min-width:39px;min-height:39px;font-size:18px;background:linear-gradient(120deg,#785126,#1b1b1c 66%);border:1px solid #d2b17d;opacity:1;}
  #page-world .world-book-reading,
  #page-world .world-book[data-world-book="first"] .world-book-reading,
  #page-world .world-book[data-world-book="second"] .world-book-reading,
  #page-world .world-book[data-world-book="third"] .world-book-reading {
    border:2px solid #d3ac6f;
    border-top:0;
    border-radius:0 0 12px 12px;
    padding: 26px 22px 51px;
    display:block;
    min-height: 0;
    background:
      linear-gradient(90deg,#7b472b50,#f7e7c6 9%,#e8c792 50%,#f5d7ab 90%,#9b673a),
      #ecd09f;
    color:#3b281b;
    box-shadow:inset 0 1px 12px #ae7c3b40;
  }
  #page-world .world-book[data-world-book="second"] .world-book-reading {background:linear-gradient(90deg,#b2a99b,#f4ede0 9%,#f0ede7 90%,#c1b8ab);color:#1a2e3b;}
  #page-world .world-book[data-world-book="third"] .world-book-stage {border-color:#71d8e1;background:linear-gradient(90deg,#102c3c,#136176 4%,#102635 45%,#0b3245 96%);box-shadow:inset 0 0 0 2px #0b1b29, 0 20px 24px #000b,0 0 28px #00dfff24;}
  #page-world .world-book[data-world-book="third"] .world-book-reading {background:linear-gradient(90deg,#051620,#133b50 8%,#133043 90%,#051922);color:#ecffff;border-color:#44bac9;}
  #page-world .world-book-reading .world-age-copy {position:static;inset:auto;overflow:visible;text-align:center;}
  #page-world .world-book-reading .period {font-size:10px;line-height:1.55;letter-spacing:.09em;}
  #page-world .world-book-reading h2 {font-size:clamp(24px,5.8vw,30px);margin:10px 0 18px;}
  #page-world .world-book-reading p {font-size:clamp(12px,2.95vw,14px);line-height:1.82;text-align:left;margin-bottom:14px;word-break:keep-all;}
  #page-world .world-book-hinge {display:none!important;}
  #page-world .world-book-close {bottom:-20px;width:175px;height:67px;}
  #page-world .world-book-shelf.has-open .world-book:not(.is-open) {align-self:start;margin-top:31px;}
  #page-world .world-book-shelf.has-open .world-book-model {width:clamp(105px,32vw,173px);}
  #page-world .world-book-shelf:not(.has-open) {grid-template-columns:repeat(2,minmax(0,1fr));max-width:510px;row-gap:32px;padding-top:18px;}
  #page-world .world-book-shelf:not(.has-open) .world-book-model {width:clamp(120px,35vw,190px);}
  #page-world .world-book-shelf:not(.has-open) .world-book:last-child {grid-column:1/-1;}
  #page-world .story-note {font-size:11px;margin:25px auto 42px;padding-inline:8px;}
}
@media (max-width: 640px) {
  #page-world .page-header .shell {width:calc(100% - 24px);}
  #page-world .page-header .world-emblem {width:min(100%,460px);}
  #page-world .page-header .lede {max-width:390px;margin:-23px auto 17px;font-size:clamp(12px,3.15vw,14px);}
  #page-world > .shell {width:calc(100% - 24px);}
  #page-world .world-book-stage {padding:7px 7px 17px;border-radius:20px 20px 15px 15px;}
  #page-world .world-book-reading,
  #page-world .world-book[data-world-book="first"] .world-book-reading,
  #page-world .world-book[data-world-book="second"] .world-book-reading,
  #page-world .world-book[data-world-book="third"] .world-book-reading {padding:24px 18px 49px;}
}
@media (max-width: 360px) {
  #page-world .page-header .lede {font-size:11.5px;}
  #page-world .world-book-reading p {font-size:12px;}
  #page-world .world-book-close {width:158px;height:62px;}
}
@media (prefers-reduced-motion: reduce) {
 #page-world .world-book-close {transition:none;}
}
