/* Shared site header. Keep links and account controls on one line, and
   catalogue search in its own row; the homepage artwork is independent. */
.shared-site-header {
    --nav-gold: #efcc82;
    --nav-cream: #f4ead8;
    --nav-muted: #d9cfbf;
    position: relative;
    z-index: 16;
    background: #0b1624;
    border-bottom: 1px solid rgba(218,176,101,.22);
    font-family: Arial, Helvetica, sans-serif;
}
.shared-site-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 24px;
    width: min(1120px, calc(100% - 36px));
    margin: 0 auto;
    min-height: 60px;
    padding: 6px 0;
}
.site-nav-links, .site-nav-account {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}
.site-nav-links { gap: 30px; }
.site-nav-account { flex: 0 0 auto; gap: 12px; margin-left: auto; }
.site-nav-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    flex: 0 0 auto;
    font: 600 14px/1.2 Arial, Helvetica, sans-serif;
    color: var(--nav-muted);
    text-decoration: none;
    white-space: nowrap;
}
.site-nav-link[aria-current] { color: var(--nav-gold); }
.site-nav-link:hover { color: var(--nav-cream); text-decoration: underline; text-underline-offset: 4px; }
.site-nav-link:focus-visible, .shared-site-header .reader-bell:focus-visible,
.shared-site-header .account-sign-in:focus-visible {
    outline: 2px solid var(--nav-gold);
    outline-offset: 3px;
    border-radius: 4px;
}
.shared-site-header .prescillium-account {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    min-width: 0;
    min-height: 36px;
    margin: 0;
}
.shared-site-header .account-user-avatar { min-width: 36px; min-height: 36px; }
.shared-site-header .account-sign-in {
    min-height: 36px;
    padding: 8px 13px;
    white-space: nowrap;
    font: 600 12px/1.2 Arial, Helvetica, sans-serif;
}
.shared-site-header .reader-bell { width: 36px; height: 36px; }
.site-nav-search {
    width: min(1120px, calc(100% - 36px));
    margin: 0 auto;
    padding: 0 0 14px;
    display: flex;
    justify-content: center;
}
.shared-site-header .book-header-search {
    width: min(100%, 520px);
    max-width: 520px;
    min-width: 0;
    flex: 0 1 520px;
    margin: 0;
}
.shared-site-header .book-header-search input { height: 40px; }
.shared-site-header .book-header-search-results { width: 100%; left: 0; right: auto; }
/* Retain the existing illustrated branding, but keep controls off the art. */
.site-brand-banner .hero-inner {
    min-height: clamp(144px, 12vw, 180px);
    justify-content: center;
    padding: 9px 0;
}
.site-brand-banner .hero-brand { flex: 0 1 auto; justify-content: center; width: min(580px,100%); }
.site-brand-banner .hero-brand-logo { width: min(100%, 490px); max-height: 150px; }
.prescience-page-heading {
    color: #f4ead8;
    font: 400 clamp(2rem, 4vw, 2.8rem)/1.15 Georgia, 'Times New Roman', serif;
    margin: 0 0 12px;
}
.prescience-page-heading span { color: #d6ac61; font-size: .55em; vertical-align: middle; }
@media (max-width: 680px) {
    .shared-site-nav { width: calc(100% - 28px); gap: 12px; min-height: 54px; padding: 4px 0; }
    .site-nav-links { flex: 1 1 auto; justify-content: space-between; gap: 12px; }
    .site-nav-link { font-size: 12px; }
    .site-nav-account { gap: 7px; }
    .shared-site-header .reader-bell { width: 32px; height: 36px; }
    .shared-site-header .account-sign-in { padding: 7px 10px; font-size: 11px; }
    .site-nav-search { width: calc(100% - 28px); padding-bottom: 12px; }
    .site-brand-banner .hero-inner { min-height: 0; padding: 12px 0; }
    .site-brand-banner .hero-brand { width: min(370px,100%); }
    .site-brand-banner .hero-brand-logo { max-height: 116px; }
}
@media (max-width: 360px) {
    .shared-site-nav { width: calc(100% - 20px); gap: 8px; }
    .site-nav-links { gap: 7px; }
    .site-nav-link { font-size: 11px; }
    .site-nav-account { gap: 4px; }
    .shared-site-header .reader-bell { width: 30px; }
}

/* Archive only: search anchored left and navigation anchored right on desktop.
   Mobile keeps search over the artwork and uses a separate navigation strip. */
.archive-hero {
    --nav-gold: #efcc82;
    --nav-cream: #f4ead8;
    --nav-muted: #d9cfbf;
}
.archive-hero .hero-art {
    background-image: linear-gradient(to bottom, rgba(3,7,12,.03) 15%,
        rgba(3,7,12,.30) 58%, rgba(3,7,12,.83) 100%),
        url("/static/prescillium-library-hero.webp");
}
.archive-hero .archive-hero-inner {
    width: calc(100% - 72px);
    min-height: 0;
    padding: 12px 0 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 8px;
}
.archive-hero .hero-brand {
    flex: 0 0 auto;
    width: min(560px, 100%);
    max-width: 100%;
    justify-content: center;
}
.archive-hero .hero-brand-logo {
    width: 100%;
    max-height: 135px;
}
.archive-hero-toolbar {
    position: relative;
    z-index: 15;
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) max-content max-content;
    grid-template-areas: "search links account";
    align-items: center;
    column-gap: 24px;
}
.archive-hero-toolbar .site-nav-links {
    grid-area: links;
    justify-self: end;
    gap: 24px;
}
.archive-hero-toolbar .book-header-search {
    grid-area: search;
    flex: none;
    min-width: 0;
    width: 100%;
    max-width: 560px;
    margin: 0;
}
.archive-hero-toolbar .book-header-search input {
    height: 40px;
    background: rgba(9,19,31,.90);
}
.archive-hero-toolbar .book-header-search-results {
    right: auto;
    left: 0;
    width: 100%;
}
.archive-hero-toolbar .site-nav-account {
    grid-area: account;
    gap: 10px;
    margin-left: 0;
    justify-self: end;
}
.archive-hero-toolbar .prescillium-account {
    min-width: 0;
    margin: 0;
}
.archive-hero-toolbar .reader-bell { width: 36px; height: 36px; }
.archive-hero-toolbar .site-nav-link { text-shadow: 0 2px 6px #000; }
.archive-hero-toolbar .reader-bell[hidden] { display: none !important; }
.archive-hero-toolbar .reader-bell:focus-visible,
.archive-hero-toolbar .account-sign-in:focus-visible {
    outline: 2px solid var(--nav-gold);
    outline-offset: 3px;
}
@media (max-width: 980px) {
    .archive-hero .archive-hero-inner { width: calc(100% - 36px); }
    .archive-hero-toolbar { column-gap: 16px; }
    .archive-hero-toolbar .site-nav-links { gap: 16px; }
    .archive-hero-toolbar .site-nav-link { font-size: 13px; }
}
@media (max-width: 760px) {
    .archive-hero { --archive-nav-height: 50px; }
    .archive-hero .hero-art { bottom: var(--archive-nav-height); height: auto; }
    .archive-hero .archive-hero-inner {
        width: 100%;
        padding: 10px 0 0;
        gap: 5px;
    }
    .archive-hero .hero-brand { width: min(370px,100%); }
    .archive-hero .hero-brand-logo { max-height: 112px; }
    .archive-hero-toolbar {
        grid-template-columns: minmax(0,1fr) max-content;
        grid-template-areas: "search search" "links account";
        column-gap: 12px;
        row-gap: 10px;
        padding: 0 14px;
        isolation: isolate;
    }
    .archive-hero-toolbar::before {
        content: "";
        position: absolute;
        inset: auto 0 0;
        height: var(--archive-nav-height);
        background: #0b1624;
        border-top: 1px solid rgba(218,176,101,.18);
        box-sizing: border-box;
        z-index: -1;
    }
    .archive-hero-toolbar .book-header-search { max-width: none; }
    .archive-hero-toolbar .site-nav-links { justify-content: space-between; justify-self: stretch; gap: 8px; min-height: var(--archive-nav-height); }
    .archive-hero-toolbar .site-nav-account { min-height: var(--archive-nav-height); }
    .archive-hero-toolbar .site-nav-link { text-shadow: none; }
    .archive-hero-toolbar .site-nav-link { font-size: 12px; }
    .archive-hero-toolbar .site-nav-account { gap: 6px; }
    .archive-hero-toolbar .reader-bell { width: 30px; height: 36px; }
}
@media (max-width: 360px) {
    .archive-hero-toolbar { column-gap: 8px; padding-inline: 10px; }
    .archive-hero-toolbar .site-nav-links { gap: 6px; }
    .archive-hero-toolbar .site-nav-link { font-size: 11px; }
    .archive-hero-toolbar .site-nav-account { gap: 4px; }
}
