/* ==== MASTHEAD ==== */
/* Depends only on ui-base.css and resets what it needs at zero specificity
   so it stays correct regardless of component load order. */
.mh-bar,
.mh,
.mh-panel {
    font-family: var(--ff-sans);
    font-size: var(--fs-ui);
    font-weight: 400;
    line-height: 1.5;
    color: var(--c-ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:where(.mh-bar, .mh, .mh-panel) :is(p, ul) {
    margin: 0;
}

:where(.mh, .mh-panel) ul {
    padding: 0;
    list-style: none;
}

:where(.mh-bar, .mh, .mh-panel) :is(img, svg) {
    display: block;
    max-width: 100%;
}

:where(.mh-bar, .mh, .mh-panel) button {
    font: inherit;
    color: inherit;
    cursor: pointer;
    background: none;
    border: 0;
    padding: 0;
}

:where(.mh, .mh-panel) [hidden],
.mh-panel[hidden] {
    display: none !important;
}

.mh__cta,
.mh-panel__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: var(--control-h);
    padding: 0 var(--s-3);
    border-radius: var(--radius);
    background: var(--c-ink);
    font-size: var(--fs-small);
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    touch-action: manipulation;
    transition: background-color 0.15s var(--ease);
}

:where(.mh, .mh-panel) :is(.mh__cta, .mh__cta:hover, .mh-panel__cta, .mh-panel__cta:hover) {
    color: var(--c-canvas);
}

.mh__cta:hover,
.mh-panel__cta:hover {
    background: var(--c-ink-hover);
}

.mh__cta:active,
.mh-panel__cta:active {
    transform: translateY(1px);
}

.mh-panel__cta {
    padding: 0 14px;
    font-size: var(--fs-ui);
}

.mh-bar {
    background-color: var(--c-bar);
    background-image: var(--g-bar);
    color: var(--c-ink);
    font-size: var(--fs-small);
    line-height: 1.4;
}

.mh-bar__inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: var(--s-2) var(--s-7);
}

.mh-bar__text {
    text-align: center;
}

.mh-bar__link {
    margin-left: var(--s-2);
    text-underline-offset: 3px;
}

.mh-bar__close {
    position: absolute;
    right: var(--s-2);
    top: 50%;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    transform: translateY(-50%);
    border-radius: var(--radius-nav);
}

.mh-bar__close:hover {
    background: rgba(255, 255, 255, 0.45);
}

@media (max-width: 767px) {
    .mh-bar {
        font-size: var(--fs-label);
        line-height: 1.35;
    }

    .mh-bar__inner {
        min-height: 0;
        padding: 6px var(--s-6) 6px var(--s-3);
        justify-content: flex-start;
    }

    .mh-bar__text {
        text-align: left;
    }

    .mh-bar__link {
        margin-left: var(--s-1);
        white-space: nowrap;
    }

    .mh-bar__close {
        right: var(--s-1);
        width: 28px;
        height: 28px;
    }

    .mh-bar__close svg {
        width: 12px;
        height: 12px;
    }
}

.mh {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--c-canvas);
}

.mh__inner {
    display: flex;
    align-items: center;
    gap: var(--s-5);
    height: var(--mh-height);
    padding-inline: var(--s-4);
}

.mh__logo {
    flex: none;
    padding-inline: var(--s-1);
}

.mh-nav {
    display: none;
}

.mh-nav__list {
    display: flex;
    align-items: center;
}

.mh-nav__item--dropdown {
    display: flex;
    align-items: center;
    margin-right: var(--s-1);
    padding-right: var(--s-2);
    border-radius: var(--radius-nav);
    transition: background-color 0.15s var(--ease);
}

.mh-nav__item--dropdown:hover,
.mh-nav__item--dropdown:focus-within,
.mh-nav__item--dropdown:has(.mh-nav__toggle[aria-expanded='true']) {
    background: var(--c-tint);
}

.mh-nav__link,
.mh__link {
    display: inline-flex;
    align-items: center;
    min-height: var(--control-h);
    padding: 0 var(--s-3);
    border-radius: var(--radius-nav);
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.15s var(--ease);
}

.mh-nav__item--dropdown .mh-nav__link {
    padding-right: 2px;
}

