/* HAN Header */
.han-header {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    background: var(--han-neutral-800);
    color: var(--han-neutral-100);
    min-height: 3.75rem;
    z-index: 100;

    @media (width >=1080px) {
        min-height: 4.75rem;
    }

    /* Skiplink */
    .han-header-skiplink {
        position: fixed;
        top: 0.5rem;
        left: 0.5rem;
        padding: 1rem 2rem;
        color: var(--han-neutral-100);
        background: var(--han-color-brand);
        transform: translateY(-150%);

        &:focus {
            transform: translateY(0);
            outline: 2px solid var(--han-neutral-100);
            outline-offset: -4px;
        }
    }

    /* Logo */
    .han-header-logo {
        display: flex;

        &:focus-visible {
            outline: 2px solid var(--han-neutral-100);
            outline-offset: 8px;
        }

        @media (width < 1080px) {
            margin: 0.8125rem 0;

            svg {
                width: 66px;
            }
        }
    }

    /* Open/close buttons */
        .han-header-menu-open,
        .han-header-menu-close {
            position: absolute;
            top: 0;
            display: flex;
            padding: 1.25rem;
            border: none;
            color: var(--han-neutral-100);
            font-size: 1.25rem;
            cursor: pointer;

            &:focus-visible {
                outline: 2px solid var(--han-neutral-100);
                outline-offset: -4px;
            }

            @media (width >=1080px) {
                display: none;
            }
        }

        .han-header-menu-open {
            left: 0;
            background: var(--han-neutral-600);
        }

        .han-header-menu-close {
            right: 0;
            background: transparent;
        }

    /* Menu container */
    .han-header-menu {
        display: flex;

        @media (width < 1080px) {
            justify-content: center;

            .han-header-menu-content {
                width: 100%;
            }

            &:not(.is-open) .han-header-menu-content {
                display: none;
            }

            &.is-open {
                flex-direction: column;
                align-items: center;
                justify-content: flex-start;
                position: fixed;
                inset: 0;
                background: var(--han-neutral-800);
                overflow: auto;
            }
        }

        @media (width >=1080px) {
            gap: 1rem;
            align-items: center;
            justify-content: space-between;
        }

        /* Menu items list */
        .han-header-menu-items {
            display: flex;
            flex-wrap: wrap;
            margin: 0;
            padding: 0;
            list-style: none;

            @media (width < 1080px) {
                flex-direction: column;
                width: 100%;
                padding: 0 1.5rem 5rem;
            }
        }

        /* Menu item */
        .han-header-menu-item {
            position: relative;
            display: flex;

            @media (width < 1080px) {
                flex-direction: column;
                border-bottom: 1px solid var(--han-neutral-600);

                &:first-child {
                    border-top: 1px solid var(--han-neutral-600);
                }
            }

            &.line-left {
                @media (width >=1080px) {
                    border-left: 1px solid var(--han-neutral-600);
                }
            }

            &.is-open {
                .han-header-submenu-items {
                    display: flex;
                }

                @media (width < 1080px) {
                    .icon-chevron-down {
                        transform: rotate(180deg);
                    }
                }

                @media (width >=1080px) {
                    button {
                        color: var(--han-neutral-800);
                        background: var(--han-neutral-100);
                    }
                }
            }

            &:last-child .han-header-submenu-items {
                right: 0;
                left: auto;
            }

            /* Link/button */
            .han-header-menu-link-button {
                display: flex;
                align-items: center;
                gap: 0.5rem;
                padding: 1rem 0;
                background: transparent;
                border: none;
                color: inherit;
                font-weight: var(--font-weight-semi-bold);
                text-decoration: none;
                cursor: pointer;
                transition: background-color .1s, color .1s;

                &:hover,
                &:focus-visible {
                    text-decoration: underline;
                }

                &:focus-visible {
                    outline: 2px solid var(--han-neutral-100);
                    outline-offset: 4px;
                }

                @media (width < 1080px) {
                    span:has(.icon-chevron-down) {
                        display: flex;
                        justify-content: center;
                        align-items: center;
                        margin-left: auto;
                        padding: 0.5rem;
                        background: var(--han-neutral-700);

                        .icon-chevron-down {
                            transition: transform .2s;
                        }
                    }
                }

                @media (width >=1080px) {
                    padding: 1.6875rem 1.25rem;
                    font-size: 1rem;

                    .icon-chevron-down {
                        width: .75rem;
                        height: .75rem;
                    }

                    &:hover {
                        color: var(--han-neutral-800);
                        background: var(--han-neutral-100);
                    }

                    &:focus-visible {
                        outline-offset: -4px;
                    }

                    .is-open & {
                        &:focus-visible {
                            outline-color: var(--han-neutral-800);
                        }
                    }
                }
            }

            /* Submenu */
            .han-header-submenu-items {
                display: none;
                flex-direction: column;
                margin: 0;
                padding: 0;
                list-style: none;

                @media (width < 1080px) {
                    padding-bottom: 1rem;
                }

                @media (width >=1080px) {
                    position: absolute;
                    top: 100%;
                    left: 0;
                    min-width: 100%;
                    width: max-content;
                    max-width: 15.625rem;
                    color: var(--han-neutral-800);
                    background: var(--han-neutral-100);
                    box-shadow: 0 4px 4px rgba(0, 0, 0, .1);
                }

                .han-header-submenu-item {
                    @media (width >=1080px) {
                        &:not(:last-child) {
                            border-bottom: 1px solid var(--han-neutral-300);
                        }
                    }
                }

                .han-header-submenu-link {
                    display: flex;
                    align-items: center;
                    gap: .5rem;
                    padding: .5rem;
                    font: 400 1rem/1.4 inherit;
                    text-decoration: none;
                    color: inherit;

                    &:hover,
                    &:focus-visible {
                        text-decoration: underline;
                    }

                    &:focus-visible {
                        outline: 2px solid var(--han-neutral-100);
                        outline-offset: 4px;
                    }

                    @media (width < 1080px) {
                        color: var(--han-neutral-100);
                    }

                    @media (width >=1080px) {
                        padding: 1rem 1.5rem;
                        font-size: .875rem;
                        font-weight: 600;

                        &:hover,
                        &:focus-visible {
                            background: var(--han-neutral-300);
                        }

                        &:focus-visible {
                            outline: 2px solid var(--han-neutral-800);
                            outline-offset: -4px;
                        }
                    }
                }
            }
        }
    }
}

/* HAN Hero */
.han-hero {
    &:not(:has(.han-hero-image)) {
        margin-top: 2rem;
    }

    &:has(.han-hero-image) {
        display: grid;
        align-items: end;
    }

    .han-hero-image,
    .han-hero-breadcrumb-container {
        grid-area: 1 / 1;
    }

    .han-hero-image {
        display: block;
        width: 100%;
        height: 25rem;
        object-fit: cover;
    }

    .han-hero-breadcrumb-container {
        position: relative;
        color: var(--han-neutral-100);
        padding: 1.5rem 0 5rem 0;
        overflow: hidden;
        background-color: rgba(0, 0, 0, 0.5);

        .han-container, .container {
            position: relative;

            &::after {
                content: "";
                position: absolute;
                top: calc(100% + 1.5rem);
                right: -3rem;
                left: -3rem;
                bottom: -5rem;
                background-color: var(--han-neutral-100);
            }
        }
    }
}

@media (max-width: 576px) {
    .han-hero {
        .han-hero-image {
            height: 10rem;
        }

        .han-hero-breadcrumb-container {
            padding-bottom: 2rem;
        }
    }
}