/*
    Bueren / Sektion "Unsere Expertise"
    ===================================
    Einleitungstext plus responsives Karussell. Auf kleinen Bildschirmen
    ist jeweils eine Karte sichtbar, ab 768px drei gleichzeitig. Wenn mehr
    als drei Karten existieren, werden Pfeile und Positionsbalken aktiv.
*/

.expertise {
    padding-block: 80px;
    overflow: hidden;
    background: var(--farbe-surface-container-low);
}

.expertise + .expertise {
    padding-top: 32px;
}

.expertise__kopf {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 48px;
}

@media (min-width: 768px) {
    .expertise__kopf {
        flex-direction: row;
        align-items: flex-end;
    }

    .expertise__intro {
        flex: 1;
    }
}

.expertise__headline {
    margin-bottom: 8px;
    font-size: 32px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
    color: var(--farbe-primary);
}

.expertise__text {
    font-size: 16px;
    line-height: 1.5;
    color: var(--farbe-on-surface-variant);
}

.expertise__steuerung {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    width: min(100%, 240px);
}

.expertise__zierlinie {
    display: flex;
    gap: 4px;
    padding-bottom: 8px;
}

.expertise__zierlinie-lang,
.expertise__zierlinie-kurz {
    height: 2px;
}

.expertise__zierlinie-lang {
    width: 48px;
    background: var(--farbe-primary);
}

.expertise__zierlinie-kurz {
    width: 16px;
    background: var(--farbe-outline);
}

.expertise__positionsanzeige {
    position: relative;
    width: 100%;
    height: 4px;
    overflow: hidden;
    background: var(--farbe-outline);
    border-radius: 999px;
}

.expertise__positionsanzeige-fuellung {
    position: absolute;
    inset-block: 0;
    left: 0;
    width: 100%;
    background: var(--farbe-primary);
    border-radius: inherit;
    transition: width var(--uebergang), left var(--uebergang);
}

.expertise__aktionen {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.expertise__pfeil {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid var(--farbe-outline-variant);
    border-radius: 50%;
    background: var(--farbe-surface-container-lowest);
    color: var(--farbe-primary);
    cursor: pointer;
    transition: background-color var(--uebergang), color var(--uebergang), opacity var(--uebergang),
                transform 140ms var(--ease-ui);
}

.expertise__pfeil:hover:not(:disabled) {
    background: var(--farbe-primary);
    color: var(--farbe-on-primary);
}

.expertise__pfeil:active:not(:disabled) {
    transform: scale(0.93);
    transition-duration: 80ms;
}

.expertise__pfeil:disabled {
    opacity: 0.4;
    cursor: default;
}

.expertise__pfeil .material-symbols-outlined {
    font-size: 20px;
}

.expertise__karussell {
    width: 100%;
}

.expertise__viewport {
    width: 100%;
}

.expertise__raster {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--gutter);
}

@media (min-width: 768px) {
    .expertise__raster {
        grid-template-columns: repeat(3, 1fr);
    }
}

.expertise__karussell.is-ready {
    --expertise-visible: 1;
    --expertise-visible-fraction: 1.18;
    --expertise-edge-fade: 22px;
    position: relative;
}

.expertise__karussell.is-ready .expertise__viewport {
    width: 100%;
    overflow: hidden;
    touch-action: pan-y;
    cursor: grab;
}

.expertise__karussell.is-ready .expertise__track {
    display: flex;
    grid-template-columns: none;
    align-items: stretch;
    transform: translateX(0);
    transition: transform 280ms var(--ease-ui);
    will-change: transform;
}

.expertise__karussell.is-ready .expertise__viewport.is-dragging {
    cursor: grabbing;
}

