/* Hamburger */

.menu-handler {
  position: absolute;
  top: calc(0.5 * var(--griditem));
  right: var(--griditem);
  width: 50px;
  height: 50px;
  cursor: pointer;
  z-index: 909;
}

.menu-handler span {
  width: 40px;
  height: 4px;
  background: black;
  position: absolute;
  top: 12px;
  left: 5px;
  transition: 0.2s;
}

.menu-handler span:nth-child(2) {
  top: 33px;
}

body.menu-active .menu-handler span:nth-child(1) {
  transform: rotate(45deg);
  top: 20px;
}

body.menu-active .menu-handler span:nth-child(2) {
  transform: rotate(-45deg);
  top: 20px;
}

/* Menü */

#block-wolff-natursteine-main-menu {
    position: fixed;
    inset: 0;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 90;
    display: none;
    align-items: center;
    justify-content: center;
    padding: clamp(1.25rem, 3vw, 2.5rem);
    box-sizing: border-box;
    background: rgba(233, 234, 239, 0.62);
    backdrop-filter: blur(4px);
    min-height: 100dvh;
}

body.menu-active {
    overflow: hidden;
    height: 100%;
}

body.menu-active #block-wolff-natursteine-main-menu {
    display: flex;
}

header .main-menu-wrap {
    position: relative;
    z-index: 808;
    display: flex;
    flex-direction: column;
    width: min(76vw, 62rem);
    aspect-ratio: 1 / 1;
    min-width: 30rem;
    min-height: 30rem;
    flex-shrink: 0;
    padding: clamp(1.5rem, 4vw, 3rem);
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 1.25rem 4rem rgba(0, 0, 0, 0.08);
}

header .main-menu-wrap > ul:not(.contextual-links) {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    height: 100%;
    min-height: 100%;
    box-sizing: border-box;
    margin: 0;
    padding: clamp(2.75rem, 6vw, 5rem) 0 clamp(1.5rem, 4vw, 2.5rem);
    list-style: none;
    text-align: center;
    gap: clamp(0.1rem, 0.5vw, 0.35rem);
}

header .main-menu-wrap > ul:not(.contextual-links) li {
    width: 100%;
}

header .main-menu-wrap > ul:not(.contextual-links) a {
    position: relative;
    display: inline-grid;
    place-items: center;
    color: black;
    text-decoration: none;
    text-transform: uppercase;
    font-size: clamp(2.75rem, 7.2vw, 6.25rem);
    line-height: 0.92;
    letter-spacing: clamp(0.04em, 0.12vw, 0.08em);
    font-weight: 500;
    cursor: pointer;
    min-height: 1.1em;
    transition: opacity 0.2s ease;
}

header .main-menu-wrap > ul:not(.contextual-links) a span,
header .main-menu-wrap > ul:not(.contextual-links) a em {
    grid-area: 1 / 1;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

header .main-menu-wrap > ul:not(.contextual-links) a em {
    opacity: 0;
    visibility: hidden;
    font-style: italic;
}

header .main-menu-wrap > ul:not(.contextual-links) a:hover span,
header .main-menu-wrap > ul:not(.contextual-links) a:focus-visible span {
    opacity: 0;
    visibility: hidden;
}

header .main-menu-wrap > ul:not(.contextual-links) a:hover em,
header .main-menu-wrap > ul:not(.contextual-links) a:focus-visible em {
    opacity: 1;
    visibility: visible;
}

header .main-menu-wrap > ul:not(.contextual-links) li:last-child {
    margin-top: auto;
    padding-top: clamp(1.75rem, 6vw, 4rem);
}

header .main-menu-wrap > ul:not(.contextual-links) li:last-child a {
    font-size: clamp(1.15rem, 1.9vw, 1.9rem);
    line-height: 1;
    letter-spacing: 0.06em;
    min-height: auto;
    padding-bottom: 0.2em;
    border-bottom: 0.2rem solid transparent;
    transition: border-color 0.2s ease, opacity 0.2s ease;
}

header .main-menu-wrap > ul:not(.contextual-links) li:last-child a:hover,
header .main-menu-wrap > ul:not(.contextual-links) li:last-child a:focus-visible {
    border-bottom-color: currentColor;
}

@media (max-width: 900px) {
    header .main-menu-wrap {
        width: min(88vw, 40rem);
        min-width: 28rem;
        min-height: 28rem;
    }

    header .main-menu-wrap > ul:not(.contextual-links) a {
        font-size: clamp(2.2rem, 9vw, 4.8rem);
    }
}

@media (max-width: 640px) {
    .menu-handler {
        right: calc(0.5 * var(--griditem));
    }

    #block-wolff-natursteine-main-menu {
        padding: 0.75rem;
        align-items: flex-start;
    }

    header .main-menu-wrap {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 100vw;
        height: auto;
        aspect-ratio: auto;
        padding: 1.25rem 1rem 1rem;
    }

    header .main-menu-wrap > ul:not(.contextual-links) {
        height: 100%;
        min-height: 100%;
        padding: 3.5rem 0 0;
        gap: 0.2rem;
    }

    header .main-menu-wrap > ul:not(.contextual-links) a {
        font-size: clamp(1.7rem, 8.4vw, 3rem);
        line-height: 0.95;
        letter-spacing: 0.04em;
    }

    header .main-menu-wrap > ul:not(.contextual-links) li:last-child a {
        font-size: clamp(0.95rem, 4vw, 1.25rem);
    }
}

@media (max-height: 760px) {
    #block-wolff-natursteine-main-menu {
        align-items: flex-start;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    header .main-menu-wrap {
        width: min(76vw, 36rem);
        min-height: 30rem;
    }

    header .main-menu-wrap > ul:not(.contextual-links) a {
        font-size: clamp(2.3rem, 6vw, 4.8rem);
    }
}

@media (max-width: 640px) and (max-height: 760px) {
    header .main-menu-wrap {
        width: 100%;
        min-height: calc(100vw - 60px);
        height: auto;
        aspect-ratio: auto;
    }

    header .main-menu-wrap > ul:not(.contextual-links) a {
        font-size: clamp(1.45rem, 7vw, 2.5rem);
    }
}
