/* TBONE site system — Home / Art / About shared chrome.
   Check-In hard load does not need this file; SPA may load it later. */

/* Dual-shell [hidden] + SPA opacity live in tokens.css (always loaded).
   #site-shell must be a flex column child of body.site so .page-wrapper
   (flex:1) and fixed footer clearance keep working after SPA wrap. */

/* Persistent banner + marquee — sibling of #site-shell (not inside it).
   IMPORTANT: do NOT use display:none to stash — that cancels CSS marquee
   animations and leaves stale spans that overlap on resume. */
body.site > #site-banner-chrome {
    width: 100%;
    flex: 0 0 auto;
    box-sizing: border-box;
    order: 0;
}

body.site #site-shell {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-height: 0; /* fill remaining body below banner; body has min-height 100vh */
    min-width: 0;
    box-sizing: border-box;
    order: 1;
    overflow-x: hidden;
}

body.site #site-shell > .page-wrapper {
    flex: 1 1 auto;
    width: 100%;
}

/* is-stashed clip rules live in tokens.css (must work when site.css is off). */

html {
    overflow-x: hidden;
    max-width: 100%;
}

body.site {
    font-family: var(--site-font);
    color: #FFFFFF !important;
    background-color: #000000 !important;
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.5;
    /* iOS standalone / notched devices: keep banner out from under status bar */
    padding-top: var(--safe-top, env(safe-area-inset-top, 0px));
    padding-left: var(--safe-left, env(safe-area-inset-left, 0px));
    padding-right: var(--safe-right, env(safe-area-inset-right, 0px));
    box-sizing: border-box;
}

/* Default GIF background (index look) for all site pages */
body.site::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: var(--site-bg-image);
    background-color: #000000;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
    opacity: 1;
    z-index: -1 !important;
    image-rendering: pixelated;
    pointer-events: none;
}

body.site img {
    max-width: 100%;
    height: auto;
    display: block;
    image-rendering: pixelated;
}

body.site a {
    color: var(--retro-blue);
    text-decoration: underline;
}

body.site button {
    background: var(--retro-gray);
    border: 1px solid #000;
    padding: 0.5rem;
    cursor: pointer;
    min-width: 44px;
    min-height: 44px;
    font-family: inherit;
}

body.site button:hover {
    background: transparent;
    color: #fff;
}

/* Main column wrapper above fixed radio footer.
   Footer clearance comes only from radio-footer.css (!important) — keep base padding low. */
body.site .page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 0;
    padding-bottom: 0;
    box-sizing: border-box;
    overflow-x: hidden;
}

/*
 * Shared nav (OCR-A) — ONE source for Home + About so SPA soft-nav does not jump.
 * Art may tighten spacing below; do not re-declare margins/padding in pages/home.css.
 */
body.site .nav-links {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    flex: 0 0 auto;
    padding: 5px 0;
    margin: 5px 0 10px 0;
    z-index: 3;
    width: 100%;
    box-sizing: border-box;
}

/* Default white; red on hover (desktop) and press (mobile touch — no sticky hover) */
body.site .nav-links a {
    color: #FFFFFF;
    text-decoration: none;
    font-weight: bold;
    padding: 8px 15px;
    transition: color 0.15s ease, text-shadow 0.15s ease;
    text-shadow: 1px 1px 0 #000000;
    -webkit-tap-highlight-color: transparent;
}

body.site .nav-links a:hover,
body.site .nav-links a:active,
body.site .nav-links a:focus-visible {
    color: var(--accent-red);
    text-shadow: 2px 2px 2px #000000, -1px -1px 1px #FFFFFF;
    outline: none;
}

/* Art page: nav sits lightly so work stays primary */
body.site.page-art .nav-links {
    margin: 0.25rem 0 0.5rem;
    padding: 2px 5px;
}

body.site.page-art .nav-links a {
    padding: 8px 12px;
    font-size: 0.95em;
}

/* ========== Shared banner strip + marquee (Home + About) ==========
   Must live in site.css so About matches Home (not only pages/home.css). */
body.site .retro-header {
    width: 100%;
    background-color: transparent;
    padding: 5px;
    box-sizing: border-box;
}

