/*
=================================================================
OSG Chrome - Header, Footer, and Global Navigation
Reference design: Project Hub (hub.css) signed off by Will.
=================================================================
*/


/* Google Fonts are loaded via wp_enqueue_style in functions.php
   with preconnect hints in wp_head - not as a CSS @import. */


/* ---------------------------------------------------------------
   Skip link  (matches .hub-skip-link pattern)
   --------------------------------------------------------------- */
.osg-skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 9999;
    font-size: 13px;
    font-weight: 600;
    background: var(--navy-700);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--r-sm);
    text-decoration: none;
}

.osg-skip-link:focus {
    left: 16px;
    outline: 2px solid var(--teal-400);
    outline-offset: 2px;
}


/* ---------------------------------------------------------------
   Sticky footer
   body grows to at least 100vh, main fills the remaining space,
   footer is always at the bottom with no white gap below content.
   --------------------------------------------------------------- */
body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

body > main,
body > #main-content,
body > .osg-main {
    flex: 1;
}


/* ---------------------------------------------------------------
   Site header
   Matches hub .return-bar visual language but taller to
   accommodate primary navigation.
   --------------------------------------------------------------- */
.osg-site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: var(--navy-900);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: box-shadow 0.25s ease;
}

.osg-site-header.is-scrolled {
    box-shadow: 0 4px 24px rgba(13, 30, 56, 0.45);
}

.osg-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    min-height: 64px;
    padding: 0 clamp(1rem, 5vw, 5rem);
}


/* ---------------------------------------------------------------
   Logo  (matches hub .return-osg img: max-width 140px, opacity 0.8)
   --------------------------------------------------------------- */
.osg-header-brand {
    flex-shrink: 0;
}

.osg-header-brand a,
.osg-header-brand .custom-logo-link,
.osg-logo-link {
    display: block;
    line-height: 1;
}

.osg-header-brand img,
.osg-header-brand .custom-logo,
.osg-logo-img {
    display: block;
    max-width: 140px;
    height: auto;
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.osg-header-brand a:hover img,
.osg-header-brand a:hover .custom-logo,
.osg-logo-link:hover .osg-logo-img {
    opacity: 1;
}

.osg-header-brand a:focus-visible,
.osg-logo-link:focus-visible {
    outline: 2px solid var(--teal-400);
    outline-offset: 3px;
    border-radius: 2px;
}

.osg-logo-text {
    font-family: var(--font-m);
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    letter-spacing: 0.04em;
}


/* ---------------------------------------------------------------
   Primary navigation
   Typography matches hub .return-link: font-m, 11px, 0.06em spacing
   --------------------------------------------------------------- */
.osg-primary-nav {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.osg-nav-list {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.osg-nav-list li a {
    display: block;
    padding: 6px 14px;
    font-family: var(--font-m);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    transition: color 0.2s ease;
}

.osg-nav-list li a:hover {
    color: rgba(255, 255, 255, 0.9);
}

.osg-nav-list li a:focus-visible {
    color: rgba(255, 255, 255, 0.9);
    outline: 2px solid var(--teal-400);
    outline-offset: 2px;
    border-radius: 2px;
}

.osg-nav-list li.current-menu-item > a,
.osg-nav-list li.current-page-ancestor > a {
    color: rgba(255, 255, 255, 0.9);
}


/* ---------------------------------------------------------------
   Mobile toggle button
   --------------------------------------------------------------- */
.osg-nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--r-sm);
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: border-color 0.2s ease;
}

.osg-nav-toggle:hover {
    border-color: rgba(255, 255, 255, 0.4);
}

.osg-nav-toggle:focus-visible {
    outline: 2px solid var(--teal-400);
    outline-offset: 2px;
}

.osg-nav-toggle-bar {
    display: block;
    width: 18px;
    height: 1.5px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease;
    transform-origin: center;
}

[aria-expanded="true"] .osg-nav-toggle-bar:nth-child(1) {
    transform: translateY(6.5px) rotate(45deg);
}
[aria-expanded="true"] .osg-nav-toggle-bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
[aria-expanded="true"] .osg-nav-toggle-bar:nth-child(3) {
    transform: translateY(-6.5px) rotate(-45deg);
}


/* ---------------------------------------------------------------
   Mobile nav panel
   --------------------------------------------------------------- */
@media (max-width: 1023px) {
    .osg-nav-toggle {
        display: flex;
    }

    .osg-header-inner {
        padding: 0 16px;
    }

    .osg-primary-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--navy-900);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        padding: 8px 0;
        display: none;
        justify-content: flex-start;
    }

    .osg-primary-nav.is-open {
        display: flex;
    }

    .osg-nav-list {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        padding: 0 16px;
    }

    .osg-nav-list li a {
        padding: 10px 8px;
        font-size: 12px;
    }
}


