.tsv-video-gallery {
    display: grid;
    grid-template-columns: repeat(var(--tsv-columns, 3), minmax(0, 1fr));
    gap: 22px;
    width: 100%;
}

.tsv-video-card { min-width: 0; }

.tsv-video-thumb {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: inherit;
}

.tsv-video-thumb-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 260px;
    overflow: hidden;
    border-radius: 10px;
    background: #1c1c1c;
    box-shadow: 0 3px 14px rgba(0,0,0,.16);
}

.tsv-video-thumb-source {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.tsv-video-thumb-canvas {
    display: none;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
}

.tsv-video-thumb.is-ready .tsv-video-thumb-canvas { display: block; }
.tsv-video-thumb.is-ready .tsv-video-fallback { display: none; }

.tsv-video-fallback {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .12em;
    opacity: .72;
}

.tsv-video-play {
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-50%, -50%);
    display: grid;
    place-items: center;
    width: 64px;
    height: 64px;
    padding-left: 5px;
    border-radius: 50%;
    background: rgba(0,0,0,.65);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    transition: transform .15s ease, background .15s ease;
}

.tsv-video-thumb:hover .tsv-video-play,
.tsv-video-thumb:focus-visible .tsv-video-play {
    transform: translate(-50%, -50%) scale(1.08);
    background: rgba(0,0,0,.78);
}

.tsv-video-thumb:focus-visible {
    outline: 3px solid currentColor;
    outline-offset: 4px;
    border-radius: 10px;
}

.tsv-video-title {
    margin-top: 9px;
    font-weight: 600;
    line-height: 1.3;
}

.tsv-video-modal[hidden] { display: none !important; }
.tsv-video-modal {
    position: fixed;
    z-index: 999999;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 24px;
}

.tsv-video-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.82);
}

.tsv-video-modal-dialog {
    position: relative;
    z-index: 1;
    width: min(1100px, 94vw);
    max-height: 92vh;
    padding: 12px;
    border-radius: 12px;
    background: #111;
    color: #fff;
    box-shadow: 0 16px 60px rgba(0,0,0,.45);
}

.tsv-video-player {
    display: block;
    width: 100%;
    max-height: 78vh;
    object-fit: contain;
    background: #000;
}

.tsv-video-modal-title {
    padding: 10px 4px 2px;
    font-weight: 600;
}

.tsv-video-close {
    position: absolute;
    z-index: 2;
    top: -14px;
    right: -14px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #111;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
}

body.tsv-video-modal-open { overflow: hidden; }

@media (max-width: 1000px) {
    .tsv-video-gallery { grid-template-columns: repeat(min(var(--tsv-columns, 3), 2), minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .tsv-video-gallery { grid-template-columns: 1fr; gap: 18px; }
    .tsv-video-thumb-stage { height: 220px; }
    .tsv-video-modal { padding: 12px; }
    .tsv-video-close { top: 6px; right: 6px; }
}

.tsv-video-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0 0 22px;
}

.tsv-video-filter {
    appearance: none;
    border: 1px solid currentColor;
    border-radius: 999px;
    padding: 8px 18px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .15s ease;
}

.tsv-video-filter:hover,
.tsv-video-filter:focus-visible {
    transform: translateY(-1px);
}

.tsv-video-filter.is-active {
    background: currentColor;
}

.tsv-video-filter.is-active::first-line {
    color: initial;
}

/* Ein zusätzlicher Innen-Text ist nicht nötig; mix-blend-mode hält die Schrift
   auf hellen und dunklen Themes gut lesbar. */
.tsv-video-filter.is-active {
    color: #fff;
    background: #222;
    border-color: #222;
}

.tsv-video-card[hidden] {
    display: none !important;
}

.tsv-video-no-results {
    margin: 18px 0 0;
    font-style: italic;
}
