/* baut bewusst auf default.css und perspektiven.css auf */

/* ---------------- Übersicht / Karten ---------------- */

.mediathek-results {
    display: grid;
    gap: 34px;
}

.mediathek-card {
    display: flex;
    align-items: stretch;
    gap: 28px;

    padding: 24px;
    border: 1px solid #dfe4ee;
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(0, 28, 100, 0.06);
}

.mediathek-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
}

.mediathek-card__body h2 {
    margin-top: 6px;
    line-height: 1.35;
}

.mediathek-card__body .teaser {
    margin-top: 10px;
    margin-bottom: 14px;
}

.mediathek-card__body .perspektiven-btn {
    margin-top: auto;
    align-self: flex-start;
    width: auto;
    padding: 8px 18px;
}

.mediathek-type {
    align-self: flex-start;
    width: auto;
}

/* Einheitliche Vorschaubilder */
.mediathek-card__img,
.mediathek-card-slider {
    flex: 0 0 190px;
    width: 190px;
    height: 190px;
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    background: #eef3ff;
}

.mediathek-card__img {
    display: block;
}

.mediathek-card__img img,
.card-slide {
    width: 100%;
    height: 100%;
}

.mediathek-card__img img,
.card-slide {
    object-fit: cover;
    display: block;
}

.mediathek-type {
    display: inline-block;
    margin-bottom: .5rem;
    padding: .2rem .55rem;
    border-radius: 999px;
    background: #e6ecff;
    color: #001c64;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.mediathek-meta {
    font-size: .9rem;
    color: #555;
}

/* ---------------- Card-Slideshow Vorschau ---------------- */

.mediathek-card-slider {
    touch-action: pan-y;
}

.card-slide {
    display: none !important;
}

.card-slide.active {
    display: block !important;
}

.card-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;

    width: 34px;
    height: 34px;

    border: none;
    border-radius: 50%;

    background: #0077ff;
    color: #fff;

    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
}

.card-slider-prev {
    left: 8px;
}

.card-slider-next {
    right: 8px;
}

.card-slider-btn:hover,
.card-slider-btn:focus {
    background: #001c64;
}

/* ---------------- Detailseite ---------------- */

.mediathek-viewer {
    width: 100%;
    margin: 1.5rem 0;
}

.mediathek-viewer > img {
    max-width: 100%;
    border-radius: 18px;
    height: auto;
    display: block;
}

.mediathek-single-image {
    width: 100%;
    max-width: 760px;
    height: auto;
    border-radius: 22px;
    display: block;
}

.mediathek-pdf {
    width: 100%;
    min-height: 720px;
    border: 1px solid #ddd;
    border-radius: 18px;
}

.mediathek-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    border-radius: 18px;
}

.mediathek-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
    width: 100%;
}

.mediathek-gallery img {
    width: 100%;
    border-radius: 18px;
    height: auto;
    display: block;
}

/* ---------------- Detail-Slider ---------------- */

.mediathek-slider {
    position: relative;
    width: 100%;
    max-width: 760px;
    margin: 30px 0;
}

.slider-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 22px;
    background: #f2f5ff;
}

.slider-slide {
    display: none;
    margin: 0;
    width: 100%;
    height: 100%;
}

.slider-slide.active {
    display: block;
}

.slider-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;

    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;

    background: #0077ff;
    color: #fff;

    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.slider-prev {
    left: 12px;
}

.slider-next {
    right: 12px;
}

.slider-btn:hover,
.slider-btn:focus {
    background: #001c64;
}

.slider-counter {
    margin-top: 12px;
    font-size: 0.9rem;
    color: #68738a;
    text-align: center;
}

/* ---------------- Filter / Sidebar ---------------- */

.mediathek-format-bubbles {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.format-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 10px 18px;
    min-height: 42px;

    border-radius: 999px;
    background: #eef3ff;
    color: #001c64;

    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1;

    text-decoration: none;
    border: 1px solid transparent;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}

.format-bubble:hover,
.format-bubble:focus {
    background: #dbe8ff;
    color: #001c64;
    border-color: #0077ff;
    transform: translateY(-1px);
    outline: none;
}

.format-bubble.active {
    background: #0077ff;
    color: #fff;
    border-color: #0077ff;
}

.mediathek-sidebar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.mediathek-sidebar-tags .tag {
    border-radius: 999px;
    padding: 8px 14px;
    background: #f0f4ff;
    color: #001c64;
}

.mediathek-sidebar-tags .tag.active {
    background: #ff3366;
    color: #fff;
}

.tag-count {
    opacity: .7;
    margin-left: .25rem;
}

/* ---------------- Responsive ---------------- */

@media (max-width: 900px) {
    .mediathek-card {
        padding: 20px;
        gap: 20px;
    }

    .mediathek-card__img,
    .mediathek-card-slider {
        flex: 0 0 150px;
        width: 150px;
        height: 150px;
    }

    .mediathek-pdf {
        min-height: 520px;
    }
}

@media (max-width: 700px) {
    .mediathek-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .mediathek-card__img,
    .mediathek-card-slider {
        width: 100%;
        max-width: 320px;
        height: auto;
        aspect-ratio: 1 / 1;
        flex: none;
    }

    .mediathek-card__body {
        align-items: center;
    }

    .mediathek-slider {
        max-width: 100%;
    }

    .slider-btn {
        width: 38px;
        height: 38px;
        font-size: 1.7rem;
    }

    .slider-prev {
        left: 8px;
    }

    .slider-next {
        right: 8px;
    }
}