/* ============================================================
   Allymonews YouTube Integration — Frontend Styles
   ============================================================ */

/* ── Grid Layout ────────────────────────────────────────── */
.ally-yt-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin: 24px 0;
}

.ally-yt-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    cursor: pointer;
    transition: transform .2s, box-shadow .2s;
}
.ally-yt-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.12); }

.ally-yt-thumb-wrap {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 */
    overflow: hidden;
    background: #000;
}
.ally-yt-thumb {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: opacity .2s;
}
.ally-yt-card:hover .ally-yt-thumb { opacity: .85; }

.ally-yt-play-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 54px; height: 54px;
    background: rgba(255,0,0,.85);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 18px;
    opacity: 0;
    transition: opacity .2s;
    pointer-events: none;
}
.ally-yt-card:hover .ally-yt-play-btn { opacity: 1; }

.ally-yt-info { padding: 12px 14px 14px; }
.ally-yt-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ally-yt-meta { font-size: 12px; color: #94a3b8; }

/* Inline embed */
.ally-yt-embed-wrap {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}
.ally-yt-embed-wrap iframe {
    width: 100%; height: 100%;
    border: none;
}

/* ── Row Layout ─────────────────────────────────────────── */
.ally-yt-row-wrap {
    overflow-x: auto;
    padding-bottom: 8px;
    margin: 24px 0;
    -webkit-overflow-scrolling: touch;
}
.ally-yt-row {
    display: flex;
    gap: 16px;
    width: max-content;
    padding: 4px 2px;
}
.ally-yt-row-card {
    width: 220px;
    cursor: pointer;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    transition: transform .2s;
}
.ally-yt-row-card:hover { transform: translateY(-2px); }
.ally-yt-row-card .ally-yt-title {
    padding: 8px 10px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Featured Layout ────────────────────────────────────── */
.ally-yt-featured-wrap {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
    margin: 24px 0;
    align-items: start;
}
@media (max-width: 768px) {
    .ally-yt-featured-wrap { grid-template-columns: 1fr; }
}

.ally-yt-featured-player {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
}
.ally-yt-featured-thumb {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
}
.ally-yt-featured-play {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 70px; height: 70px;
    background: rgba(255,0,0,.9);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: 26px;
    transition: background .2s, transform .2s;
}
.ally-yt-featured-player:hover .ally-yt-featured-play {
    background: #ff0000;
    transform: translate(-50%, -50%) scale(1.1);
}
.ally-yt-featured-embed {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
}
.ally-yt-featured-embed iframe { width: 100%; height: 100%; border: none; }

.ally-yt-featured-title {
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
    margin-top: 12px;
    line-height: 1.4;
}
.ally-yt-featured-desc {
    font-size: 14px;
    color: #64748b;
    margin-top: 6px;
    line-height: 1.5;
}

/* Sidebar */
.ally-yt-featured-sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 480px;
    overflow-y: auto;
}
.ally-yt-sidebar-item {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .15s;
    align-items: center;
}
.ally-yt-sidebar-item:hover { background: #f1f5f9; }
.ally-yt-sidebar-active { background: #e0f2fe; }
.ally-yt-sidebar-item img { width: 100px; height: 60px; object-fit: cover; border-radius: 6px; }
.ally-yt-sidebar-item span { font-size: 12.5px; font-weight: 600; color: #1e293b; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ── Widget ─────────────────────────────────────────────── */
.ally-yt-widget { display: flex; flex-direction: column; gap: 12px; }
.ally-yt-widget-item { display: grid; grid-template-columns: 80px 1fr; gap: 10px; align-items: center; }
.ally-yt-widget-item img { width: 80px; height: 50px; object-fit: cover; border-radius: 4px; }
.ally-yt-widget-title { display: block; font-size: 13px; font-weight: 600; color: #1e293b; line-height: 1.3; text-decoration: none; }
.ally-yt-widget-title:hover { color: #0891b2; }
.ally-yt-widget-meta { font-size: 11px; color: #94a3b8; }

/* ── Lightbox Modal ─────────────────────────────────────── */
.ally-yt-modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,.85);
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.ally-yt-modal-overlay.active { display: flex; }
.ally-yt-modal-inner {
    width: 90%;
    max-width: 860px;
    position: relative;
}
.ally-yt-modal-inner iframe { width: 100%; aspect-ratio: 16/9; border: none; border-radius: 8px; }
.ally-yt-modal-close {
    position: absolute;
    top: -36px; right: 0;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    background: none;
    border: none;
    line-height: 1;
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 600px) {
    .ally-yt-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .ally-yt-featured-sidebar { flex-direction: row; overflow-x: auto; overflow-y: visible; max-height: none; }
    .ally-yt-sidebar-item { grid-template-columns: 1fr; min-width: 130px; }
}
@media (max-width: 400px) {
    .ally-yt-grid { grid-template-columns: 1fr; }
}
