/* HubLAC — Grid de vídeos do YouTube e lightbox (shortcode [youtube_playlist_thumbs]) */

.hub-yt-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.hub-yt-card {
    min-width: 0;
}

.hub-yt-open {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.hub-yt-thumb-wrap {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    background: #f2f2f2;
}

.hub-yt-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.hub-yt-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.15);
    transition: background .25s ease;
}

.hub-yt-play {
    position: absolute;
    inset: 50% auto auto 50%;
    width: 72px;
    height: 50px;
    transform: translate(-50%, -50%) scale(1);
    border-radius: 14px;
    background: rgba(255, 0, 0, 0.92);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
    transition: transform .25s ease, background .25s ease;
}

.hub-yt-play::before {
    content: "";
    position: absolute;
    inset: 50% auto auto 50%;
    transform: translate(-35%, -50%);
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #fff;
}

.hub-yt-open:hover .hub-yt-thumb {
    transform: scale(1.05);
}

.hub-yt-open:hover .hub-yt-overlay {
    background: rgba(0, 0, 0, 0.28);
}

.hub-yt-open:hover .hub-yt-play {
    transform: translate(-50%, -50%) scale(1.08);
    background: rgba(230, 0, 0, 0.98);
}

.hub-yt-title {
    margin: 12px 0 0;
    font-size: 16px;
    line-height: 1.4;
}

.hub-yt-title-button {
    display: inline;
    width: auto;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.hub-yt-title-button:hover {
    text-decoration: underline;
}

.hub-yt-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}

.hub-yt-modal.is-active {
    opacity: 1;
    visibility: visible;
}

.hub-yt-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.hub-yt-modal__dialog {
    position: relative;
    z-index: 2;
    width: min(92vw, 1000px);
    margin: 5vh auto 0;
}

.hub-yt-modal__close {
    position: absolute;
    top: -42px;
    right: 0;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #111;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.hub-yt-modal__frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
}

.hub-yt-modal__frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

body.hub-yt-modal-open {
    overflow: hidden;
}

@media (max-width: 900px) {
    .hub-yt-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .hub-yt-grid {
        grid-template-columns: 1fr;
    }

    .hub-yt-play {
        width: 64px;
        height: 44px;
    }

    .hub-yt-modal__dialog {
        width: min(94vw, 1000px);
        margin-top: 12vh;
    }
}