body.site .banner-container {
    display: flex;
    flex-direction: column; /* below desktop: single banner (see :not(:first-child)) */
    width: 100%;
    height: auto;
    border: none; /* no harsh red frame around banners */
    align-items: stretch;
    box-sizing: border-box;
}

body.site .banner-image {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    height: auto;
    object-fit: cover;
    border: none;
    display: block;
}

/* Below desktop row: only one banner — less jarring load; JS also skips src on extras */
@media (max-width: 1024px) {
    body.site .banner-image:not(:first-of-type),
    body.site .banner-image[hidden] {
        display: none !important;
    }
}

body.site .scrolling-banner {
    position: relative;
    width: 100%;
    height: 24px;
    background-color: rgba(0, 0, 0, 0.7);
    color: #FFFF00;
    font-size: 10px;
    line-height: 24px;
    overflow: hidden;
    white-space: nowrap;
    border-top: 1px solid var(--accent-red) !important;
    border-bottom: 1px solid var(--accent-red) !important;
    text-align: center;
    z-index: 2;
    margin: 5px 0;
    box-sizing: border-box;
}

body.site .scrolling-banner span {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateX(100vw);
    white-space: nowrap;
    font-weight: bold;
    text-shadow: 1px 1px 1px #000000;
    /* duration set by scrolling-banner.js */
}

@keyframes marquee {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(calc(-100vw - var(--text-width))); }
}

/* phone-up: larger type (nav colors are shared — white default above) */
@media (min-width: 481px) {
    body.site {
        font-size: 16px;
    }

    body.site .scrolling-banner {
        font-size: 10px;
        height: 24px;
        line-height: 24px;
    }
}

/* Mobile chrome: tighter vertical rhythm (~half the former dead space) */
@media (max-width: 1024px) {
    body.site .retro-header {
        padding: 2px 4px;
    }

    body.site .scrolling-banner {
        margin: 2px 0;
    }

    body.site .nav-links {
        margin: 2px 0 4px 0;
        padding: 2px 0;
    }

    body.site .nav-links a {
        padding: 6px 12px;
    }
}

/* Tablet: still stacked banners */
@media (min-width: 769px) {
    body.site .banner-container {
        flex-direction: column;
        min-height: auto;
    }

    body.site .banner-image {
        width: 100%;
        height: auto;
    }

    body.site .scrolling-banner {
        font-size: 10px;
        height: 24px;
        line-height: 24px;
        margin-top: 5px;
        margin-bottom: 5px;
    }
}

/* Desktop: four banners in a row — Home + About */
@media (min-width: 1025px) {
    body.site.page-home {
        overflow-x: hidden;
        overflow-y: auto;
    }

    /* Footer clearance: radio-footer.css only (do not stack extra padding here) */

    body.site .banner-container {
        flex-direction: row;
        flex-wrap: nowrap;
        align-items: stretch;
        max-height: min(160px, 18vh);
        overflow: hidden;
    }

    body.site .banner-image {
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        height: 100%;
        max-height: min(160px, 18vh);
        object-fit: cover;
        object-position: center;
    }

    body.site .scrolling-banner {
        font-size: 14px;
        height: 32px;
        line-height: 30px;
        margin-top: 0;
        margin-bottom: 0;
    }
}

/* Short desktop: compact banner + nav (shared so Home↔About does not jump) */
@media (min-width: 1025px) and (max-height: 900px) {
    body.site .banner-container {
        max-height: min(110px, 14vh);
    }
    body.site .banner-image {
        max-height: min(110px, 14vh);
    }
    body.site .scrolling-banner {
        height: 24px;
        line-height: 24px;
        font-size: 12px;
    }
    body.site:not(.page-art) .nav-links {
        margin: 0 0 4px;
        padding: 0;
    }
    body.site:not(.page-art) .nav-links a {
        padding: 4px 12px;
    }
}

@media (min-width: 1025px) and (max-height: 720px) {
    body.site .banner-container {
        max-height: min(88px, 12vh);
    }
    body.site .banner-image {
        max-height: min(88px, 12vh);
    }
    body.site .scrolling-banner {
        height: 22px;
        line-height: 22px;
        font-size: 11px;
        margin: 2px 0;
    }
    body.site .retro-header {
        padding: 2px 5px;
    }
}
