/* ========================================================================
   PaperNet — visual theme.
   Color palette:
     - Brand green:    #5d9b22 (top menu / footer)
     - Deep green:     #3a6614 (header band, hover)
     - Highlight:      #daf54f (link hover on dark)
     - Body bg:        #ecf2e6 (subtle green tint, repeats body.png)
     - Card bg:        #ffffff
     - Borders:        #cccccc
     - Sidebar link:   #5076b6
     - Active link:    #ff8800
   ======================================================================== */

html {
    font-size: 14px;
    height: 100%;
    min-height: 100%;
}

@media (min-width: 768px) {
    html { font-size: 15px; }
}

body.site-body {
    margin: 0;
    padding: 0;
    color: #2e2e2e;
    font-family: Tahoma, Arial, Helvetica, sans-serif;
    /* Page wallpaper: green tile, full-bleed beyond the centered frame. */
    background: #5d9b22 url('/img/legacy/images/body.png') repeat;
    min-height: 100%;
}

/* Centered transparent column. The header sits directly on the body's
   green wallpaper; the white .site-card below it (wrapping slider +
   content + footer) carries the box-shadow. */
.site-frame {
    max-width: 1000px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* White card wrapping the slider band, main grid, and footer. The
   shadow lifts it visually off the green wallpaper. */
.site-card {
    background: #ffffff;
    box-shadow: 0 0 24px rgba(0, 0, 0, 0.25);
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
}

/* ---------- Header ----------
   Logo + top menu sit directly on the page wallpaper. No background,
   no border — the body's green tile shows through. */
.site-header {
    background: transparent;
    padding: 0;
    position: relative;     /* positioning context for .site-controls */
}

.site-brand {
    padding: 0.5rem 0.5rem 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.site-brand-link {
    display: inline-block;
    text-decoration: none;
}

.site-brand-logo {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ---------- Top menu (horizontal green strip) ---------- */
.site-topmenu {
    padding: 0;
}

.site-topmenu-toggle {
    display: none;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #fff;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
}

.site-topmenu-toggle-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    margin: 4px 0;
}

/* Menu strip spans the full container width. Items share width equally
   (flex: 1), so the green band reads as one continuous bar with no gap
   on the right. */
.site-topmenu-items {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.15);

    -webkit-border-top-left-radius: 5px 5px;
    -webkit-border-top-right-radius: 5px 5px;
}

.site-topmenu-item {
    position: relative;
    flex: 1 1 0;
    text-align: center;
}

/* Round the outer top corners of the first/last root items so the menu
   strip's tinted band has soft shoulders. The radius is applied both to
   the <li> (in case of background) and the <a> inside (so hover background
   follows the same shape). Only first-level items in the strip — nested
   dropdown items aren't affected because the selector targets direct
   children of .site-topmenu-items. */
.site-topmenu-items > .site-topmenu-item:first-child,
.site-topmenu-items > .site-topmenu-item:first-child > .site-topmenu-link {
    -webkit-border-top-left-radius: 5px 5px;
    border-top-left-radius: 5px;
}

.site-topmenu-items > .site-topmenu-item:last-child,
.site-topmenu-items > .site-topmenu-item:last-child > .site-topmenu-link {
    -webkit-border-top-right-radius: 5px 5px;
    border-top-right-radius: 5px;
}

.site-topmenu-link {
    display: block;
    padding: 0.85rem 1rem;
    color: #ffffff;
    text-decoration: none;
    font-family: Tahoma, Arial, sans-serif;
    font-size: 1.05rem;
    font-weight: 500;
    text-shadow: 0 1px #5a8503;
}

/* Items with a dropdown panel show a small downward caret on the right
   edge of the link (centered label remains centered; caret is decorative). */
.site-topmenu-item.has-dropdown > .site-topmenu-link {
    background-image: url('/img/legacy/menu_images/drop.png');
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
}

/* topmenu.js injects a separate <button class="site-topmenu-expand"> on
   every dropdown item for the mobile drawer accordion. Hidden by
   default; the mobile media query below makes it visible (and hides
   this CSS-driven caret in turn). */
.site-topmenu-expand { display: none; }

.site-topmenu-link:hover,
.site-topmenu-item.is-active > .site-topmenu-link {
    color: #daf54f;
    background-color: rgba(0, 0, 0, 0.15);
}

/* Dropdown panel — appears on hover/focus of parent. Same green tile as
   the top strip; text white, hover yellow. Width grows with column count
   so multi-column dropdowns lay out side-by-side. */
.site-topmenu-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background: #5d9b22 url('/img/legacy/images/body.png') repeat;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    padding: 1rem 1.25rem;
    z-index: 100;
    display: none;
    text-shadow: 0 1px #3a6614;
}

.site-topmenu-item.has-dropdown:hover > .site-topmenu-dropdown,
.site-topmenu-item.has-dropdown:focus-within > .site-topmenu-dropdown {
    display: block;
}

