/* GRT Branchen block styles */

/* ── Section ── */
.grt-branchen {
    padding-block: var(--space-dkt-100, 6.25rem);
    background: var(--color-gray-50, #F7F7F7);
    overflow: hidden;
}

/* ── Heading ── */
.grt-branchen__heading {
    font-family: var(--font-family-headline, 'Campora', serif);
    font-size: 3.75rem; /* Figma: 60px — between H2 (75px) and H3 (44px) */
    font-weight: 400;
    line-height: 1.2;
    color: var(--color-black, #000);
    margin: 0 0 var(--space-dkt-60, 3.75rem);
}

/* ── Keyword highlights ── */
.grt-branchen__kw {
    text-decoration: underline;
    text-decoration-thickness: 7%;
    text-underline-offset: 0.1em;
    font-weight: 400;
    color: inherit;
    transition: color 0.2s ease, font-weight 0s;
    cursor: pointer;
}

.grt-branchen__kw.is-active {
    font-weight: 700;
    color: var(--color-brand-red, #E40521);
    cursor: default;
}

.grt-branchen__kw:focus-visible {
    outline: 2px solid var(--color-brand-red, #E40521);
    outline-offset: 3px;
    border-radius: 2px;
}

/* ── Gallery wrapper ── */
.grt-branchen__gallery-wrap {
    margin-bottom: var(--space-dkt-60, 3.75rem);
}

/* Break out of .grt-container to full viewport width at all breakpoints */
.grt-branchen__gallery-wrap .grt-container {
    max-width: none;
}

/* ── Gallery ── */
.grt-branchen__gallery {
    display: flex;
    gap: var(--space-dkt-12, 0.75rem);
    height: clamp(340px, 38vw, 549px); /* Figma: 549px */
    align-items: stretch;
}

/* ── Item ── */
.grt-branchen__item {
    position: relative;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    border-radius: 12px; /* Figma: rounded-[12px] */
    cursor: pointer;
    transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    outline-offset: 3px;
    background-color: var(--color-gray-200, #E7E7E7); /* fallback when no image/video */
}

.grt-branchen__item.is-active {
    flex: 5;
    cursor: default;
}

/* ── Image + Video (shared cover styles) ── */
.grt-branchen__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    filter: grayscale(100%);
    transition: filter 0.5s ease;
}

.grt-branchen__item.is-active .grt-branchen__img {
    filter: none;
}

.grt-branchen__video {
    z-index: 0;
}

/* ── Overlay (gradient + content) ── */
.grt-branchen__item-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--space-dkt-24, 1.5rem);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.54) 0%, rgba(0, 0, 0, 0) 23.08%, rgba(0, 0, 0, 0) 72.6%, rgba(0, 0, 0, 0.54) 100%);
    background-blend-mode: saturation;
}

/* ── Item label (top-left, active only) ── */
.grt-branchen__item-label {
    font-family: var(--font-family-headline, 'Campora', serif);
    font-size: 2.75rem; /* Figma: H3 44px Bold */
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-white, #fff);
    opacity: 0;
    transition: opacity 0.3s ease 0.1s;
    pointer-events: none;
}

.grt-branchen__item.is-active .grt-branchen__item-label {
    opacity: 1;
}

/* ── CTA button (bottom-left, active only) ── */
.grt-branchen__item-cta {
    align-self: flex-start;
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.3s ease 0.1s, transform 0.3s ease 0.1s;
    pointer-events: none;
}

.grt-branchen__item.is-active .grt-branchen__item-cta {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.grt-branchen__item-cta .grt-btn {
    white-space: nowrap;
}

.grt-branchen__item-cta .grt-btn__label::before {
    content: 'Mehr zu ';
    margin-right: 0.2rem;
}

@media (max-width: 768px) {
    .grt-branchen__item-cta .grt-btn__label::before {
        content: none;
    }
}

/* ── Text row: 3 columns matching active card / description / summary ── */
.grt-branchen__text {
    display: grid;
    grid-template-columns: 3fr 2fr 1fr; /* Figma: ~50% / ~33% / ~17% */
    gap: var(--space-dkt-32, 2rem);
    align-items: start;
}

/* ── Motion toggle button (left column) ── */
.grt-branchen__motion-toggle {
    display: inline-flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--color-white, #fff);
    border: none;
    border-radius: 4px;
    padding: 0.625rem 1.0625rem;
    height: 43px;
    cursor: pointer;
    font-family: var(--font-family-body, 'Calibri', sans-serif);
    font-size: 1rem;
    line-height: 1.3;
    color: var(--color-black, #000);
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s ease;
}

.grt-branchen__motion-toggle:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.14);
}

