/* Framed photo component (reused for carousel, feature and portrait frames) */
.framed-photo {
    position: relative;
    display: block;
    width: 100%;
}

.framed-photo__frame {
    display: block;
    width: 100%;
    height: auto;
    position: relative;
    z-index: 2;
    pointer-events: none;
    user-select: none;
}

.framed-photo__photo {
    position: absolute;
    z-index: 1;
    object-fit: cover;
    display: block;
}

.framed-photo--rahmen1 {
    aspect-ratio: 1103 / 798;
}

.framed-photo--rahmen1 .framed-photo__photo {
    inset: 9.5% 7.1% 9.9% 6.9%;
    width: 86%;
    height: 80.6%;
}

.framed-photo--rahmen2 {
    aspect-ratio: 1767 / 1230;
}

.framed-photo--rahmen2 .framed-photo__photo {
    inset: 15% 10.2% 15% 10.5%;
    width: 79.3%;
    height: 70%;
}

.framed-photo--rahmen3 {
    aspect-ratio: 351 / 463;
}

.framed-photo--rahmen3 .framed-photo__photo {
    inset: 8% 10% 8% 10.5%;
    width: 79.5%;
    height: 84%;
}

/* Split hero: HME / HAK */
.gallery-split {
    display: flex;
    flex-direction: column;
}

.gallery-split__half {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 34rem;
    overflow: hidden;
    isolation: isolate;
    color: var(--color-cream);
}

