/* Phase 7 Globalisierung 2026-06-20: Farbwelt nach globale.css verschoben; Datei regelt Layout/Sonderfälle. */
/* =========================================================
   VN-BIKER – Globaler Medien Viewer / Social Cards
   Datei: /forum/oeffentlich/css/medien_viewer.css
   Zweck: wiederverwendbar für Thema, Suche, Profil, Treffen.
   Keine eigene Kommentar-/Like-/Melde-Logik.
   ========================================================= */

:root {
    --vn-media-radius: 22px;
    --vn-media-gap: .78rem;
    --vn-media-card-w: clamp(190px, 32vw, 340px);
    --vn-media-card-h: clamp(155px, 24vw, 255px);
}

/* Beitrag-/Modul-Rail */
.vn-media-viewer-rail,
.beitrag-medien.vn-media-viewer-rail {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: var(--vn-media-gap);
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 1rem 0 0;
    padding: .12rem .08rem .72rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: .08rem;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    touch-action: pan-x;
    scrollbar-width: thin;
}

.vn-media-viewer-rail--single,
.beitrag-medien.vn-media-viewer-rail--single {
    justify-content: center;
    overflow-x: visible;
    padding-left: 0;
    padding-right: 0;
}

.vn-media-viewer-card {
    position: relative;
    display: block;
    flex: 0 0 var(--vn-media-card-w);
    width: var(--vn-media-card-w);
    min-width: var(--vn-media-card-w);
    max-width: var(--vn-media-card-w);
    min-height: 0;
    margin: 0;
    padding: 0;
    border-radius: var(--vn-media-radius);
    overflow: hidden;
    scroll-snap-align: start;
    text-decoration: none;
}

.vn-media-viewer-rail--single .vn-media-viewer-card {
    flex: 0 1 auto;
    width: fit-content;
    min-width: 0;
    max-width: min(100%, 560px);
    scroll-snap-align: center;
}

.vn-media-viewer-card__frame,
.vn-media-viewer-card .vn-media-card__frame,
.thema-gallery__image,
.thema-gallery__mediaopen {
    position: relative;
    display: block;
    width: 100%;
    height: var(--vn-media-card-h);
    min-height: 0;
    overflow: hidden;
}

.vn-media-viewer-rail--single .vn-media-viewer-card__frame,
.vn-media-viewer-rail--single .vn-media-card__frame {
    width: auto;
    height: auto;
    max-width: min(100%, 560px);
}

.vn-media-viewer-card img,
.vn-media-viewer-card video,
.vn-media-viewer-card .vn-media-card__image,
.vn-media-viewer-card .vn-media-card__video {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    border-radius: 0;
}

.vn-media-viewer-rail--single .vn-media-viewer-card img,
.vn-media-viewer-rail--single .vn-media-viewer-card video {
    width: auto;
    height: auto;
    max-width: min(100%, 560px);
    max-height: 470px;
    object-fit: contain;
    margin-inline: auto;
    border-radius: 18px;
}

.vn-media-viewer-card__open,
.thema-gallery__mediaopen > button {
    position: absolute;
    top: .55rem;
    right: .55rem;
    z-index: 5;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 999px;
    cursor: pointer;
}

.vn-media-viewer-card__type,
.thema-gallery__typ {
    position: absolute;
    top: .55rem;
    left: .55rem;
    z-index: 4;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 .56rem;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 950;
    line-height: 1;
}

.vn-media-viewer-card__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: block;
    min-height: 2.65rem;
    padding: 1.8rem .72rem .76rem;
    box-sizing: border-box;
    font-size: .82rem;
    font-weight: 900;
    line-height: 1.16;
    pointer-events: none;
}

.vn-media-viewer-card--audio,
.vn-media-viewer-card--file {
    display: flex;
    align-items: center;
    gap: .72rem;
    min-height: 86px;
    padding: .78rem .88rem;
}

