/* ===== Navigation ===== */

.nav-root,
.nav-root ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav-root a {
    display: inline-block;
    line-height: 1.15;
    transition: color 180ms ease, opacity 180ms ease, transform 180ms ease;
}

.nav-root > li {
    position: relative;
    z-index: 1;
    width: fit-content;
    margin-bottom: var(--nav-l1-gap);
}

.nav-root > li:last-child {
    margin-bottom: 0;
}

.nav-root > li > a {
    position: relative;
    z-index: 1;
    font-size: var(--nav-l1-size);
    font-weight: 500;
    letter-spacing: 0.05em;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    white-space: nowrap;
}

.nav-root > li > .sub-menu {
    position: absolute;
    top: 0;
    left: var(--nav-l1-to-l2);
    z-index: 20;
    display: none;
    min-width: 160px;
    white-space: nowrap;
}

.nav-root > li > .sub-menu > li {
    position: relative;
    z-index: 21;
    width: max-content;
    margin-bottom: 8px;
}

.nav-root > li > .sub-menu > li:last-child {
    margin-bottom: 0;
}

.nav-root > li > .sub-menu > li > a {
    font-size: var(--nav-l2-size);
    font-weight: 500;
    color: #8a8a8a;
}

.nav-root > li > .sub-menu > li > .sub-menu {
    position: absolute;
    top: 0;
    left: calc(100% + 32px);
    z-index: 30;
    display: none;
    min-width: 180px;
    white-space: nowrap;
}

.nav-root > li > .sub-menu > li > .sub-menu > li {
    margin-bottom: 8px;
}

.nav-root > li > .sub-menu > li > .sub-menu > li:last-child {
    margin-bottom: 0;
}

.nav-root > li > .sub-menu > li > .sub-menu > li > a {
    font-size: var(--nav-l3-size);
    color: #8a8a8a;
    white-space: nowrap;
}

.nav-root > li.current-menu-item > a,
.nav-root > li.current-menu-ancestor > a,
.nav-root > li > .sub-menu > li.current-menu-item > a,
.nav-root > li > .sub-menu > li.current-menu-ancestor > a,
.nav-root > li > .sub-menu > li > .sub-menu > li.current-menu-item > a,
.nav-root > li > .sub-menu > li > .sub-menu > li.current-menu-ancestor > a {
    color: #000;
    font-weight: 900;
}

.nav-root > li.current-menu-item > .sub-menu,
.nav-root > li.current-menu-ancestor > .sub-menu,
.nav-root > li > .sub-menu > li.current-menu-item > .sub-menu,
.nav-root > li > .sub-menu > li.current-menu-ancestor > .sub-menu {
    display: block;
}

.nav-root a:hover {
    opacity: 0.9;
}

.nav-root > li > .sub-menu > li > a:hover,
.nav-root > li > .sub-menu > li > .sub-menu > li > a:hover {
    transform: translateX(2px);
}

/* ===== Generic Content ===== */

.entry-title {
    margin-bottom: 24px;
}

.entry-content {
    max-width: 900px;
}

/* ===== Standort Page ===== */

.standort-page {
    display: grid;
    grid-template-columns: minmax(360px, 0.7fr) minmax(360px, 0.95fr);
    align-items: end;
    column-gap: clamp(30px, 4vw, 80px);
    margin-left: clamp(-10vw, -8vw, -4vw);
    font-size: 32px;
}

.standort-page__map img {
    display: block;
    width: min(100%, 760px);
    height: auto;
}

.standort-page__right {
    display: flex;
    align-items: flex-end;
    min-height: 100%;
    padding-top: clamp(140px, 18vh, 300px);
}

.standort-page__info {
    display: grid;
    grid-template-columns: auto auto auto;
    align-items: start;
    column-gap: clamp(24px, 4.5vw, 150px);
}

@media (max-width: 1350px) {
    .standort-page {
        grid-template-columns: minmax(300px, 1fr) minmax(320px, 0.95fr);
        margin-left: clamp(-6vw, -4vw, -2vw);
    }

    .standort-page__labels p,
    .standort-page__values p,
    .standort-page__note p {
        font-size: clamp(14px, 1.35vw, 24px);
    }
}

