/* Themed series and author pages (web/js/pages/themed.js). A theme sets --th-* on the page; everything below the
   hero stays on the site's own role tokens, so Light, Dark and Larger Text behave as on every other page.
   Hero text is white on --th-bg1/--th-bg2 (12:1 and 7:1 by the mockups' check); --th-gold is the highlight (7:1).
   The texture stays under 20% and fades out; it's off with Reduce Motion and Increase Contrast. */
.th{--bleed:36px;--face:var(--th-face),var(--serif);--body:var(--th-body,var(--face));margin:-28px calc(var(--bleed) * -1) 0}
@media (max-width:820px){.th{--bleed:max(16px,env(safe-area-inset-left,0px))}}
.th-w{padding:0 var(--bleed);max-width:1180px}
.th a:not(.link):not(.th-btn){color:inherit}

/* hero */
.th-hero{position:relative;overflow:hidden;color:#fff;padding:36px var(--bleed) 44px;
 background:radial-gradient(700px 420px at 80% 28%,var(--th-glow),transparent 62%),linear-gradient(160deg,var(--th-bg1),var(--th-bg2) 70%,var(--th-bg1))}
.th-hero::before,.th-band::before{content:"";position:absolute;inset:0;pointer-events:none;background-image:var(--th-tex,none);background-size:var(--th-tsize,auto);
 -webkit-mask-image:linear-gradient(180deg,#000,#000 55%,transparent);mask-image:linear-gradient(180deg,#000,#000 55%,transparent)}
@media (prefers-reduced-motion:reduce),(prefers-contrast:more){.th-hero::before,.th-band::before{display:none}}
.th-in{position:relative;z-index:1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.05fr);gap:40px;align-items:center}
.th-eyebrow,.th-label{font:700 13px/1.2 var(--font);letter-spacing:.12em;text-transform:uppercase;margin:0 0 14px}
.th-eyebrow{color:var(--th-gold)}
.th-label{color:var(--label-2)}
.th-display{font:400 clamp(44px,8vw,84px)/.98 var(--face);letter-spacing:-.01em;color:#fff;text-wrap:balance;margin:0}
.th-deck{font:italic 400 clamp(19px,2.4vw,25px)/1.32 var(--body);color:var(--th-deck);margin:18px 0 0;max-width:34ch}
.th-byline{display:flex;flex-wrap:wrap;gap:6px 18px;margin:22px 0 24px;font-size:16px;color:#fff}
.th-byline a{text-decoration:underline;text-underline-offset:3px;font-weight:600}
.th-tick{display:inline-flex;align-items:center;gap:6px;font-weight:600}
.th-tick .sym{width:15px;height:15px}
.th-actions{display:flex;flex-wrap:wrap;gap:12px}
.th-btn{min-height:48px;padding:0 24px;border-radius:24px;display:inline-flex;align-items:center;gap:8px;font:700 17px var(--font);background:#fff;color:var(--th-bg1);border:0;cursor:pointer}
.th-btn .sym{width:18px;height:18px}
.th-btn.ghost{background:rgba(255,255,255,.16);color:#fff}
.th-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:24px}
.th-chips span{font:600 13px var(--font);padding:5px 12px;border-radius:99px;background:rgba(255,255,255,.16);color:#fff}
.th-stats{display:flex;flex-wrap:wrap;gap:16px 32px;margin:24px 0}
.th-stats div{display:flex;flex-direction:column}.th-stats b{font:400 34px/1.1 var(--face);color:#fff}.th-stats span{font-size:14px;color:var(--th-deck)}
.th-more-btn{position:absolute;top:0;right:0;color:#fff}
.th-author .th-text{position:relative}
.th-photo{width:96px;height:96px;border-radius:48px;object-fit:cover;display:block;margin-bottom:18px;box-shadow:0 0 0 3px rgba(255,255,255,.85)}

/* the fanned covers: real covers, never recolored */
.th-fan{position:relative;height:440px}
.th-fc{position:absolute;width:42%;left:calc(var(--i) * 14.5%);top:20%;z-index:calc(var(--i) + 1)}
.th-fc:nth-child(even){top:4%}.th-fc:nth-child(3n){top:30%}
.th-fan.n1 .th-fc{left:25%}.th-fan.n2 .th-fc{left:calc(10% + var(--i) * 36%)}
.th-fc .cover{border-radius:var(--r-cover-lg);box-shadow:0 1px 2px rgba(0,0,0,.25),0 14px 30px -6px rgba(0,0,0,.5)}
.th-fc .badge{display:none}

/* sections */
.th-sec{padding:52px 0}
.th-tinted{background:var(--th-tint)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .th-tinted{background:color-mix(in srgb,var(--th-bg1) 55%,#000)}}
:root[data-theme="dark"] .th-tinted{background:color-mix(in srgb,var(--th-bg1) 55%,#000)}
.th-two{display:grid;grid-template-columns:1fr 1fr;gap:40px;align-items:start}
.th-h2,.th-sechead h2{font:400 34px/1.12 var(--face);margin:0;letter-spacing:-.005em;display:block;text-wrap:balance}
.th-h2.sm{font-size:28px;margin-bottom:18px}
.th-sechead{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 16px;margin-bottom:24px}
.th-sechead p{margin:0;font-size:15px;color:var(--label-2)}
.th-rule{border:0;height:14px;margin:0 0 16px;background:var(--label);-webkit-mask:var(--th-div) left center/auto 14px repeat-x;mask:var(--th-div) left center/auto 14px repeat-x}
.th-author .th-rule{-webkit-mask:none;mask:none;height:3px}
.th-lede{font:400 20px/1.55 var(--body);margin:0;max-width:62ch}
.th-lede::first-letter{font:700 72px/.8 var(--face);float:left;padding:8px 10px 0 0}
.th-sub{font-size:14px;color:var(--label-2)}
.th-note{font-size:14px;color:var(--label-2);margin:18px 0 0}
.th-band{position:relative;overflow:hidden;background:var(--th-band);color:#fff;padding:72px 0}
.th-band .th-w{position:relative;z-index:1}
.th-pull{font:italic 400 clamp(28px,4.4vw,44px)/1.18 var(--body);margin:0;padding:0;border:0;max-width:24em;color:#fff}
.th-pull cite{display:block;font:700 13px var(--font);letter-spacing:.12em;text-transform:uppercase;font-style:normal;margin-top:18px;color:var(--th-gold)}

/* No Spoilers bar */
.th-spoilbar{padding:20px 0;border-bottom:1px solid var(--sep)}
.th-spoilbar .th-w{display:flex;flex-wrap:wrap;align-items:center;gap:12px 18px}
.th-spoilbar .th-label{margin:0}
.th-spoilbar p{margin:0;flex:1 1 280px;font-size:14px;color:var(--label-2)}
.th .seg button{min-height:36px}
.th-lock{display:flex;gap:8px;align-items:flex-start;font-size:15px;color:var(--label-2);margin:16px 0 0}
.th-lock .sym{width:17px;height:17px;flex:none;margin-top:2px}

/* reading order */
.th-strip{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(132px,1fr);gap:20px;overflow-x:auto;padding-bottom:10px;align-items:end;scroll-snap-type:x proximity}
.th-bk{display:flex;flex-direction:column;gap:6px;scroll-snap-align:start;min-width:0}
.th-bk.nov{padding:0 12px}
.th-num{font:700 13px var(--font);letter-spacing:.08em;color:var(--label-2);border-bottom:2px solid var(--label);padding-bottom:6px;margin-bottom:8px}
.th-bk b{font:700 17px/1.18 var(--body);margin-top:8px}
.th-ok{display:inline-flex;align-items:center;gap:5px;font:600 13px var(--font);color:var(--ok)}
.th-ok .sym{width:13px;height:13px}
.th-callout{margin-top:26px;border:1px solid var(--label-3);border-radius:12px;padding:16px 18px}
.th-callout .th-label{margin-bottom:6px}.th-callout p{margin:0;font-size:16px;line-height:1.45}

/* realms, rankings, bonus scenes, a map */
.th-realms{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:14px}
.th-realm,.th-card{background:var(--cell);border:1px solid var(--sep);border-radius:20px;padding:16px 18px}
.th-realm .th-num{border:0;padding:0;margin:0}
.th-realm h3{font:400 22px/1.15 var(--face);margin:4px 0 2px}.th-realm p{margin:2px 0;font-size:14px;color:var(--label-2)}
.th-eye{display:flex;align-items:center;gap:8px;color:var(--label)!important;font-weight:600}
.th-eye i{width:14px;height:14px;border-radius:7px;box-shadow:0 0 0 1.5px var(--label);flex:none}
.th-cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:16px}
.th-card h3{font:400 24px/1.15 var(--face);margin:8px 0 6px}.th-card p{margin:0;color:var(--label-2);font-size:15px}
.th-card .th-label{margin:0}
.th-ranks{padding:4px 22px;margin-top:16px}
.th-rank{display:grid;grid-template-columns:32px minmax(0,1fr) minmax(0,1.3fr);gap:14px;align-items:center;padding:14px 0;border-bottom:1px solid var(--sep)}
.th-rank:last-child{border-bottom:0}
.th-rank .th-num{border:0;padding:0;margin:0;font-size:15px}
.th-rank h3{font:400 19px var(--face);letter-spacing:.06em;text-transform:uppercase;margin:0}
.th-bar b{display:block;font-size:14px;margin-bottom:5px}
.th-bar i{display:block;height:10px;border-radius:5px;background:var(--label);min-width:2px}
.th-map{margin:0}.th-map img{width:100%;max-width:820px;border-radius:14px;box-shadow:var(--shadow)}
.th-map figcaption{font-size:14px;color:var(--label-2);margin-top:10px}

/* inside the books, characters, links, more by */
.th-inside{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:2px 24px}
.th-inside a{display:grid;grid-template-columns:44px 1fr;gap:2px 10px;padding:12px 0;border-bottom:1px solid var(--sep)}
.th-inside .th-num{grid-row:span 2;border:0;padding:0;margin:0}
.th-inside b{font:700 16px var(--body)}.th-inside span:last-child{font-size:14px;color:var(--label-2)}
.th-chars{display:grid;grid-template-columns:repeat(auto-fill,minmax(84px,1fr));gap:16px 10px}
.th-chars a{display:flex;flex-direction:column;align-items:center;text-align:center;font-size:13px;font-weight:600;gap:6px;min-height:44px}
.th-chars small{font-weight:400;color:var(--label-2)}
.th-av{width:56px;height:56px;border-radius:28px;display:grid;place-items:center;background:var(--th-bg2);color:#fff;font:400 20px var(--face)}
.th-links p{margin:0 0 14px;font-size:17px}.th-links .sym{width:14px;height:14px}
.th-more{display:grid;grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:20px 16px;margin-bottom:16px}
.th-more a{display:flex;flex-direction:column;gap:6px}.th-more b{font:700 15px/1.2 var(--body)}.th-more span{font-size:13px;color:var(--label-2)}

/* author pages */
.th-dept{display:grid;grid-template-columns:220px minmax(0,1fr);gap:24px;padding:22px 0;border-bottom:1px solid var(--sep)}
.th-dept h3{font:400 26px/1.15 var(--face);margin:0 0 6px}
.th-dept h3 a{text-decoration:underline;text-underline-offset:3px;text-decoration-thickness:1px}
.th-shelf{display:grid;grid-template-columns:repeat(auto-fill,minmax(112px,1fr));gap:20px 14px}
.th-tl{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(130px,1fr));gap:16px;border-top:2px solid var(--label);padding-top:16px}
.th-tl b{display:block;font:400 30px var(--face)}.th-tl a{font-size:14px;color:var(--label-2)}

@media (max-width:820px){
 .th-hero{padding-top:24px;padding-bottom:32px}
 .th-in,.th-two{grid-template-columns:1fr;gap:24px}
 .th-fan{height:230px;order:2}
 .th-fc{width:34%;left:calc(var(--i) * 16.5%)}
 .th-sec{padding:40px 0}
 .th-band{padding:52px 0}
 .th-h2,.th-sechead h2{font-size:28px}
 .th-lede{font-size:19px}
 .th-strip{grid-auto-columns:140px}
 .th-dept{grid-template-columns:1fr;gap:12px}
 .th-rank{grid-template-columns:28px minmax(0,1fr)}.th-bar{grid-column:1/-1}
 .th-actions .th-btn{flex:1 1 auto;justify-content:center}
}

/* a book in a themed series: the hero only (book.js); the rest of the book page stays plain */
.hero.th-book{--face:var(--th-face),var(--serif);color:#fff;
 background:radial-gradient(520px 320px at 85% 20%,var(--th-glow),transparent 62%),linear-gradient(160deg,var(--th-bg1),var(--th-bg2) 70%,var(--th-bg1))}
.hero.th-book::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background-image:var(--th-tex,none);background-size:var(--th-tsize,auto);
 -webkit-mask-image:linear-gradient(180deg,#000,#000 55%,transparent);mask-image:linear-gradient(180deg,#000,#000 55%,transparent)}
@media (prefers-reduced-motion:reduce),(prefers-contrast:more){.hero.th-book::before{display:none}}
.hero.th-book h1{font-family:var(--face);font-weight:400;color:#fff}
.hero.th-book .eyebrow,.hero.th-book .eyebrow a{color:var(--th-gold);letter-spacing:.06em}
.hero.th-book .byline,.hero.th-book .prog{color:var(--th-deck)}
.hero.th-book .fmt{background:rgba(255,255,255,.16);color:#fff}
.hero.th-book .link{color:#fff}
.hero.th-book .btn.primary{background:#fff;color:var(--th-bg1)}
.hero.th-book .btn.tinted{background:rgba(255,255,255,.16);color:#fff}
.hero.th-book .more{background:rgba(255,255,255,.16)}.hero.th-book .more .sym{color:#fff}
.hero.th-book .cover{box-shadow:0 1px 2px rgba(0,0,0,.25),0 14px 30px -6px rgba(0,0,0,.55)}