.vn-media-viewer-card--audio .vn-media-card__icon,
.vn-media-viewer-card--file .vn-media-card__icon {
    font-size: 1.25rem;
}

.vn-media-viewer-card--audio audio {
    width: min(260px, 100%);
    margin-top: .25rem;
}

/* Medien-Galerie */
.thema-gallery[hidden],
.vn-media-viewer-layer[hidden] {
    display: none !important;
}

.thema-gallery {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: clamp(10px, 2vw, 24px);
}

.thema-gallery__panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    width: min(100%, 1080px);
    max-height: calc(100svh - 28px);
    overflow: hidden;
    border-radius: 26px;
}

.thema-gallery__kopf {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: .8rem;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.thema-gallery__titel strong {
    display: block;
    font-size: 1.05rem;
}

.thema-gallery__titel span {
    display: block;
    margin-top: .22rem;
    font-weight: 850;
}

.thema-gallery__filter {
    display: inline-flex;
    gap: .4rem;
    align-items: center;
    overflow-x: auto;
}

.thema-gallery__filterbtn,
.thema-gallery__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 .78rem;
    border-radius: 999px;
    font-weight: 900;
    cursor: pointer;
}

.thema-gallery__filterbtn.is-active {
}

.thema-gallery__close {
    width: 38px;
    padding: 0;
    font-size: 1.45rem;
}

.thema-gallery__grid {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    gap: .82rem;
    min-height: 0;
    padding: 1rem;
    overflow: auto;
}

.thema-gallery__item.vn-media-viewer-card {
    flex: 0 0 178px;
    width: 178px;
    min-width: 178px;
}

.thema-gallery__image,
.thema-gallery__mediaopen {
    height: 132px;
}

.thema-gallery__image img,
.thema-gallery__mediaopen video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thema-gallery__index {
    position: absolute;
    top: .55rem;
    right: .55rem;
    z-index: 5;
    display: inline-flex;
    min-height: 24px;
    padding: 0 .52rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 950;
}

.thema-gallery__item figcaption {
    display: grid;
    gap: .25rem;
    padding: .55rem .62rem .68rem;
    font-size: .84rem;
    font-weight: 900;
}

.thema-gallery__item figcaption a {
    text-decoration: none;
}

.thema-gallery__empty {
    padding: 1rem;
}

/* Vollbild-/Layer-Viewer */
body.vn-media-viewer-open {
    overflow: hidden;
}

.vn-media-viewer-layer {
    position: fixed;
    inset: 0;
    z-index: 11000;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
    justify-items: center;
    padding: clamp(10px, 2vw, 26px);
}

