/* TBS Heritage Stories — responsive grid + lightbox */

.tbs-hs-grid {
    --tbs-hs-min: 280px;
    --tbs-hs-gap: 1.5rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--tbs-hs-min), 1fr));
    gap: var(--tbs-hs-gap);
    width: 100%;
    margin: 1rem 0 2rem;
    box-sizing: border-box;
}

.tbs-hs-card {
    /* kill button defaults */
    all: unset;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    box-sizing: border-box;
    width: 100%;
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
    transition: transform 160ms ease;
}

.tbs-hs-card:hover,
.tbs-hs-card:focus-visible {
    transform: translateY(-2px);
}

.tbs-hs-card:focus-visible .tbs-hs-thumb-wrap {
    outline: 3px solid #005b9a;
    outline-offset: 3px;
}

.tbs-hs-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #0a0a0a;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.tbs-hs-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 240ms ease, opacity 160ms ease;
}

.tbs-hs-card:hover .tbs-hs-thumb,
.tbs-hs-card:focus-visible .tbs-hs-thumb {
    transform: scale(1.03);
    opacity: 0.9;
}

.tbs-hs-play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 68px;
    height: 48px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: transform 160ms ease;
}

.tbs-hs-card:hover .tbs-hs-play {
    transform: translate(-50%, -50%) scale(1.08);
}

.tbs-hs-play svg {
    width: 100%;
    height: 100%;
    display: block;
}

.tbs-hs-title {
    font-weight: 600;
    font-size: 1.05rem;
    line-height: 1.3;
    color: inherit;
    text-align: center;
    padding: 0 0.25rem;
}

.tbs-hs-empty {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 2rem 0;
}

/* --- Lightbox --- */

.tbs-hs-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    box-sizing: border-box;
}

.tbs-hs-lightbox.is-open {
    display: flex;
}

body.tbs-hs-lock {
    overflow: hidden;
}

.tbs-hs-lightbox-inner {
    position: relative;
    width: 100%;
    max-width: 1100px;
}

.tbs-hs-player-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
}

.tbs-hs-player,
.tbs-hs-player iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.tbs-hs-close {
    position: absolute;
    top: -44px;
    right: 0;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 36px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 4px;
    transition: background 120ms ease;
}

.tbs-hs-close:hover,
.tbs-hs-close:focus-visible {
    background: rgba(255, 255, 255, 0.1);
    outline: none;
}

/* Small screens: pull close button inside the frame */
@media (max-width: 640px) {
    .tbs-hs-close {
        top: 4px;
        right: 4px;
        background: rgba(0, 0, 0, 0.55);
        z-index: 2;
    }
    .tbs-hs-title {
        font-size: 1rem;
    }
}
