/* =============================================
   YT Channel Embed — ytce.css
   ============================================= */

/* ── Variables thèmes ── */
.ytce-theme-dark {
    --ytce-bg:          #0f0f0f;
    --ytce-surface:     #1a1a1a;
    --ytce-surface2:    #242424;
    --ytce-border:      #2d2d2d;
    --ytce-text:        #f1f1f1;
    --ytce-text-muted:  #aaa;
    --ytce-accent:      #ff0000;
    --ytce-accent-h:    #cc0000;
    --ytce-shadow:      0 4px 20px rgba(0,0,0,.6);
    --ytce-radius:      10px;
}
.ytce-theme-light {
    --ytce-bg:          #f9f9f9;
    --ytce-surface:     #ffffff;
    --ytce-surface2:    #f0f0f0;
    --ytce-border:      #e0e0e0;
    --ytce-text:        #0f0f0f;
    --ytce-text-muted:  #666;
    --ytce-accent:      #ff0000;
    --ytce-accent-h:    #cc0000;
    --ytce-shadow:      0 2px 12px rgba(0,0,0,.10);
    --ytce-radius:      10px;
}

/* ── Wrapper ── */
.ytce-wrap {
    background: var(--ytce-bg);
    border-radius: 12px;
    overflow: hidden;
    font-family: 'Segoe UI', 'Roboto', sans-serif;
    color: var(--ytce-text);
}
.ytce-error {
    background: #fff0f0;
    border: 1px solid #fcc;
    color: #900;
    border-radius: 8px;
    padding: 16px 20px;
    margin: 12px 0;
    font-size: 14px;
}

/* ── Bannière ── */
.ytce-banner {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: var(--ytce-surface2);
}
@media (min-width: 600px) { .ytce-banner { height: 220px; } }
@media (min-width: 900px) { .ytce-banner { height: 270px; } }

/* ── Header chaîne ── */
.ytce-header { background: var(--ytce-surface); }
.ytce-channel-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px 20px;
    flex-wrap: wrap;
}
.ytce-avatar {
    width: 72px; height: 72px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--ytce-border);
    flex-shrink: 0;
}
@media (min-width: 600px) { .ytce-avatar { width: 88px; height: 88px; } }
.ytce-channel-text { flex: 1; min-width: 0; }
.ytce-channel-name {
    margin: 0 0 6px;
    font-size: clamp(16px, 3vw, 22px);
    font-weight: 700;
    color: var(--ytce-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ytce-channel-stats {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--ytce-text-muted);
    margin-bottom: 10px;
}
.ytce-stat strong { color: var(--ytce-text); }
.ytce-channel-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--ytce-accent);
    color: #fff !important;
    text-decoration: none !important;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    transition: background .2s, transform .15s;
}
.ytce-channel-link:hover { background: var(--ytce-accent-h); transform: translateY(-1px); }
.ytce-channel-link svg { width: 16px; height: 16px; }

/* ── Grille ── */
.ytce-grid {
    display: grid;
    gap: 16px;
    padding: 20px;
    grid-template-columns: 1fr;
}
@media (min-width: 480px) {
    .ytce-cols-2, .ytce-cols-3, .ytce-cols-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
    .ytce-cols-3, .ytce-cols-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1100px) {
    .ytce-cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ── Carte ── */
.ytce-card {
    background: var(--ytce-surface);
    border-radius: var(--ytce-radius);
    overflow: hidden;
    box-shadow: var(--ytce-shadow);
    transition: transform .22s, box-shadow .22s;
    cursor: pointer;
}
.ytce-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0,0,0,.35);
}

/* ── Thumbnail ── */
.ytce-thumb-wrap {
    position: relative;
    padding-top: 56.25%;
    background: #000;
    overflow: hidden;
}
.ytce-thumb {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform .3s, opacity .3s;
}
.ytce-card:hover .ytce-thumb { transform: scale(1.04); opacity: .85; }

.ytce-play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .2s;
}
.ytce-card:hover .ytce-play-btn { opacity: 1; }
.ytce-play-btn svg { width: 64px; height: 44px; filter: drop-shadow(0 2px 8px rgba(0,0,0,.6)); }
.ytce-play-bg { fill: var(--ytce-accent); opacity: .92; }
.ytce-play-arrow { fill: #fff; }

.ytce-duration {
    position: absolute;
    bottom: 8px; right: 8px;
    background: rgba(0,0,0,.85);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: .3px;
}

/* ── Corps carte ── */
.ytce-card-body { padding: 12px 14px 14px; }
.ytce-card-title {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ytce-card-title a {
    color: var(--ytce-text) !important;
    text-decoration: none !important;
}
.ytce-card-title a:hover { color: var(--ytce-accent) !important; }
.ytce-card-desc {
    margin: 0 0 8px;
    font-size: 12px;
    color: var(--ytce-text-muted);
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.ytce-card-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--ytce-text-muted);
}
.ytce-meta-item { display: flex; align-items: center; gap: 3px; }

/* ── Voir plus ── */
.ytce-load-more-wrap {
    display: flex;
    justify-content: center;
    padding: 0 20px 28px;
}
.ytce-load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--ytce-surface2);
    color: var(--ytce-text);
    border: 1px solid var(--ytce-border);
    border-radius: 24px;
    padding: 12px 32px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .15s, box-shadow .2s;
}
.ytce-load-more-btn:hover {
    background: var(--ytce-accent);
    border-color: var(--ytce-accent);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(255,0,0,.35);
}
.ytce-load-more-btn:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.ytce-end-msg {
    text-align: center;
    color: var(--ytce-text-muted);
    font-size: 13px;
    padding: 0 20px 24px;
    margin: 0;
}

/* ── Spinner ── */
.ytce-spinner {
    width: 18px; height: 18px;
    animation: ytce-spin 1s linear infinite;
}
@keyframes ytce-spin { to { transform: rotate(360deg); } }

/* ── Modal ── */
.ytce-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}
.ytce-modal.is-open { display: flex; }
.ytce-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.88);
    backdrop-filter: blur(4px);
}
.ytce-modal-inner {
    position: relative;
    width: 94vw;
    max-width: 900px;
    z-index: 1;
}
.ytce-modal-close {
    position: absolute;
    top: -38px; right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    opacity: .8;
    padding: 4px 8px;
    transition: opacity .15s;
}
.ytce-modal-close:hover { opacity: 1; }
.ytce-modal-player {
    position: relative;
    padding-top: 56.25%;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
}
.ytce-modal-player iframe {
    position: absolute;
    inset: 0;
    width: 100%; height: 100%;
}

/* ── Animation entrée cartes ── */
.ytce-card { animation: ytce-card-in .35s ease both; }
@keyframes ytce-card-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}