.vn-media-viewer__stage {
    grid-column: 2;
    grid-row: 1;
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.vn-media-viewer__stage img,
.vn-media-viewer__stage video {
    display: block;
    width: auto;
    height: auto;
    max-width: min(96vw, 1280px);
    max-height: calc(100svh - 98px);
    object-fit: contain;
    border-radius: 20px;
}

.vn-media-viewer__audio,
.vn-media-viewer__file {
    display: grid;
    gap: .8rem;
    place-items: center;
    width: min(92vw, 520px);
    padding: 2rem;
    border-radius: 24px;
    text-decoration: none;
}

.vn-media-viewer__audio i,
.vn-media-viewer__file i {
    font-size: 2rem;
}

.vn-media-viewer__audio audio {
    width: min(100%, 420px);
}

.vn-media-viewer__close {
    position: fixed;
    top: max(12px, env(safe-area-inset-top));
    right: max(12px, env(safe-area-inset-right));
    z-index: 4;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
}

.vn-media-viewer__nav {
    grid-row: 1;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 999px;
    cursor: pointer;
}

.vn-media-viewer__nav--prev { grid-column: 1; }
.vn-media-viewer__nav--next { grid-column: 3; }
.vn-media-viewer-layer.is-single .vn-media-viewer__nav { display: none; }

.vn-media-viewer__info {
    grid-column: 1 / -1;
    grid-row: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    max-width: min(96vw, 980px);
    min-height: 42px;
    margin-top: .85rem;
    padding: .55rem .9rem;
    border-radius: 999px;
    font-weight: 850;
}

.vn-media-viewer__info strong {
}


@media (max-width: 760px) and (orientation: portrait) {
    .beitrag-card:has(.vn-media-viewer-rail),
    .beitrag-card__inhalt:has(.vn-media-viewer-rail) {
        min-width: 0;
        overflow: visible;
        contain: none;
    }

    .vn-media-viewer-rail:not(.vn-media-viewer-rail--single),
    .beitrag-medien.vn-media-viewer-rail:not(.vn-media-viewer-rail--single) {
        --vn-media-card-w: min(82vw, 330px);
        --vn-media-card-h: min(60vw, 252px);
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-left: 0;
        margin-right: 0;
        padding: .18rem 0 1.15rem 0;
        gap: .72rem;
        overflow-x: auto;
        overflow-y: hidden;
        justify-content: flex-start;
        scroll-padding-left: 0;
        scroll-padding-right: .85rem;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        touch-action: pan-x pan-y;
        overscroll-behavior-x: contain;
    }

    .vn-media-viewer-rail:not(.vn-media-viewer-rail--single)::after,
    .beitrag-medien.vn-media-viewer-rail:not(.vn-media-viewer-rail--single)::after {
        content: "";
        flex: 0 0 .55rem;
    }

    .vn-media-viewer-rail:not(.vn-media-viewer-rail--single)::-webkit-scrollbar,
    .beitrag-medien.vn-media-viewer-rail:not(.vn-media-viewer-rail--single)::-webkit-scrollbar {
        display: none;
    }

    .vn-media-viewer-rail:not(.vn-media-viewer-rail--single) > .vn-media-viewer-card,
    .beitrag-medien.vn-media-viewer-rail:not(.vn-media-viewer-rail--single) > .vn-media-viewer-card {
        flex: 0 0 var(--vn-media-card-w);
        width: var(--vn-media-card-w);
        min-width: var(--vn-media-card-w);
        max-width: var(--vn-media-card-w);
        margin: 0;
    }

    .vn-media-viewer-card__frame,
    .vn-media-viewer-card .vn-media-card__frame {
        height: var(--vn-media-card-h);
        min-height: 188px;
    }

    .vn-media-viewer-card__caption {
        min-height: 2.75rem;
        padding: 1.72rem .68rem .72rem;
        line-height: 1.16;
        font-size: .80rem;
    }

    .vn-media-viewer-rail--single,
    .beitrag-medien.vn-media-viewer-rail--single {
        width: 100%;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
        padding-left: 0;
        padding-right: 0;
        justify-content: center;
        overflow-x: visible;
    }

    .vn-media-viewer-rail--single .vn-media-viewer-card {
        width: fit-content;
        min-width: 0;
        max-width: 100%;
        flex-basis: auto;
    }

    .vn-media-viewer-rail--single .vn-media-viewer-card__frame,
    .vn-media-viewer-rail--single .vn-media-card__frame {
        min-height: 0;
        height: auto;
    }

    .vn-media-viewer-rail--single .vn-media-viewer-card img,
    .vn-media-viewer-rail--single .vn-media-viewer-card video {
        max-width: min(100%, 86vw);
        max-height: 62svh;
    }

    .thema-gallery {
        padding: 10px;
        place-items: stretch;
    }

    .thema-gallery__panel {
        max-height: calc(100svh - 20px);
        border-radius: 20px;
    }

    .thema-gallery__kopf {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: .65rem;
        padding: .85rem;
    }

    .thema-gallery__filter {
        grid-column: 1 / -1;
        justify-content: flex-start;
    }

    .thema-gallery__grid {
        padding: .85rem;
        gap: .65rem;
    }

    .thema-gallery__item.vn-media-viewer-card {
        flex: 0 0 calc(50% - .34rem);
        width: calc(50% - .34rem);
        min-width: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .thema-gallery__image,
    .thema-gallery__mediaopen {
        flex: 0 0 auto;
        height: min(36vw, 170px);
        min-height: 118px;
    }

    .thema-gallery__item figcaption {
        flex: 0 0 auto;
        min-height: 3.4rem;
        padding: .55rem .58rem .68rem;
    }

    .vn-media-viewer-layer {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr) auto;
        padding: max(10px, env(safe-area-inset-top)) 10px max(12px, env(safe-area-inset-bottom));
    }

    .vn-media-viewer__stage {
        grid-column: 1;
    }

    .vn-media-viewer__stage img,
    .vn-media-viewer__stage video {
        max-width: 100%;
        max-height: calc(100svh - 100px);
        border-radius: 16px;
    }

    .vn-media-viewer__nav {
        position: fixed;
        top: 50%;
        width: 40px;
        height: 40px;
        transform: translateY(-50%);
    }

    .vn-media-viewer__nav--prev { left: 8px; }
    .vn-media-viewer__nav--next { right: 8px; }

    .vn-media-viewer__info {
        max-width: calc(100vw - 20px);
        border-radius: 18px;
        justify-content: space-between;
        font-size: .86rem;
    }
}


/* =========================================================
   FINAL 2026-06-08 – Galeriecards: Text im Bild + sichere Vorschau
   ========================================================= */
.thema-gallery__item.vn-media-viewer-card {
    position: relative;
    display: block;
    overflow: hidden;
    cursor: zoom-in;
}

.thema-gallery__item.vn-media-viewer-card figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    display: grid;
    gap: .18rem;
    min-height: 3.35rem;
    padding: 1.85rem .68rem .62rem;
    box-sizing: border-box;
    pointer-events: none;
}