.expertise__karussell.is-ready .expertise-karte {
    flex: 0 0 calc((100% - (var(--gutter) * (var(--expertise-visible) - 1))) / var(--expertise-visible-fraction));
    min-width: 0;
    opacity: 0.3;
    transform: scale(0.96);
    transition: box-shadow var(--uebergang),
                opacity 240ms var(--ease-ui),
                transform 240ms var(--ease-ui),
                filter 240ms var(--ease-ui);
    filter: saturate(0.7);
}

.expertise__karussell.is-ready .expertise-karte.is-adjacent {
    opacity: 0.62;
    transform: scale(0.985);
    filter: saturate(0.85);
}

.expertise__karussell.is-ready .expertise-karte.is-visible {
    opacity: 1;
    transform: none;
    filter: none;
}

.expertise__karussell.is-ready .expertise-karte:hover {
    opacity: 1;
}

.expertise__karussell.is-ready::before,
.expertise__karussell.is-ready::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: var(--expertise-edge-fade);
    z-index: 2;
    pointer-events: none;
    opacity: 1;
    transition: opacity var(--uebergang);
}

.expertise__karussell.is-ready::before {
    left: 0;
    background: linear-gradient(to right, #eff4ff 0%, rgba(239, 244, 255, 0) 100%);
}

.expertise__karussell.is-ready::after {
    right: 0;
    background: linear-gradient(to left, #eff4ff 0%, rgba(239, 244, 255, 0) 100%);
}

.expertise__karussell.is-ready.is-at-start::before,
.expertise__karussell.is-ready.is-at-end::after {
    opacity: 0.15;
}

@media (min-width: 768px) {
    .expertise__karussell.is-ready {
        --expertise-visible: 3;
        --expertise-visible-fraction: 3.35;
        --expertise-edge-fade: 28px;
    }
}

.expertise-karte {
    padding: 32px;
    background: var(--farbe-surface-container-lowest);
    border: 1px solid var(--farbe-outline-variant);
    transition: box-shadow var(--uebergang);
}

.expertise-karte:hover {
    box-shadow: 0 8px 24px rgba(11, 28, 48, 0.1);
}

/* Akzent-Variante: Navy-Hintergrund für visuelle Diversität im Raster */
.expertise-karte--akzent {
    background: var(--farbe-primary);
    border-color: var(--farbe-primary);
}

.expertise-karte--akzent:hover {
    box-shadow: 0 8px 32px rgba(11, 28, 48, 0.3);
}

.expertise-karte--akzent .expertise-karte__icon {
    color: var(--farbe-secondary-fixed);
}

.expertise-karte--akzent .expertise-karte__titel {
    color: var(--farbe-weiss);
}

.expertise-karte--akzent .expertise-karte__text {
    color: rgba(255, 255, 255, 0.75);
}

.expertise-karte--akzent .expertise-karte__punkte {
    color: rgba(255, 255, 255, 0.9);
}

.expertise-karte--akzent .expertise-karte__punkte .material-symbols-outlined {
    color: var(--farbe-secondary-fixed);
}

.expertise-karte__icon {
    display: block;
    margin-bottom: 16px;
    font-size: 36px;
    color: var(--farbe-secondary);
}

.expertise-karte__titel {
    margin-bottom: 8px;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.3;
    color: var(--farbe-primary);
}

.expertise-karte__text {
    margin-bottom: 16px;
    font-size: 16px;
    line-height: 1.5;
    color: var(--farbe-on-surface-variant);
}

.expertise-karte__punkte {
    display: flex;
    flex-direction: column;
    gap: 8px;
    list-style: none;
    padding-left: 0;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    color: var(--farbe-on-surface);
}

.expertise-karte__punkte li {
    display: flex;
    align-items: center;
    gap: 8px;
}

.expertise-karte__punkte .material-symbols-outlined {
    font-size: 18px;
    color: var(--farbe-secondary);
}

.expertise__leer {
    color: var(--farbe-on-surface-variant);
    font-style: italic;
}

@media (max-width: 767px) {
    .expertise__steuerung {
        width: 100%;
        max-width: 280px;
    }
}