@media (max-width: 1180px) {
    .standort-page {
        grid-template-columns: 1fr 1fr;
        align-items: center;
        margin-left: 0;
    }

    .standort-page__map img {
        width: min(100%, 620px);
    }

    .standort-page__right {
        padding-top: 120px;
    }

    .standort-page__note {
        padding-top: 130px;
    }
}

@media (max-width: 1100px) {
    .standort-page {
        grid-template-columns: 1fr;
        align-items: start;
        row-gap: 48px;
        margin-left: 0;
    }

    .standort-page__header {
        margin-bottom: 40px;
    }

    .standort-page__left {
        width: 100%;
    }

    .standort-page__map img {
        width: min(100%, 760px);
        max-width: 100%;
    }

    .standort-page__right {
        align-items: flex-start;
        min-height: auto;
        padding-top: 0;
    }

    .standort-page__info {
        grid-template-columns: auto auto;
        column-gap: 28px;
        row-gap: 0;
    }

    .standort-page__note {
        grid-column: 2;
        padding-top: 0;
    }

    .standort-page__labels p,
    .standort-page__values p,
    .standort-page__note p {
        font-size: clamp(14px, 2vw, 22px);
    }
}

@media (max-width: 700px) {
    .standort-page {
        row-gap: 0;
    }

    .standort-page__header {
        margin-bottom: 28px;
    }

    .standort-page__info {
        row-gap: 16px;
    }

    .standort-page__labels,
    .standort-page__note {
        padding-top: 0;
    }

    .standort-page__note {
        grid-column: auto;
    }

    .standort-page__values p,
    .standort-page__note p {
        white-space: normal;
    }
}

/* ===== Video Page ===== */

.video-page {
    display: flex;
    align-items: end;
    justify-content: center;
}

.video-page__frame {
    display: flex;
    align-items: center;
    justify-content: center;
    width: min(100%, 1180px);
    aspect-ratio: 1180 / 845;
    overflow: hidden;
}

.video-page__embed {
    width: 100%;
    height: 100%;
}

.video-page__embed video,
.video-page__embed iframe,
.video-page__embed .wp-block-video,
.video-page__embed .wp-block-video video,
.video-page__embed .wp-block-embed,
.video-page__embed .wp-block-embed iframe {
    display: block;
    width: 100%;
    height: 100%;
}

@media (max-width: 1450px) and (min-width: 1351px) {
    .video-page__frame {
        width: min(100%, 920px);
    }
}

@media (max-width: 1350px), (max-height: 820px) {
    .video-page__frame {
        width: min(100%, 650px);
    }
}

@media (max-width: 1180px), (max-height: 740px) {
    .video-page__frame {
        width: min(100%, 820px);
    }
}

/* ===== Product Gallery ===== */

.product-gallery {
    --gallery-cols: 1;
    --gallery-item-min-height: 420px;
    --gallery-image-max-height: 700px;

    display: grid;
    grid-template-columns: repeat(var(--gallery-cols), minmax(0, 1fr));
    width: 100%;
}

.product-gallery__item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--gallery-item-min-height);
    padding: clamp(20px, 2vw, 40px);
    overflow: hidden;
}

.product-gallery__item img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: var(--gallery-image-max-height);
    object-fit: contain;
}

.product-gallery--single {
    --gallery-cols: 1;
    --gallery-item-min-height: 820px;
    --gallery-image-max-height: 1030px;
}

.product-gallery--stack-2 {
    --gallery-cols: 1;
    --gallery-item-min-height: 410px;
    --gallery-image-max-height: 515px;
}

.product-gallery--cols-3 {
    --gallery-cols: 3;
    --gallery-item-min-height: 820px;
    --gallery-image-max-height: 1030px;
}

.product-gallery--grid-2x2 {
    --gallery-cols: 2;
    --gallery-item-min-height: 410px;
    --gallery-image-max-height: 515px;
}

.product-gallery--grid-3x2 {
    --gallery-cols: 3;
    --gallery-item-min-height: 410px;
    --gallery-image-max-height: 515px;
}

