/* ============================================
   YT Latest Videos v2 — No API Key
   Grid + List + Lightbox Popup Player
   Works with any WordPress theme
   ============================================ */

/* ---- GRID ---- */
.ytlv-layout-grid .ytlv-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
@media (max-width: 900px) {
    .ytlv-layout-grid .ytlv-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 500px) {
    .ytlv-layout-grid .ytlv-grid { grid-template-columns: 1fr; }
}

/* ---- LIST ---- */
.ytlv-layout-list .ytlv-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.ytlv-layout-list .ytlv-card {
    display: flex;
    gap: 0;
    flex-direction: row;
    align-items: stretch;
}
.ytlv-layout-list .ytlv-thumb-wrap {
    width: 220px;
    flex-shrink: 0;
    padding-top: 0;
    height: 124px;
    border-radius: 8px 0 0 8px;
}
.ytlv-layout-list .ytlv-thumb {
    position: static;
    width: 100%;
    height: 100%;
    border-radius: 8px 0 0 8px;
}
.ytlv-layout-list .ytlv-title {
    margin: 14px 16px;
    font-size: 15px;
    align-self: center;
}
@media (max-width: 560px) {
    .ytlv-layout-list .ytlv-card { flex-direction: column; }
    .ytlv-layout-list .ytlv-thumb-wrap { width: 100%; height: auto; padding-top: 56.25%; border-radius: 8px 8px 0 0; }
    .ytlv-layout-list .ytlv-thumb { position: absolute; border-radius: 8px 8px 0 0; }
}

/* ---- CARD ---- */
.ytlv-wrap { width: 100%; box-sizing: border-box; margin: 20px 0; font-family: inherit; }
.ytlv-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,.10);
    cursor: pointer;
    transition: transform .22s ease, box-shadow .22s ease;
    outline: none;
}
.ytlv-card:hover, .ytlv-card:focus-visible {
    transform: translateY(-5px);
    box-shadow: 0 10px 28px rgba(0,0,0,.18);
}
.ytlv-card:focus-visible { outline: 3px solid #ff0000; }

/* ---- THUMBNAIL ---- */
.ytlv-thumb-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    overflow: hidden;
    background: #111;
    border-radius: 10px 10px 0 0;
}
.ytlv-thumb {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100% !important;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}
.ytlv-card:hover .ytlv-thumb { transform: scale(1.05); }

/* ---- PLAY OVERLAY ---- */
.ytlv-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0);
    transition: background .22s ease;
}
.ytlv-card:hover .ytlv-play-overlay { background: rgba(0,0,0,.35); }

.ytlv-play-btn {
    background: rgba(255,0,0,.92);
    border-radius: 50%;
    width: 52px; height: 52px;
    display: flex; align-items: center; justify-content: center;
    opacity: 0;
    transform: scale(.75);
    transition: opacity .22s ease, transform .22s ease;
}
.ytlv-play-btn svg { width: 24px; height: 24px; margin-left: 4px; }
.ytlv-card:hover .ytlv-play-btn {
    opacity: 1;
    transform: scale(1);
}

/* ---- TITLE ---- */
.ytlv-title {
    margin: 10px 12px 12px !important;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.45;
    color: #111 !important;
    word-break: break-word;
    transition: color .18s;
}
.ytlv-card:hover .ytlv-title { color: #ff0000; }

/* ---- WATCH MORE BUTTON ---- */
.ytlv-footer { text-align: center; margin-top: 30px; }
.ytlv-watch-btn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: #ff0000;
    color: #fff !important;
    text-decoration: none !important;
    padding: 13px 34px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .3px;
    transition: background .2s, transform .2s, box-shadow .2s;
    box-shadow: 0 4px 16px rgba(255,0,0,.35);
}
.ytlv-watch-btn:hover {
    background: #cc0000;
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(255,0,0,.45);
    color: #fff !important;
}

/* ---- ERROR ---- */
.ytlv-error {
    padding: 14px 18px;
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    font-size: 14px;
}

/* ======================================
   LIGHTBOX
====================================== */
.ytlv-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    animation: ytlvFadeIn .2s ease;
}

@keyframes ytlvFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.ytlv-lb-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.88);
    cursor: pointer;
}

.ytlv-lb-box {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0,0,0,.7);
    animation: ytlvSlideUp .25s ease;
}

@keyframes ytlvSlideUp {
    from { transform: translateY(30px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.ytlv-lb-close {
    position: absolute;
    top: 10px; right: 14px;
    z-index: 10;
    background: rgba(0,0,0,.6);
    border: none;
    color: #fff;
    font-size: 26px;
    line-height: 1;
    width: 38px; height: 38px;
    border-radius: 50%;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: background .18s, transform .18s;
    padding: 0;
}
.ytlv-lb-close:hover {
    background: #ff0000;
    transform: scale(1.1);
}

.ytlv-lb-title {
    padding: 14px 54px 14px 18px;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    background: #111;
    min-height: 20px;
}

.ytlv-lb-iframe-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
}

.ytlv-lb-iframe-wrap iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
    display: block;
}
