/* ===========================
   YT Feed – Front-end Styles
   =========================== */

/* Grid layout */
.ytf-feed {
    display: grid;
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ytf-cols-1 { grid-template-columns: repeat(1, 1fr); }
.ytf-cols-2 { grid-template-columns: repeat(2, 1fr); }
.ytf-cols-3 { grid-template-columns: repeat(3, 1fr); }
.ytf-cols-4 { grid-template-columns: repeat(4, 1fr); }
.ytf-cols-5 { grid-template-columns: repeat(5, 1fr); }
.ytf-cols-6 { grid-template-columns: repeat(6, 1fr); }

/* Responsive: collapse to 1 column on mobile */
@media ( max-width: 600px ) {
    .ytf-feed { grid-template-columns: 1fr !important; }
}
@media ( min-width: 601px ) and ( max-width: 900px ) {
    .ytf-cols-3,
    .ytf-cols-4,
    .ytf-cols-5,
    .ytf-cols-6 { grid-template-columns: repeat(2, 1fr); }
}

/* Individual video item */
.ytf-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Thumbnail wrapper */
.ytf-thumb-wrap {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 6px;
    background: #000;
}

.ytf-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.ytf-thumb-wrap:hover .ytf-thumb {
    transform: scale(1.03);
    opacity: 0.85;
}

/* Play button overlay */
.ytf-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 42px;
    pointer-events: none;
    transition: transform 0.2s ease;
}

.ytf-thumb-wrap:hover .ytf-play-btn {
    transform: translate(-50%, -50%) scale(1.1);
}

.ytf-play-bg {
    fill: #ff0000;
    opacity: 0.9;
}

.ytf-play-arrow {
    fill: #fff;
}

/* Duration badge */
.ytf-duration {
    position: absolute;
    bottom: 6px;
    right: 8px;
    background: rgba(0,0,0,0.75);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    padding: 3px 6px;
    border-radius: 3px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    pointer-events: none;
}

/* Meta area */
.ytf-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ytf-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
}

.ytf-title a {
    color: inherit;
    text-decoration: none;
}

.ytf-title a:hover {
    text-decoration: underline;
}

.ytf-sub-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ytf-date,
.ytf-views {
    font-size: 12px;
    color: #666;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ytf-description {
    font-size: 12px;
    color: #555;
    margin: 0;
    line-height: 1.5;
}

/* Error state */
.ytf-error {
    padding: 12px 16px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    font-size: 14px;
    color: #856404;
}

/* ===========================
   Lightbox
   =========================== */

.ytf-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

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

.ytf-lightbox-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ytf-lightbox-x {
    position: absolute;
    top: -40px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.8;
}

.ytf-lightbox-x:hover {
    opacity: 1;
}

.ytf-lightbox-video-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 6px;
    overflow: hidden;
}

.ytf-lightbox-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.ytf-lightbox-title {
    color: #fff;
    font-size: 14px;
    margin: 0;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    opacity: 0.85;
}
