/* Small-window policy: preserve the full desktop canvas and allow horizontal
   scrolling instead of rearranging or compressing the original blog art.
   Historical narrow-screen rules below remain inactive on purpose. */

main.story-main{height:auto;min-height:calc(100dvh - 60px);padding:52px 34px 48px;background:#fff7ef url('/assets/blog/patterns/home-brush-story-dots.jpg') left top/512px auto repeat}
.story-page{max-width:920px;margin:auto;color:#725842;font:17px/1.5 Basiic,RainyHearts,"Courier New",sans-serif;text-transform:lowercase}
.story-page *,.story-page *::before,.story-page *::after{box-sizing:border-box}
.story-page a{color:inherit;text-underline-offset:4px}
.story-page [hidden]{display:none!important}
.story-page .shelf{display:grid;gap:24px}
.story-page .collection-heading{display:flex;align-items:center;gap:12px;font-size:18px;color:#94674d;letter-spacing:1px;margin-bottom:0}
.story-page .collection-heading::after{content:'';height:1px;background:#dec3a5;flex:1}
.story-page .collection-heading img{width:24px;height:24px;object-fit:contain}

/* Warm cream cards echo the painted sidebar's rounded honey borders. */
.story-page .treasure{--edge:#d7ad84;--paper:#fff9ed;position:relative;display:grid;grid-template-columns:174px minmax(0,1fr);gap:27px;align-items:center;text-decoration:none;padding:24px 28px 24px 22px;background:var(--paper);border:2px solid var(--edge);border-radius:20px 24px 19px 16px;box-shadow:0 4px 0 #bf926431;outline-offset:5px;transition:border-color .16s,transform .16s}
.story-page .treasure:nth-of-type(2){--paper:#fff5ed;--edge:#d9b19b;border-radius:22px 18px 24px 17px}
.story-page .treasure:nth-of-type(3){--paper:#fff8e8;--edge:#d5b080}
.story-page .treasure:hover{border-color:#b7865e;transform:translateY(-2px)}
.story-page .treasure:focus-visible{outline:2px solid #a87956}
.story-page .story-cover{position:relative;display:block;padding:7px;background:#fffdf5;border:1px solid #dfc2a4;box-shadow:0 3px 6px #8b61351a;transform:rotate(-2deg)}
.story-page .treasure:nth-of-type(2) .story-cover{transform:rotate(2deg)}
.story-page .story-cover::before{content:'';position:absolute;width:48px;height:14px;top:-7px;left:calc(50% - 24px);background:#edcfacce;transform:rotate(-5deg);z-index:1}
.story-page .story-cover img{display:block;width:100%;height:132px;object-fit:cover}
.story-page .story-copy{display:flex;flex-direction:column;gap:10px;min-width:0}
.story-page .story-number{align-self:flex-start;font-size:14px;line-height:1.4;letter-spacing:1px;color:#9b6b51;background:#f6e6d0;border:1px solid #e4c7a7;border-radius:8px 10px 8px 9px;padding:3px 10px}
.story-page .story-name{display:flex;align-items:center;gap:9px;font-size:26px;line-height:1.3;color:#85553d}
.story-page .story-name img{width:25px;height:25px;object-fit:contain;image-rendering:pixelated;flex:none}
.story-page .treasure small{display:block;font-size:18px;line-height:1.65;color:#75614e;overflow-wrap:anywhere}
.story-page .treasure em{font-size:17px;font-style:normal;color:#a0754f;margin-top:2px}
.story-page .closing-decoration{display:flex;align-items:center;justify-content:center;gap:18px;color:#c09b88;font-size:18px;margin:28px 0 4px}
.story-page .closing-decoration img{width:38px;height:38px;object-fit:contain}

/* Keep reading text on quiet opaque paper, above the dotted wallpaper. */
.story-page.reading .shelf,.story-page.reading .closing-decoration{display:none}
.story-page .book{scroll-margin-top:28px;background:#fffaf1;border:1.5px solid #dbb693;border-radius:20px 23px 19px 18px;padding:26px 30px;box-shadow:0 4px 0 #bf926426}
.story-page .back-shelf{display:inline-block;text-decoration:none;font-size:17px;color:#9b6d53;border-bottom:1px dotted #cda98b;margin-bottom:20px}
.story-page .chapters{border:1px solid #e1c5a7;border-radius:12px;background:#fff1dc;padding:13px 18px;margin:0 0 30px}
.story-page .chapters summary{cursor:pointer;font-size:18px}
.story-page .chapters div{display:grid;grid-template-columns:1fr 1fr;gap:7px 18px;padding-top:17px}
.story-page .chapters a{font-size:17px;text-decoration:none}
.story-page .chapters a:hover{text-decoration:underline}
.story-page .story-subtab{max-width:650px;margin:auto;font-size:20px;line-height:1.95}
.story-page .story-subtab p{margin:18px 0;overflow-wrap:anywhere}
.story-page .story-subtab h3{text-align:center;font-weight:400;font-size:34px;color:#85553d;margin:25px 0 12px}
.story-page .story-subtab h4{font-size:25px;font-weight:400;color:#a47665;border-bottom:1px dotted #dbbea6;padding-bottom:10px;margin:38px 0 18px;scroll-margin-top:24px}
.story-page .storygif{display:block;width:auto;max-width:100%;height:auto;max-height:420px;object-fit:contain;margin:28px auto}
.story-page .book>.back-shelf:last-child{display:block;width:max-content;max-width:100%;margin:30px auto 20px}

@media (max-width: 0px){
 main.story-main{padding:30px 12px}
 .story-page .treasure{grid-template-columns:115px minmax(0,1fr);padding:20px 16px;gap:18px}
 .story-page .story-cover img{height:100px}
 .story-page .story-name{font-size:23px}
 .story-page .story-name img{width:20px;height:20px}
 .story-page .treasure small{font-size:17px}
 .story-page .book{padding:22px 18px}
 .story-page .story-subtab{font-size:19px}
 .story-page .chapters div{grid-template-columns:1fr}
}
@media (max-width: 0px){
 .story-page .treasure{grid-template-columns:1fr;gap:20px;padding:24px 20px}
 .story-page .story-cover{width:165px;margin:auto}
 .story-page .story-copy{gap:10px}
 .story-page .story-number{align-self:center}
}
@media(prefers-reduced-motion:reduce){.story-page .treasure{transition:none}.story-page .treasure:hover{transform:none}}

/* Keep the three-story shelf within the desktop viewport using the blog font. */
@media(min-width:681px){
 main.story-main{height:calc(100dvh - 60px);min-height:0;padding:36px clamp(20px,3.5vw,48px) 18px;display:flex}
 .story-page{width:100%;max-width:960px;height:100%;display:flex;flex-direction:column;min-height:0}
 .story-page .shelf{flex:1;min-height:0;grid-template-rows:auto repeat(3,minmax(0,1fr));gap:clamp(8px,1.45dvh,14px)}
 .story-page .collection-heading{font-size:17px;line-height:1.2;gap:10px}
 .story-page .collection-heading img{width:20px;height:20px}
 .story-page .treasure{grid-template-columns:clamp(112px,13vw,150px) minmax(0,1fr);gap:20px;padding:10px 20px 10px 16px;min-height:0}
 .story-page .story-cover{padding:6px}
 .story-page .story-cover img{height:clamp(70px,11.5dvh,102px)}
 .story-page .story-cover::before{height:11px;top:-6px;width:40px;left:calc(50% - 20px)}
 .story-page .story-copy{gap:clamp(3px,.5dvh,5px)}
 .story-page .story-number{font-size:12px;line-height:1.1;padding:2px 8px}
 .story-page .story-name{font-size:clamp(18px,2.65dvh,22px);line-height:1.15;gap:7px}
 .story-page .story-name img{width:20px;height:20px}
 .story-page .treasure small{font-size:clamp(13px,1.9dvh,16px);line-height:1.4}
 .story-page .treasure em{font-size:14px;line-height:1.2;margin-top:0}
 .story-page .closing-decoration{flex:none;height:26px;margin:10px 0 0;gap:14px;font-size:15px}
 .story-page .closing-decoration img{width:26px;height:26px}
 /* A whole story remains scrollable after selecting its card. */
 .story-main:has(.story-page.reading){height:auto;min-height:calc(100dvh - 60px);display:block}
 .story-page.reading{height:auto;display:block}
}

/* A small centered shelf with the same open breathing room as Neighbors. */
@media(min-width:681px){
 main.story-main{padding:76px 24px 32px;align-items:flex-start}
 .story-page{max-width:720px;height:auto}
 .story-page .shelf{flex:none;grid-template-rows:auto repeat(3,auto);gap:12px}
 .story-page .collection-heading{font-size:15px;gap:8px}
 .story-page .collection-heading img{width:18px;height:18px}
 .story-page .treasure{grid-template-columns:134px minmax(0,1fr);min-height:154px;gap:16px;padding:14px 18px;border-width:1.5px;border-radius:16px 18px 15px 14px}
 .story-page .story-cover{padding:5px}
 .story-page .story-cover img{height:100px}
 .story-page .story-cover::before{width:32px;height:9px;top:-5px;left:calc(50% - 16px)}
 .story-page .story-copy{gap:4px}
 .story-page .story-number{font-size:10px;padding:2px 6px}
 .story-page .story-name{font-size:18px;gap:6px}
 .story-page .story-name img{width:17px;height:17px}
 .story-page .treasure small{font-size:14px;line-height:1.4}
 .story-page .treasure em{font-size:13px}
 .story-page .closing-decoration{height:22px;margin-top:14px;font-size:13px;gap:12px}
 .story-page .closing-decoration img{width:23px;height:23px}
 .story-page .book{padding:20px 24px;border-radius:17px}
 .story-page .story-subtab{max-width:590px;font-size:17px;line-height:1.8}
 .story-page .story-subtab h3{font-size:27px}
 .story-page .story-subtab h4{font-size:21px}
 .story-page .storygif{max-height:300px}
}

/* Read directly on the dotted paper, with a narrow and quiet text column. */
.story-page.reading{max-width:840px}
.story-page.reading .book{background:none;border:0;box-shadow:none;border-radius:0;padding:0}
.story-page.reading .back-shelf{font-size:13px;margin-bottom:15px;color:#8c6046}
.story-page.reading .chapters{width:100%;padding:0 0 14px;margin-bottom:24px;background:none;border:0;border-bottom:1px dotted #d5b89b;border-radius:0}
.story-page.reading .chapters summary{width:fit-content;font-size:13px;line-height:1.5;color:#93664a}
.story-page.reading .chapters div{grid-template-columns:1fr 1fr;gap:7px 16px;padding-top:13px}
.story-page.reading .chapters a{font-size:12px;line-height:1.4}
.story-page.reading .story-subtab{max-width:800px;font-size:15px;line-height:1.85;color:#72533e}
.story-page.reading .story-subtab p{margin:16px 0}
.story-page.reading .story-subtab h3{font-size:23px;line-height:1.35;margin:8px 0 18px;color:#85553d}
.story-page.reading .story-subtab>h3+p{text-align:center;font-size:12px;color:#987458;margin-bottom:30px}
.story-page.reading .story-subtab h4{font-size:18px;margin:30px 0 14px;padding-bottom:8px;border-color:#d9bea2}
.story-page.reading .storygif{width:min(100%,330px);max-width:330px;max-height:320px;margin:20px auto}
.story-page.reading .book>.back-shelf:last-child{margin:28px auto 14px}



/* Use a light native glyph for double quotes; keep Basiic for the story text. */
@font-face{
 font-family:StoryPunctuation;
 src:local("Arial"),local("Liberation Sans"),local("DejaVu Sans");
 font-style:normal;
 font-weight:400;
 font-display:swap;
 unicode-range:U+0022,U+201C-201D;
}
.story-page .story-subtab{font-family:StoryPunctuation,Basiic,RainyHearts,"Courier New",sans-serif}

/* Story shelf and chapter links feel gently pressable while reading. */
.story-page .treasure:active,.story-page .treasure:hover:active{transform:translateY(1px) scale(.995)}
.story-page .back-shelf,.story-page .chapters a{transition:transform .16s ease,color .16s ease}
.story-page .back-shelf:is(:hover,:focus-visible),.story-page .chapters a:is(:hover,:focus-visible){
 color:#a5765b;transform:translateX(3px)
}
.story-page .back-shelf:active,.story-page .chapters a:active{transform:translate(1px,1px)}
@media(prefers-reduced-motion:reduce){
 .story-page .back-shelf,.story-page .chapters a{transition:none}
 .story-page .treasure:active,.story-page .treasure:hover:active,
 .story-page .back-shelf:is(:hover,:focus-visible,:active),
 .story-page .chapters a:is(:hover,:focus-visible,:active){transform:none}
}


/* One cream-peach paper palette connects this room to the blog sidebar. */
main.story-main{background-blend-mode:multiply}

/* Keep the original bow lace in view while reading long stories; it does
   not change the standard blog canvas or obstruct its interactions. */
body.story-room .blog-lace-header{
  position:sticky;
  top:0;
  z-index:30;
}
/* Chapter anchors land below the pinned lace instead of beneath it. */
.story-page.reading .book [id]{
  scroll-margin-top:calc(var(--lace-height) + 18px);
}

/* Airier Story shelf. Typography and candy-ink colors stay untouched:
   only frame geometry, spacing, and image sizing change. */
@media (min-width:681px) {
  main.story-main:not(:has(.story-page.reading)) {
    padding-top:66px;
    padding-bottom:36px;
  }
  .story-page:not(.reading) {
    max-width:810px;
  }
  .story-page:not(.reading) .shelf {
    gap:25px;
  }
  .story-page:not(.reading) .collection-heading {
    margin-bottom:3px;
  }
  .story-page:not(.reading) .treasure {
    grid-template-columns:116px minmax(0,1fr);
    gap:24px;
    min-height:0;
    padding:16px 24px 16px 20px;
    border-width:1px;
    border-radius:14px;
    box-shadow:0 2px 0 #bf926418;
  }
  .story-page:not(.reading) .treasure:nth-of-type(2),
  .story-page:not(.reading) .treasure:nth-of-type(3) {
    border-radius:14px;
  }
  .story-page:not(.reading) .story-cover {
    padding:5px;
  }
  .story-page:not(.reading) .story-cover img {
    height:92px;
  }
  .story-page:not(.reading) .story-copy {
    gap:7px;
  }
  .story-page:not(.reading) .treasure small {
    line-height:1.6;
  }
  .story-page:not(.reading) .closing-decoration {
    margin-top:20px;
  }
}

/* Minimal story bookshelf: keep all colorful title lettering and reading
   content unchanged, but replace the large preview cards with three links. */
@media(min-width:681px){
 main.story-main:not(:has(.story-page.reading)){padding-top:92px;padding-bottom:50px}
 .story-page:not(.reading){max-width:680px}
}
.story-page:not(.reading) .shelf{
 display:flex;
 flex-direction:column;
 gap:24px;
 max-width:560px;
 width:100%;
 margin:0 auto;
}
.story-page:not(.reading) .collection-heading{margin-bottom:8px}
.story-page:not(.reading) .treasure,
.story-page:not(.reading) .treasure:nth-of-type(2),
.story-page:not(.reading) .treasure:nth-of-type(3){
 box-sizing:border-box;
 display:block;
 width:fit-content;
 max-width:100%;
 min-height:0;
 margin:0;
 padding:9px 6px;
 border:0;
 border-radius:0;
 background:transparent;
 box-shadow:none;
 outline-offset:5px;
 transform:none;
 text-decoration:none;
}
.story-page:not(.reading) .treasure:is(:hover,:active,:focus-visible){
 background:transparent;
 border:0;
 box-shadow:none;
 transform:none;
}
.story-page:not(.reading) .treasure .story-name{
 display:inline;
 font-size:16px;
 line-height:1.65;
}
.story-page:not(.reading) .treasure:is(:hover,:focus-visible) .story-name{
 text-decoration:underline;
 text-decoration-thickness:1px;
 text-underline-offset:5px;
}
.story-page:not(.reading) .closing-decoration{margin-top:28px}

/* Center the three colorful Story links without touching their lettering. */
.story-page:not(.reading) .shelf > .treasure {
 align-self:center;
 text-align:center;
}

/* Story typography, images and candy-ink palette are unchanged.
   Center the plain star/title row; no trailing rule. Lift the shelf 32px.
   Chapter dividers and the reading-page top controls are gone. */
.story-page:not(.reading) .collection-heading {
 justify-content:center;
 text-align:center;
}
.story-page:not(.reading) .collection-heading::after {
 display:none;
 content:none;
}
@media(min-width:681px) {
 main.story-main:not(:has(.story-page.reading)) {padding-top:60px}
 main.story-main:has(.story-page.reading) {padding-top:44px}
}
.story-page.reading .story-subtab h4 {
 border-bottom:0;
 padding-bottom:0;
}

/* Three quiet, centered stanzas for Bubble and Star's closing poem.
   Leave the rest of the story text and its candy colors untouched. */
.story-page.reading .story-subtab .star-poem {
 width:min(100%,420px);
 max-width:100%;
 margin:38px auto 30px;
 padding:0 12px;
 border:0;
 background:none;
 box-shadow:none;
 text-align:center;
 font-size:15px;
 line-height:1.85;
 color:#569581;
 font-style:italic;
}
.story-page .star-poem-stanza + .star-poem-stanza {
 margin-top:20px;
}
.story-page .star-poem-stanza > span {
 display:block;
}
.story-page .star-poem-lead {
 margin-bottom:5px;
}
/* Uniform mint ink on every line; no multicolored stanza headings. */
.story-page.reading .story-subtab .star-poem .star-poem-stanza,
.story-page.reading .story-subtab .star-poem .star-poem-stanza span {
 color:inherit;
 font-style:inherit;
}

/* A small, readable floating return arrow travels with a long Story.
   Sticky positioning keeps it beside the reading column without covering
   any title or paragraph, and it stops at the end of its book. */
.story-page.reading .book > .story-back-arrow {
 position:sticky;
 top:calc(var(--lace-height, 96px) + 16px);
 z-index:20;
 display:flex;
 align-items:center;
 justify-content:center;
 width:28px;
 height:28px;
 margin:0 0 -28px -42px;
 padding:0;
 border:1px solid #d8bea5;
 border-radius:50%;
 background:#fff8eeec;
 box-shadow:0 2px 6px #9c78531a;
 color:#987052;
 text-decoration:none;
 font:18px/1 Arial,sans-serif;
 transition:background-color .15s,border-color .15s;
}
.story-page.reading .book > .story-back-arrow:hover {
 background:#ffeedb;
 border-color:#c99f79;
}
.story-page.reading .book > .story-back-arrow:focus-visible {
 outline:2px dashed #ae7c59;
 outline-offset:3px;
}
@media(max-width:680px){
 .story-page.reading .book > .story-back-arrow {
  margin-left:-8px;
 }
}
@media(prefers-reduced-motion:reduce){
 .story-page.reading .book > .story-back-arrow{transition:none}
}

/* Book-style justification for the prose of all three stories.
   Titles, author notes, illustrations and the mint closing poem retain
   their existing alignment and colorful lettering. */
.story-page.reading .story-subtab p {
 text-align:justify;
 text-align-last:left;
}
.story-page.reading .story-subtab > h3 + p {
 text-align:center;
 text-align-last:center;
}

/* Respect the English capitalization already written in the three books.
   Only the reader changes: the three Story links on the shelf remain as-is. */
.story-page.reading {
 text-transform:none;
}