.thema-gallery__item.vn-media-viewer-card figcaption span {
    display: block;
    font-size: .82rem;
    line-height: 1.14;
    font-weight: 950;
}

.thema-gallery__item.vn-media-viewer-card figcaption a {
    width: fit-content;
    font-size: .78rem;
    line-height: 1.1;
    font-weight: 950;
    text-decoration: none;
    pointer-events: auto;
}

.thema-gallery__item.vn-media-viewer-card figcaption a:hover { text-decoration: underline; }

.thema-gallery__item.vn-media-viewer-card .thema-gallery__image,
.thema-gallery__item.vn-media-viewer-card .thema-gallery__mediaopen {
    height: 100%;
    min-height: 100%;
}

.thema-gallery__item.vn-media-viewer-card .thema-gallery__image img,
.thema-gallery__item.vn-media-viewer-card .thema-gallery__mediaopen video {
    height: 100%;
    min-height: 100%;
}

@media (min-width: 761px) {
    .thema-gallery__item.vn-media-viewer-card {
        height: 178px;
    }
}

@media (max-width: 760px) {
    .thema-gallery__item.vn-media-viewer-card {
        height: min(46vw, 190px);
        min-height: 148px;
    }

    .thema-gallery__item.vn-media-viewer-card figcaption {
        min-height: 3.15rem;
        padding: 1.65rem .58rem .58rem;
    }
}


/* Nachrichten-Integration: Medienkarten in Chatblasen kompakt halten */
.nachrichten-bubble .vn-media-viewer-rail {
    --vn-media-card-w: min(260px, 72vw);
    --vn-media-card-h: min(190px, 48vw);
    max-width: 100%;
    margin-top: .55rem;
    padding: .15rem 0 .25rem;
}

.nachrichten-bubble .vn-media-viewer-rail--single {
    justify-content: flex-start;
}

.nachrichten-bubble .vn-media-viewer-card {
}

.nachrichten-bubble .vn-media-viewer-card--audio {
    min-height: 96px;
}

@media (max-width: 760px) and (orientation: portrait) {
    .nachrichten-bubble .vn-media-viewer-rail:not(.vn-media-viewer-rail--single) {
        --vn-media-card-w: min(74vw, 300px);
        --vn-media-card-h: min(54vw, 220px);
    }
}