.grt-branchen__motion-toggle[aria-pressed="true"] {
    outline: 2px solid var(--color-brand-red, #E40521);
    outline-offset: 2px;
}

.grt-branchen__motion-icon {
    flex-shrink: 0;
    width: 37px;
    height: 41px;
}

/* ── Description (Figma: Campora Regular 36px) ── */
.grt-branchen__description {
    font-family: var(--font-family-headline, 'Campora', serif);
    font-size: 2.25rem; /* Figma: 36px */
    font-weight: 400;
    line-height: 1.2;
    color: var(--color-black, #000);
}

/* ── Summary (Figma: Calibri Regular 18px, partial bold) ── */
.grt-branchen__summary {
    font-family: var(--font-family-body, 'Calibri', sans-serif);
    font-size: var(--copy-font-size, 1.125rem);
    line-height: 1.35;
    color: var(--color-black, #000);
}

.grt-branchen__summary p { margin: 0; }

/* ── Reduced motion ── */
.grt-branchen.no-motion .grt-branchen__item,
.grt-branchen.no-motion .grt-branchen__img,
.grt-branchen.no-motion .grt-branchen__item-label,
.grt-branchen.no-motion .grt-branchen__item-cta,
.grt-branchen.no-motion .grt-branchen__kw {
    transition: none;
}

@media (prefers-reduced-motion: reduce) {
    .grt-branchen__item,
    .grt-branchen__img,
    .grt-branchen__item-label,
    .grt-branchen__item-cta,
    .grt-branchen__kw {
        transition: none;
    }
}

/* ── 1024px ── */
@media (max-width: 1024px) {
    .grt-branchen__heading {
        font-size: clamp(2rem, 4.5vw, 3.75rem);
    }

    .grt-branchen__gallery {
        height: clamp(280px, 42vw, 420px);
    }

    .grt-branchen__text {
        grid-template-columns: 1fr 1fr; /* aside hidden, desc + summary */
    }

    .grt-branchen__text-aside {
        display: none;
    }
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .grt-branchen {
        padding-block: var(--space-mbl-60, 3.75rem);
    }

    .grt-branchen__heading {
        font-size: var(--mbl-h2-font-size, 2rem);
        line-height: 1.2;
        margin-bottom: var(--space-mbl-24, 1.5rem);
    }

    .grt-branchen__gallery-wrap {
        margin-bottom: var(--space-mbl-32, 2rem);
    }

    .grt-branchen__gallery {
        height: auto;
        overflow-x: auto;
        overflow-y: visible;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: var(--space-mbl-8, 0.5rem);
        padding-inline: var(--space-mbl-24, 1.5rem);
        padding-right: calc(var(--space-mbl-24, 1.5rem) + 2rem);
    }

    .grt-branchen__gallery::-webkit-scrollbar { display: none; }

    .grt-branchen__item {
        flex: 0 0 80vw;
        height: 64vw;
        min-width: 0;
        scroll-snap-align: start;
        cursor: default;
        transition: none;
        border-radius: 12px;
    }

    .grt-branchen__item.is-active {
        flex: 0 0 80vw;
    }

    .grt-branchen__img {
        filter: none;
        transition: none;
    }

    .grt-branchen__item-label,
    .grt-branchen__item-cta {
        opacity: 1;
        transform: none;
        pointer-events: auto;
        transition: none;
    }

    .grt-branchen__item-label {
        font-size: 1.5rem; /* scale down on mobile */
    }

    .grt-branchen__kw {
        transition: color 0.2s ease;
    }

    /* Text section stacks, aside shown again */
    .grt-branchen__text {
        grid-template-columns: 1fr;
        gap: var(--space-mbl-24, 1.5rem);
    }

    .grt-branchen__text-aside {
        display: block;
    }

    .grt-branchen__description {
        font-size: var(--mbl-copy-font-size, 1.1875rem);
    }

    .grt-branchen__summary {
        font-size: var(--mbl-copy-font-size, 1.1875rem);
    }
}
