/* ── Grid ── */
.ytf-grid {
    display: grid;
    gap: 24px;
    margin: 24px 0;
}

.ytf-grid[data-columns="2"] { grid-template-columns: repeat(2, 1fr); }
.ytf-grid[data-columns="3"] { grid-template-columns: repeat(3, 1fr); }
.ytf-grid[data-columns="4"] { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
    .ytf-grid[data-columns="3"],
    .ytf-grid[data-columns="4"] {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .ytf-grid[data-columns="2"],
    .ytf-grid[data-columns="3"],
    .ytf-grid[data-columns="4"] {
        grid-template-columns: 1fr;
    }
}

/* ── Card ── */
.ytf-item {
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    transition: transform .2s ease, box-shadow .2s ease;
}

.ytf-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
}

/* ── Thumbnail ── */
.ytf-thumb-link {
    display: block;
    text-decoration: none;
}

.ytf-thumb-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: #000;
}

.ytf-thumb-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

.ytf-item:hover .ytf-thumb-wrap img {
    transform: scale(1.05);
}

/* Play button overlay */
.ytf-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: .85;
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}

.ytf-item:hover .ytf-play-btn {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.1);
}

/* ── Title ── */
.ytf-title {
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    padding: 12px 14px;
    color: #1a1a1a;
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* ── Error ── */
.ytf-error {
    color: #b00;
    font-style: italic;
}

/* ── Lightbox ── */
.ytf-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ytf-lightbox-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .85);
    cursor: pointer;
}

.ytf-lightbox-content {
    position: relative;
    width: 90%;
    max-width: 960px;
    z-index: 1;
    animation: ytfFadeIn .25s ease;
}

.ytf-lightbox-video {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
}

.ytf-lightbox-video iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.ytf-lightbox-close {
    position: absolute;
    top: -44px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    transition: opacity .2s;
}

.ytf-lightbox-close:hover {
    opacity: .7;
}

@keyframes ytfFadeIn {
    from { opacity: 0; transform: scale(.95); }
    to   { opacity: 1; transform: scale(1); }
}