.product-gallery--grid-3x3 {
    --gallery-cols: 3;
    --gallery-item-min-height: 275px;
    --gallery-image-max-height: 345px;
}

.product-gallery--tall .product-gallery__item img {
    max-height: 88%;
}

/* ===== Product Page Layout ===== */

.product-page-content {
    width: 100%;
}

.product-page-content--with-intro {
    display: flex;
    align-items: flex-start;
    gap: 48px;
}

.product-page-intro {
    flex: 0 0 360px;
    max-width: 360px;
    padding-top: clamp(160px, 18vw, 310px);
}

.product-page-intro__text {
    transform: translateX(calc(-1 * var(--sidebar-width) + 100px));
    font-size: clamp(16px, 1.2vw, 20px);
    line-height: 1.35;
}

.product-page-intro__text > *:last-child {
    margin-bottom: 0;
}

.product-page-content--with-intro .product-gallery {
    flex: 1;
    min-width: 0;
}

@media (max-width: 1200px) {
    .product-page-content--with-intro {
        gap: 32px;
    }

    .product-page-intro {
        flex: 0 0 300px;
        max-width: 300px;
        padding-top: 120px;
    }

    .product-page-intro__text {
        transform: none;
        margin-left: 0;
        font-size: 18px;
    }
}

@media (max-width: 1550px), (max-height: 900px) {
    .product-gallery--single,
    .product-gallery--cols-3 {
        --gallery-item-min-height: 700px;
        --gallery-image-max-height: 880px;
    }

    .product-gallery--stack-2,
    .product-gallery--grid-2x2,
    .product-gallery--grid-3x2 {
        --gallery-item-min-height: 350px;
        --gallery-image-max-height: 440px;
    }

    .product-gallery--grid-3x3 {
        --gallery-item-min-height: 235px;
        --gallery-image-max-height: 295px;
    }
}

@media (max-width: 1350px), (max-height: 820px) {
    .product-gallery--single,
    .product-gallery--cols-3 {
        --gallery-item-min-height: 600px;
        --gallery-image-max-height: 754px;
    }

    .product-gallery--stack-2,
    .product-gallery--grid-2x2,
    .product-gallery--grid-3x2 {
        --gallery-item-min-height: 300px;
        --gallery-image-max-height: 377px;
    }

    .product-gallery--grid-3x3 {
        --gallery-item-min-height: 200px;
        --gallery-image-max-height: 251px;
    }
}

@media (max-width: 1350px) and (min-width: 1181px) {
    .product-page-content {
        width: 88%;
        margin-left: 12%;
    }

    .product-page-content--with-intro {
        gap: 36px;
    }

    .product-page-intro {
        flex: 0 0 300px;
        max-width: 300px;
        padding-top: 180px;
    }

    .product-page-intro__text {
        transform: translateX(calc(-1 * var(--sidebar-width) - 50px));
        font-size: 18px;
    }

    .product-gallery--single,
    .product-gallery--cols-3 {
        --gallery-item-min-height: 500px;
        --gallery-image-max-height: 640px;
    }

    .product-gallery--stack-2,
    .product-gallery--grid-2x2,
    .product-gallery--grid-3x2 {
        --gallery-item-min-height: 260px;
        --gallery-image-max-height: 332px;
    }

    .product-gallery--grid-3x3 {
        --gallery-item-min-height: 188px;
        --gallery-image-max-height: 236px;
    }

    .product-gallery__item {
        padding: 16px;
    }
}

@media (max-width: 1180px), (max-height: 740px) {
    .product-page-content {
        width: 85%;
        margin: 0 auto;
    }

    .product-gallery--single,
    .product-gallery--cols-3 {
        --gallery-item-min-height: 500px;
        --gallery-image-max-height: 628px;
    }

    .product-gallery--stack-2,
    .product-gallery--grid-2x2,
    .product-gallery--grid-3x2 {
        --gallery-item-min-height: 250px;
        --gallery-image-max-height: 314px;
    }

    .product-gallery--grid-3x3 {
        --gallery-item-min-height: 168px;
        --gallery-image-max-height: 211px;
    }

    .product-gallery__item {
        padding: clamp(14px, 1.4vw, 28px);
    }

    .product-page-intro__text {
        transform: translateX(calc(-1 * var(--sidebar-width) - 50px));
        font-size: 18px;
    }
}