/* Multi-column dropdown (one column per direct child of root).
   nowrap keeps columns side-by-side; the dropdown width grows with the
   column count via the column's flex-basis budget. */
.site-topmenu-columns {
    display: flex;
    flex-wrap: nowrap;
    gap: 1.5rem;
}

.site-topmenu-col {
    flex: 1 1 220px;
    min-width: 225px;
}

.site-topmenu-col-header {
    display: block;
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    padding-bottom: 0.4rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
    text-align: left;
}

.site-topmenu-col-header:hover,
.site-topmenu-col-header.is-active { color: #daf54f; }

.site-topmenu-col-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-topmenu-col-item,
.site-topmenu-col-solo {
    display: block;
    color: #ffffff;
    text-decoration: none;
    padding: 0.35rem 0;
    font-size: 0.95rem;
    text-align: left;
}

.site-topmenu-col-item:hover,
.site-topmenu-col-solo:hover,
.site-topmenu-col-item.is-active,
.site-topmenu-col-solo.is-active { color: #daf54f; }

.site-topmenu-col-solo {
    font-weight: 600;
    padding: 0.35rem 0 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

/* Flat single-column dropdown (when at most one direct child is a section). */
.site-topmenu-flat,
.site-topmenu-flat-sub {
    list-style: none;
    margin: 0;
    padding: 0;
    min-width: 220px;
    text-align: left;
}

.site-topmenu-flat-sub {
    margin: 0 0 0.5rem 0.75rem;
    border-left: 1px solid rgba(255, 255, 255, 0.25);
    padding-left: 0.75rem;
}

.site-topmenu-flat-item {
    display: block;
    color: #ffffff;
    text-decoration: none;
    padding: 0.4rem 0;
    font-size: 0.95rem;
}

.site-topmenu-flat-item:hover,
.site-topmenu-flat-item.is-active { color: #daf54f; }

/* ---------- Slider band (full-width inside the frame) ----------
   One slide at a time via CSS scroll-snap on the track. Dots below the
   track are anchor links to slide IDs — clicking jumps to that slide.
   Track height is fixed so layout doesn't jump between slides; caption
   floats over the image. */
.site-slider-band {
    background: #ffffff;
    border-bottom: 1px solid #cccccc;
}

.site-slider {
    position: relative;
    margin: 0;
    background: #1a1a1a;
    /* clip stops a fractional-pixel sliver of the neighbouring slide from
       leaking past the slider's left edge after a scroll snap. */
    overflow-x: clip;
}

.site-slider-track {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;          /* Firefox */
}

.site-slider-track::-webkit-scrollbar { display: none; }   /* WebKit */

/* Each slide pinned to exactly the track's width. min-width prevents
   flex-shrink from rounding fractional widths down by a pixel and
   exposing a sliver of the neighbouring slide after a snap. */
.site-slider-slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    height: 300px;
    scroll-snap-align: start;
    scroll-snap-stop: always;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    position: relative;
}

@media (max-width: 767px) {
    .site-slider-slide {
        /* Match the source images' 984×400 aspect (≈ 2.46:1) so the slide
           height tracks the natural photo ratio. With background-size:cover
           inherited from the base rule, the image fills edge-to-edge — no
           letterbox bars regardless of viewport width. */
        height: auto;
        aspect-ratio: 984 / 400;
    }
}

/* Caption overlay — top-left, sits flat over the image. Dark navy text
   over a white halo so it stays readable on most photos without a panel
   behind it. */
.site-slider-caption {
    position: absolute;
    top: 1.25rem;
    left: 1.5rem;
    right: auto;
    max-width: min(520px, 60%);
    color: #000033;
    text-shadow: 0 0 4px #ffffff, 0 0 6px #ffffff;
    padding: 0;
    background: transparent;
}

.site-slider-title {
    margin: 0 0 0.6rem;
    color: #000033;
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.25;
    text-shadow: 0 0 4px #ffffff, 0 0 6px #ffffff;
}

.site-slider-body {
    color: #000033;
    font-size: 1rem;
    line-height: 1.6;
}

.site-slider-body p { margin: 0 0 0.4rem; }
.site-slider-body p:last-child { margin-bottom: 0; }
.site-slider-body strong { color: #000033; }
.site-slider-body a { color: #5076b6; }
.site-slider-body * { max-width: 100%; }
.site-slider-body h2 { display: none; } /* Title is rendered separately above. */

/* Switcher row: title + subtitle tabs overlaid on the bottom of the
   slide image (does not add to slider height). Translucent dark panel
   keeps the image visible behind. */
.site-slider-tabs {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    background: rgba(58, 102, 20, 0.78);
}

.site-slider-tab {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding: 0.5rem 0.75rem 0.55rem;
    color: #ffffff;
    text-decoration: none;
    border-right: 1px solid rgba(255, 255, 255, 0.18);
    text-shadow: 0 1px #1f3a09;
    transition: background 0.15s;
}

.site-slider-tab:last-child { border-right: none; }

.site-slider-tab:hover {
    background: rgba(0, 0, 0, 0.25);
    color: #daf54f;
}

.site-slider-tab.is-active {
    background: rgba(0, 0, 0, 0.45);
    color: #ffffff;
}

.site-slider-tab-title {
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.2;
}

.site-slider-tab-subtitle {
    font-size: 0.75rem;
    line-height: 1.25;
    opacity: 0.9;
}

/* ---------- Main grid ---------- */
.site-main-grid {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 1.25rem;
    padding: 1rem 1rem 2rem;
    align-items: start;
    flex: 1 1 auto;     /* fill the frame's vertical space */
}

@media (max-width: 767px) {
    .site-main-grid { grid-template-columns: 1fr; }
}

/* ---------- Sidebar (left rail) ---------- */
.site-sidenav {
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 3px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.site-sidenav-title {
    margin: 0;
    padding: 0.55rem 0.75rem;
    color: #ffffff;
    background: #5d9b22 url('/img/legacy/images/body.png') repeat;
    font-size: 1rem;
    font-weight: 700;
    text-align: center;
    text-shadow: 0 1px #3a6614;
}

.site-sidenav-title a {
    color: #ffffff;
    text-decoration: none;
}

.site-sidenav-title a:hover { color: #daf54f; }

.site-sidenav-list,
.site-sidenav-sublist {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-sidenav-sublist {
    padding-left: 1rem;
    background: #f9f9f6;
    border-top: 1px solid #e5e5e5;
}

.site-sidenav-item {
    border-top: 1px solid #e5e5e5;
}

.site-sidenav-item:first-child { border-top: none; }

.site-sidenav-link {
    display: block;
    padding: 0.45rem 0.5rem 0.45rem 1.4rem;
    color: #5076b6;
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.3;
    background-image: url('/img/legacy/images/menu_link_bg.gif');
    background-repeat: no-repeat;
    background-position: 0.1rem center;
    transition: background-color 0.1s;
}

.site-sidenav-link:hover {
    background-color: #f0f3eb;
    color: #255098;
}

.site-sidenav-item.active > .site-sidenav-link {
    color: #255098;
    font-weight: 700;
    background-image: url('/img/legacy/images/menu_curren_link_bg.gif');
    background-color: #f9f9f6;
}

/* ---------- Content (article body) ---------- */
.site-content {
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 3px;
    padding: 1.5rem 2rem;
    min-height: 480px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.site-content article h1,
.site-content article h2 {
    margin-top: 0;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 0.4rem;
    margin-bottom: 0.8rem;
}

.site-content article h2 { font-size: 1.6rem; font-weight: 700; }
.site-content article h3 { font-size: 1.3rem; font-weight: 700; }

.site-content article p { line-height: 1.6; margin: 0 0 0.85rem; }

.site-content article ul,
.site-content article ol { line-height: 1.6; margin: 0 0 0.85rem 1.5rem; }

.site-content article a { color: #5076b6; text-decoration: none; }
.site-content article a:hover { color: #255098; text-decoration: underline;}

.site-content article img,
.site-content article table { max-width: 100%; height: auto; }

/* Breadcrumb. */
.site-breadcrumb {
    margin-bottom: 0.75rem;
}

.site-breadcrumb-list {
    background: transparent;
    padding: 0 0 0.75rem;
    margin: 0;
    border-bottom: 1px solid #e5e5e5;
    list-style: none;
    font-size: 0.85rem;
}

.site-breadcrumb-item { display: inline-block; }
.site-breadcrumb-item + .site-breadcrumb-item::before { content: "/"; padding: 0 0.4rem; color: #999; }
.site-breadcrumb-item a { color: #5076b6; text-decoration: none; }
.site-breadcrumb-item a:hover { color: #255098; }
.site-breadcrumb-item.is-active { color: #666; }

/* Generic muted-text helper for placeholder messages inside .site-content. */
.site-content-muted {
    color: #888;
}

/* ---------- Footer ---------- */
.site-footer {
    background: #5d9b22 url('/img/legacy/images/body.png') repeat;
    color: #ffffff;
    padding: 1rem;
    border-top: 4px solid #3a6614;
    font-size: 0.85rem;
    text-shadow: 0 1px #3a6614;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.site-footer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.site-footer a { color: #daf54f; }

.site-footer-elapsed {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: none;
}

.site-footer-build {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: none;
}

/* ---------- Embedded map ----------
   maps.js lazy-loads Leaflet and renders this placeholder. Authors mark
   up a map in article HTML as
     <div class="site-map" data-lat="50.42" data-lng="30.53" data-popup="…">
   The fixed height ensures Leaflet's map sizing works (the lib needs a
   non-zero container before init). data-zoom is optional. */
.site-map {
    width: 100%;
    height: 360px;
    margin: 0 0 1rem;
    background: #eef2eb;
    border: 1px solid #cccccc;
}

/* ---------- Header layout ----------
   .site-header-top hosts the brand. The site-controls panel below is
   positioned independently so it can stay pinned top-right regardless
   of brand layout. */
.site-header-top {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* ---------- Top-right control panel ----------
   The cluster sits absolute-positioned in the top-right of .site-header.
   Inside the cluster, .site-controls-row lays out two siblings in a
   single line: the search form (which grows leftward from width 0 to
   its open width) and the icon strip (search / flag / chevron).
   The settings panel drops below the icon row when the chevron is open.
   On mobile the same cluster shifts to bottom-right of the header to
   share a row with the hamburger (overrides in the < 768px block). */
.site-controls {
    position: absolute;
    top: 0.4rem;
    right: 0.5rem;
    z-index: 5;
}

.site-controls-row {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: flex-end;
}

.site-controls-icons {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    background: transparent;
    flex: 0 0 auto;
}

/* Each icon (button or anchor) shares a uniform square tile shape so
   the row reads as a row of equal cells regardless of which control
   fills them. The square (not 28×22) lets flag icons fit the same
   visual area as the search SVG without distortion. */
.site-controls-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 3px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 3px;
    color: #ffffff;
    cursor: pointer;
    overflow: hidden;
    transition: background-color 0.15s, border-color 0.15s, opacity 0.15s;
    text-decoration: none;
    box-sizing: border-box;
}
.site-controls-button:hover {
    background: rgba(0, 0, 0, 0.18);
    border-color: rgba(255, 255, 255, 0.7);
}
.site-controls-button svg { display: block; }

/* Settings chevron rotates -90° when open: ▾ becomes ▸ pointing
   toward the inline picker that has grown to its right. */
.site-controls.is-settings-open .site-settings-toggle svg {
    transform: rotate(-90deg);
}
.site-settings-toggle svg { transition: transform 0.15s; }

/* Flag tiles: contain (not cover) so the rectangular flag fits the
   square button with vertical padding above + below. The 3px padding
   on the button gives breathing room around all icons. */
.site-locale-flag { opacity: 0.85; }
.site-locale-flag img { width: 100%; height: 100%; object-fit: contain; display: block; }
.site-locale-flag:hover { opacity: 1; }
.site-locale-flag.is-active { opacity: 1; cursor: default; }

/* Search form: inline flex sibling to the icon strip. Closed state =
   max-width 0 + zero padding so it occupies no horizontal space and
   the icons sit flush against the right edge. Open state animates
   max-width to its target — visually, the input grows out of the search
   icon, leftward (because the form is the left sibling, justify-content
   is flex-end, and only the form's max-width changes). */
.site-controls-search {
    overflow: hidden;
    max-width: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
    transition: max-width 0.22s ease-out, padding 0.22s ease-out;
}
.site-controls.is-search-open .site-controls-search {
    max-width: min(60vw, 280px);
    padding: 0;
}

.site-controls-search-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    padding: 0.3rem 0.55rem;
    height: 24px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 3px;
    background: #ffffff;
    color: #2e2e2e;
    font-size: 0.85rem;
    outline: none;
    box-sizing: border-box;
}

/* Locale picker: inline flex sibling on the right of the icon row.
   Mirrors the search form on the left — closed = max-width 0 (zero
   footprint), open = animates to fit the flag tiles. The cluster as a
   whole is right-anchored, so as the picker grows rightward it pushes
   the cluster's effective width — but since right is pinned to 0.5rem
   of the header, the search/icons end up shifting *left* visually,
   which is exactly the "block slides right, picker fills the new space"
   feel the spec asks for. */
.site-controls-settings {
    overflow: hidden;
    max-width: 0;
    margin-left: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: max-width 0.22s ease-out, margin-left 0.22s ease-out;
}
.site-controls.is-settings-open .site-controls-settings {
    max-width: 220px;        /* fits 2-3 flag tiles + gaps comfortably */
    margin-left: 4px;        /* same gap as inter-icon spacing */
}

/* Active state on the search toggle when the drawer is open. */
.site-controls.is-search-open .site-search-toggle {
    background: rgba(255, 255, 255, 0.18);
    border-color: #ffd966;
    color: #ffd966;
}
.site-controls.is-settings-open .site-settings-toggle {
    background: rgba(255, 255, 255, 0.18);
    border-color: #ffd966;
}

/* ---------- Search results page ---------- */
.site-search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.site-search-form input[type="search"] {
    flex: 1 1 auto;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 3px;
}
.site-search-form button {
    padding: 0.5rem 1.25rem;
    background: #5d9b22;
    color: #ffffff;
    border: 1px solid #3a6614;
    border-radius: 3px;
    cursor: pointer;
}
.site-search-form button:hover { background: #3a6614; }

.site-search-results {
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-search-result {
    border-bottom: 1px solid #e5e5e5;
    padding: 0.75rem 0;
}
.site-search-result:last-child { border-bottom: none; }
.site-search-result-title {
    margin: 0 0 0.3rem;
    font-size: 1.05rem;
    font-weight: 700;
}
.site-search-result-title a { color: #5076b6; text-decoration: none; }
.site-search-result-title a:hover { color: #ff8800; }
.site-search-result-snippet {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.4;
    color: #444;
}
.site-search-result mark {
    background: #ffd966;
    color: inherit;
    padding: 0 0.1em;
    border-radius: 2px;
}

/* ---------- Library Fund (catalog grid) ---------- */
.site-library-header {
    margin-bottom: 0.5rem;
}
.site-library-header h1 {
    margin: 0 0 0.25rem;
}
.site-library-header .site-content-muted {
    margin: 0;
    font-size: 0.95rem;
}

.site-library-search { margin-bottom: 1rem; }

.site-library-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.site-library-table thead th {
    text-align: left;
    background: #f4f6f1;
    border-bottom: 2px solid #cccccc;
    padding: 0.5rem 0.6rem;
    font-weight: 700;
    color: #2e2e2e;
}
.site-library-table thead th a {
    display: block;
    color: inherit;
    text-decoration: none;
}
.site-library-table thead th a:hover { color: #5076b6; }
.site-library-table tbody td {
    padding: 0.45rem 0.6rem;
    border-bottom: 1px solid #ececec;
    vertical-align: top;
}
.site-library-table tbody tr:hover td { background: #fafbf6; }

.site-library-table .col-inv    { width: 6rem;  white-space: nowrap; }
.site-library-table .col-code   { width: 6rem;  white-space: nowrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.85rem; }
.site-library-table .col-author { width: 12rem; }
.site-library-table .col-title  { /* takes remaining width */ }

.site-library-imprint {
    color: #777;
    font-size: 0.85rem;
}

.site-library-pager {
    margin: 1rem 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: #555;
    font-size: 0.9rem;
}
.site-library-pager-step {
    color: #5076b6;
    text-decoration: none;
}
.site-library-pager-step:hover { color: #ff8800; }

/* Auxiliary sidenav blocks (Library categories on /library-fund,
   document years on /about-documents, rental floors on /rent-available,
   …) stack directly below the regular menu rail. Small top margin so
   the two nav blocks read as separate sections rather than running
   together. */
.site-sidenav-library,
.site-sidenav-documents,
.site-sidenav-rental {
    margin-top: 1rem;
}
.site-sidenav-library .site-sidenav-item,
.site-sidenav-documents .site-sidenav-item,
.site-sidenav-rental .site-sidenav-item {
    list-style: none;
}
.site-sidenav-library .site-sidenav-item a,
.site-sidenav-documents .site-sidenav-item a,
.site-sidenav-rental .site-sidenav-item a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.3rem 0.5rem;
    color: #5076b6;
    text-decoration: none;
    border-radius: 3px;
}
.site-sidenav-library .site-sidenav-item a:hover,
.site-sidenav-documents .site-sidenav-item a:hover,
.site-sidenav-rental .site-sidenav-item a:hover {
    background: rgba(80, 118, 182, 0.08);
    color: #ff8800;
}
.site-sidenav-library .site-sidenav-item.is-active a,
.site-sidenav-documents .site-sidenav-item.is-active a,
.site-sidenav-rental .site-sidenav-item.is-active a {
    background: rgba(80, 118, 182, 0.12);
    color: #2a4a82;
    font-weight: 600;
}
.site-sidenav-library .site-sidenav-count,
.site-sidenav-documents .site-sidenav-count,
.site-sidenav-rental .site-sidenav-count {
    color: #999;
    font-size: 0.85rem;
    flex: 0 0 auto;
}

/* Documents page — year-grouped list of downloadable files. Each year
   gets its own h2 + <ul>; items render as a link + a small size badge. */
.site-documents-header {
    margin-bottom: 1rem;
}
.site-documents-header h1 {
    margin: 0 0 0.25rem;
}
.site-documents-year {
    margin: 0 0 1.25rem;
}
.site-documents-year-title {
    font-size: 1.15rem;
    margin: 0 0 0.4rem;
    color: #2a4a82;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 0.2rem;
}
.site-documents-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.site-documents-item {
    padding: 0.35rem 0;
    border-bottom: 1px dashed #ececec;
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
}
.site-documents-item:last-child { border-bottom: none; }
.site-documents-item a {
    color: #5076b6;
    text-decoration: none;
    flex: 1 1 auto;
    word-break: break-word;
}
.site-documents-item a:hover { color: #ff8800; }
.site-documents-size {
    color: #999;
    font-size: 0.85rem;
    flex: 0 0 auto;
    white-space: nowrap;
}

/* Library tweaks for narrow viewports. The author column collapses (its
   data folds into the title cell visually because authors are usually
   short) and we keep the table horizontally scrollable as a last resort. */
@media (max-width: 600px) {
    .site-library-table .col-inv,
    .site-library-table .col-code {
        font-size: 0.8rem;
    }
    .site-library-table .col-author {
        display: none;
    }
}

/* ---------- Forms (rent / science request) ----------
   Vertical labelled-row layout — looks consistent with the existing
   site-content typography. The honeypot row is visually hidden but
   still focusable for accessibility tools that surface form metadata;
   server-side check is the actual defence. */
.site-form-header h1 { margin: 0 0 1rem; }

.site-form-error {
    background: #fdecea;
    border: 1px solid #f5c2c0;
    color: #5a1f1c;
    padding: 0.6rem 0.85rem;
    border-radius: 3px;
    margin-bottom: 1rem;
}

.site-form-fields {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.site-form-row {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.site-form-row label {
    font-weight: 600;
    color: #2e2e2e;
    font-size: 0.93rem;
}
.site-form-row input,
.site-form-row textarea {
    padding: 0.5rem 0.7rem;
    font-size: 0.95rem;
    font-family: inherit;
    border: 1px solid #cccccc;
    border-radius: 3px;
    background: #ffffff;
    color: #2e2e2e;
}
.site-form-row input:focus,
.site-form-row textarea:focus {
    outline: 2px solid #5d9b22;
    outline-offset: 1px;
    border-color: #5d9b22;
}

.site-form-honeypot {
    /* Off-screen but still in the layout so a bot's text-fill heuristic
       can't tell it apart from the real fields by box dimensions. */
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.site-form-actions {
    margin-top: 0.5rem;
}
.site-form-submit {
    padding: 0.55rem 1.6rem;
    background: #5d9b22;
    color: #ffffff;
    border: 1px solid #3a6614;
    border-radius: 3px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
}
.site-form-submit:hover { background: #3a6614; }
.site-form-submit:focus {
    outline: 2px solid #2a4810;
    outline-offset: 2px;
}

/* ---------- Rent → Available ----------
   Floor-grouped, single-column listing. Each row is just the floor
   plan thumbnail (legacy 100px-tall, aspect-ratio width — same scale
   the original site uses) + a caption underneath. No card chrome.
   Existing lightbox.js binds the <a class="fancybox"> anchors. */
.site-rent-available-header h1 { margin: 0 0 0.5rem; }
.site-rent-available-intro { margin-bottom: 1rem; }
.site-rent-available-intro p { margin: 0 0 0.6rem; }
.site-rent-available-cta { margin-top: 1.5rem; text-align: center; }
.site-rent-available-cta p { margin: 0 0 0.4rem; }

.site-rent-floor {
    margin: 0 0 1.5rem;
}
.site-rent-floor-title {
    font-size: 1.15rem;
    margin: 0 0 0.5rem;
    color: #2a4a82;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 0.2rem;
}

/* Uniform aspect-ratio grid: each floor-plan thumbnail sits inside a
   fixed-aspect frame so cards line up cleanly regardless of the
   underlying image dimensions. The white .fancybox frame doubles as
   the lightbox trigger; lightbox.js sets its own overlay dimensions
   on click so this grid doesn't constrain the full-size view. */
.site-rent-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.site-rent-item {
    margin: 0;
    text-align: center;
}

/* The whole card is one anchor. Hovering it highlights the entire
   tile (frame + text), the cursor turns into the zoom-in magnifier
   anywhere inside, and a click anywhere opens the lightbox.
   lightbox.js still tags the inner <img> with .site-lightbox-thumb
   but we suppress that rule's hover ring on rent cards — only the
   outer card's ring shows, otherwise the two outlines double up. */
.site-rent-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.35rem;
    border-radius: 4px;
    text-decoration: none;
    color: inherit;
    cursor: zoom-in;
    transition: box-shadow 0.15s, transform 0.15s, background-color 0.15s;
}
.site-rent-card:hover,
.site-rent-card:focus-visible {
    background: #fafafa;
    box-shadow: 0 0 0 3px rgba(93, 155, 34, 0.45);
    outline: none;
}
.site-rent-card .site-lightbox-thumb:hover {
    /* Don't add the per-image hover ring on top of the card ring —
       lightbox.js bolts on .site-lightbox-thumb to every <img> it
       binds; without this neutraliser the card would render a
       nested outline when the cursor sat over the image. */
    box-shadow: none;
}

.site-rent-card-frame {
    aspect-ratio: 4 / 3;
    background: #ffffff;
    border: 1px solid #ececec;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    line-height: 0;
}
.site-rent-card img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.site-rent-caption {
    display: block;
    margin: 0.4rem 0 0;
    font-size: 0.95rem;
    color: #2e2e2e;
    line-height: 1.3;
}

.site-rent-description {
    display: block;
    margin: 0.25rem 0 0;
    font-size: 0.88rem;
    color: #555;
}

/* ---------- Lightbox ----------
   Driven by /js/lightbox.js. Article images get a zoom-in cursor and a
   subtle hover ring; clicking opens a full-viewport overlay with the
   image fitted to the viewport, prev/next nav across all images in the
   article, and a caption from alt/title. */
.site-lightbox-thumb {
    cursor: zoom-in;
    transition: box-shadow 0.15s, transform 0.15s;
}

.site-lightbox-thumb:hover {
    box-shadow: 0 0 0 3px rgba(93, 155, 34, 0.45);
}

body.site-lightbox-open {
    overflow: hidden; /* lock scroll behind the overlay */
}

.site-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    opacity: 0;
    transition: opacity 0.18s ease-out;
}

.site-lightbox[aria-hidden="false"] {
    display: flex;
    opacity: 1;
}

.site-lightbox-stage {
    max-width: 100%;
    max-height: calc(100vh - 6rem);
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-lightbox-image {
    max-width: 100%;
    max-height: calc(100vh - 6rem);
    width: auto;
    height: auto;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.6);
    background: #1a1a1a;
}

.site-lightbox-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1rem;
    text-align: center;
    color: #fff;
    font-size: 0.95rem;
    padding: 0 4rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.site-lightbox-counter {
    position: absolute;
    top: 1rem;
    left: 1rem;
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.85rem;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

.site-lightbox-close,
.site-lightbox-nav {
    position: absolute;
    background: rgba(0, 0, 0, 0.4);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 999px;
    width: 44px;
    height: 44px;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, transform 0.15s;
}

.site-lightbox-close:hover,
.site-lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.05);
}

.site-lightbox-close {
    top: 1rem;
    right: 1rem;
}

.site-lightbox-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.site-lightbox-next { right: 1rem; top: 50%; transform: translateY(-50%); }

.site-lightbox-prev:hover,
.site-lightbox-next:hover {
    transform: translateY(-50%) scale(1.05);
}

@media (max-width: 480px) {
    .site-lightbox { padding: 1rem; }
    .site-lightbox-close,
    .site-lightbox-nav { width: 36px; height: 36px; font-size: 1.1rem; }
    .site-lightbox-caption { padding: 0 1rem; bottom: 0.5rem; font-size: 0.85rem; }
}

/* ---------- Bootstrap focus override (kept from template) ---------- */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem #fff, 0 0 0 0.25rem #5d9b22;
}

/* ========================================================================
   Mobile (< 768px) — hamburger drawer top menu, smaller chrome.
   ======================================================================== */
@media (max-width: 767px) {
    /* Logo scales down so it never overflows the column. */
    .site-brand-logo {
        max-width: 80vw;
        max-height: 80px;
    }

    /* The hamburger button replaces the always-visible menu strip. */
    .site-topmenu {
        position: relative;
    }
    .site-topmenu-toggle {
        display: block;
        margin: 0.25rem 0.5rem 0.5rem;
        background: rgba(0, 0, 0, 0.18);
    }
    .site-topmenu-toggle:hover,
    .site-topmenu-toggle[aria-expanded="true"] {
        background: rgba(0, 0, 0, 0.32);
    }

    /* Drawer: hidden by default; topmenu.js adds .is-open. Slides in from
       the left, covers the viewport vertically, scrolls if longer than
       the screen. */
    .site-topmenu-items {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: min(85vw, 320px);
        background: #5d9b22 url('/img/legacy/images/body.png') repeat;
        box-shadow: 4px 0 16px rgba(0, 0, 0, 0.3);
        overflow-y: auto;
        padding: 1rem 0;
        transform: translateX(-105%);
        transition: transform 0.18s ease-out;
        z-index: 1000;
        border-radius: 0; /* override desktop rounded corners on mobile */
    }
    .site-topmenu-items.is-open {
        transform: translateX(0);
    }

    /* Lock body scroll behind the open drawer. */
    body.site-topmenu-drawer-open {
        overflow: hidden;
    }

    /* Items stack vertically inside the drawer, full width. */
    .site-topmenu-item {
        flex: 0 0 auto;
        text-align: left;
        border-top: 1px solid rgba(255, 255, 255, 0.12);
    }
    .site-topmenu-item:first-child { border-top: none; }

    /* Drop the desktop rounded corners — they look odd inside a stacked list. */
    .site-topmenu-items > .site-topmenu-item:first-child,
    .site-topmenu-items > .site-topmenu-item:first-child > .site-topmenu-link,
    .site-topmenu-items > .site-topmenu-item:last-child,
    .site-topmenu-items > .site-topmenu-item:last-child > .site-topmenu-link {
        border-radius: 0;
        -webkit-border-top-left-radius: 0;
        -webkit-border-top-right-radius: 0;
    }

    .site-topmenu-link {
        padding: 0.85rem 1.25rem;
        background-image: none !important; /* hide desktop dropdown caret */
    }

    /* Inline expand toggle (▾) injected by topmenu.js. Positioned at the
       end of each item with children so the link itself remains a real
       navigation target. */
    .site-topmenu-expand {
        display: block;       /* override the desktop "display: none" base rule */
        position: absolute;
        right: 0.5rem;
        top: 0.4rem;
        background: transparent;
        border: 1px solid rgba(255, 255, 255, 0.3);
        color: #fff;
        font-size: 1rem;
        line-height: 1;
        padding: 0.4rem 0.7rem;
        border-radius: 4px;
        cursor: pointer;
    }
    .site-topmenu-expand:hover { background: rgba(0, 0, 0, 0.2); }
    .site-topmenu-item.is-expanded > .site-topmenu-expand span { display: inline-block; transform: rotate(180deg); }

    /* Hover dropdowns are off on touch — show panels only when the parent
       <li> is .is-expanded (toggled by the expand button). The panel
       becomes a normal block flow inside the drawer, not absolute. */
    .site-topmenu-item.has-dropdown > .site-topmenu-dropdown {
        display: none;
    }
    .site-topmenu-item.has-dropdown.is-expanded > .site-topmenu-dropdown {
        display: block;
        position: static;
        box-shadow: none;
        background: rgba(0, 0, 0, 0.18);
        padding: 0.5rem 1rem 0.75rem 2rem;
    }
    .site-topmenu-item.has-dropdown:hover > .site-topmenu-dropdown,
    .site-topmenu-item.has-dropdown:focus-within > .site-topmenu-dropdown {
        /* Override desktop's :hover rule — drawer should only respond to
           an explicit toggle tap on touch. */
        display: none;
    }
    .site-topmenu-item.has-dropdown.is-expanded:hover > .site-topmenu-dropdown,
    .site-topmenu-item.has-dropdown.is-expanded:focus-within > .site-topmenu-dropdown {
        display: block;
    }

    /* Multi-column dropdowns stack vertically inside the drawer. The
       desktop "flex: 1 1 220px" applies to height when flex-direction is
       column — that's where the giant ~440px gap between sections came
       from. Reset to auto so each column hugs its own content. */
    .site-topmenu-columns {
        flex-direction: column;
        gap: 0.5rem;
    }
    .site-topmenu-col {
        flex: 0 0 auto;
        min-width: 0;
    }
    .site-topmenu-col-list { padding-left: 0; }
    /* Tighter row spacing for the leaves under each column header so the
       expanded section reads as a tight block, not a sparse list. */
    .site-topmenu-col-item,
    .site-topmenu-col-solo {
        padding: 0.25rem 0;
    }
    .site-topmenu-col-header {
        margin-bottom: 0.3rem;
        padding-bottom: 0.25rem;
    }

    /* Slider tabs go 2x2 grid so 4 tabs don't overflow horizontally. */
    .site-slider-tabs {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
    .site-slider-tab {
        border-right: 1px solid rgba(255, 255, 255, 0.18);
        border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    }
    .site-slider-tab:nth-child(2n) { border-right: none; }
    .site-slider-tab:nth-last-child(-n+2) { border-bottom: none; }

    /* Tighter content padding so text gets more horizontal room. */
    .site-main-grid {
        padding: 0.75rem 0.5rem 1.5rem;
        gap: 0.75rem;
    }
    .site-content {
        padding: 1rem 0.85rem;
    }

    /* On mobile the controls move down to share the burger row — the logo
       is too wide to share the top of the header with anything else.
       Anchored to the bottom-right of .site-header so they sit alongside
       the hamburger button (which lives at the bottom of the header). */
    .site-controls {
        top: auto;
        bottom: 0.5rem;
        right: 0.5rem;
    }
    .site-controls-button {
        width: 30px;
        height: 30px;
    }
    /* Match the input height to the larger mobile button size so the
       inline-expand stays visually balanced with the icons. */
    .site-controls-search-input {
        height: 30px;
        font-size: 0.9rem;
    }
    /* Cap the open-state widths so neither inline expansion crosses the
       brand on small phones. The picker only needs to fit a couple of
       flag tiles, so its cap is tighter than the search input's. */
    .site-controls.is-search-open .site-controls-search {
        max-width: min(60vw, 240px);
    }
    .site-controls.is-settings-open .site-controls-settings {
        max-width: min(50vw, 180px);
    }

    /* Footer stacks both rows. */
    .site-footer-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    /* Slider caption: tighten so the body text doesn't overflow the slide
       on phones in portrait (~360–480 CSS px). The desktop "60%, 520px"
       cap leaves text running off the right edge once the slide narrows. */
    .site-slider-caption {
        top: 0.75rem;
        left: 0.75rem;
        right: 0.75rem;            /* hard right boundary */
        max-width: none;
        padding: 0;
    }
    .site-slider-title {
        font-size: 1.3rem;
        margin-bottom: 0.4rem;
    }
    .site-slider-body { font-size: 0.9rem; line-height: 1.45; }
    .site-slider-body p { margin-bottom: 0.25rem; }
}

@media (max-width: 480px) {
    /* Tab subtitles drop on the smallest screens — tab titles alone fit. */
    .site-slider-tab-subtitle { display: none; }

    /* Even tighter caption sizing for iPhone-class viewports (~390–440px).
       Title shrinks further; body text gets smaller line-height to keep
       the caption from pushing into the tab strip. The slide height is
       handled by the clamp() rule in the <768px block (60vw scales to
       ~258px on a 430px viewport — sensible without an override here). */
    .site-slider-title { font-size: 1.1rem; }
    .site-slider-body { font-size: 0.82rem; line-height: 1.35; }
}
