/* MAGLIFICENT · six collection showcase · responsive concept implementation */
/* Scene artwork is local SVG, not a third-party image request. */
body.theme-midcentury{--show-scene:url('./scenes/museum.svg');--show-bg:#171711;--show-text:#f6e9cb;--show-muted:#d4c6a3;--show-card:#121416dd;--show-border:#b29459;--show-accent:#edc67a}
body.theme-spacetech{--show-scene:url('./scenes/observatory.svg');--show-bg:#040c18;--show-text:#e4f2ff;--show-muted:#afd0ee;--show-card:#071524e5;--show-border:#5695b8;--show-accent:#87d4ff}
body.theme-wasteland{--show-scene:url('./scenes/ruins.svg');--show-bg:#25211c;--show-text:#f5e9ce;--show-muted:#d2bea0;--show-card:#29231ee8;--show-border:#aa875d;--show-accent:#e0ba7b}
body.theme-poolcore{--show-scene:url('./scenes/underwater.svg');--show-bg:#072c38;--show-text:#e2ffff;--show-muted:#b5dfe0;--show-card:#072d3ce5;--show-border:#71cbd0;--show-accent:#aaf6f3}
body.theme-forest{--show-scene:url('./scenes/forest.svg');--show-bg:#11231a;--show-text:#eef0d5;--show-muted:#c3d5b4;--show-card:#1a2921ed;--show-border:#a2ae83;--show-accent:#e0d9a5}
body.theme-ink{--show-scene:url('./scenes/parchment.svg');--show-bg:#e8ddc9;--show-text:#24231e;--show-muted:#514b3e;--show-card:#f4ecdbeb;--show-border:#5a5447;--show-accent:#514434}
body.theme-dos{--show-scene:none;--show-bg:#040907;--show-text:#abe2bb;--show-muted:#86b495;--show-card:#07120c;--show-border:#54846a;--show-accent:#b6ffcf}
body[class*="theme-"] .page-view.archive-home{max-width:1600px!important;min-height:calc(100dvh - 58px);padding:14px clamp(18px,4vw,65px) 95px;background-color:var(--show-bg);background-image:linear-gradient(180deg,#03091018 0%,#00000018 38%,var(--show-bg) 93%),var(--show-scene);background-size:100% 100%,cover;background-position:center top;background-repeat:no-repeat;color:var(--show-text)}
body[class*="theme-"] .archive-home .archive-header{display:flex!important;flex-direction:column;align-items:center;justify-content:center;min-height:285px!important;max-width:1100px;margin:5px auto 10px!important;padding:50px 20px 25px!important;text-align:center!important;border:0!important;border-radius:0!important;background:none!important;box-shadow:none!important}
body[class*="theme-"] .archive-home .archive-header>*:not(.archive-architecture){position:relative;z-index:2;grid-column:auto}
body[class*="theme-"] .archive-home .archive-title{max-width:100%!important;margin:10px 0 6px!important;color:var(--show-text);font-size:clamp(30px,4vw,52px);font-weight:500;letter-spacing:.15em;text-shadow:0 2px 24px #030907ab}
body[class*="theme-"] .archive-home :is(.archive-subtitle,.archive-meta,.archive-kicker,.layout-status,.layout-caption){max-width:100%;color:var(--show-muted);opacity:1}
body[class*="theme-"] .archive-home .archive-meta{margin-top:13px;justify-content:center;font-size:11px}
body[class*="theme-"] .archive-home .archive-meta span+span{border-color:var(--show-border)}
body[class*="theme-"] .archive-home .layout-caption{margin:0;font-size:10px;letter-spacing:.22em}
body[class*="theme-"] .archive-home .layout-status{margin:12px 0 0}
body[class*="theme-"] .archive-home .archive-architecture{display:none}
body[class*="theme-"] .archive-home .archive-tools{position:relative;z-index:2;max-width:1260px;margin:0 auto 18px;align-items:end}
body[class*="theme-"] .archive-home .archive-tools h2{color:var(--show-text);font-size:18px}
body[class*="theme-"] .archive-home .archive-search{border:1px solid var(--show-border);border-radius:3px;background:var(--show-card);color:var(--show-muted)}
body[class*="theme-"] .archive-home .archive-search input{color:var(--show-text)}
body[class*="theme-"] .archive-home .archive-search input::placeholder{color:var(--show-muted)}
body[class*="theme-"] .archive-home .search-results,body[class*="theme-"] .archive-home .reading-resume{position:relative;z-index:2;max-width:1260px;margin-inline:auto}
body[class*="theme-"] .archive-home .archive-grid{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr))!important;gap:clamp(10px,1.4vw,18px)!important;max-width:1260px;margin:0 auto 28px!important;padding:0!important;align-items:stretch!important;border:0!important;background:none!important}
body[class*="theme-"] .archive-home .archive-grid::before,body[class*="theme-"] .archive-home .archive-grid::after{display:none!important}
body[class*="theme-"] .archive-home .archive-card.collection-card:nth-child(n){position:relative!important;display:flex!important;flex-direction:column!important;grid-column:auto!important;grid-row:auto!important;width:100%!important;min-width:0!important;min-height:315px!important;height:auto!important;margin:0!important;padding:19px 13px 15px!important;justify-content:flex-start!important;align-items:center!important;transform:none!important;text-align:center!important;border:1px solid var(--show-border)!important;border-radius:5px 5px 2px 2px!important;background:linear-gradient(157deg,#ffffff18,#ffffff04 47%,#00000038),var(--show-card)!important;box-shadow:inset 0 0 0 5px #00000020,0 8px 20px #0000003b!important;overflow:hidden!important;color:var(--show-text)!important;isolation:isolate;transition:transform .2s,border-color .2s,box-shadow .2s!important}
body[class*="theme-"] .archive-home .archive-card.collection-card:not(.special-collection)::before{content:''!important;display:block!important;position:absolute;inset:7px;border:1px solid var(--show-border);opacity:.42;pointer-events:none;z-index:-1}
body[class*="theme-"] .archive-home .archive-card.collection-card:not(.special-collection)::after{content:'✦'!important;display:block!important;position:absolute;top:5px;left:12px;color:var(--show-accent);opacity:.76;font-size:9px;pointer-events:none}
body[class*="theme-"] .archive-home .archive-card.collection-card:nth-child(n):hover{transform:translateY(-5px)!important;border-color:var(--show-accent)!important;box-shadow:inset 0 0 0 5px #00000020,0 13px 28px #0000007a!important}
body[class*="theme-"] .archive-home .archive-card .collection-graphic{display:none!important}
body[class*="theme-"] .archive-home .archive-card .card-number{display:block!important;width:100%;min-width:0;margin:0!important;font:10px/1.8 monospace!important;letter-spacing:.10em;color:var(--show-muted)!important;overflow-wrap:anywhere}
body[class*="theme-"] .archive-home .collection-emblem{display:flex;justify-content:center;align-items:center;flex:1;min-height:103px;width:100%;max-height:140px;margin:8px auto 8px;color:var(--show-accent);opacity:.88;filter:drop-shadow(0 0 14px #e7c98f35)}
body[class*="theme-"] .archive-home .collection-emblem svg{width:min(108px,75%);height:108px;max-width:100%;overflow:visible}
body[class*="theme-"] .archive-home .archive-card .card-tag{display:block!important;margin:0!important;font:10px/1.4 sans-serif!important;color:var(--show-accent)!important;letter-spacing:.10em}
body[class*="theme-"] .archive-home .archive-card .card-name{display:block!important;margin:7px 0!important;color:var(--show-text)!important;font:500 clamp(19px,2vw,27px)/1.5 'Songti SC','SimSun',serif!important;letter-spacing:.08em;overflow-wrap:anywhere}
body[class*="theme-"] .archive-home .archive-card .card-subtitle{margin:0 auto 15px!important;min-height:40px;max-width:100%;color:var(--show-muted)!important;font:11px/1.7 sans-serif!important;letter-spacing:0;opacity:.95}
body[class*="theme-"] .archive-home .archive-card .card-foot{display:flex!important;width:100%;flex-direction:column;align-items:center;justify-content:center;gap:4px;margin-top:auto!important;padding-top:11px;border-top:1px solid var(--show-border);color:var(--show-muted)}
body[class*="theme-"] .archive-home .archive-card .card-count{font-size:10px!important;color:var(--show-muted)!important}
body[class*="theme-"] .archive-home .archive-card .card-enter{color:var(--show-accent);font-size:11px}
body[class*="theme-"] .archive-home .archive-card.special-collection:nth-child(n){grid-column:1/-1!important;flex-direction:row!important;justify-content:space-between!important;min-height:105px!important;gap:18px;padding:18px 35px!important;border-width:2px!important}
body[class*="theme-"] .archive-home .special-collection .collection-emblem{flex:0 0 55px;width:55px;min-height:0;height:56px;margin:0}
body[class*="theme-"] .archive-home .special-collection .collection-emblem svg{width:55px;height:55px}
body[class*="theme-"] .archive-home .special-collection .card-number{width:auto;font-size:10px}
body[class*="theme-"] .archive-home .special-collection .card-name{font:24px/1.3 'Rajdhani',serif!important;white-space:nowrap}
body[class*="theme-"] .archive-home .special-collection .card-tag{display:none!important}
body[class*="theme-"] .archive-home .special-collection .card-subtitle{min-height:0;margin:0!important;flex:1;text-align:left}
body[class*="theme-"] .archive-home .special-collection .card-foot{width:auto;flex-direction:row;border:0;flex:0 0 auto;margin:0!important;gap:15px}
body[class*="theme-"] .archive-home .archive-footer{max-width:1260px;margin:auto;border-color:var(--show-border);color:var(--show-muted);opacity:.8}
body[class*="theme-"] .archive-home .archive-card[data-kind="gazetteer"]{border-color:var(--show-accent)!important}
body[class*="theme-"] .archive-home .archive-card[data-kind="gazetteer"] .card-tag::after{content:' · NEW';font:9px monospace}
body.theme-wasteland .archive-home .archive-card.collection-card:nth-child(n){border-top:8px solid var(--show-border)!important;border-radius:1px!important;box-shadow:4px 5px 0 #171311b8!important}
body.theme-poolcore .archive-home .archive-card.collection-card:not(.special-collection):nth-child(n){border-radius:45% 45% 3px 3px / 12% 12% 3px 3px!important;background:linear-gradient(180deg,#65d6e515,#042d3be9 60%),var(--show-card)!important}
body.theme-forest .archive-home:not([style*="none"]){display:block!important}
body.theme-forest .archive-home :is(.archive-tools,.search-results,.reading-resume,.archive-grid,.archive-footer){grid-column:auto!important}
body.theme-forest .archive-home .archive-card.collection-card:nth-child(n){border-left:5px solid var(--show-border)!important;border-radius:2px!important}
body.theme-ink .archive-home .archive-card.collection-card:nth-child(n){background:linear-gradient(#ffffff15,#6c5b3b15),var(--show-card)!important;box-shadow:none!important}
body.theme-ink .archive-home .archive-card.collection-card:not(.special-collection)::before{border-color:#514434;opacity:.65}
body.theme-ink .archive-home .archive-title,body.theme-ink .archive-home .archive-tools h2{text-shadow:none}
body.theme-dos .archive-home{background-image:none!important}
body.theme-dos .archive-home .archive-header{min-height:205px!important;align-items:flex-start;text-align:left!important;padding:35px 2px 15px!important}
body.theme-dos .archive-home .archive-meta{justify-content:flex-start}
body.theme-dos .archive-home .archive-grid{display:block!important;border:1px solid var(--show-border)!important}
body.theme-dos .archive-home .archive-grid::before{display:block!important;content:'INDEX / NAME / TYPE / FILES';background:#0c1d11!important;color:var(--show-text);padding:10px 18px;font:12px monospace}
body.theme-dos .archive-home .archive-card.collection-card:nth-child(n){display:grid!important;grid-template-columns:150px minmax(0,1fr) minmax(180px,1.5fr) 160px!important;min-height:64px!important;padding:10px 18px!important;align-items:center!important;gap:10px!important;border:0!important;border-bottom:1px dashed var(--show-border)!important;border-radius:0!important;box-shadow:none!important;background:transparent!important;text-align:left!important}
body.theme-dos .archive-home .archive-card.collection-card:nth-child(n)::before,body.theme-dos .archive-home .archive-card.collection-card:nth-child(n)::after{display:none!important}
body.theme-dos .archive-home .collection-emblem,body.theme-dos .archive-home .card-tag{display:none!important}
body.theme-dos .archive-home .archive-card .card-number{grid-column:1}
body.theme-dos .archive-home .archive-card .card-name{margin:0!important;font:21px/1.6 monospace!important;grid-column:2}
body.theme-dos .archive-home .archive-card .card-subtitle{min-height:0;grid-column:3;margin:0!important}
body.theme-dos .archive-home .archive-card .card-foot{grid-column:4;margin:0!important;padding:0;border:0;align-items:flex-end}
body.theme-dos .archive-home .archive-card.special-collection:nth-child(n){border-top:1px solid var(--show-border)!important;grid-template-columns:150px minmax(0,1fr) minmax(180px,1.5fr) 160px!important}
/* Gazetteer exhibition: a map-paper gallery on book, volume and reading views. */
body[class*="theme-"] :is(.book-home,.volume-home)[data-kind="gazetteer"]{position:relative;background-image:linear-gradient(90deg,var(--bg) 0%,transparent 110%),url('./scenes/parchment.svg');background-position:center top;background-size:100% 100%,cover;background-repeat:no-repeat}
body[class*="theme-"] :is(.book-home,.volume-home)[data-kind="gazetteer"] .book-header,
body[class*="theme-"] :is(.book-home,.volume-home)[data-kind="gazetteer"] .volume-header{padding-top:38px;border-top:3px double var(--archive-metal)}
body[class*="theme-"] .book-home[data-kind="gazetteer"] .book-title{font-family:'Songti SC','SimSun',serif;letter-spacing:.12em}
body[class*="theme-"] .volume-home[data-kind="gazetteer"] .volume-chapter-item{border-left:3px solid var(--archive-metal)}
body.theme-ink :is(.book-home,.volume-home)[data-kind="gazetteer"]{background-color:#f4ecdb}
/* Adapt cards without squeezed titles or horizontal overflow */
@media(max-width:1050px){
body[class*="theme-"] .archive-home .archive-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}
body[class*="theme-"] .archive-home .archive-card.collection-card:nth-child(n){min-height:275px!important}
body[class*="theme-"] .archive-home .special-collection .card-subtitle{display:none!important}
}
@media(max-width:700px){
body[class*="theme-"] .page-view.archive-home{padding:12px 15px 65px;background-size:100% 100%,auto 740px}
body[class*="theme-"] .archive-home .archive-header{min-height:232px!important;padding:38px 10px 18px!important}
body[class*="theme-"] .archive-home .archive-title{font-size:32px;letter-spacing:.09em}
body[class*="theme-"] .archive-home .archive-subtitle{font-size:11px;line-height:1.7}
body[class*="theme-"] .archive-home .archive-meta{font-size:10px;gap:8px;margin-top:10px}
body[class*="theme-"] .archive-home .archive-meta span+span{padding-left:8px}
body[class*="theme-"] .archive-home .archive-tools{align-items:stretch;flex-direction:column;gap:10px}
body[class*="theme-"] .archive-home .archive-search{width:100%}
body[class*="theme-"] .archive-home .archive-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:11px!important}
body[class*="theme-"] .archive-home .archive-card.collection-card:nth-child(n){min-height:257px!important;padding:12px 10px 11px!important}
body[class*="theme-"] .archive-home .collection-emblem{min-height:72px;max-height:91px;margin:5px auto}
body[class*="theme-"] .archive-home .collection-emblem svg{width:75px;height:75px}
body[class*="theme-"] .archive-home .archive-card .card-name{font-size:20px!important;letter-spacing:.04em}
body[class*="theme-"] .archive-home .archive-card .card-subtitle{font-size:10px!important;min-height:30px;margin-bottom:10px!important}
body[class*="theme-"] .archive-home .archive-card .card-foot{padding-top:8px}
body[class*="theme-"] .archive-home .archive-card .card-count{font-size:9px!important}
body[class*="theme-"] .archive-home .archive-card .card-enter{font-size:10px}
body[class*="theme-"] .archive-home .archive-card.special-collection:nth-child(n){min-height:85px!important;padding:16px!important;gap:10px;flex-wrap:wrap}
body[class*="theme-"] .archive-home .special-collection .collection-emblem{width:40px;height:40px;flex:0 0 40px}
body[class*="theme-"] .archive-home .special-collection .collection-emblem svg{width:40px;height:40px}
body[class*="theme-"] .archive-home .special-collection .card-number{font-size:9px!important}
body[class*="theme-"] .archive-home .special-collection .card-name{font-size:20px!important}
body[class*="theme-"] .archive-home .special-collection .card-foot{flex:0 0 100%;justify-content:space-between!important}
body.theme-dos .archive-home .archive-header{align-items:flex-start!important;min-height:172px!important}
body.theme-dos .archive-home .archive-grid{display:block!important}
body.theme-dos .archive-home .archive-card.collection-card:nth-child(n){display:grid!important;grid-template-columns:90px minmax(0,1fr)!important;min-height:78px!important;gap:6px 9px!important;padding:10px!important}
body.theme-dos .archive-home .archive-card .card-number{grid-column:1;grid-row:1/span 2}
body.theme-dos .archive-home .archive-card .card-name{grid-column:2;grid-row:1;font-size:17px!important}
body.theme-dos .archive-home .archive-card .card-subtitle{display:none!important}
body.theme-dos .archive-home .archive-card .card-foot{grid-column:2;grid-row:2;width:100%;align-items:flex-start;flex-direction:row!important}
body.theme-dos .archive-home .special-collection .card-number{width:100%}
}
@media(max-width:360px){
body[class*="theme-"] .archive-home .archive-card .card-name{font-size:18px!important}
body[class*="theme-"] .archive-home .archive-card .card-subtitle{font-size:9px!important}
body[class*="theme-"] .archive-home .archive-card .card-number{font-size:9px!important;letter-spacing:0}
}
@media(prefers-reduced-motion:reduce){
body[class*="theme-"] .archive-home .archive-card.collection-card:nth-child(n){transition:none!important}
}

/* Seamless navigation over the gallery; legible in every scene. */
body[class*="theme-"] #header{
  background:var(--show-bg)!important;
  border-bottom:1px solid var(--show-border)!important;
}
body[class*="theme-"] #header :is(.header-title,.menu-toggle,.header-home){
  color:var(--show-text)!important;
}
body.theme-dos #header{border-bottom-style:dashed!important}
