/**
 * BBWS: Showreel — frontend styles
 */

.chadai-showreel {
    /* These are designed to be overridden by the active theme. */
    --chadai-showreel-accent: #b8a050;
    --chadai-showreel-tile-bg: #111;
    --chadai-showreel-tile-text: #fff;
    --chadai-showreel-placeholder-gradient: linear-gradient(135deg, #2a2a2a 0%, #0a0a0a 100%);
    --chadai-showreel-overlay-gradient: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.2) 60%, rgba(0,0,0,0) 100%);
    --chadai-showreel-grid-gap: 30px;
    --chadai-showreel-section-spacing: 40px;
    display: block;
    width: 100%;
}

.chadai-showreel-section {
    margin: 0 0 var(--chadai-showreel-section-spacing);
}

.chadai-showreel-section-title {
    margin: 0 0 16px;
    padding: 0;
    border: 0;
    text-align: center;
}

.chadai-showreel-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--chadai-showreel-grid-gap);
    justify-content: center;
}

.chadai-showreel-tile {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    cursor: pointer;
    background: var(--chadai-showreel-tile-bg);
    border: 0;
    border-radius: 2px;
    padding: 0;
    margin: 0;
    display: block;
    flex: 0 0 calc((100% - (var(--chadai-showreel-grid-gap) * 2)) / 3);
    color: var(--chadai-showreel-tile-text);
    font-family: inherit;
}

@media (max-width: 900px) {
    .chadai-showreel-tile {
        flex-basis: calc((100% - var(--chadai-showreel-grid-gap)) / 2);
    }
}

@media (max-width: 560px) {
    .chadai-showreel-tile {
        flex-basis: 100%;
    }
}

.chadai-showreel-tile:focus-visible {
    outline: 3px solid var(--chadai-showreel-accent);
    outline-offset: 2px;
}

.chadai-showreel-thumb {
    position: absolute;
    inset: 0;
}

.chadai-showreel-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.chadai-showreel-tile:hover .chadai-showreel-thumb-img {
    transform: scale(1.04);
}

.chadai-showreel-placeholder {
    position: absolute;
    inset: 0;
    background: var(--chadai-showreel-placeholder-gradient);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    text-align: left;
    padding: 16px;
    color: var(--chadai-showreel-tile-text);
}

.chadai-showreel-placeholder-cat {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--chadai-showreel-accent);
    margin-bottom: 4px;
}

.chadai-showreel-placeholder-title {
    font-size: 15px;
    font-weight: 600;
}

.chadai-showreel-tile.is-placeholder .chadai-showreel-overlay {
    display: none;
}

.chadai-showreel-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s ease;
    pointer-events: none;
    z-index: 2;
    opacity: 1;
}

.chadai-showreel-play::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-left: 18px solid #fff;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 4px;
}


.chadai-showreel-overlay {
    position: absolute;
    inset: 0;
    background: var(--chadai-showreel-overlay-gradient);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 16px;
    color: var(--chadai-showreel-tile-text);
    text-align: left;
    pointer-events: none;
}

.chadai-showreel-cat {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--chadai-showreel-accent);
    margin-bottom: 4px;
}

.chadai-showreel-title {
    font-size: 15px;
    font-weight: 600;
}

/* Lightbox */
.chadai-showreel-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2147483647;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.chadai-showreel-lightbox[hidden] {
    display: none;
}

.chadai-showreel-lightbox-inner {
    width: 100%;
    max-width: 1000px;
    position: relative;
}

.chadai-showreel-lightbox-inner.is-vertical {
    max-width: 420px;
}

.chadai-showreel-close {
    position: absolute;
    top: -42px;
    right: 0;
    background: transparent;
    border: 0;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 10px;
}

.chadai-showreel-close:hover {
    color: var(--chadai-showreel-accent);
}

.chadai-showreel-video-wrap {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    background: #000;
}

.chadai-showreel-video-wrap iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.chadai-showreel-lightbox .instagram-media {
    margin: 0 auto !important;
    min-width: 0 !important;
}
