/*
=========================
header-footer.css
The fixed site header (logo, navigation, demo button, mobile menu) and the footer.
Both are shared partials, loaded into every page by js/load-partials.js.
=========================
*/

/*
=========================
Header & navigation
Markup: nav-bar.html, behaviour: js/load-partials.js, which sets the states
.is-transparent (homepage, over the hero) and .is-open (mobile menu)
=========================
*/

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--site-bg);
    box-shadow: var(--shadow-md);
    transition: background var(--t-med), box-shadow var(--t-med);
}

.site-header__inner {
    height: var(--site-header-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--c-text);
    text-decoration: none;
}

.brand:hover {
    color: var(--c-text);
}

/* the cream tile keeps the dark "t" visible on photos and dark backgrounds.
   Resize the logo with --logo-size only: the image scales with its tile and keeps its proportions. */
.brand__tile {
    --logo-size: 70px;
    width: var(--logo-size);
    height: var(--logo-size);
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--logo-bg);
    border-radius: var(--r-lg);
}

.brand__tile img {
    width: 99%;
    height: auto;
}

.brand__name {
    font-size: var(--text-xl);
    font-weight: 700;
    letter-spacing: .02em;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 32px;
}

.site-nav a:not(.btn) {
    padding: 12px 2px;
    font-size: var(--text-md);
    color: var(--c-text);
    text-decoration: none;
    border-bottom: 2px solid transparent;
}

.site-nav a:not(.btn):hover,
.site-nav a[aria-current="page"] {
    color: var(--c-text);
    border-bottom-color: var(--c-accent);
}

/* demo button inside the mobile menu; the extra class beats .btn in components.css */
.site-nav .site-nav__demo {
    display: none;
}

.nav-cta {
    background: var(--c-nav-active-bg);
    color: var(--c-nav-active-fg);
}

.nav-cta:hover {
    background: var(--c-accent);
    color: var(--c-on-accent);
}

.nav-toggle {
    display: none;
    width: 48px;
    height: 48px;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--c-text);
    border: 2px solid var(--c-border-strong);
    border-radius: var(--r-md);
    cursor: pointer;
}

.nav-toggle .icon-close,
.site-header.is-open .nav-toggle .icon-open {
    display: none;
}

.site-header.is-open .nav-toggle .icon-close {
    display: block;
}

/* homepage: see-through over the hero until the page is scrolled */
.site-header.is-transparent {
    background: transparent;
    box-shadow: none;
}

.site-header.is-transparent .brand,
.site-header.is-transparent .site-nav a:not(.btn) {
    color: var(--band-fg);
}

.site-header.is-transparent .site-nav a:not(.btn):hover {
    border-bottom-color: var(--band-accent);
}

.site-header.is-transparent .brand__tile {
    box-shadow: var(--shadow-md);
}

.site-header.is-transparent .nav-cta {
    background: var(--brand-ochre);
    color: var(--brand-forest);
}

.site-header.is-transparent .nav-toggle {
    color: var(--band-fg);
    border-color: color-mix(in srgb, var(--band-fg) 60%, transparent);
}

/*
=========================
Footer
Markup: footer.html
=========================
*/

.site-footer {
    padding: 48px 0;
    background: var(--footer-bg);
    color: var(--band-fg);
}

.site-footer__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 32px;
}

.site-footer .brand,
.site-footer a {
    color: var(--band-fg);
    text-decoration: none;
}

.site-footer a:hover,
.site-footer .link-button:hover {
    color: var(--band-accent);
}

.site-footer .brand__tile {
    --logo-size: 44px;
}

.site-footer .brand__name {
    font-size: var(--text-lg);
}

.site-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 28px;
    font-size: var(--text-base);
}

.site-footer small {
    font-size: var(--text-sm);
    color: var(--band-muted);
}

/*
=========================
Responsive
=========================
*/

@media (max-width: 980px) {

    /* the extra class beats .btn in components.css */
    .site-nav,
    .site-header .nav-cta {
        display: none;
    }

    .nav-toggle {
        display: inline-flex;
    }

    /* the opened menu drops down below the header bar */
    .site-header.is-open {
        background: var(--site-bg);
        box-shadow: var(--shadow-md);
    }

    .site-header.is-open .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 8px 20px 24px;
        background: var(--site-bg);
        box-shadow: var(--shadow-md);
    }

    .site-header.is-open .site-nav a:not(.btn) {
        padding: 14px 0;
        font-size: var(--text-lg);
        border-bottom: 1px solid var(--c-border);
    }

    .site-header.is-open .site-nav .site-nav__demo {
        display: inline-flex;
        margin-top: 16px;
    }
}

@media (max-width: 640px) {

    .brand__tile {
        --logo-size: 44px;
    }

    .brand__name {
        font-size: var(--text-lg);
    }
}
