/* Shared Story entrances, followed by the original-layout book reader. */
.story-navigation { display:flex; flex-wrap:wrap; gap:8px; grid-column:1 / -1; margin-bottom:var(--space-4); }
.story-navigation a { font-size:var(--type-small); padding:10px 16px; border-radius:30px; background:#03040209; }
.story-navigation a[aria-current=page] { background:var(--ink); color:var(--paper); }
.story-navigation a:hover { background:var(--blue); color:white; }
.stories-hero .story-navigation { margin:0; }
.stories-hub .stories-hero { min-height:0; }
.stories-hub .stories-hero-heading { grid-column:1 / -1; }
.story-entrances { display:grid; gap:var(--grid-gap); }
.story-entrance { border-radius:24px; padding:var(--space-4); display:flex; flex-direction:column; align-items:flex-start; }
.story-entrance.creator-entrance { background:var(--pink); }
.story-entrance.caregivers-entrance { background:#dcece2; }
.story-entrance p { font-size:var(--type-body); max-width:46ch; margin-top:var(--space-2); }
.story-entrance .button { margin-top:var(--space-4); background:var(--ink); color:var(--paper); }
.story-entrance .stories-eyebrow { margin-top:0; font-size:var(--type-small); }
.story-entrance h2 { text-wrap:pretty; }
.author-introduction p+p { margin-top:var(--space-2); }
.stories-hub .site-menu [aria-current=page],.creator-story-page .site-menu [aria-current=page] { text-decoration:underline; text-underline-offset:5px; }
.entrance-art { --entrance-art-height:240px; width:100%; height:var(--entrance-art-height); display:flex; align-items:center; justify-content:center; margin-bottom:var(--space-4); }
.entrance-spread { position:relative; display:flex; width:min(90%,calc(var(--entrance-art-height) * 1.18919)); aspect-ratio:1.18919; background:#f4ecdf; isolation:isolate; box-shadow:6px 8px 14px #4d302812; transform:rotate(-4deg); }
.entrance-spread img { display:block; width:50%; height:auto; mix-blend-mode:multiply; }
.entrance-spread::after { content:""; position:absolute; inset:0; pointer-events:none; background:linear-gradient(90deg,transparent 46%,#0000000d 49.9%,#00000012 50%,transparent 54%); }
.voices-art { display:flex; align-items:center; gap:0; isolation:isolate; }
.voices-art span { position:relative; display:grid; place-items:center; border-radius:22px; flex:0 0 min(40%,240px); width:min(40%,240px); aspect-ratio:1; }
.voices-art span+span { margin-left:max(-10%,-60px); }
.voices-art img { width:90%; height:90%; object-fit:contain; pointer-events:none; }
.voices-art span:nth-child(1) { z-index:1; background:var(--blue); transform:translateY(18px) rotate(-11deg); }
.voices-art span:nth-child(2) { z-index:2; background:var(--yellow); transform:translateY(-22px) rotate(3deg); }
.voices-art span:nth-child(3) { z-index:3; background:var(--pink); transform:translateY(24px) rotate(10deg); }
.author-heading h1 { font-size:var(--type-display); line-height:var(--leading-display); letter-spacing:-.035em; }
.author-introduction { color:var(--muted); font-size:var(--type-body); max-width:55ch; margin-top:var(--space-3); }
.book-reader { --book-height:calc(100svh - 240px); --leaf-ratio:.594595; position:relative; padding:14px var(--gutter); scroll-margin-top:89px; }
.reader-heading { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:12px; min-height:44px; }
.reader-heading h2 { font-size:var(--type-subheading); }
.reader-tools { display:flex; gap:8px; align-items:center; flex-wrap:wrap; }
.reader-control { display:inline-flex; gap:12px; justify-content:center; align-items:center; min-height:44px; border:0; border-radius:14px; padding:10px 16px; background:var(--ink); color:var(--paper); font:inherit; font-size:14px; }
.reader-control.secondary { color:var(--ink); background:#0304020b; }
.reader-control:disabled { opacity:.35; }
.reader-control svg { width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.7; }
.book-viewport { overflow:auto; max-height:calc(var(--book-height) + 8px); overscroll-behavior-x:contain; scrollbar-width:thin; border-radius:12px; background:#e9e4db; padding:4px; touch-action:pan-y pinch-zoom; }
.book-viewport.is-zoomed { touch-action:auto; }
.book-canvas { width:100%; min-height:var(--book-height); display:flex; justify-content:center; align-items:center; }
.book { position:relative; flex-shrink:0; aspect-ratio:1.18919; perspective:2400px; isolation:isolate; user-select:none; box-shadow:0 8px 22px #0002; }
.book.is-single { aspect-ratio:.594595; }
.book-page { position:absolute; top:0; width:50%; height:100%; background:white; }
.book-page.left { left:0; }
.book-page.right { right:0; }
.book.is-single .book-page.left { display:none; }
.book.is-single .book-page.right { width:100%; }
.book-page img { width:100%; height:100%; max-width:none; object-fit:fill; pointer-events:none; }
/* The binding and ground shadows belong to the book, not the leaves. They
   stay visible while an opaque turning leaf crosses the centre. */
.book:not(.is-single)::after { content:""; position:absolute; z-index:6; inset:0; pointer-events:none; background:linear-gradient(90deg,transparent 46%,#0000000d 49.9%,#00000012 50%,transparent 52.5%); }
.curl-sheet { position:absolute; inset:0; z-index:4; transform-style:preserve-3d; pointer-events:none; }
.curl-strip { position:absolute; left:0; top:0; height:100%; transform-origin:0 50%; transform-style:preserve-3d; will-change:transform; }
.curl-face { position:absolute; inset:0; backface-visibility:hidden; -webkit-backface-visibility:hidden; background-repeat:no-repeat; }
.curl-face.front::after { content:""; position:absolute; inset:0; background:#17120a; opacity:var(--shade,0); }
.curl-face.back { transform:rotateY(180deg); background-color:#faf8f3; }
.curl-face.back::after { content:""; position:absolute; inset:0; background:#574b39; opacity:var(--back-shade,0); }
.curl-shadow { position:absolute; z-index:2; inset-block:0; left:0; width:24%; pointer-events:none; background:linear-gradient(90deg,transparent,#0003,transparent); filter:blur(8px); opacity:0; }
.reader-bottom { margin-top:12px; display:flex; align-items:center; justify-content:center; gap:16px; }
.reader-pagination { display:flex; align-items:center; gap:12px; }
.reader-page-status { min-width:105px; text-align:center; font-size:14px; font-variant-numeric:tabular-nums; }
.reader-jump { display:flex; align-items:center; gap:8px; font-size:13px; }
.reader-jump input { width:64px; min-height:44px; border:1px solid #03040230; border-radius:12px; background:transparent; padding:8px; color:var(--ink); }
.reader-hint { margin-top:16px; color:var(--muted); font-size:var(--type-small); }
.reader-status { font-size:14px; margin-top:12px; }
.reader-status:empty { display:none; }
.reader-options { position:absolute; z-index:10; top:70px; right:var(--gutter); width:min(520px,calc(100% - 24px)); max-height:calc(100svh - 180px); overflow:auto; padding:24px; background:var(--paper); border:1px solid #03040220; border-radius:20px; box-shadow:0 12px 40px #0003; }
.reader-options[hidden] { display:none; }
.reader-chapter { display:flex; align-items:center; gap:12px; margin-bottom:20px; font-size:var(--type-small); }
.reader-chapter select { font:inherit; background:var(--paper); color:var(--ink); border:1px solid #03040230; border-radius:12px; min-height:44px; padding:10px 38px 10px 14px; max-width:100%; appearance:none; background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23030402' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat:no-repeat; background-position:right 14px center; }
.reader-transcript { margin-top:24px; font-size:14px; }
.reader-transcript summary { cursor:pointer; padding-block:12px; text-decoration:underline; text-underline-offset:4px; }
.reader-transcript-content { display:grid; gap:24px; padding-block:16px; }
.reader-text-page h3 { font-size:14px; color:var(--muted); margin-bottom:16px; }
.reader-text-page p { white-space:pre-line; font-size:16px; line-height:1.6; max-width:66ch; }
.book-reader.is-expanded { position:fixed; z-index:1000; inset:0; margin:0; border-radius:0; overflow:auto; --book-height:calc(100dvh - 148px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding:calc(14px + env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)); }
body.book-expanded { overflow:hidden; }
body.book-expanded .site-header,body.book-expanded .game-bar,body.book-reading .game-bar { visibility:hidden; }
.book-reader.is-expanded .reader-heading { background:var(--paper); }
.book-reader.is-expanded .reader-options { top:calc(70px + env(safe-area-inset-top)); right:12px; }
@media(min-width:800px) {
  .reader-transcript-content { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media(min-width:900px) {
  .story-entrances { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .entrance-art { --entrance-art-height:300px; }
  .story-entrance { padding:40px; }
  .author-heading { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); column-gap:var(--grid-gap); row-gap:var(--space-3); align-items:center; }
  .author-title { display:contents; }
  .author-title .stories-eyebrow { grid-column:1 / span 2; grid-row:2; margin:0; }
  .author-title h1 { grid-column:1 / span 2; grid-row:3; }
  .author-introduction { grid-column:3 / span 2; grid-row:3; align-self:center; margin:0; }
}
@media(max-width:799px) {
  .book-reader { --book-height:calc(100svh - 210px); padding:14px 8px; scroll-margin-top:61px; }
  .reader-heading h2 { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
  .reader-tools { gap:6px; width:100%; flex-wrap:nowrap; }
  .reader-tools .reader-control { flex:1; white-space:nowrap; }
  .reader-control { padding:10px 12px; font-size:13px; border-radius:12px; }
  .reader-pagination { width:100%; justify-content:space-between; gap:8px; }
  .reader-page-status { min-width:0; font-size:13px; }
  .reader-options { right:12px; padding:20px; }
  .reader-chapter { display:grid; gap:8px; }
  .reader-chapter select { width:100%; }
  .story-navigation { gap:6px; }
  .story-navigation a { padding:10px 12px; }
  .story-entrance { padding:24px; }
  .story-entrance h2 { font-size:24px; }
}
@media(prefers-reduced-motion:reduce) { .book *, .book { animation:none!important; transition:none!important; } }
