/*
Theme Name: Sách Thiếu Nhi – Kệ sách
Version: 1.0.0
*/
*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0;background:#fffcf4;color:#193d36;font:16px/1.55 system-ui,sans-serif}a{color:inherit;text-decoration:none}a:hover{text-decoration:underline;text-underline-offset:4px}button,input{font:inherit}button{cursor:pointer}.wrap{width:min(1180px,92%);margin:auto}header{background:#fffef9;border-bottom:1px solid #dfdfce}.bar,nav,.section-title,footer .wrap{display:flex;align-items:center;justify-content:space-between;gap:20px}.bar{min-height:56px}.brand{font-size:23px;font-weight:850;letter-spacing:-1px}.brand span{color:#d75e36;font-size:34px;vertical-align:middle}nav{font-weight:650;gap:28px}form[role=search]{display:flex;border:1px solid #c6d1c4;border-radius:30px;overflow:hidden;background:white}form input{min-width:0;width:140px;padding:8px 14px;border:0;background:none}form button{border:0;background:none;padding:0 14px;font-size:24px}.hero{margin:28px 0 18px;padding:clamp(24px,5vw,68px);display:grid;grid-template-columns:1fr 1fr;align-items:center;background:#e5efd9;border-radius:26px;overflow:hidden}.hero h1,h1,h2,h3,.cover strong{font-family:Georgia,'Times New Roman',serif}.hero h1{font-size:clamp(48px,6vw,86px);line-height:1.02;letter-spacing:-.05em;margin:0}.hero em{color:#a54729}.intro p{max-width:330px}.cta{display:inline-flex;align-items:center;gap:20px;background:#205248;color:white;border-radius:30px;padding:11px 22px;font-weight:700}.showcase{display:flex;justify-content:center;align-items:center;position:relative;isolation:isolate;min-height:270px}.showcase:before{content:'';position:absolute;width:75%;height:95%;background:#f8d987;border-radius:50%;z-index:-1}.cover{overflow:hidden;display:flex;flex-flow:column;width:41%;max-width:190px;background:#f2b79b;border:5px solid #fff7df;border-left:9px solid #b45e46;box-shadow:5px 9px 0 #46755a35;transform:rotate(-10deg);border-radius:3px 8px 8px 3px}.cover+.cover{background:#d1ddad;transform:rotate(11deg) translateY(12px);border-left-color:#577349;margin-left:-7px}.cover img{width:100%;height:clamp(90px,12vw,155px);object-fit:cover}.cover strong{padding:10px;font-size:clamp(14px,1.5vw,22px);line-height:1.2}.showcase i{position:absolute;color:#bd612b;left:0;top:2%;font-size:40px}.showcase i:last-child{left:auto;right:0;top:75%}.paths,.grid{display:grid;gap:18px}.paths{grid-template-columns:repeat(3,1fr);scroll-margin:18px}.paths a{padding:15px 20px;background:#f6dfbe;border-radius:15px;font-size:19px;font-weight:750;display:flex;align-items:center;gap:14px}.paths a:nth-child(2){background:#e6dff1}.paths a:nth-child(3){background:#dcebe9}.paths span{font-size:24px}.paths b{margin-left:auto}.shelf{margin:44px 0}.section-title h2{font-size:34px;margin:0}.section-title{margin-bottom:18px}.section-title a,.crumb{font-weight:700}.grid{grid-template-columns:repeat(4,minmax(0,1fr))}.pic{aspect-ratio:1.5;background:#eedbad;overflow:hidden;border-radius:14px;display:grid;place-items:center}.pic img{width:100%;height:100%;object-fit:cover}.card small{display:block;margin:12px 0 3px;color:#805339;font-weight:700}.card h3{font-size:22px;line-height:1.3;margin:0}.archive,.reader{padding-block:38px;min-height:60vh}.reader article{max-width:780px;margin:auto}.reader h1,.archive h1{font-size:clamp(32px,4vw,54px);line-height:1.15;margin:20px 0}.tools{display:flex;gap:6px;flex-wrap:wrap;background:inherit;position:sticky;top:0;z-index:2;padding:8px 0}.tools button{background:#fcfaf1;color:#244739;border:1px solid #bfc9b8;border-radius:20px;padding:5px 12px}.story{font:20px/1.8 Georgia,serif;overflow-wrap:anywhere}.story img,.story video,.story iframe,.story figure{max-width:100%}.story img{height:auto;scroll-margin-top:70px}.story audio{width:100%}.story a{text-decoration:underline}.dark{background:#192d2a;color:#f4efd9}.dark header,.dark footer{background:#253c35}.tools{background:#fffcf4}.dark .tools{background:#192d2a}footer{padding:30px 0;background:#e9eddf;margin-top:40px}.pagination{margin:30px 0}.page-numbers{padding:6px}@media(max-width:760px){.bar{flex-wrap:wrap;gap:4px;padding:5px 0}.bar nav{order:3;width:100%;justify-content:flex-start;gap:20px;font-size:14px}.brand{font-size:19px}form input{width:100px}.hero{grid-template-columns:1fr;padding:26px}.showcase{min-height:175px;margin-top:12px}.cover{max-width:130px}.paths{gap:6px}.paths a{padding:9px 4px;gap:4px;justify-content:center;font-size:14px}.paths b{display:none}.grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 12px}.card h3{font-size:18px}.section-title h2{font-size:26px}.shelf{margin:28px 0}.section-title a{font-size:14px}.hero h1 br{display:none}.hero h1 em:before{content:' '}}@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}}

