/* ============================================================
   Staiano's site header (partial/header.blade.php)
   Utility row and main row share one full-width grid: the open/closed status and the wordmark on the
   left, "Contact" and the phone number on the right. The gutter matches the footer's (.lf__wrap), so
   header and footer share edges. The room navigation is centred under the search box. Loaded after
   header.css, whose rules are mostly !important, so the navigation overrides below are scoped to
   #header and use !important too.
   ============================================================ */

:root {
    --sh-ink: #171717;          /* header background, same as the footer */
    --sh-text: #f2ece2;         /* facade white */
    --sh-muted: rgba(242, 236, 226, 0.66);
    --sh-timber: #d8be95;       /* the cedar entry posts; the only accent */
    --sh-rule: rgba(255, 255, 255, 0.1);
    --sh-wrap: none;            /* full width, like the hero and footer */
    --sh-gutter: clamp(1.2rem, 3vw, 3rem);
    --sh-sans: 'Manrope', 'Segoe UI', system-ui, sans-serif;
    --sh-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
}

.sh-wrap {
    max-width: var(--sh-wrap);
    margin-inline: auto;
    padding-inline: var(--sh-gutter);
}

/* ---------- Utility row ---------- */

.sh-utility {
    background: var(--sh-ink);
    border-bottom: 1px solid var(--sh-rule);
    color: var(--sh-muted);
    font: 500 13px/1.4 var(--sh-sans);
}

.sh-utility__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 38px;
}

.sh-utility__visit {
    display: flex;
    align-items: center;
    gap: 24px;
    min-width: 0;
}

.sh-status {
    display: block;
    color: var(--sh-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Open: green; closed: the muted tone, so a closed store does not read as an error. */
.sh-status::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 8px;
    border-radius: 50%;
    background: var(--sh-muted);
    vertical-align: 1px;
}

.sh-status.is-open::before {
    background: #8cc79a;
}

.sh-utility a {
    color: var(--sh-muted);
    text-decoration: none;
    text-underline-offset: 4px;
    transition: color 0.2s ease;
}

.sh-utility a:hover,
.sh-utility a:focus-visible {
    color: var(--sh-text);
    text-decoration: underline;
}

.sh-utility__address {
    white-space: nowrap;
}

.sh-utility__links {
    display: flex;
    gap: 28px;
    white-space: nowrap;
}

.sh-utility__call {
    display: none;
}

/* ---------- Main row ---------- */

.sh-main {
    background: var(--sh-ink);
    border-bottom: 1px solid var(--sh-rule);
}

/* Equal side columns keep the search box on the page centre, in line with the centred room navigation; a
   narrow window shrinks the search before the wordmark or phone number. */
.sh-main__inner {
    display: grid;
    grid-template-columns: minmax(max-content, 1fr) minmax(0, 560px) minmax(max-content, 1fr);
    align-items: center;
    gap: 48px;
    min-height: 88px;
}

.sh-brand {
    display: block;
    line-height: 0;
}

/* The wordmark is a 303x68 raster: shown at its own size or smaller, never stretched. */
.sh-brand img {
    display: block;
    width: 268px;
    height: auto;
}

.sh-search {
    justify-self: center;
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 560px;
    height: 44px;
    margin: 0;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.04);
    transition: border-color 0.2s ease;
}

.sh-search:focus-within {
    border-color: var(--sh-timber);
}

.sh-search input {
    flex: 1;
    min-width: 0;
    padding: 0 16px;
    border: 0;
    background: transparent;
    color: var(--sh-text);
    font: 400 15px var(--sh-sans);
    outline: none;
}

.sh-search input::placeholder {
    color: var(--sh-muted);
}

.sh-search input::-webkit-search-cancel-button {
    filter: invert(1);
    opacity: 0.6;
}

.sh-search button {
    width: 48px;
    border: 0;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
    background: transparent;
    color: var(--sh-text);
    font-size: 15px;
    cursor: pointer;
}

.sh-search button:hover,
.sh-search button:focus-visible {
    color: var(--sh-timber);
}

.sh-contact {
    justify-self: end;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    line-height: 1.25;
    text-decoration: none;
}

.sh-contact__label {
    color: var(--sh-muted);
    font: 500 13px var(--sh-sans);
}

.sh-contact__number {
    color: var(--sh-timber);
    font: 600 19px var(--sh-sans);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.sh-contact:hover .sh-contact__number,
.sh-contact:focus-visible .sh-contact__number {
    color: var(--sh-text);
}

.sh-utility a:focus-visible,
.sh-brand:focus-visible,
.sh-contact:focus-visible,
.sh-search button:focus-visible {
    outline: 2px solid var(--sh-timber);
    outline-offset: 3px;
}

/* ---------- Room navigation (sticky) ---------- */

#header .navbar {
    border-top: 0 !important;
    border-bottom: 1px solid var(--sh-rule) !important;
}

#header .navbar .container-fluid {
    max-width: var(--sh-wrap);
    padding-left: var(--sh-gutter) !important;
    padding-right: var(--sh-gutter) !important;
}

