/* Midnight Gold: an opt-in preview theme for the book page. Everything is scoped to html[data-theme="midnight"]; the classic design is untouched. */
html[data-theme="midnight"]{--ink:#f3ecdc;--cream:#0d1410;--paper:#141d17;--lime:#e2b45c;--orange:#f08a4b;--line:rgba(243,236,220,.14);--mn-bg2:#101813;--mn-deep:#080d0a;--mn-gold:#e2b45c;--mn-text:#f3ecdc;--mn-mute:rgba(243,236,220,.68);color-scheme:dark}
html[data-theme="midnight"] body{background:var(--cream);color:var(--mn-text)}
html[data-theme="midnight"] ::selection{background:var(--mn-gold);color:#10180f}

/* nav */
html[data-theme="midnight"] .nav{background:rgba(13,20,16,.86);backdrop-filter:blur(14px);border-bottom:1px solid var(--line);position:sticky;top:0;z-index:30}
html[data-theme="midnight"] .brand span{background:var(--mn-gold);color:#10180f}
html[data-theme="midnight"] .nav-cta{background:var(--mn-gold);border-color:var(--mn-gold);color:#10180f;font-weight:700}

/* buttons */
html[data-theme="midnight"] .primary,html[data-theme="midnight"] .dark{background:var(--mn-gold);color:#10180f;border-radius:99px;transition:transform .2s,box-shadow .2s}
html[data-theme="midnight"] .primary span{color:#10180f}
html[data-theme="midnight"] .primary:hover,html[data-theme="midnight"] .dark:hover{transform:translateY(-2px);box-shadow:0 12px 30px -10px rgba(226,180,92,.55)}
html[data-theme="midnight"] .text-button{color:var(--mn-text);border-color:var(--mn-gold)}

/* hero */
html[data-theme="midnight"] .hero{background:radial-gradient(900px 520px at 78% 40%,rgba(226,180,92,.12),transparent 70%),var(--cream)}
html[data-theme="midnight"] .hero h1,html[data-theme="midnight"] .buy h2,html[data-theme="midnight"] .inside h2,html[data-theme="midnight"] .account h2{color:var(--mn-text)}
html[data-theme="midnight"] .hero h1 em,html[data-theme="midnight"] .buy h2 em{color:var(--mn-gold)}
html[data-theme="midnight"] .eyebrow{color:var(--mn-gold)}
html[data-theme="midnight"] .lead,html[data-theme="midnight"] .trust{color:var(--mn-mute);opacity:1}
html[data-theme="midnight"] .trust i{background:var(--mn-gold)}
html[data-theme="midnight"] .book-stage{background:var(--mn-deep);border-left:1px solid var(--line)}
html[data-theme="midnight"] .stage-caption strong{color:var(--mn-gold)}

/* buy */
html[data-theme="midnight"] .buy{background:var(--mn-bg2);border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
html[data-theme="midnight"] .buy>div>p:last-child,html[data-theme="midnight"] .buy p{color:var(--mn-mute)}
html[data-theme="midnight"] .price-card{background:var(--paper);border:1px solid var(--line);border-radius:18px;box-shadow:0 30px 60px -34px rgba(0,0,0,.8);transition:transform .3s,border-color .3s}
html[data-theme="midnight"] .price-card:hover{transform:translateY(-4px);border-color:rgba(226,180,92,.5)}
html[data-theme="midnight"] .price-card .price,html[data-theme="midnight"] .price{color:var(--mn-gold);border-color:var(--line)}
html[data-theme="midnight"] .price-card li,html[data-theme="midnight"] .price-card small,html[data-theme="midnight"] .price-card p{color:var(--mn-mute)}
html[data-theme="midnight"] .price-card h3,html[data-theme="midnight"] .price-card strong,html[data-theme="midnight"] .price-card b{color:var(--mn-text)}
html[data-theme="midnight"] .edition-cover,html[data-theme="midnight"] .actual-cover{background:var(--mn-deep);box-shadow:0 8px 18px -6px rgba(0,0,0,.7);border-radius:3px}
html[data-theme="midnight"] .price-card label,html[data-theme="midnight"] .price-card .buy-option,html[data-theme="midnight"] .price-card [class*="option"]{background:rgba(255,255,255,.03);border-color:var(--line);color:var(--mn-text);border-radius:10px}
html[data-theme="midnight"] input,html[data-theme="midnight"] select,html[data-theme="midnight"] textarea{background:rgba(255,255,255,.05);border:1px solid var(--line);color:var(--mn-text);border-radius:8px}
html[data-theme="midnight"] input::placeholder{color:rgba(243,236,220,.4)}
html[data-theme="midnight"] input:focus,html[data-theme="midnight"] select:focus,html[data-theme="midnight"] textarea:focus{outline:2px solid var(--mn-gold);outline-offset:1px}
html[data-theme="midnight"] option{background:#141d17;color:var(--mn-text)}
html[data-theme="midnight"] input[type=checkbox],html[data-theme="midnight"] input[type=radio]{accent-color:var(--mn-gold)}

/* marquee */
html[data-theme="midnight"] .marquee{background:transparent;color:var(--mn-gold);border-top:1px solid var(--line);border-bottom:1px solid var(--line);padding:15px}
html[data-theme="midnight"] .marquee b{color:var(--mn-text);opacity:.4}

/* inside */
html[data-theme="midnight"] .inside-copy>p{color:var(--mn-text)}
html[data-theme="midnight"] .chapters,html[data-theme="midnight"] .chapters article{border-color:var(--line)}
html[data-theme="midnight"] .chapters b{color:var(--mn-gold)}
html[data-theme="midnight"] .chapters h3{color:var(--mn-text)}
html[data-theme="midnight"] .chapters p{color:var(--mn-mute);opacity:1}
html[data-theme="midnight"] .quote{background:linear-gradient(135deg,#1a1408,#2a1f0d);border-top:1px solid rgba(226,180,92,.3);border-bottom:1px solid rgba(226,180,92,.3)}
html[data-theme="midnight"] .quote>span,html[data-theme="midnight"] .quote blockquote{color:var(--mn-gold)}

/* gallery */
html[data-theme="midnight"] .book-photo-story{background:linear-gradient(180deg,transparent,rgba(226,180,92,.05) 40%,transparent)}
html[data-theme="midnight"] .photo-story-copy h2{color:var(--mn-text)}
html[data-theme="midnight"] .photo-story-copy>p:not(.eyebrow){color:var(--mn-mute);opacity:1}
html[data-theme="midnight"] .photo-gallery{column-gap:18px}
html[data-theme="midnight"] .photo-gallery figure{margin-bottom:18px;border-radius:12px;background:var(--paper);box-shadow:0 24px 50px -28px rgba(0,0,0,.9);outline:1px solid var(--line);outline-offset:-1px}
html[data-theme="midnight"] .gallery-tile:focus-visible{outline-color:var(--mn-gold)}
html[data-theme="midnight"] .lb-btn:hover{background:var(--mn-gold);border-color:var(--mn-gold);color:#10180f}

/* account */
html[data-theme="midnight"] .account{background:var(--cream)}
html[data-theme="midnight"] .account p{color:var(--mn-mute)}
html[data-theme="midnight"] .auth-box{background:var(--paper);border:1px solid var(--line);border-radius:18px}
html[data-theme="midnight"] .tabs button{color:var(--mn-mute);border-color:var(--line)}
html[data-theme="midnight"] .tabs button.active{color:var(--mn-text);border-color:var(--mn-gold)}
html[data-theme="midnight"] label{color:var(--mn-text)}

/* author */
html[data-theme="midnight"] .author{background:var(--mn-bg2);border-top:1px solid var(--line)}
html[data-theme="midnight"] .author-card{background:var(--paper);border:1px solid var(--line);border-radius:14px;overflow:hidden}
html[data-theme="midnight"] .author>div:last-child h2{color:var(--mn-text)}
html[data-theme="midnight"] .author>div:last-child>p:last-child,html[data-theme="midnight"] .author p{color:var(--mn-mute);opacity:1}
html[data-theme="midnight"] .author-art{background:var(--mn-deep);border-top:1px solid var(--line)}
html[data-theme="midnight"] .author-art-card{background:var(--paper);border:1px solid var(--line);border-radius:12px;overflow:hidden}
html[data-theme="midnight"] .author-art>header>a{color:var(--mn-gold);border-color:var(--mn-gold)}
html[data-theme="midnight"] .author-art-card p{color:var(--mn-gold)}

/* affiliate + footer */
html[data-theme="midnight"] .book-affiliate{background:linear-gradient(135deg,#1b1509,#0f1712);border-top:1px solid rgba(226,180,92,.3);color:var(--mn-text)}
html[data-theme="midnight"] .book-affiliate h2{color:var(--mn-text)}
html[data-theme="midnight"] .book-affiliate p{color:var(--mn-mute)}
html[data-theme="midnight"] .book-affiliate a.button,html[data-theme="midnight"] .book-affiliate .button{background:var(--mn-gold);color:#10180f}
html[data-theme="midnight"] footer{background:var(--mn-deep);color:var(--mn-text);border-top:1px solid var(--line)}
html[data-theme="midnight"] footer button{color:var(--mn-gold)}

/* preview dialog + flash */
html[data-theme="midnight"] dialog{background:var(--paper);color:var(--mn-text);border:1px solid var(--line)}
html[data-theme="midnight"] .preview-copy>p{color:var(--mn-mute)}
html[data-theme="midnight"] .flash{background:var(--paper);color:var(--mn-text)}

/* theme switcher (only rendered once a theme has been chosen) */
.theme-switch{position:fixed;z-index:90;left:50%;bottom:18px;transform:translateX(-50%);display:flex;align-items:center;gap:4px;padding:5px;border-radius:99px;background:rgba(16,24,19,.92);border:1px solid rgba(255,255,255,.16);box-shadow:0 14px 40px rgba(0,0,0,.45);backdrop-filter:blur(10px);font:600 12px 'DM Sans',sans-serif}
.theme-switch>span{padding:0 10px 0 12px;color:rgba(255,255,255,.55);letter-spacing:.14em;text-transform:uppercase;font-size:10px}
.theme-switch button{white-space:nowrap;border:0;border-radius:99px;padding:9px 15px;background:transparent;color:#fff;font:inherit;cursor:pointer;transition:background .2s,color .2s}
.theme-switch button:hover{background:rgba(255,255,255,.1)}
.theme-switch button[aria-pressed="true"]{background:#e2b45c;color:#10180f}
.theme-switch button:focus-visible{outline:2px solid #e2b45c;outline-offset:2px}
@media(max-width:520px){.theme-switch>span{display:none}.theme-switch{bottom:12px}}
