/* Directors' Library header
 * A single, self-contained component. It deliberately avoids the theme's
 * legacy .main-header/.main-menu/.other-options selectors. */
.dl-site-header,
.dl-site-header * {
    box-sizing: border-box;
}

.dl-site-header {
    position: relative;
    z-index: 101;
    width: 100%;
    margin: 10px 0 0;
    padding: 19.27px 0;
    background: #fff;
}

.dl-site-header__inner {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(30px, 5vw, 78px);
    width: 100%;
    max-width: 1090px;
    min-height: 39px;
    margin: 0 auto;
    padding: 0 16px;
}

.dl-site-header__brand,
.dl-site-header__brand a {
    display: flex;
    align-items: center;
    width: 52px;
    margin: 0;
    padding: 0;
}

.dl-site-header__brand img.custom-logo {
    display: block;
    width: 52px;
    max-width: 52px;
    height: auto;
    aspect-ratio: auto;
}

.dl-site-header__nav,
.dl-site-header__nav > div {
    min-width: 0;
}

.dl-site-header__menu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(16px, 2.25vw, 40px);
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.dl-site-header__menu li {
    margin: 0;
    padding: 0;
    list-style: none;
}

.dl-site-header__menu a {
    display: block;
    color: #828282;
    font-family: 'Neue Haas Unica', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 21px;
    letter-spacing: 0.01em;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}

.dl-site-header__menu a:hover,
.dl-site-header__menu a:focus-visible,
.dl-site-header__menu .current-menu-item > a,
.dl-site-header__menu .current-menu-ancestor > a {
    color: #1a1919;
}

.dl-site-header__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 48px;
}

.dl-site-header__search,
.dl-site-header__menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    margin: 0;
    padding: 0;
    color: #1a1919;
    border: 0;
    border-radius: 0;
    background: transparent;
    appearance: none;
    -webkit-appearance: none;
}

.dl-site-header__search {
    width: 22px;
    height: 22px;
}

.dl-site-header__search svg {
    display: block;
    width: 22px;
    height: 22px;
    overflow: visible;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.4;
    stroke-linecap: round;
}

.dl-site-header__search:hover,
.dl-site-header__search:focus-visible,
.dl-site-header__search[aria-expanded="true"] {
    color: #828282;
}

.dl-site-header__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 39px;
    margin: 0;
    padding: 9px 16px;
    color: #1a1919;
    border-radius: 4px;
    background: #ededed;
    font-family: 'Neue Haas Unica', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 21px;
    letter-spacing: 0.01em;
    text-decoration: none;
    text-transform: uppercase;
    white-space: nowrap;
}

.dl-site-header__submit:hover,
.dl-site-header__submit:focus-visible {
    color: #1a1919;
    background: #d9d9d9;
}

.dl-site-header__menu-toggle {
    display: none;
    position: relative;
    width: 33px;
    height: 22px;
}

.dl-site-header__menu-toggle span {
    position: absolute;
    left: 0;
    display: block;
    width: 33px;
    height: 2px;
    background: #1a1919;
    transform-origin: center;
    transition: transform 160ms ease, top 160ms ease;
}

.dl-site-header__menu-toggle span:first-child {
    top: 4px;
}

.dl-site-header__menu-toggle span:last-child {
    top: 16px;
}

.dl-site-header__menu-toggle[aria-expanded="true"] span:first-child {
    top: 10px;
    transform: rotate(45deg);
}

.dl-site-header__menu-toggle[aria-expanded="true"] span:last-child {
    top: 10px;
    transform: rotate(-45deg);
}

/* Existing search and mobile-menu content is retained, but opening it is now
 * controlled by the new component rather than the legacy header handlers. */
.search-results-custom.is-open,
.dl-mobile-panel.is-open {
    display: block !important;
}

.blur-back > .search-results-custom {
    top: 100%;
}

@media screen and (max-width: 1200px) {
    .dl-site-header {
        height: 66px;
        min-height: 66px;
        margin: 0;
        padding: 0;
    }

    .dl-site-header__inner {
        display: flex;
        justify-content: space-between;
        gap: 24px;
        height: 66px;
        min-height: 66px;
        max-width: none;
        padding: 0 20px;
    }

    .dl-site-header__nav,
    .dl-site-header__submit {
        display: none;
    }

    .dl-site-header__actions {
        gap: 24px;
        margin-left: auto;
    }

    .dl-site-header__menu-toggle {
        display: inline-flex;
    }

    .blur-back > .search-results-custom {
        top: 66px;
    }

    .dl-mobile-panel {
        position: fixed;
        z-index: 100;
        top: 66px;
        right: 0;
        bottom: 0;
        left: 0;
        height: auto;
        margin: 0;
        padding-bottom: 80px;
        overflow-x: hidden;
        overflow-y: auto;
        background: #fff;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    .dl-mobile-panel__menu {
        display: flex;
        flex-direction: column;
        gap: 24px;
        margin: 0;
        padding: 56px 20px 0;
        list-style: none;
    }

    .dl-mobile-panel__menu li {
        margin: 0;
        padding: 0;
        list-style: none;
    }

    .dl-mobile-panel__menu a {
        display: block;
        width: 100%;
        color: #1a1919;
        font-family: 'Neue Haas Unica', sans-serif;
        font-size: 16px;
        font-weight: 400;
        line-height: 21px;
        letter-spacing: 0.01em;
        text-decoration: none;
        text-transform: uppercase;
    }

    body.admin-bar .dl-mobile-panel,
    body.admin-bar .search-results-custom {
        top: 98px;
    }
}

@media screen and (max-width: 782px) {
    body.admin-bar .dl-mobile-panel,
    body.admin-bar .search-results-custom {
        top: 112px;
    }
}