/* =========================================================
   FINAL 2026-06-20 – Medienkarten Thema vereinheitlicht
   Ziel: wie Profil-/Galerie-Karten, icon-only, keine Textpills/Captions.
   ========================================================= */

:root {
    --vn-media-card-w: clamp(240px, 28vw, 340px);
    --vn-media-card-h: clamp(170px, 21vw, 214px);
}

.vn-media-viewer-rail,
.beitrag-medien.vn-media-viewer-rail {
    justify-content: flex-start;
    gap: .78rem;
    margin: .88rem 0 0;
    padding: .08rem 0 .78rem;
}

.vn-media-viewer-rail--single,
.beitrag-medien.vn-media-viewer-rail--single {
    justify-content: flex-start;
    overflow-x: auto;
    padding-left: 0;
    padding-right: 0;
}

.vn-media-viewer-rail--single .vn-media-viewer-card {
    flex: 0 0 var(--vn-media-card-w);
    width: var(--vn-media-card-w);
    min-width: var(--vn-media-card-w);
    max-width: var(--vn-media-card-w);
}

.vn-media-viewer-rail--single .vn-media-viewer-card__frame,
.vn-media-viewer-rail--single .vn-media-card__frame {
    width: 100%;
    height: var(--vn-media-card-h);
    max-width: none;
}

.vn-media-viewer-rail--single .vn-media-viewer-card img,
.vn-media-viewer-rail--single .vn-media-viewer-card video {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    margin: 0;
    border-radius: 0;
}

.vn-media-viewer-card__type,
.thema-gallery__typ {
    width: 31px;
    height: 31px;
    min-height: 31px;
    padding: 0;
    justify-content: center;
    font-size: 0;
}

.vn-media-viewer-card__type i,
.thema-gallery__typ i {
    font-size: .92rem;
    line-height: 1;
}

.vn-media-viewer-card__caption,
.vn-media-viewer-card .vn-media-viewer-card__caption {
    display: none !important;
}

.thema-gallery__titel span,
.thema-gallery__filter {
    display: none;
}

.thema-gallery__kopf {
    grid-template-columns: minmax(0, 1fr) auto;
}

.thema-gallery__grid {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: .82rem;
    padding: 1rem;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
}

.thema-gallery__item.vn-media-viewer-card {
    flex: 0 0 var(--vn-media-card-w);
    width: var(--vn-media-card-w);
    min-width: var(--vn-media-card-w);
    max-width: var(--vn-media-card-w);
    height: var(--vn-media-card-h);
    scroll-snap-align: start;
}

.thema-gallery__item.vn-media-viewer-card figcaption,
.thema-gallery__caption {
    display: none !important;
}

.thema-gallery__image,
.thema-gallery__mediaopen,
.thema-gallery__item.vn-media-viewer-card .thema-gallery__image,
.thema-gallery__item.vn-media-viewer-card .thema-gallery__mediaopen {
    height: 100%;
    min-height: 100%;
}

.thema-gallery__image img,
.thema-gallery__mediaopen video {
    height: 100%;
    min-height: 100%;
    object-fit: cover;
}

.thema-gallery__index {
    min-height: 24px;
    padding: 0 .52rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 950;
}

@media (max-width: 760px) {
    :root {
        --vn-media-card-w: min(78vw, 300px);
        --vn-media-card-h: min(54vw, 202px);
    }

    .thema-gallery__grid {
        flex-wrap: nowrap;
        padding: .85rem;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .thema-gallery__item.vn-media-viewer-card {
        flex: 0 0 var(--vn-media-card-w);
        width: var(--vn-media-card-w);
        min-width: var(--vn-media-card-w);
        max-width: var(--vn-media-card-w);
        height: var(--vn-media-card-h);
        min-height: 148px;
    }
}

/* ENDE FINAL 2026-06-20 – Medienkarten Thema vereinheitlicht */
