﻿/* =========================================================
   STREGA
   HEADER
========================================================= */


/* =========================================================
   SKIP LINK
========================================================= */

.skip-link {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 2000;
    padding: 0.75rem 1rem;
    color: var(--strega-paper);
    background: var(--strega-ink);
    transform: translateY(-200%);
    transition: transform 150ms ease;
}

    .skip-link:focus {
        transform: translateY(0);
    }


/* =========================================================
   HEADER SHELL
========================================================= */

.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
    background: rgba(250, 247, 241, 0.98);
    border-bottom: 1px solid var(--strega-line);
    transition: background 220ms ease, box-shadow 220ms ease;
}


/* =========================================================
   HEADER INNER
========================================================= */

.site-header__inner {
    width: min( calc(100% - 3rem), var(--content-width) );
    min-height: 106px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 180px 1fr 180px;
    align-items: center;
    transition: min-height 220ms ease, grid-template-columns 220ms ease;
}


/* =========================================================
   LOGO
========================================================= */

.site-logo {
    width: fit-content;
    display: inline-flex;
    align-items: center;
    color: var(--strega-ink);
    text-decoration: none;
}


/* FULL LOGO */

.site-logo__full {
    display: block;
    width: 150px;
    max-height: 92px;
    object-fit: contain;
}


/* COMPACT WORDMARK */

.site-logo__wordmark {
    display: none;
    color: var(--strega-ink);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.55rem;
    font-weight: 400;
    letter-spacing: 0.14em;
    line-height: 1;
    white-space: nowrap;
}


/* =========================================================
   DESKTOP NAVIGATION
========================================================= */

.desktop-nav {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp( 1.5rem, 3vw, 3rem );
}


    .desktop-nav a {
        position: relative;
        color: var(--strega-ink);
        font-size: 0.95rem;
        text-decoration: none;
    }


        .desktop-nav a::after {
            content: "";
            position: absolute;
            left: 0;
            right: 100%;
            bottom: -7px;
            height: 1px;
            background: var(--strega-ink);
            transition: right 180ms ease;
        }


        .desktop-nav a:hover::after,
        .desktop-nav a[aria-current="page"]::after {
            right: 0;
        }


        .desktop-nav a:focus-visible {
            outline: 1px solid currentColor;
            outline-offset: 6px;
        }


/* =========================================================
   HEADER ACTIONS
========================================================= */

.header-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1rem;
}


/* =========================================================
   SEARCH BUTTON
========================================================= */

.header-icon {
    width: 42px;
    height: 42px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    color: var(--strega-ink);
    background: transparent;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}


    .header-icon:hover {
        opacity: 0.6;
    }


    .header-icon:focus-visible {
        outline: 1px solid currentColor;
        outline-offset: 3px;
    }


/* =========================================================
   MOBILE MENU BUTTON
========================================================= */

.mobile-menu-button {
    display: none;
    width: 30px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}


    .mobile-menu-button span {
        display: block;
        width: 100%;
        height: 1px;
        margin: 7px 0;
        background: var(--strega-ink);
    }


/* =========================================================
   MOBILE NAVIGATION
========================================================= */

.mobile-nav {
    display: none;
}


    .mobile-nav a {
        color: var(--strega-ink);
        text-decoration: none;
    }


        .mobile-nav a[aria-current="page"] {
            text-decoration: underline;
            text-underline-offset: 0.35em;
        }


/* =========================================================
   COMPACT / SCROLLED HEADER
========================================================= */

.site-header.is-scrolled {
    box-shadow: 0 4px 18px rgba(37, 29, 23, 0.07);
}


    .site-header.is-scrolled
    .site-header__inner {
        min-height: 66px;
    }


    /* hide full logo */

    .site-header.is-scrolled
    .site-logo__full {
        display: none;
    }


    /* show STREGA wordmark */

    .site-header.is-scrolled
    .site-logo__wordmark {
        display: inline-block;
    }


    /* slightly tighten nav */

    .site-header.is-scrolled
    .desktop-nav {
        align-self: center;
    }


        .site-header.is-scrolled
        .desktop-nav a {
            font-size: 0.9rem;
        }


/* =========================================================
   SEARCH OVERLAY
========================================================= */

body.site-search-open {
    overflow: hidden;
}


.site-search[hidden] {
    display: none;
}


.site-search {
    position: fixed;
    inset: 0;
    z-index: 1100;
}


.site-search__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(23, 18, 14, 0.55);
}


.site-search__panel {
    position: relative;
    width: 100%;
    padding: 2rem max( 1.5rem, calc( (100vw - var(--content-width)) / 2 ) ) 3rem;
    color: var(--strega-ink);
    background: var(--strega-paper);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
}


/* =========================================================
   SEARCH HEADER
========================================================= */

.site-search__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    margin-bottom: 2rem;
}


.site-search__close {
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}


    .site-search__close:hover {
        opacity: 0.55;
    }


    .site-search__close:focus-visible {
        outline: 1px solid currentColor;
        outline-offset: 3px;
    }


/* =========================================================
   SEARCH FORM
========================================================= */

.site-search__form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    border-bottom: 1px solid var(--strega-ink);
}


    .site-search__form input {
        min-width: 0;
        min-height: 70px;
        padding: 0;
        border: 0;
        outline: 0;
        color: inherit;
        background: transparent;
        font-family: Georgia, "Times New Roman", serif;
        font-size: clamp( 1.35rem, 3vw, 2.25rem );
    }


        .site-search__form input::placeholder {
            color: inherit;
            opacity: 0.42;
        }


    .site-search__form button {
        padding-left: 2rem;
        border: 0;
        color: inherit;
        background: transparent;
        font-family: Arial, Helvetica, sans-serif;
        font-size: 0.7rem;
        letter-spacing: 0.12em;
        text-transform: uppercase;
        cursor: pointer;
    }


        .site-search__form button:hover {
            opacity: 0.55;
        }


        .site-search__form button:focus-visible {
            outline: 1px solid currentColor;
            outline-offset: 4px;
        }


/* =========================================================
   TABLET / MOBILE
========================================================= */

@media (max-width: 980px) {

    .site-header__inner {
        grid-template-columns: 1fr auto;
    }


    .desktop-nav {
        display: none;
    }


    .mobile-menu-button {
        display: block;
    }


    .mobile-nav {
        padding: 1rem 1.5rem 2rem;
        background: var(--strega-paper);
        border-top: 1px solid var(--strega-line);
    }


        .mobile-nav.is-open {
            display: flex;
            flex-direction: column;
            gap: 1.25rem;
        }


        .mobile-nav a {
            font-size: 1.05rem;
        }


    .site-header.is-scrolled
    .site-header__inner {
        min-height: 62px;
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 640px) {

    .site-header__inner {
        width: calc(100% - 2rem);
        min-height: 84px;
    }


    .site-logo__full {
        width: 125px;
        max-height: 76px;
    }


    .site-logo__wordmark {
        font-size: 1.35rem;
    }


    .site-header.is-scrolled
    .site-header__inner {
        min-height: 58px;
    }


    .header-actions {
        gap: 0.5rem;
    }


    .site-search__panel {
        padding: 1.5rem 1rem 2rem;
    }


    .site-search__form input {
        min-height: 62px;
        font-size: 1.2rem;
    }


    .site-search__form button {
        padding-left: 1rem;
    }
}