.gallery-split__media {
    position: absolute;
    z-index: -2;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.gallery-split__overlay {
    position: absolute;
    z-index: -1;
    inset: 0;
    background: linear-gradient(to top, rgb(10 2 0 / 78%) 0%, rgb(10 2 0 / 30%) 55%, rgb(10 2 0 / 45%) 100%);
}

.gallery-split__content {
    width: 100%;
    padding: 6rem 1.5rem 2.75rem;
    text-align: center;
}

.gallery-split__title {
    margin: 0;
    font-family: var(--font-serif);
    font-weight: 500;
    font-size: clamp(2.75rem, 12vw, 3.75rem);
    letter-spacing: 0.04em;
    color: var(--color-gold-light);
}

.gallery-split__text {
    max-width: 26rem;
    margin: 0.75rem auto 0;
    font-size: clamp(0.85rem, 3vw, 1rem);
    line-height: 1.55;
}

.gallery-split__content .button {
    margin-top: 1.5rem;
}

@media (min-width: 64rem) {
    .gallery-split {
        flex-direction: row;
    }

    .gallery-split__half {
        flex: 1 1 50%;
        min-height: 44rem;
        align-items: flex-end;
        justify-content: flex-end;
    }

    .gallery-split__content {
        width: auto;
        max-width: 30rem;
        padding: 6rem 3.5rem 4rem;
        text-align: right;
    }

    .gallery-split__text {
        margin-inline: 0 0;
        margin-left: auto;
    }
}

/* Teams / carousel */
.gallery-teams {
    padding-block: clamp(3rem, 8vw, 5rem) 0;
    background: var(--color-black);
    text-align: center;
}

.gallery-teams__title {
    margin: 0 0 clamp(2rem, 6vw, 3rem);
    padding-inline: 1rem;
    font-size: clamp(1.75rem, 6vw, 2.6rem);
    color: var(--color-cream);
}

.gallery-carousel {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    max-width: 90rem;
    margin: 0 auto;
    padding-inline: 0.5rem;
}

.gallery-carousel__track {
    display: block;
    width: 100%;
    max-width: 22rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.gallery-carousel__slide {
    transition: opacity var(--transition-base);
}

.gallery-carousel__slide:not([data-active]) {
    display: none;
}

.gallery-carousel__trigger {
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.gallery-carousel__trigger:disabled {
    cursor: default;
}

@media (min-width: 40rem) {
    .gallery-carousel__track {
        display: grid;
        grid-template-columns: 1fr 2fr 1fr;
        align-items: center;
        gap: 1rem;
        max-width: 64rem;
    }

    .gallery-carousel__slide[data-visible] {
        display: block;
        opacity: 0.55;
    }

    .gallery-carousel__slide[data-active] {
        opacity: 1;
    }
}

.gallery-carousel__arrow {
    flex-shrink: 0;
    width: 2.75rem;
    height: 2.75rem;
    display: grid;
    place-items: center;
    border: 1px solid rgb(255 255 255 / 35%);
    border-radius: 50%;
    color: var(--color-cream);
    background: rgb(255 255 255 / 8%);
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.gallery-carousel__arrow svg {
    width: 1.1rem;
    height: 1.1rem;
}

.gallery-carousel__arrow:hover {
    background: rgb(255 255 255 / 18%);
    transform: scale(1.05);
}

.gallery-teams__banner {
    margin: clamp(2.5rem, 6vw, 3.5rem) 0 0;
    padding: 0.9rem 1rem;
    background: var(--color-brown);
    color: var(--color-sand);
    font-family: var(--font-body);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.28em;
    text-transform: uppercase;
}

/* Feature sections (HAK / HME Royals) */
.gallery-feature {
    padding-block: clamp(3rem, 8vw, 5rem);
    background:
        linear-gradient(rgb(20 8 2 / 55%), rgb(20 8 2 / 55%)),
        url('../../assets/backgrounds/wandtapete.webp');
    background-position: center;
    background-repeat: repeat;
    background-size: auto, 78rem;
    color: var(--color-cream);
}

.gallery-feature__inner {
    display: flex;
    flex-direction: column;
    gap: clamp(2rem, 6vw, 3rem);
    align-items: center;
}

.gallery-feature__text {
    text-align: center;
}

.gallery-feature__eyebrow {
    margin: 0;
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 11vw, 3.6rem);
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--color-gold);
}

.gallery-feature__title {
    margin: -0.5rem 0 0;
    font-size: clamp(2rem, 9vw, 2.75rem);
    color: var(--color-cream);
}

.gallery-feature__copy {
    max-width: 30rem;
    margin: 1rem auto 0;
    font-size: clamp(0.85rem, 3vw, 1rem);
    line-height: 1.6;
}

.gallery-feature__frame {
    width: min(30rem, 100%);
}

@media (min-width: 64rem) {
    .gallery-feature__inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        text-align: left;
    }

    .gallery-feature__text {
        flex: 0 0 auto;
        width: 22rem;
        text-align: left;
    }

    .gallery-feature__copy {
        margin-inline: 0;
    }

    .gallery-feature--hme .gallery-feature__inner {
        flex-direction: row-reverse;
    }

    .gallery-feature__frame {
        flex: 1 1 auto;
        max-width: 44rem;
    }
}

/* Portrait grids */
.gallery-portraits {
    padding-block: clamp(3rem, 8vw, 5rem);
    background: var(--color-black);
    text-align: center;
}

.gallery-portraits__logo {
    display: block;
    width: min(16rem, 70%);
    margin: 0 auto clamp(2.5rem, 7vw, 3.5rem);
}

.gallery-portraits__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(1.75rem, 5vw, 2.5rem) clamp(1rem, 4vw, 1.75rem);
    max-width: 68rem;
    margin: 0 auto;
    padding: 0;
    list-style: none;
}

.gallery-portrait {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-portrait__trigger {
    display: block;
    width: min(11rem, 100%);
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.gallery-portrait__trigger .framed-photo {
    width: 100%;
}

.gallery-portrait__name {
    margin: 0.6rem 0 0;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-cream);
}

@media (min-width: 30rem) {
    .gallery-portraits__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (min-width: 48rem) {
    .gallery-portraits__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* Portrait lightbox */
.portrait-lightbox {
    padding: 0;
    border: none;
    background: transparent;
    max-width: min(90vw, 40rem);
    max-height: 90vh;
}

.portrait-lightbox::backdrop {
    background: rgb(19 11 8 / 85%);
}

.portrait-lightbox__image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 90vh;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.portrait-lightbox__close {
    position: absolute;
    top: -2.5rem;
    right: 0;
    width: 2rem;
    height: 2rem;
    border: none;
    border-radius: var(--radius-pill);
    background: var(--color-cream);
    color: var(--color-black);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