.mh-nav__link:hover,
.mh__link:hover {
    background: var(--c-tint);
}

.mh-nav__item--dropdown .mh-nav__link:hover {
    background: transparent;
}

.mh-nav__toggle {
    display: grid;
    place-items: center;
    width: 20px;
    height: var(--control-h);
    color: var(--c-ink-mute);
}

.mh-nav__toggle .icon {
    transition: transform 0.2s var(--ease);
}

.mh-nav__toggle[aria-expanded='true'] .icon {
    transform: rotate(180deg);
}

.mh__actions {
    display: flex;
    align-items: center;
    gap: var(--s-1);
    margin-left: auto;
}

.mh__cta {
    margin-left: var(--s-2);
}

.mh__link {
    display: none;
}

.mh__lang {
    font-family: var(--ff-mono);
    font-size: var(--fs-label);
    letter-spacing: 0.05em;
}

.mh__burger {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-left: var(--s-1);
    border-radius: var(--radius-nav);
}

.mh-mega {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--c-canvas);
    border-bottom: 1px solid var(--c-line);
    animation: ui-fade 0.15s var(--ease);
}

.mh-mega__inner {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: var(--s-7);
    padding: var(--s-6) var(--container-pad) var(--s-7);
}

.mh-mega__intro {
    display: grid;
    align-content: start;
    justify-items: start;
    gap: var(--s-3);
}

.mh-mega__title {
    font-size: var(--fs-h4);
    line-height: 1;
    letter-spacing: -0.02em;
}

.mh-mega__desc {
    font-family: var(--ff-serif);
    font-weight: 300;
    color: var(--c-ink);
}

.mh-mega__grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--s-1) var(--s-5);
}

.mh-mega__item {
    display: grid;
    gap: 2px;
    padding: var(--s-3);
    border-radius: var(--radius-nav);
    text-decoration: none;
    transition: background-color 0.15s var(--ease);
}

.mh-mega__item:hover {
    background: var(--c-tint);
}

.mh-mega__more {
    font-size: var(--fs-small);
    text-decoration: underline;
    text-decoration-color: var(--c-line-strong);
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: text-decoration-color 0.15s var(--ease);
}

.mh-mega__more:hover {
    text-decoration-color: currentColor;
}

.mh-mega__hint {
    font-size: var(--fs-small);
    color: var(--c-ink-2);
}

.mh-panel {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: flex;
    flex-direction: column;
    background: var(--c-canvas);
    overflow-y: auto;
    overscroll-behavior: contain;
    animation: ui-fade 0.15s var(--ease);
}

.mh-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--mh-height);
    padding-inline: var(--s-4);
}

.mh-panel__close {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
}

.mh-panel__nav {
    display: grid;
    padding: var(--s-3) var(--gutter);
}

.mh-panel__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.mh-panel__link {
    display: block;
    padding: var(--s-4) 0;
    font-size: var(--fs-h4);
    line-height: 1;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.mh-panel__row .mh-panel__link {
    flex: 1;
}

.mh-panel__toggle {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
}

.mh-panel__toggle .icon {
    transition: transform 0.2s var(--ease);
}

.mh-panel__toggle[aria-expanded='true'] .icon {
    transform: rotate(180deg);
}

.mh-panel__sub {
    display: grid;
    gap: var(--s-1);
    padding-bottom: var(--s-4);
}

.mh-panel__sub a {
    display: block;
    padding: var(--s-2) 0;
    color: var(--c-ink-2);
    text-decoration: none;
}

.mh-panel__foot {
    display: grid;
    gap: var(--s-3);
    margin-top: auto;
    padding: var(--s-5) var(--gutter) var(--s-6);
}

.mh-panel__secondary {
    color: var(--c-ink-2);
    text-decoration: none;
}

/* Tablet keeps the burger for the nav but shows the action links. */
@media (min-width: 768px) {
    .mh__link {
        display: inline-flex;
    }
}

@media (min-width: 1024px) {
    .mh-nav {
        display: block;
    }

    .mh__burger {
        display: none;
    }

    .mh-panel {
        display: none !important;
    }
}

@media (max-width: 1023px) {
    .mh-mega {
        display: none !important;
    }
}

@media (max-width: 359px) {
    .mh__cta {
        display: none;
    }
}