@media (min-width: 992px) {
    #header #main_nav {
        width: 100%;
    }

    /* Rooms sit in a centred group under the search box, a fixed gap apart (spread edge to edge on a wide
       screen they were ~150px apart and read as separate items rather than one menu). */
    #header #main_nav .navbar-nav {
        width: 100%;
        justify-content: center;
        align-items: stretch;
        gap: 0 clamp(28px, 3vw, 52px) !important;
    }

    /* Items stay display:block: the mega menus are absolutely positioned at their static position, which is
       below the link only in block flow (in a flex item it would be the item's top, over the row). */
    #header .navbar-nav .nav-link {
        position: relative;
        min-height: 52px;
        padding: 0 !important;
        font-family: var(--sh-serif) !important;
        font-size: 19px !important;
        font-weight: 600 !important;
        letter-spacing: 0.005em !important;
        text-transform: none !important;
        color: var(--sh-text) !important;
        background-color: transparent !important;
        /* A timber rule under the label: grows from the centre on hover and focus, full on the current page. */
        background-image: linear-gradient(var(--sh-timber), var(--sh-timber)) !important;
        background-repeat: no-repeat !important;
        background-position: 50% calc(100% - 13px) !important;
        background-size: 0 1.5px !important;
        box-shadow: none !important;
        transition: background-size 0.25s ease, color 0.2s ease;
    }

    #header .navbar-nav .nav-link:hover,
    #header .navbar-nav .nav-link:focus-visible,
    #header .navbar-nav .nav-item:hover > .nav-link,
    #header .navbar-nav .nav-item.show > .nav-link {
        color: #ffffff !important;
        background-color: transparent !important;
        background-size: 100% 1.5px !important;
    }

    #header .navbar-nav .nav-link.active {
        color: var(--sh-timber) !important;
        background-color: transparent !important;
        background-size: 100% 1.5px !important;
        box-shadow: none !important;
    }

    #header .navbar-nav .nav-link:focus-visible {
        outline: 2px solid var(--sh-timber);
        outline-offset: 4px;
    }

    /* The mega menu spans the window; its thumbnails start on the same grid edge as the wordmark. */
    #header .navbar .nav-item.dropdown > .dropdown-menu .category-row {
        max-width: var(--sh-wrap);
        margin-inline: auto;
        padding-inline: calc(var(--sh-gutter) - 12px);
    }

    #header .sh-nav-mark {
        display: flex;
        align-items: center;
        color: var(--sh-timber);
        font: 400 15px var(--sh-serif);
        user-select: none;
    }
}

/* Smaller laptops: tighter rows, same structure. */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .sh-utility__links {
        gap: 20px;
    }

    .sh-main__inner {
        gap: 32px;
        min-height: 80px;
    }

    .sh-brand img {
        width: 232px;
    }

    #header .navbar-nav .nav-link {
        font-size: 17px !important;
    }
}

/* ---------- Tablets and phones ---------- */

@media (max-width: 991.98px) {
    :root {
        --sh-gutter: 16px;
    }

    .sh-main,
    .sh-utility__links,
    .sh-utility__address {
        display: none;
    }

    .sh-utility__inner {
        min-height: 44px;
        gap: 12px;
    }

    .sh-utility__visit {
        flex: 1;
    }

    .sh-utility__call {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        min-height: 44px;
        color: var(--sh-timber) !important;
        font-size: 14px;
        font-weight: 600;
        font-variant-numeric: tabular-nums;
        white-space: nowrap;
    }

    .sh-utility__call i {
        font-size: 12px;
    }

    /* One 60px sticky bar: menu, wordmark, search. */
    #header .navbar .container-fluid {
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }

    #header .mobile-top-actions {
        display: grid !important;
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        align-items: center;
        min-height: 60px;
        padding: 0 !important;
        gap: 8px;
    }

    #header .mobile-top-actions .navbar-toggler,
    #header .mobile-top-actions .mobile-search-icon {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 44px !important;
        height: 44px !important;
        margin: 0 !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        color: var(--sh-text) !important;
        font-size: 20px !important;
    }

    #header .mobile-top-actions .navbar-toggler i,
    #header .mobile-top-actions .mobile-search-icon i {
        color: var(--sh-text) !important;
    }

    #header .mobile-top-actions .navbar-toggler:focus-visible,
    #header .mobile-top-actions .mobile-search-icon:focus-visible,
    .sh-mobile-brand:focus-visible {
        outline: 2px solid var(--sh-timber) !important;
        outline-offset: 2px;
    }

    #header .mobile-actions-right {
        display: flex;
        justify-content: flex-end;
        margin: 0 !important;
    }

    .sh-mobile-brand {
        justify-self: center;
        display: block;
        line-height: 0;
    }

    .sh-mobile-brand img {
        display: block;
        width: 172px;
        height: auto;
    }
}

/* Mobile menu panel: same sentence/title case as the desktop navigation, readable size. */
.mobile-canvas .mobile-nav-section {
    text-transform: none !important;
    letter-spacing: 0 !important;
    font: 600 14px var(--sh-sans) !important;
    color: #6b645c !important;
}

.mobile-canvas .mobile-accordion__link,
.mobile-canvas .mobile-submenu__link {
    text-transform: none !important;
    letter-spacing: 0 !important;
    font-family: var(--sh-sans) !important;
    font-size: 16px !important;
    font-weight: 500 !important;
}

.mobile-canvas .mobile-submenu__link {
    font-size: 15px !important;
    font-weight: 400 !important;
}

@media (min-width: 992px) {
    .sh-mobile-brand {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sh-utility a,
    .sh-search,
    #header .navbar-nav .nav-link {
        transition: none !important;
    }
}
