/**
 * The menu has 2 layouts:
 * - default: full page header height block with a full link block width top or bottom border line
 * - simple: Regular link, thick underline on active, focus & hover
 */

.page-header__menu__link {
    line-height: 1.5;
    position: relative;
    display: flex;
    align-items: center;
    text-decoration: none;
    outline-offset: -0.25rem;
}

/* Safari focus outline is further outside then other browsers */
@media not all and (min-resolution: .001dpcm) {
    @media {
        .page-header__menu__link {
            outline-offset: -1rem;
        }
    }
}

@media (max-width: 61.999rem) {
    .page-header__menu__link {
        padding: 1rem 0;
        border-top-width: 0.125rem;
        border-top-style: solid;
        border-left-width: 0.188rem;
        border-left-style: solid;
        border-left-color: transparent;
    }

    .page-header__menu__link:last-child {
        border-bottom-width: 0.125rem;
        border-bottom-style: solid;
    }

    .page-header__menu__text {
        display: flex;
        align-items: center;
        flex-grow: 1;
        margin-left: 1rem;
    }

    .page-header__menu__link-icon {
        width: 1.25rem;
    }

    .page-header__menu__text br {
        display: none;
    }
}

@media (min-width: 62rem) {
    .page-header__menu__link {
        justify-content: center;
        text-align: center;
    }

    .page-header__menu__link::before {
        position: absolute;
        right: 0;
        left: 0;
        box-sizing: content-box;
        content: '';
        transition: transform 100ms cubic-bezier(0.46, 0.03, 0.52, 0.96);
        border-top-width: 0.188rem;
        border-top-style: solid;
        border-right-width: calc(var(--condition-border-vertical__visibility, 0) * 0.063rem);
        border-right-style: solid;
        border-bottom-width: 0.188rem;
        border-bottom-style: solid;
        border-left-width: calc(var(--condition-border-vertical__visibility, 0) * 0.063rem);
        border-left-style: solid;
    }

    .page-header__menu__link:first-child::before {
        border-left-width: calc(var(--condition-border-vertical__visibility, 0) * 0.125rem);
    }

    .page-header__menu__link:last-child::before {
        border-right-width: calc(var(--condition-border-vertical__visibility, 0) * 0.125rem);
    }

    .page-header__menu__text {
        z-index: 1;
        display: flex;
        flex-direction: column;
        justify-content: center;
        width: 100%;
        height: 100%;
        padding-top: 0;
        padding-bottom: 0;
        border-inline-end-width: 0.063rem;
        border-inline-end-style: solid;
        border-left-width: 0.063rem;
        border-left-style: solid;
    }

    .page-header__menu__link:first-child .page-header__menu__text {
        border-left-width: 0.125rem;
    }

    .page-header__menu__link:last-child .page-header__menu__text {
        border-right-width: 0.125rem;
    }

    .page-header__menu__link-icon {
        display: none;
    }
}

/* Simple layout */
.page-header__menu__link--simple:active,
.page-header__menu__link--simple:focus,
.page-header__menu__link--simple:hover,
.page-header__menu__link--simple[aria-current="page"] {
    text-decoration: underline;
    text-decoration-thickness: 0.188rem;
    text-underline-offset: 0.375rem;
}

/* Responsive */
@media (max-width: 61.999rem) {
    .page-header__menu__link--simple {
        padding: 0.75rem 0;
    }

    .page-header__menu__link--simple .page-header__menu__text {
        margin-left: 0;
    }
}
