/* Theme-owned page presentation for CMS-rendered Gutenberg markup.
 *
 * These rules deliberately do not infer or activate JavaScript component contracts.
 * Functional .erxos-* hooks remain CMS-owned and are handled by js/theme.js only when
 * the CMS emits the documented component markup.
 */

/* Shared shell: keep accessible labels visual-only and present CMS footer widgets intentionally. */
.sr-only{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);clip-path:inset(50%);white-space:nowrap;border:0}
.siteFooter{grid-template-columns:minmax(220px,.7fr) minmax(0,1.3fr);gap:44px 8vw;padding:72px max(24px,7vw) 42px;background:#070809}
.siteFooter .footerBrand{align-self:start}
.siteFooter .footerBrand .custom-logo{width:min(220px,100%);max-width:220px}
.siteFooter .footerWidgets{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:28px 36px}
.siteFooter .footerWidget{min-width:0;padding-top:18px;border-top:1px solid var(--line)}
.siteFooter .footerWidget :where(h2,.footerWidgetTitle){margin:0 0 16px;color:#d8d1c9;font:400 11px/1.2 Arial,sans-serif;letter-spacing:.18em;text-transform:uppercase}
.siteFooter .footerWidget ul{display:flex;flex-wrap:wrap;gap:8px 16px;margin:0;padding:0;list-style:none}
.siteFooter .footerWidget li{margin:0;padding:0}
.siteFooter .footerWidget a{display:inline-flex;min-height:36px;align-items:center;border-bottom:1px solid #36383b;color:#aaa39c;font-size:12px;line-height:1.4}
.siteFooter .footerWidget a:hover,.siteFooter .footerWidget a:focus-visible{border-bottom-color:var(--red);color:var(--paper)}
.siteFooter>small{margin-top:10px;color:#777;font-size:10px;letter-spacing:.12em;text-transform:uppercase}

/* Homepage: restore the decorative map skin for markup that still exists in the CMS. */
.siteMainFront .moon{font-size:35px}
.siteMainFront .crimeMap .sea{fill:#16242b;opacity:.72}
.siteMainFront .crimeMap .coast{fill:none;stroke:#a9a19a;stroke-width:2}
.siteMainFront .crimeMap .route{fill:none;stroke:#8f333e;stroke-width:2;stroke-dasharray:7 9}
.siteMainFront .crimeMap .city circle:first-child{fill:#c34451}
.siteMainFront .crimeMap .city circle:nth-child(2){fill:none;stroke:#c34451;stroke-width:1;opacity:.7}
.siteMainFront .crimeMap .city text{fill:#e1d9d1;font:700 14px Arial,sans-serif;letter-spacing:3px}
.siteMainFront .crimeMap .bay{fill:#63727a;font:10px Arial,sans-serif;letter-spacing:4px}
.siteMainFront .crimeMap .crosshair{fill:none;stroke:#554f4b;stroke-width:1}
.siteMainFront .crimeMap .coordinates{fill:#716a65;font:10px Arial,sans-serif;letter-spacing:3px}

/* Homepage: Gutenberg Button wrappers must render as the intended full-width shop rows. */
.siteMainFront .shops>.wp-block-buttons{display:block;gap:0}
.siteMainFront .shops>.wp-block-buttons>.wp-block-button{display:block;width:100%;min-height:0;margin:0;padding:0;border:0}
.siteMainFront .shops>.wp-block-buttons>.wp-block-button>.wp-block-button__link{display:grid;width:100%;height:auto;min-height:70px;grid-template-columns:minmax(0,.5fr) minmax(0,1fr);align-items:center;column-gap:24px;padding:26px 5px;border:0;border-bottom:1px solid #aaa49b;border-radius:0;background:transparent;color:inherit;text-align:left}
.siteMainFront .shops>.wp-block-buttons>.wp-block-button:first-child>.wp-block-button__link{border-top:1px solid #aaa49b}
.siteMainFront .shops>.wp-block-buttons>.wp-block-button>.wp-block-button__link br{display:none}

/* Default CMS pages: give plain Gutenberg content an editorial reading layout. */
body.page-template-default:not(.home) .cmsContent{width:min(1180px,88vw);margin:0 auto;padding:72px 0 120px}
body.page-template-default:not(.home) .cmsContent>.pageHeader,body.page-template-default:not(.home) .cmsContent>.pageFeaturedImage,body.page-template-default:not(.home) .cmsContent>.entryContent{width:auto;margin-inline:0}
body.page-template-default:not(.home) .cmsContent>.pageHeader{padding-top:0}
body.page-template-default:not(.home) .pageHeader h1{margin:0 0 36px;font:400 clamp(48px,6vw,82px)/.95 var(--serif);letter-spacing:-.04em}
body.page-template-default:not(.home) .pageFeaturedImage{width:min(760px,100%);aspect-ratio:4/3;margin:0 auto 76px;overflow:hidden;border:1px solid #ffffff1a;background:#101112}
body.page-template-default:not(.home) .pageFeaturedImage img{display:block;width:100%;height:100%;object-fit:cover;object-position:50% 30%}
body.page-template-default:not(.home) .entryContent{width:min(820px,100%);padding:0;margin-inline:auto}
body.page-template-default:not(.home) .entryContent>p{margin:0 0 24px;color:#aaa39c;font-size:17px;line-height:1.75}
body.page-template-default:not(.home) .entryContent>p:first-child{margin-bottom:0}
body.page-template-default:not(.home) .entryContent>p:first-child strong{color:#c7beb5;font-size:11px;letter-spacing:.18em;text-transform:uppercase}
body.page-template-default:not(.home) .entryContent h2{margin:76px 0 22px;font:400 clamp(42px,5vw,60px)/1.02 var(--serif);letter-spacing:-.035em}
body.page-template-default:not(.home) .entryContent>p:first-child+h2{margin-top:18px}
body.page-template-default:not(.home) .entryContent h3{margin:42px 0 12px;padding-top:22px;border-top:1px solid var(--line);font:400 25px/1.15 var(--serif)}
body.page-template-default:not(.home) .entryContent blockquote{margin:30px 0 34px;padding:6px 0 6px 26px;border-left:2px solid var(--red);font:400 clamp(24px,3vw,32px)/1.35 var(--serif)}
body.page-template-default:not(.home) .entryContent blockquote p{margin:0;color:var(--paper)}
body.page-template-default:not(.home) .entryContent a{text-decoration:underline;text-decoration-color:#6f6963;text-underline-offset:4px}
body.page-template-default:not(.home) .entryContent a:hover,body.page-template-default:not(.home) .entryContent a:focus-visible{text-decoration-color:var(--red)}

/* Sangariel: normalize Core Paragraph wrappers used as visual controls. */
.sangariel-universe :where(.realm-switcher,.race-selector,.timeline-filters,.character-filters)>p{min-width:0;margin:0}
.sangariel-universe :where(.realm-switcher,.race-selector,.timeline-filters,.character-filters)>p>a{width:100%;height:100%}
.sangariel-universe .realm-switcher>p+ p{border-left:1px solid var(--su-line)}
.sangariel-universe .race-selector>p>a{border-top:0}
.sangariel-universe .race-selector>p:first-child>a{border-top:1px solid var(--su-line)}

/* Sangariel: restore visual layout that is independent of CMS data ownership. */
.sangariel-universe .coordinate{position:absolute;margin:0;color:rgba(118,228,255,.62);font:400 .62rem ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.14em}
.sangariel-universe .coordinate.c1{top:24px;left:24px}
.sangariel-universe .coordinate.c2{right:24px;bottom:24px}
.sangariel-universe .magic-visual .coordinate{color:rgba(228,104,127,.7)}
.sangariel-universe :where(.realm-number,.inspector-kicker,.character-kicker){color:var(--su-tech);font:400 .63rem ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.18em}
.sangariel-universe #realm-magic .realm-number{color:#e6677e}
.sangariel-universe .primary-button:hover,.sangariel-universe .primary-button:focus-visible{transform:none}
.sangariel-universe .timeline-section{width:100%;max-width:none;padding-right:max(20px,calc((100vw - 1240px)/2));padding-left:max(20px,calc((100vw - 1240px)/2));border-top:1px solid var(--su-line);border-bottom:1px solid var(--su-line);background:rgba(9,10,25,.65)}
.sangariel-universe .timeline-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:24px;margin-bottom:38px}
.sangariel-universe .timeline-toolbar .timeline-filters{margin:0}
.sangariel-universe .timeline-toolbar .spoiler-toggle{margin:0}
.sangariel-universe .timeline>.timeline-card{margin:0}
.sangariel-universe .timeline-label{display:flex;justify-content:space-between;gap:12px;color:var(--su-muted);font:400 .62rem ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.14em;text-transform:uppercase}
.sangariel-universe .spoiler-badge{display:inline-flex;align-items:center;gap:6px;color:#e8778c;font-size:.64rem;letter-spacing:.08em;text-transform:uppercase}
.sangariel-universe .race-selector{align-self:start;align-content:start}
.sangariel-universe .race-symbol{position:relative;display:grid;width:48px;height:48px;flex:0 0 auto;place-items:center;color:var(--su-magic);font:400 1.2rem Georgia,"Times New Roman",serif}
.sangariel-universe .race-symbol::before{content:"";position:absolute;inset:7px;border:1px solid currentColor;transform:rotate(45deg)}
.sangariel-universe .race-symbol+span strong,.sangariel-universe .race-symbol+span small{display:block}
.sangariel-universe .race-symbol+span strong{font:400 1.1rem Georgia,"Times New Roman",serif}
.sangariel-universe .race-symbol+span small{margin-top:4px;color:var(--su-muted);font-size:.66rem;letter-spacing:.08em;text-transform:uppercase}
.sangariel-universe .race-detail .race-intro{max-width:640px;color:var(--su-muted)}
.sangariel-universe .character-card .index{position:absolute;top:20px;right:22px;margin:0;color:rgba(255,255,255,.3);font:400 .64rem ui-monospace,SFMono-Regular,Menlo,monospace}
.sangariel-universe .quote-block{margin:30px 0;padding:4px 0 4px 22px;border-left:2px solid var(--su-magic);color:var(--su-ink);font:400 1.35rem/1.35 Georgia,"Times New Roman",serif}
.sangariel-universe .quote-block>span{display:block;margin-bottom:5px;color:var(--su-magic);font:600 .58rem ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.16em}
.sangariel-universe .tag-row{display:flex;flex-wrap:wrap;gap:7px;margin-top:28px}
.sangariel-universe .tag-row>span{padding:6px 10px;border:1px solid var(--su-line);color:var(--su-muted);font-size:.65rem;letter-spacing:.07em;text-transform:uppercase}
.sangariel-universe .relations-section{width:100%;max-width:none;padding-right:max(20px,calc((100vw - 1240px)/2));padding-left:max(20px,calc((100vw - 1240px)/2));background:linear-gradient(180deg,transparent,rgba(16,13,27,.85))}
.sangariel-universe .graph-wrap{position:relative}
.sangariel-universe .graph-hint{position:absolute;bottom:12px;left:20px;margin:0;color:rgba(255,255,255,.35);font-size:.64rem;letter-spacing:.08em;text-transform:uppercase}
.sangariel-universe .relation-inspector{background:linear-gradient(180deg,rgba(255,255,255,.02),transparent)}
.sangariel-universe .relation-inspector h3{font-size:2.2rem}
.sangariel-universe .relation-inspector>p{color:var(--su-muted);font-size:.84rem}
.sangariel-universe .relation-list{margin-top:28px;padding-top:18px;border-top:1px solid var(--su-line)}
.sangariel-universe .relation-list>span{color:#747687;font-size:.75rem}
.sangariel-universe .relation-item{margin:0;padding:10px 0;border-bottom:1px solid var(--su-line)}
.sangariel-universe .relation-item br{display:none}
.sangariel-universe .relation-item :where(strong,small){display:block}
.sangariel-universe .relation-item strong{font-size:.79rem;font-weight:500}
.sangariel-universe .relation-item small{color:var(--su-muted);font-size:.7rem}
.sangariel-universe .fact-list strong{text-align:right;font-weight:500}
.sangariel-universe .closing-section>div{max-width:720px}
.sangariel-universe .closing-section>div>p:last-child{margin-top:22px}
.sangariel-universe .circle-link{display:grid;width:74px;height:74px;flex:0 0 auto;place-items:center;border:1px solid rgba(255,255,255,.3);border-radius:50%;font-size:1.4rem;transition:background .2s,color .2s}
.sangariel-universe .circle-link:hover,.sangariel-universe .circle-link:focus-visible{background:var(--su-ink);color:var(--su-night)}

/* Kryminalne Trojmiasto: restore the skin for CMS-authored copy and Gutenberg wrappers. */
.crime-world :where(.character-tabs,.place-nav)>p{display:flex;min-width:0;margin:0}
.crime-world :where(.character-tabs,.place-nav)>p>a{width:100%;height:100%}
.crime-world .character-tabs :where(a,button) small{margin-left:auto;font:400 11px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.08em}
.crime-world .file-label{color:var(--cw-red);font:400 11px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.16em}
.crime-world .role{color:var(--cw-muted);font:400 12px ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:.15em;text-transform:uppercase}
.crime-world .bio{max-width:800px;color:#bac1c7}
.crime-world .tags{display:flex;flex-wrap:wrap;gap:8px;margin-top:25px}
.crime-world .tags span{padding:7px 12px;border:1px solid #4b535a;font:400 10px ui-monospace,SFMono-Regular,Menlo,monospace;text-transform:uppercase}
.crime-world .book-copy{max-width:700px}
.crime-world .text-button{margin-top:8px}
.crime-world .text-button>.wp-block-button__link{display:inline-flex;min-height:44px;align-items:center;padding:10px 0;border:0;border-bottom:1px solid var(--cw-red);border-radius:0;background:transparent;color:#fff;font-size:12px;letter-spacing:.15em;text-transform:uppercase}
.crime-world .case-map>.wp-block-cover__inner-container{position:absolute;inset:0;width:100%;height:100%}
.crime-world .case-map .map-pin>a{display:flex;align-items:center;gap:9px;color:inherit}
.crime-world .case-map .map-pin>a span{padding:6px;border:1px solid #66717b}
.crime-world .case-map .map-pin>a strong{font-weight:500}

/* Kryminalne Trojmiasto: Gutenberg Query wraps the book media and copy in .detail-item.
 * Keep the CMS structure intact and put the visual two-column layout on the actual wrapper. */
.crime-world .book-list .wp-block-post{display:block;padding:0;border-bottom:0}
.crime-world .book-list .detail-item{display:grid;grid-template-columns:240px minmax(0,1fr);align-items:center;gap:50px;padding:55px 0;border-bottom:1px solid var(--cw-line)}
.crime-world .book-list .detail-item:not(:has(.wp-block-post-featured-image)){grid-template-columns:1fr}
.crime-world .book-list .detail-item>.wp-block-post-featured-image{justify-self:start}

/* Responsive selectors in style.css intentionally group components with :where().
 * Those rules cannot override the two-class desktop selectors because :where() has
 * zero specificity. Re-state only the responsive overrides here with :is(), which
 * preserves the grouped selector while matching the desktop selector specificity.
 */
@media(max-width:980px){
    .sangariel-universe :is(.section-heading,.realm-panel,.race-layout,.relation-layout){grid-template-columns:1fr}
    .sangariel-universe :is(.realm-visual,.graph-wrap){border-right:0;border-bottom:1px solid var(--su-line)}
    .sangariel-universe .race-selector>p>a{border-top:1px solid var(--su-line)}
    .sangariel-universe .race-selector>p:last-child>a{border-right:0}
    .sangariel-universe .race-symbol+span small{display:none}
    .sangariel-universe .relation-inspector{min-height:300px}
}

@media(max-width:850px){
    .siteFooter{grid-template-columns:1fr;gap:32px;padding-top:58px}
    .siteFooter .footerWidgets{grid-template-columns:repeat(2,minmax(0,1fr));gap:24px}
    .siteMainFront :is(.manifest,.catalog,.world,.crimeWorld,.author,.shops){padding-inline:6vw}
    .siteMainFront :is(.manifest,.world,.crimeWorld,.author){grid-template-columns:1fr}
    .siteMainFront :is(.manifest,.world,.crimeWorld,.author)>*{min-width:0;max-width:100%}
    .siteMainFront :is(.crimeMap,.portrait){max-width:100%}
    .crime-world .hero,.crime-world :is(.world-grid,.character-layout,.book-list .detail-item,.place-switcher){grid-template-columns:1fr}
    .crime-world .book-list .detail-item{gap:30px}
    .crime-world .hero-copy{position:relative;display:flex;min-height:64svh;flex-direction:column;justify-content:center;padding-left:24px;background:linear-gradient(90deg,rgba(9,10,12,.97),rgba(9,10,12,.65))}
    .crime-world .character-tabs :where(a,button),.crime-world .place-nav :where(a,button){padding:18px 10px;font-size:18px}
}

@media(max-width:720px){
    body.page-template-default:not(.home) .cmsContent{width:min(92vw,680px);padding:52px 0 88px}
    body.page-template-default:not(.home) .pageHeader h1{margin-bottom:28px;font-size:clamp(42px,13vw,54px)}
    body.page-template-default:not(.home) .pageFeaturedImage{aspect-ratio:4/5;margin-bottom:52px}
    body.page-template-default:not(.home) .entryContent>p{font-size:16px;line-height:1.7}
    body.page-template-default:not(.home) .entryContent h2{margin:54px 0 18px;font-size:clamp(32px,10vw,42px)}
    body.page-template-default:not(.home) .entryContent h3{margin-top:34px;padding-top:18px;font-size:23px}
    body.page-template-default:not(.home) .entryContent blockquote{padding-left:20px;font-size:clamp(23px,7vw,29px)}
    .sangariel-universe .realm-switcher>p+ p{border-top:1px solid var(--su-line);border-left:0}
    .sangariel-universe .realm-switcher small{display:none}
    .sangariel-universe .fact-list li{flex-direction:column;gap:2px}
    .sangariel-universe .fact-list strong{text-align:left}
    .sangariel-universe :where(.timeline-section,.relations-section){padding-right:14px;padding-left:14px}
    .sangariel-universe .timeline-toolbar{align-items:stretch;flex-direction:column;gap:10px}
    .sangariel-universe .timeline-toolbar .timeline-filters{display:grid;width:100%;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
    .sangariel-universe .timeline-toolbar .timeline-filters>p>a{display:flex;min-height:44px;align-items:center;justify-content:center;text-align:center}
    .sangariel-universe .timeline-toolbar .spoiler-toggle{width:100%;align-self:stretch}
    .sangariel-universe .timeline-toolbar .spoiler-toggle>p{margin:0}
    .sangariel-universe .timeline-toolbar .spoiler-toggle>p>a{display:flex;width:100%;min-height:44px;align-items:center;justify-content:center}
    .sangariel-universe .timeline{grid-auto-columns:auto;grid-auto-flow:row;grid-template-columns:1fr;gap:12px;overflow-x:visible;padding:8px 0 0;scroll-snap-type:none}
    .sangariel-universe .timeline::before,.sangariel-universe .timeline-card::before{display:none}
    .sangariel-universe .timeline-card{min-height:0;padding:24px 22px}
    .sangariel-universe .timeline-card h3{margin-top:0}
    .sangariel-universe .race-selector>p:nth-child(2n)>a{border-right:0}
    .sangariel-universe .relation-layout,.sangariel-universe .graph-wrap{margin:0}
    .sangariel-universe .graph-wrap{overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:thin;scrollbar-color:var(--su-tech) transparent}
    .sangariel-universe .relation-graph{width:680px;min-width:680px;min-height:440px;aspect-ratio:1000/650}
    .sangariel-universe .graph-hint{position:static;bottom:auto;left:auto;padding:12px 16px 18px;background:none}
    .sangariel-universe .character-card{min-height:164px;padding:20px}
    .sangariel-universe .character-card:first-child,.sangariel-universe .character-card:nth-child(2){min-height:220px;padding:22px}
}

@media(max-width:550px){
    .siteMainFront .catalog .wp-block-post-template{grid-template-columns:1fr;gap:34px 12px}
    .siteMainFront .catalog .wp-block-post-featured-image{margin-bottom:12px;padding:7px;box-shadow:0 16px 32px #0007}
    .siteMainFront .catalog .bookPlaceholder{margin-bottom:12px;padding:14px;box-shadow:0 16px 32px #0007}
    .siteMainFront .catalog .bookPlaceholder .wp-block-post-title{margin:18px 0;font-size:clamp(23px,7vw,31px)}
    .siteMainFront .catalog :where(.bookMeta,.bookMetaRow){font-size:10px;letter-spacing:.06em}
    .siteMainFront .catalog .wp-block-post-title,.siteMainFront .catalog .bookTitle{margin:7px 0 12px;font-size:18px}
    .siteMainFront .catalog .detail-trigger :where(a,button,.wp-block-button__link),.siteMainFront .catalog :where(a,button,.wp-block-button__link).detail-trigger,.siteMainFront .catalog :where(a,button).bookAction{font-size:10px;letter-spacing:.07em}
    .siteMainFront .shops>.wp-block-buttons>.wp-block-button>.wp-block-button__link{grid-template-columns:1fr;row-gap:8px}
}

@media(max-width:520px){
    .crime-world .hero h1{font-size:clamp(44px,14vw,60px)}
    .crime-world .themes{grid-template-columns:1fr}
    .crime-world .case-map{min-height:420px}
    .crime-world .case-map .map-pin{font-size:10px;letter-spacing:.08em}
    .crime-world .case-map .map-pin>a{gap:0}
    .crime-world .case-map .map-pin>a span{display:grid;width:30px;height:30px;place-items:center;padding:0;border:1px solid #66717b;background:rgba(13,17,22,.9)}
    .crime-world .case-map .map-pin>a strong{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
    .crime-world :is(.character-card,.place-panel){padding:36px 22px}
    .crime-world .place-nav :where(a,button){padding:18px 9px;font-size:15px}
    .crime-world .book-list .detail-item{gap:24px;padding:42px 0}
    .crime-world .book-list .detail-item>.wp-block-post-featured-image{justify-self:center}
}

@media(max-width:380px){
    .sangariel-universe .circle-link{width:58px;height:58px}
    .siteMainFront .catalog .wp-block-post-template{grid-template-columns:1fr}
}

@media(prefers-reduced-motion:reduce){
    .siteMainFront :is(.heroBook,.catalog .wp-block-post-featured-image,.catalog .bookPlaceholder){transition:none}
    .siteMainFront :is(.heroBook:hover,.catalog .wp-block-post:hover .wp-block-post-featured-image,.catalog .wp-block-post:focus-within .wp-block-post-featured-image,.catalog .wp-block-post:hover .bookPlaceholder,.catalog .wp-block-post:focus-within .bookPlaceholder){transform:none}
}
