/* ==========================================================
   SITE HEADER & MENU  (markup: includes/header.php)
   Height and colours come from the tokens at the top of base.css
   ========================================================== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--header-height);
    padding: 0 clamp(16px, 5vw, 100px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(20, 33, 61, 0.7);
    z-index: 1000;
    transition: background-color 0.3s;
}


/* ---- Logo ---- */
.site-header .logo {
    display: flex;
    align-items: center;
    height: 100%;
    flex-shrink: 0;
}
.site-header .nav-image {
    display: block;
    height: 40px;
    width: auto;
}

/* Vertical PNG logo (images/logo.png): hangs below the bar as a badge,
   shrinks into the bar on scroll or when the mobile menu is open. */
.site-header.has-badge-logo .logo {
    align-self: flex-start;
    align-items: flex-start;
}
.site-header.has-badge-logo .nav-image {
    height: 120px;
    max-width: 180px;
    object-fit: contain;
    padding: 10px 14px;
    background: #fff;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 4px 10px rgba(20, 33, 61, 0.35);
    transition: height 0.3s, padding 0.3s, box-shadow 0.3s;
}
.site-header.has-badge-logo.scrolled .nav-image,
.site-header.has-badge-logo.active .nav-image {
    height: var(--header-height);
    padding: 6px 4px;
    box-shadow: none;
    border-radius: 0;
}

/* ---- Menu (desktop) ---- */
.site-nav > ul {
    display: flex;
    align-items: center;
    gap: clamp(4px, 1.2vw, 18px);
    margin: 0;
}
.site-header ul li {
    position: relative;
    list-style: none;
}
.site-nav > ul > li > a {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 10px;
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.02em;
    color: #111;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s;
}
/* thin gold underline on hover / current page */
.site-nav > ul > li > a::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 2px;
    height: 2px;
    background: var(--brand);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}
.site-nav > ul > li > a:hover,
.site-nav > ul > li > a.active { color: #000; }
.site-nav > ul > li > a:hover::after,
.site-nav > ul > li > a.active::after,
.site-nav > ul > li:hover > a::after { transform: scaleX(1); }

/* dropdown arrow */
.caret {
    width: 7px;
    height: 7px;
    margin-top: -3px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.2s;
}
.has-children:hover > a .caret,
.has-children.open > a .caret { transform: rotate(225deg); margin-top: 3px; }

/* "Contact Us" as a gold button */
.site-nav > ul > li.nav-button > a {
    margin-left: 6px;
    padding: 10px 22px;
    background: var(--brand);
    color: #111;
    border-radius: 999px;
    font-weight: 600;
    transition: background-color 0.2s, color 0.2s;
}
.site-nav > ul > li.nav-button > a::after { display: none; }
.site-nav > ul > li.nav-button > a:hover,
.site-nav > ul > li.nav-button > a.active { background: #111; color: #fff; }

/* dropdown panel */
.site-header ul li ul {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 240px;
    padding: 10px 0;
    background: #fff;
    border-top: 3px solid var(--brand);
    border-radius: 0 0 8px 8px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}
.site-header ul li:hover > ul,
.site-header ul li.open > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.site-header ul li ul li a {
    display: block;
    padding: 10px 20px;
    font-size: 14.5px;
    color: #222;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s, color 0.15s, padding-left 0.15s;
}
.site-header ul li ul li a:hover,
.site-header ul li ul li a.active {
    background: rgba(var(--brand-rgb), 0.12);
    color: #000;
    padding-left: 26px;
}

/* ---- Burger button (shown on tablets and phones) ---- */
.site-menuToggle {
    display: none;
    border: 0;
    background: none;
}

@media (max-width: 1279px) {
    :root { --header-height: 60px; }

    .site-header.has-badge-logo .nav-image {
        height: 92px;
        max-width: 140px;
        padding: 8px 10px;
    }

    .site-nav {
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
        display: none;
        background-color: #fff;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    }
    .site-header.active .site-nav { display: block; }

    .site-nav > ul { display: block; padding: 6px 0 16px; }
    .site-nav ul li { width: 100%; }
    .site-nav > ul > li { border-bottom: 1px solid #f0ebe0; }
    .site-nav > ul > li > a {
        justify-content: space-between;
        padding: 15px 22px;
        font-size: 16px;
    }
    .site-nav > ul > li > a::after { display: none; }
    .site-nav > ul > li > a.active { color: var(--brand); }

    /* submenus open inline when tapped */
    .site-header ul li ul,
    .site-header ul li:hover > ul {
        position: static;
        display: none;
        min-width: 0;
        padding: 0 0 8px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        background: #faf7f0;
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    .site-header ul li.open > ul { display: block; }
    .has-children:hover > a .caret { transform: rotate(45deg); margin-top: -3px; }
    .has-children.open > a .caret { transform: rotate(225deg); margin-top: 3px; }
    .site-header ul li ul li a { padding: 12px 22px 12px 38px; font-size: 15px; white-space: normal; }
    .site-header ul li ul li a:hover { padding-left: 38px; }

    .site-nav > ul > li.nav-button { border: 0; padding: 16px 22px 0; }
    .site-nav > ul > li.nav-button > a { margin: 0; justify-content: center; }

    .site-menuToggle {
        position: relative;
        width: 40px;
        height: 50px;
        cursor: pointer;
        display: flex;
        justify-content: center;
        align-items: center;
    }
    .site-menuToggle::before,
    .site-menuToggle::after {
        content: '';
        position: absolute;
        left: 0;
        width: 100%;
        height: 3px;
        background: #000;
        transition: transform 0.2s;
    }
    .site-menuToggle::before { transform: translateY(-12px); box-shadow: 0 12px #000; }
    .site-menuToggle::after  { transform: translateY(12px); }
    .site-header.active .site-menuToggle::before { transform: rotate(45deg); box-shadow: 0 0 #000; }
    .site-header.active .site-menuToggle::after  { transform: rotate(315deg); }
}

@media (max-width: 480px) {
    .site-header.has-badge-logo .nav-image {
        height: 80px;
        max-width: 120px;
        padding: 6px 8px;
    }
}