/* ---------------------------------------------------------------
   Body lock when mobile nav open
   --------------------------------------------------------------- */
.osg-nav-open {
    overflow: hidden;
}


/* ---------------------------------------------------------------
   Site footer  (matches hub .site-footer exactly)
   --------------------------------------------------------------- */
.osg-site-footer {
    background: var(--navy-900);
    padding: 48px 0 28px;
    font-family: var(--font-b);
}

.osg-footer-main {
    margin-bottom: 0;
}

.osg-footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 32px;
}


/* Brand column  (matches hub .footer-logo-wrap) */
.osg-footer-brand {
    display: flex;
    flex-direction: column;
}

.osg-footer-brand .custom-logo,
.osg-footer-brand img,
.osg-footer-logo-img {
    display: block;
    max-width: 140px;
    height: auto;
    opacity: 0.8;
}

.osg-footer-logo-text {
    font-family: var(--font-m);
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.55);
    letter-spacing: 0.04em;
}

.osg-footer-tagline {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.6;
    max-width: 280px;
    margin: 12px 0 0;
}


/* Column headings  (matches hub .footer-col-label) */
.osg-footer-heading {
    font-family: var(--font-m);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.25);
    margin: 0 0 12px;
    display: block;
}


/* Footer nav  (matches hub .footer-links-list) */
.osg-footer-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.osg-footer-nav-list a {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-block;
}

.osg-footer-nav-list a:hover {
    color: #fff;
}

.osg-footer-nav-list a:focus-visible {
    color: #fff;
    outline: 2px solid var(--teal-400);
    outline-offset: 3px;
    border-radius: 2px;
}


/* Contact column */
.osg-footer-address {
    font-style: normal;
    font-size: 12px;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.45);
    margin: 0 0 12px;
}

.osg-footer-contact-row {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    margin: 0;
}

.osg-footer-contact-row .osg-label {
    color: rgba(255, 255, 255, 0.25);
    font-size: 10px;
    font-family: var(--font-m);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.osg-footer-contact-row a {
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    transition: color 0.2s ease;
}

.osg-footer-contact-row a:hover {
    color: #fff;
}

.osg-footer-contact-row a:focus-visible {
    color: #fff;
    outline: 2px solid var(--teal-400);
    outline-offset: 3px;
    border-radius: 2px;
}


/* Footer base bar  (matches hub .footer-bottom) */
.osg-footer-base {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding-top: 20px;
    margin-top: 36px;
}

.osg-footer-copy {
    font-family: var(--font-m);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.04em;
    margin: 0;
}

.osg-footer-legal .osg-cluster {
    gap: 16px;
}

.osg-footer-legal a {
    font-family: var(--font-m);
    font-size: 11px;
    color: rgba(255, 255, 255, 0.2);
    letter-spacing: 0.04em;
    text-decoration: none;
    transition: color 0.2s ease;
}

.osg-footer-legal a:hover {
    color: rgba(255, 255, 255, 0.6);
}

.osg-footer-legal a:focus-visible {
    color: rgba(255, 255, 255, 0.6);
    outline: 2px solid var(--teal-400);
    outline-offset: 3px;
    border-radius: 2px;
}


/* ---------------------------------------------------------------
   Responsive footer  (matches hub @media breakpoints)
   --------------------------------------------------------------- */
@media (max-width: 900px) {
    .osg-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }

    .osg-footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .osg-site-footer {
        padding: 32px 0 20px;
    }

    .osg-footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
        margin-bottom: 24px;
    }

    .osg-footer-base {
        margin-top: 24px;
    }

    .osg-footer-base .osg-split {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
}

/* ---------------------------------------------------------------
   WordPress admin bar offsets
   WP adds padding-top to html.wp-toolbar which shifts all content
   below the fixed admin bar. No extra hub overrides needed -
   the base sticky values (return-bar: top 0, project-nav: top 46px)
   work correctly with the html padding offset.
   --------------------------------------------------------------- */

/* Main site sticky header must also clear admin bar */
.admin-bar .osg-site-header { top: 32px; }

@media screen and (max-width: 782px) {
    .admin-bar .osg-site-header { top: 46px; }
}
