/**
 * Site Header Styles
 *
 * Global header used across the site. Two-column layout: logo on the left,
 * contact info on the top-right with the primary navigation directly below.
 * White background, responsive across desktop, tablet and mobile.
 *
 * @package ACF Child Theme
 */

:root {
    --color-primary: #3a9bf7;
    --color-grey: #f3f3f3;
    --color-text: #252525;
    --color-white: #ffffff;
    --font-primary: 'Montserrat', sans-serif;
}

/* Skip link
   ========================================================================== */
.skip-link.screen-reader-text {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link.screen-reader-text:focus {
    position: absolute;
    left: 16px;
    top: 16px;
    width: auto;
    height: auto;
    padding: 8px 16px;
    background: var(--color-white, #ffffff);
    color: var(--color-text, #252525);
    z-index: 10000;
}

/* Header shell
   ========================================================================== */
.site-header {
    position: sticky;
    top: 0;
    width: 100%;
    background-color: var(--color-white, #ffffff);
    color: var(--color-text, #252525);
    font-family: var(--font-primary), 'Montserrat', sans-serif;
    padding: 20px 0;
    z-index: 100;
    will-change: transform, padding;
    transition:
        box-shadow 0.3s ease,
        padding 0.3s ease,
        transform 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Animate the logo and contact details alongside the header compression */
.site-header__logo-image,
.site-header__contact,
.site-header__menu a {
    transition:
        max-height 0.3s ease,
        font-size 0.3s ease,
        opacity 0.3s ease,
        transform 0.3s ease;
}

/* Stuck state: a slight slide-in from above + compact padding + shadow */
.site-header.is-stuck {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    padding: 10px 0;
    animation: site-header-slide-in 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.site-header.is-stuck .site-header__logo-image {
    max-height: 60px;
}

.site-header.is-stuck .site-header__right {
    gap: 8px;
}

@keyframes site-header-slide-in {
    from {
        transform: translateY(-100%);
    }
    to {
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .site-header,
    .site-header__logo-image,
    .site-header__contact,
    .site-header__menu a {
        transition: none;
    }

    .site-header.is-stuck {
        animation: none;
    }
}

/* Offset the sticky header below the WordPress admin bar when present */
.admin-bar .site-header {
    top: 32px;
}

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

.site-header__container {
    max-width: var(--theme-normal-container-max-width, 1290px);
    width: var(--theme-container-width, 100%);
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 40px;
}

/* Logo
   ========================================================================== */
.site-header__logo {
    display: flex;
    align-items: center;
    min-width: 0;
}

.site-header__logo-link {
    display: inline-flex;
    align-items: center;
    line-height: 0;
    text-decoration: none;
    color: inherit;
}

.site-header__logo-image {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 90px;
}

.site-header__sitename {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--color-text, #252525);
    line-height: 1.2;
}

/* Right column
   ========================================================================== */
.site-header__right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 14px;
    min-width: 0;
}

/* Contact row
   ========================================================================== */
.site-header__contact {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 24px;
}

.site-header__contact-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 22px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--color-text, #252525);
}

.site-header__contact-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--color-primary, #3a9bf7);
    flex-shrink: 0;
}

.site-header__contact-icon svg {
    width: 24px;
    height: 24px;
    display: block;
}

.site-header__contact-link {
    color: var(--color-text, #252525);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.25s ease;
}

.site-header__contact-link:hover,
.site-header__contact-link:focus-visible {
    color: var(--color-primary, #3a9bf7);
}

/* Navigation
   ========================================================================== */
.site-header__nav {
    width: auto;
}

.site-header__menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 28px;
}

.site-header__menu li {
    position: relative;
}

.site-header__menu a {
    display: inline-block;
    padding: 6px 0;
    font-family: var(--font-primary), 'Montserrat', sans-serif;
    font-size: 22px !important;
    font-weight: 600;
    line-height: 1.4;
    color: var(--color-text, #252525);
    text-decoration: none;
    transition: color 0.25s ease;
}

.site-header__menu a:hover,
.site-header__menu a:focus-visible,
.site-header__menu .current-menu-item > a,
.site-header__menu .current-menu-ancestor > a,
.site-header__menu .current_page_item > a {
    color: var(--color-primary, #3a9bf7);
}

/* Sub-menus */
.site-header__menu .sub-menu {
    list-style: none;
    margin: 0;
    padding: 8px 0;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 400px;
    background: var(--color-white, #ffffff);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 50;
    border-radius: 10px;
}

.site-header__menu li:hover > .sub-menu,
.site-header__menu li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.site-header__menu .sub-menu a {
    display: block;
    padding: 8px 16px;
    font-size: 15px;
}

/* Mobile toggle
   ========================================================================== */
.site-header__menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    color: var(--color-text, #252525);
}

.site-header__hamburger {
    position: relative;
    display: inline-block;
    width: 26px;
    height: 18px;
}

.site-header__hamburger span {
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    background-color: currentColor;
    border-radius: 2px;
    transition: transform 0.25s ease, opacity 0.2s ease, top 0.25s ease;
}

.site-header__hamburger span:nth-child(1) { top: 0; }
.site-header__hamburger span:nth-child(2) { top: 8px; }
.site-header__hamburger span:nth-child(3) { top: 16px; }

.site-header.is-menu-open .site-header__hamburger span:nth-child(1) {
    top: 8px;
    transform: rotate(45deg);
}

.site-header.is-menu-open .site-header__hamburger span:nth-child(2) {
    opacity: 0;
}

.site-header.is-menu-open .site-header__hamburger span:nth-child(3) {
    top: 8px;
    transform: rotate(-45deg);
}

/* Tablet
   ========================================================================== */
@media (min-width: 769px) and (max-width: 1023px) {
    .site-header {
        padding: 16px 0;
    }

    .site-header__container {
        gap: 24px;
    }

    .site-header__logo-image {
        max-height: 72px;
    }

    .site-header__right {
        gap: 10px;
    }

    .site-header__contact {
        gap: 16px;
    }

    .site-header__contact-item,
    .site-header__menu a {
        font-size: 14px;
    }

    .site-header__menu {
        gap: 18px;
    }
}

/* Mobile
   ========================================================================== */
@media (max-width: 768px) {
    .site-header {
        padding: 12px 0;
    }

    .site-header__container {
        grid-template-columns: auto 1fr;
        align-items: center;
        gap: 12px;
        padding: 0;
    }

    .site-header__logo-image {
        max-height: 56px;
    }

    .site-header__right {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
    }

    .site-header__menu-toggle {
        display: inline-flex;
        align-self: flex-end;
    }

    /* Contact row is hidden on mobile; the menu drawer is the focus */
    .site-header__contact {
        display: none;
    }

    /* Nav drawer acts as a full-width overlay below the header bar */
    .site-header__nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        width: 100%;
        background: var(--color-white, #ffffff);
        box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
        z-index: 99;
        padding: 0 16px;
    }

    .site-header.is-menu-open .site-header__nav {
        max-height: calc(100vh - 100%);
        overflow: auto;
        padding: 8px 16px 20px 16px;
    }

    .site-header__menu {
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
    }

    .site-header__menu li {
        width: 100%;
        border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    }

    .site-header__menu li:last-child {
        border-bottom: 0;
    }

    .site-header__menu a {
        display: block;
        padding: 12px 0;
        font-size: 16px;
        text-align: left;
    }

    .site-header__menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        padding: 0 0 8px 16px;
        background: transparent;
        min-width: 0;
    }
}