@media (max-width: 920px) {
    .product-page-content {
        width: 80%;
        margin-left: 15%;
    }

    .product-page-content--with-intro {
        gap: 24px;
    }

    .product-page-intro {
        display: none;
    }

    .product-gallery--single,
    .product-gallery--cols-3 {
        --gallery-item-min-height: 340px;
        --gallery-image-max-height: 437px;
    }

    .product-gallery--stack-2,
    .product-gallery--grid-2x2,
    .product-gallery--grid-3x2 {
        --gallery-item-min-height: 150px;
        --gallery-image-max-height: 219px;
    }

    .product-gallery--grid-3x3 {
        --gallery-item-min-height: 128px;
        --gallery-image-max-height: 161px;
    }

    .product-gallery__item {
        padding: 12px;
    }
}

@media (max-width: 700px) {
    .site-main {
        padding-top: 180px;
    }

    .nav-root > li > .sub-menu {
        left: calc(var(--nav-l1-to-l2) - 20px);
        min-width: 120px;
    }

    .nav-root > li > .sub-menu > li {
        margin-bottom: 4px;
    }

    .nav-root > li > .sub-menu > li > a {
        font-size: 14px;
        line-height: 1.2;
        color: #666;
    }

    .nav-root > li > .sub-menu > li > .sub-menu {
        left: calc(100% + 12px);
        min-width: 120px;
    }

    .nav-root > li > .sub-menu > li > .sub-menu > li > a {
        font-size: 13px;
        line-height: 1.2;
        color: #666;
    }

    .product-page-content {
        width: 100%;
        margin-left: 0;
    }

    .product-page-content--with-intro {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .product-page-intro {
        flex: none;
        width: 100%;
        max-width: none;
        padding-top: 0;
    }

    .product-page-intro__text {
        margin-left: 0;
        font-size: 15px;
        line-height: 1.45;
        max-width: 28rem;
    }

    .product-gallery {
        grid-template-columns: 1fr !important;
    }

    .product-gallery__item {
        min-height: 200px;
        padding: 10px 12px;
    }

    .product-gallery__item img {
        width: auto;
        max-width: 100%;
        max-height: 165px;
    }

    .product-gallery--single,
    .product-gallery--stack-2,
    .product-gallery--cols-3,
    .product-gallery--grid-2x2,
    .product-gallery--grid-3x2,
    .product-gallery--grid-3x3 {
        --gallery-cols: 1;
        --gallery-item-min-height: 200px;
        --gallery-image-max-height: 165px;
    }

    .image-modal__dialog {
        max-width: 94vw;
        max-height: 88vh;
    }

    .image-modal__img {
        max-height: 82vh;
    }

    .image-modal__close {
        top: -12px;
        right: -4px;
        width: 38px;
        height: 38px;
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .site-main {
        padding-top: 180px;
    }

    .product-page-intro__text {
        font-size: 14px;
    }

    .product-gallery__item {
        min-height: 180px;
        padding: 8px 10px;
    }

    .product-gallery__item img {
        max-height: 150px;
    }

    .product-gallery--single,
    .product-gallery--stack-2,
    .product-gallery--cols-3,
    .product-gallery--grid-2x2,
    .product-gallery--grid-3x2,
    .product-gallery--grid-3x3 {
        --gallery-item-min-height: 180px;
        --gallery-image-max-height: 150px;
    }
}

/* ===== Image Modal ===== */

.image-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.image-modal.is-open {
    display: flex;
}

.image-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.78);
}

.image-modal__dialog {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 92vw;
    max-height: 92vh;
}

.image-modal__img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 90vh;
    background: #fff;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.image-modal__close {
    position: absolute;
    top: -18px;
    right: -18px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 999px;
    background: #ffffff;
    color: #111111;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
}

body.modal-open {
    overflow: hidden;
}

.js-gallery-image {
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.js-gallery-image:hover {
    transform: scale(1.01);
    opacity: 0.96;
}