/*
 * Teaser of the Success Stories (Partials/News/SuccessStoryTeaser.html), layout after the designer's draft:
 * large card (styles of NewsSuccessStoryList.css), below a slider with small cards (image with arrow button, name),
 * 4 cards visible on desktop, red arrows and dots.
 */
.c-storyteaser {
   /* --storyteaser-width: 51rem;*/
    --storyteaser-card: #accae5;
    --storyteaser-radius: 1.75rem;
    --storyteaser-gap: 1.875rem;
    --storyteaser-visible: 4;
    --storyteaser-red: var(--bs-primary, #e40422);
    margin: 0 auto;
    max-width: var(--storyteaser-width);
}

.c-storyteaser__main {
    max-width: none;
}

.c-storyteaser__slider {
    margin-top: var(--storyteaser-gap);
}

/* Swiper (own class names, see NewsTeaserSlider.js): viewport = .swiper, wrapper = track, slides = cards */
.c-storyteaser__viewport {
    overflow: hidden;
}

.c-storyteaser__track {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: stretch;
    width: 100%;
    box-sizing: content-box;
    transition-property: transform;
}

.c-storyteaser__card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--storyteaser-radius);
    background: var(--storyteaser-card);
    color: #1a1a1a;
    text-decoration: none;
    flex-shrink: 0;
    height: auto;
    box-sizing: border-box;
}

.c-storyteaser__card:hover,
.c-storyteaser__card:focus-visible {
    color: #1a1a1a;
}

.c-storyteaser__image {
    position: relative;
    display: block;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--storyteaser-radius);
    background: #dfe9f3;
}

.c-storyteaser__image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* round arrow button on the image */
.c-storyteaser__image::after {
    content: "";
    position: absolute;
    top: .75rem;
    right: .75rem;
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M5.5 2.5 11 8l-5.5 5.5' fill='none' stroke='%231a1a1a' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / 1rem;
    transition: transform .15s ease;
}

.c-storyteaser__card:hover .c-storyteaser__image::after,
.c-storyteaser__card:focus-visible .c-storyteaser__image::after {
    transform: translateX(.2rem);
}

.c-storyteaser__name {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    padding: 1.25rem 1rem 1.4rem;
    font-size: 1.125rem;
    font-weight: bold;
    line-height: 1.3;
    text-align: center;
}

.c-storyteaser__card:hover .c-storyteaser__name,
.c-storyteaser__card:focus-visible .c-storyteaser__name {
    text-decoration: underline;
}

/* navigation */
.c-storyteaser__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.75rem;
}

.c-storyteaser__nav[hidden] {
    display: none;
}

.c-storyteaser__arrow {
    padding: .25rem .5rem;
    border: 0;
    background: none;
    color: var(--storyteaser-red);
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
}

.c-storyteaser__arrow:disabled {
    opacity: .3;
    cursor: default;
}

.c-storyteaser__dots {
    display: flex;
    gap: .55rem;
}

.c-storyteaser__dot {
    width: .6rem;
    height: .6rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #c4c4c4;
    cursor: pointer;
}

.c-storyteaser__dot.is-active,
.c-storyteaser__dot[aria-current="true"] {
    background: var(--storyteaser-red);
}

@media (max-width: 991.98px) {
    .c-storyteaser {
        --storyteaser-visible: 3;
        --storyteaser-gap: 1.25rem;
    }
}

@media (max-width: 575.98px) {
    .c-storyteaser {
        --storyteaser-visible: 1.6;
    }
}

/* colour variant "green": news folders Growing companies (191) and Job events (201) */
.c-storyteaser--folder-191,
.c-storyteaser--folder-201 {
    --storyteaser-card: #9bcfae;
}


 /* Macht den Hauptcontainer zum Flex-Layout */
.teaserheadgroup .frame-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center; /* Zentriert den Button vertikal zum Text */
    gap: 20px; /* Abstand zwischen den Elementen */
}

/* Zwingt die Überschrift, die volle Breite einzunehmen (bleibt oben) */
.teaserheadgroup .frame-inner .frame-header {
    flex: 0 0 100%;
}

/* Lässt den Text den restlichen verfügbaren Platz links einnehmen */
.teaserheadgroup .frame-inner p:not(:last-child) {
    flex: 1;
    margin: 0;
}

/* Schiebt den Absatz mit dem Link nach rechts und verhindert Umbrüche */
.teaserheadgroup .frame-inner p:last-child {
    white-space: nowrap;
    margin: 0;
}
