/* ── Ảnh thumbnail video có nút play, bấm vào mở popup ── */
.yt-thumb {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #000;
    cursor: pointer;
    border-radius: 6px;
}
.yt-thumb img {
    width: 100%;
    height: 100%;
    max-height: none;
    object-fit: cover;
    display: block;
    transition: transform .5s cubic-bezier(.2, .8, .2, 1);
}
.yt-thumb:hover img { transform: scale(1.05) }
.yt-thumb .yt-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 0, 51, .92);
    color: #fff;
    font-size: 22px;
    box-shadow: 0 6px 18px -6px rgba(0, 0, 0, .6);
    transition: transform .22s;
}
.yt-thumb .yt-play i { margin-left: 4px }
.yt-thumb:hover .yt-play { transform: translate(-50%, -50%) scale(1.1) }
.yt-thumb-lg .yt-play { width: 76px; height: 76px; font-size: 30px }
.yt-title {
    display: block;
    margin: 8px 0 14px;
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 600;
    line-height: 1.4;
    text-align: left;
    color: #333;
    cursor: pointer;
}
.yt-title:hover { color: #39c47c }

/* ── Popup video toàn màn hình ── */
body.video-modal-open { overflow: hidden }
.video-modal {
    position: fixed;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 28px;
    opacity: 0;
    transition: opacity .2s ease;
}
.video-modal[hidden] { display: none }
/* Không dùng class .show: main.css (bootstrap) có .show { display: block !important } làm hỏng flex */
.video-modal.is-open { opacity: 1 }
.video-modal-backdrop {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    background: rgba(6, 4, 10, .88);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    cursor: zoom-out;
}
/* Rộng tối đa theo màn hình nhưng giữ 16:9 vừa chiều cao (trừ thanh tiêu đề 48px + padding 2 bên) */
.video-modal-inner {
    position: relative;
    width: 100%;
    max-width: calc((100vh - 48px - 56px) * 16 / 9);
    margin: 0 auto;
    transform: scale(.97);
    transition: transform .22s cubic-bezier(.2, .8, .2, 1);
}
.video-modal.is-open .video-modal-inner { transform: scale(1) }
.video-modal-bar {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}
.video-modal-title {
    flex: 1;
    min-width: 0;
    margin-right: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
}
.video-modal-acts { display: flex; flex-shrink: 0 }
.video-modal-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    margin-left: 8px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    font-size: 17px;
    text-decoration: none;
    cursor: pointer;
    transition: background .18s, border-color .18s, transform .18s;
}
.video-modal-btn:hover,
.video-modal-btn:focus {
    background: rgba(255, 255, 255, .18);
    border-color: rgba(255, 255, 255, .38);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}
.video-modal-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 14px;
    background: #000;
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .9);
}
.video-modal-frame iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (max-width: 767px) {
    .video-modal { padding: 14px }
    .video-modal-inner { max-width: calc((100vh - 48px - 28px) * 16 / 9) }
    .video-modal-title { font-size: 14px }
}