/* The illustrated reading room */
body{background:#fffaf0;color:#203e46}
.voyage{background:#ffe5b6;padding:0;grid-template-columns:.85fr 1.15fr;border:1px solid #e6d6ad;box-shadow:0 5px 0 #ede3cd;border-radius:28px}
.voyage .intro{padding:clamp(26px,4vw,56px)}
.voyage h1{font-family:ui-rounded,'Trebuchet MS',system-ui,sans-serif;font-weight:900;font-size:clamp(46px,5.1vw,78px);letter-spacing:-.06em;color:#183f49}
.voyage h1 em{font-style:normal;color:#a73d25}
.voyage .intro p{max-width:34ch;line-height:1.55}
.voyage .boat{width:100%;height:100%;max-height:445px;object-fit:cover;display:block}
.cta{background:#174e52;box-shadow:0 3px 0 #103b3c}
.paths{align-items:stretch}.paths a{background:#ffdfa0;border:1px solid #dfba72;border-radius:18px;box-shadow:0 3px 0 #edcf95;padding:15px 18px}
.paths a:nth-child(2){background:#e0ddf8;border-color:#c4b9e5;box-shadow:0 3px 0 #cdc5e4}.paths a:nth-child(3){background:#cdebdc;border-color:#a1d0ba;box-shadow:0 3px 0 #b2d6be}
.paths span{background:#ffffff96;padding:4px 9px;border-radius:12px}
.card{background:#fffefa;border:1px solid #e2d8c4;border-radius:18px;padding:8px 8px 14px;box-shadow:0 3px 0 #eee4d3}
.card h3,.card small{margin-inline:7px}.card h3{font:750 clamp(16px,1.55vw,21px)/1.35 system-ui,sans-serif}.section-title h2{color:#214e50}
a:focus-visible,button:focus-visible,input:focus-visible{outline:3px solid #a64627;outline-offset:2px}
@media(max-width:760px){.voyage{grid-template-columns:1fr}.voyage .intro{padding:22px 22px 20px}.voyage h1 br{display:none}.voyage .boat{height:clamp(155px,42vw,265px);object-position:center 55%}.voyage .intro p{margin:8px 0 14px}.paths a{flex-direction:column;gap:3px;text-align:center;line-height:1.3;padding:9px 3px}.paths span{font-size:20px}.section-title h2{font-size:25px}.card{padding:5px 5px 11px}}

.reading-banner{display:grid;grid-template-columns:1fr 44%;align-items:center;margin:28px 0 22px;background:#ffedcc;border:1px solid #e7d6b6;border-radius:28px;overflow:hidden;box-shadow:0 4px 0 #eee3cf}
.reading-banner>div{padding:24px clamp(22px,4vw,55px)}
.reading-banner .crumb{color:#6f5033;font-size:15px}
.reading-banner h1{margin:12px 0 2px;font:850 clamp(40px,5vw,72px)/1.1 ui-rounded,system-ui,sans-serif;letter-spacing:-.055em;color:#234d51}
.reading-banner p{margin:10px 0 0;font-size:18px}
.reading-banner img{width:100%;height:clamp(180px,21vw,275px);object-fit:cover;object-position:center 51%}
.genre-picks{justify-content:flex-start;flex-wrap:wrap;gap:8px}
.genre-picks a{padding:8px 16px;border:1px solid #ccd7c9;border-radius:24px;background:#fffef8;font-weight:650}
.genre-picks a[aria-current]{background:#245752;color:white;border-color:#245752}
.reading-shelf .shelf{margin-top:28px}.reading-shelf .section-title{margin-bottom:18px}
.reading-shelf .pagination{display:block}.reading-shelf .nav-links{display:flex;justify-content:center;flex-wrap:wrap;gap:5px}.reading-shelf .page-numbers{border-radius:12px;background:#edeedc;padding:8px 13px}.reading-shelf .current{background:#245752;color:white}
@media(max-width:600px){.reading-banner{margin:16px 0;grid-template-columns:1fr 36%;border-radius:18px}.reading-banner>div{padding:16px}.reading-banner img{height:100%;min-height:155px}.reading-banner h1{font-size:34px}.reading-banner p{font-size:15px}.genre-picks a{padding:8px 12px;font-size:14px}}

body>header{position:sticky;top:0;z-index:90;box-shadow:0 2px 8px #24383112}
body.admin-bar{--admin-offset:32px}body.admin-bar>header{top:var(--admin-offset)}
.bar nav{gap:6px}.bar nav a{display:block;border-radius:20px;padding:8px 13px;background:#e8efe1;color:#20483d;text-transform:uppercase;font-size:14px;font-weight:800;letter-spacing:.025em}.bar nav a:hover,.bar nav a:focus-visible{background:#d0e4cf}
.book-search{position:relative;width:clamp(210px,25vw,340px)}.book-search input{width:100%;flex:1}.book-hits{position:absolute;top:calc(100% + 5px);right:0;width:min(350px,90vw);padding:8px;background:white;color:#203e46;border:1px solid #c6d1c4;border-radius:14px;box-shadow:0 8px 24px #193d3626;max-height:52vh;overflow:auto}.book-hits a{display:block;padding:8px 10px}.book-hits a:hover,.book-hits a:focus-visible{background:#eef4e8}.tools{top:calc(var(--admin-offset,0px) + var(--header-height,78px))}.story img,#ke-sach{scroll-margin-top:calc(var(--admin-offset,0px) + var(--header-height,78px) + 64px)}
@media(max-width:782px){body.admin-bar{--admin-offset:46px}}
@media(max-width:760px){.book-search{flex:1;min-width:110px;max-width:320px}.bar nav{justify-content:center}.bar nav a{padding:5px 9px;font-size:12px}}
@media(max-width:600px){body.admin-bar{--admin-offset:0px}}

.reading-layout{display:grid;grid-template-columns:minmax(0,760px) minmax(225px,305px);gap:clamp(28px,5vw,76px);justify-content:center}.reading-layout article{width:100%;margin:0}.reading-side section{background:#f6f0df;border:1px solid #e5dac0;border-radius:18px;padding:18px;margin-bottom:20px}.reading-side h2{margin:0 0 10px;font-size:25px}.reading-side ul{list-style:none;padding:0;margin:0}.reading-side li+li{border-top:1px solid #dcd4bf}.reading-side li a{display:flex;align-items:center;gap:12px;padding:10px 0;font-weight:650;line-height:1.35}.reading-side img{width:52px;height:58px;border-radius:8px;object-fit:cover}.more-books.grid{grid-template-columns:repeat(2,minmax(0,1fr))}.reading-layout article>.section-title{margin-top:40px}.dark .reading-side section,.dark .more-books .card{background:#263f39}.dark .reading-layout .section-title h2,.dark .more-books small{color:#f4efd9}@media(max-width:850px){.reading-layout{grid-template-columns:minmax(0,1fr)}.reading-side{width:100%}}

.reading-layout .story p { text-align: justify; text-align-last: start; }

.reading-layout .story > p > img:only-child { display: block; margin-inline: auto; }

.stn-to-top:not([hidden]){position:fixed;right:max(16px,env(safe-area-inset-right));bottom:max(16px,env(safe-area-inset-bottom));z-index:89;display:grid;place-items:center;width:46px;height:46px;border:2px solid #fffaf0;border-radius:50%;background:#245752;color:white;box-shadow:0 3px 12px #183b3940}
.stn-to-top:hover{background:#183f3d}

.bar .brand img{display:block;width:220px;height:auto;max-width:100%}@media(max-width:760px){.bar .brand img{width:155px}}

.brand .brand-mobile{display:none}
@media(max-width:760px){
 .bar .brand .brand-full{display:none}
 .brand .brand-mobile{display:inline-flex;align-items:center;gap:5px;color:#20483d;font:800 17px/1.2 system-ui,sans-serif;letter-spacing:-.5px;white-space:nowrap}
 .brand-mobile i{width:38px;height:29px;background:url('library-logo.png') left center/190px auto no-repeat}
}

body.admin-bar{padding-top:0!important}

.library-footer{position:relative;background:#e4efde;border-top:1px solid #c4d6bc;color:#20483d;padding:30px 0 34px}
.library-footer::before{content:'';position:absolute;top:-8px;left:0;right:0;height:8px;background:radial-gradient(ellipse at center bottom,#e4efde 68%,transparent 72%) 0 0/30px 9px repeat-x}
.library-footer .footer-layout{gap:24px}.footer-identity{display:grid;justify-items:start;gap:9px}.footer-identity img{display:block;max-width:100%;height:auto}.footer-about{font-size:15px;font-weight:650}.footer-about span{margin-left:4px}
.footer-shelves{display:flex;flex-wrap:wrap;gap:10px}.footer-shelves a{display:flex;align-items:center;gap:8px;padding:9px 15px;border:1px solid #c1d1bc;background:#fffdf4;border-radius:16px;color:#20483d;font-weight:700}.footer-shelves a:hover{background:#fff}.footer-shelves a span{font-size:20px}.dark .library-footer{color:#f4efd9}.dark .library-footer::before{display:none}.dark .footer-identity img{background:#fffdf4;border-radius:6px}
@media(max-width:760px){.library-footer{padding:22px 0 58px}.library-footer .footer-layout{align-items:flex-start;flex-direction:column;gap:16px}.footer-identity img{width:180px}.footer-shelves{gap:6px;justify-content:flex-start}.footer-shelves a{padding:8px 10px;font-size:14px}}

.about-library .reading-layout{padding-top:8px;align-items:start}.about-content{font:20px/1.75 Georgia,serif;overflow-wrap:anywhere}.about-content img,.about-content figure{max-width:100%;height:auto}.about-content>:first-child{margin-top:0}.about-content a{text-decoration:underline}.about-library .reading-side nav{display:block}.about-library .reading-side li span{font-size:22px}.about-content h2{line-height:1.25}

.listen-box{margin:18px 0;padding:18px 22px;background:#e8e4f4;color:#303552;border:1px solid #cec7df;border-radius:18px}.listen-box h2{font:750 20px/1.4 system-ui;margin:0 0 10px}.listen-box figure{margin:0}.listen-box audio{display:block;width:100%}

.deferred-audio{display:block}.deferred-audio [hidden]{display:none!important}.start-audio{border:0;cursor:pointer}

.listen-box:not([hidden]){display:flex;align-items:center;gap:clamp(14px,3vw,28px);padding:clamp(16px,3vw,28px);position:relative;isolation:isolate;overflow:hidden;background:linear-gradient(110deg,#e3f1e8,#f7efd3);border:1px solid #c2d6bd;box-shadow:0 4px 0 #dbe3cd;border-radius:22px;color:#20483d}
.listen-box::after{content:'♫';position:absolute;right:2%;top:-32px;font:110px Georgia,serif;color:#437e6820;transform:rotate(15deg);z-index:-1;pointer-events:none}
.listen-box .listen-cover{width:clamp(100px,24%,176px);aspect-ratio:1;object-fit:cover;border:3px solid white;border-radius:15px;box-shadow:0 3px 9px #34513b22}
.listen-main{flex:1;min-width:0}.listen-main h2{font:700 clamp(22px,3vw,30px)/1.2 Georgia,serif;margin:0 0 12px}.listen-main h2 span{font:650 .77em system-ui;color:#477e69}.listen-main .start-audio{padding:10px 18px;background:#21564b;color:white;border-radius:30px;font:700 16px/1.4 system-ui}.listen-main .start-audio:hover{background:#163f37}
@media(max-width:520px){.listen-box:has(audio:not([hidden])) .listen-cover{display:none}.listen-main .start-audio{font-size:14px;padding:10px 12px}}

.listen-box .listen-cover{width:calc(50% - 14px);height:auto;aspect-ratio:auto;object-fit:contain}
@media(max-width:520px){.listen-box .listen-cover{width:42%}}

.story-gallery{width:min(960px,94vw);max-height:94dvh;padding:12px;border:0;border-radius:18px;background:#193d36;color:white}.story-gallery::backdrop{background:#0b211de8}.gallery-bar,.gallery-nav:not([hidden]){display:flex;align-items:center;justify-content:space-between;gap:10px}.story-gallery button{padding:7px 14px;border:0;border-radius:18px;background:#fffaeb;color:#21463e;font-weight:700}.story-gallery button:disabled{opacity:.45}.gallery-image{display:block;margin:10px auto;width:100%;height:min(68dvh,760px);object-fit:contain}.story-gallery:focus-visible,.story-gallery button:focus-visible{outline:3px solid #ffc862}body:has(.story-gallery[open]){overflow:hidden}

.story-gallery[open]{box-sizing:border-box;display:grid;grid-template-rows:auto minmax(0,1fr) auto;gap:5px;width:calc(100vw - 16px);max-width:none;height:calc(100dvh - 16px);max-height:none;padding:8px 12px;border-radius:12px}
.story-gallery .gallery-image{width:100%;height:100%;min-height:0;margin:0;object-fit:contain}
.story-gallery .gallery-bar,.story-gallery .gallery-nav{font-size:14px}.story-gallery button{padding:5px 14px}
@media(max-width:600px){.story-gallery[open]{width:calc(100vw - 4px);height:calc(100dvh - 4px);padding:5px;border-radius:6px}}

@media(max-width:760px){
 .bar .book-search{flex:0 1 36%;width:36%;min-width:100px;max-width:148px;margin-left:auto}
 .bar .book-search input{padding:3px 0 3px 10px;font-size:16px;line-height:24px}
 .bar .book-search button{width:34px;padding:0;font-size:20px;line-height:32px;color:#245752}
}

.book-comments{margin-top:36px;padding-top:22px;border-top:1px solid #cbd7c4}.comment-list{list-style:none;padding:0}.comment-list .children{list-style:none;padding-left:20px}.comment-body{padding:16px 0;border-bottom:1px solid #ddd9ca}.comment-author .avatar{float:left;margin-right:10px;border-radius:50%}.comment-meta{font-size:14px}.comment-form label{display:block}.comment-form textarea,.comment-form input:not([type=checkbox]):not([type=submit]){box-sizing:border-box;max-width:100%;width:100%;padding:10px;border:1px solid #b9c9bd;border-radius:9px;background:#fffdf7;color:#203e46;font:inherit}.comment-form .submit{border:0;border-radius:22px;background:#245752;color:white;padding:10px 20px;cursor:pointer}.comment-form-cookies-consent label{display:inline}.book-comments a{text-decoration:underline}

.missing-page{padding-bottom:28px}.missing-page .reading-banner h1{font-size:clamp(34px,4.5vw,60px)}.missing-page .error-code{font-size:14px;font-weight:750;color:#805339}.missing-page .cta{margin-top:18px}.missing-search{max-width:620px;margin:30px auto}.missing-search h2{font-size:28px}.missing-search form{margin-bottom:18px}.missing-search input{flex:1;width:100%;padding:12px 16px}.missing-search form button{font-size:16px;white-space:nowrap;background:#245752;color:white;padding:10px 18px}@media(max-width:600px){.missing-page .reading-banner{grid-template-columns:1fr}.missing-page .reading-banner img{height:160px;min-height:0}.missing-search .genre-picks{gap:8px}}

/* Use the system's Vietnamese-capable text face across reading content. */
.story,.about-content{font-family:"Segoe UI",Arial,system-ui,sans-serif;line-height:1.8}
.story :where(p,span,div,li,blockquote,a,strong,b,em,i,font),.about-content :where(p,span,div,li,blockquote,a,strong,b,em,i,font){font-family:inherit!important}
.reader h1,.story :where(h1,h2,h3,h4,h5,h6),.about-content :where(h1,h2,h3,h4,h5,h6){font-family:"Segoe UI",Arial,system-ui,sans-serif}
