/* ==========================================================================
   AstraShield Youtube Feed — styles
   ========================================================================== */

.asyt-wrapper {
    --asyt-accent:  #ff0000;
    --asyt-radius:  10px;
    --asyt-gap:     24px;
    --asyt-border:  1px solid #e0e0e0;
    --asyt-text:    #1a1a1a;
    --asyt-muted:   #666;
    --asyt-bg:      #fff;
    font-family: inherit;
}

/* Grid — 3 colonnes fixes en desktop, 1 en mobile ----------------------- */
.asyt-grid {
    display: grid;
    grid-template-columns: repeat( 3, 1fr );
    gap: var(--asyt-gap);
    margin-bottom: var(--asyt-gap);
}

/* Card ------------------------------------------------------------------ */
.asyt-card {
    background: var(--asyt-bg);
    border-radius: var(--asyt-radius);
    border: var(--asyt-border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform .2s ease, border-color .2s ease;
}

.asyt-card:hover {
    transform: translateY(-3px);
    border-color: #bbb;
}

/* Thumbnail ------------------------------------------------------------- */
.asyt-card__thumb {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    cursor: pointer;
    background: #000;
}

.asyt-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;   /* cover : pas de bandes noires */
    object-position: center;
    display: block;
    transition: transform .3s ease, opacity .3s ease;
}

.asyt-card:hover .asyt-card__thumb img {
    transform: scale(1.04);
    opacity: .85;
}

/* Play button — toujours visible --------------------------------------- */
.asyt-play-btn {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,.2);   /* léger voile permanent */
    border: none;
    cursor: pointer;
    transition: background .2s;
}

.asyt-card:hover .asyt-play-btn {
    background: rgba(0,0,0,.35);
}

.asyt-play-btn svg {
    width: 52px;
    height: 52px;
    fill: #fff;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.6));
    /* toujours visible, léger scale au hover */
    opacity: 1;
    transform: scale(1);
    transition: transform .2s;
}

.asyt-card:hover .asyt-play-btn svg {
    transform: scale(1.12);
}

/* Body ------------------------------------------------------------------ */
.asyt-card__body {
    padding: 14px 16px 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.asyt-card__title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.asyt-card__title a {
    color: var(--asyt-text);
    text-decoration: none;
}

.asyt-card__title a:hover {
    color: var(--asyt-accent);
}

/* Meta : date à gauche, vues à droite ---------------------------------- */
.asyt-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;   /* date gauche / vues droite */
    font-size: .8rem;
    color: var(--asyt-muted);
}

.asyt-card__date,
.asyt-card__views {
    display: flex;
    align-items: center;
    gap: 4px;
}

.asyt-card__meta svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
    flex-shrink: 0;
}

/* Description ----------------------------------------------------------- */
.asyt-card__desc {
    font-size: .85rem;
    color: var(--asyt-muted);
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* Load more ------------------------------------------------------------- */
.asyt-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 8px;
}

.asyt-load-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 80px;
    background: var(--asyt-bg);
    color: var(--asyt-text);
    border: var(--asyt-border);
    border-radius: var(--asyt-radius);
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color .2s, background .2s, opacity .2s;
}

.asyt-load-more:hover {
    border-color: #bbb;
    background: #f9f9f9;
}

.asyt-load-more:disabled {
    opacity: .6;
    cursor: not-allowed;
}

/* Lightbox -------------------------------------------------------------- */
.asyt-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
}

.asyt-lightbox.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

.asyt-lightbox__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.85);
}

.asyt-lightbox__inner {
    position: relative;
    z-index: 1;
    width: min(900px, 95vw);
    max-height: 90vh;
}

.asyt-lightbox__close {
    position: absolute;
    top: -36px;
    right: 0;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
}

.asyt-lightbox__frame {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    overflow: hidden;
}

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

/* Responsive ------------------------------------------------------------ */
@media ( max-width: 768px ) {
    .asyt-grid {
        grid-template-columns: 1fr;
    }
}

/* Animations des nouvelles cards (load more) ---------------------------- */
@keyframes asyt-fadein {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.asyt-card.asyt-new {
    animation: asyt-fadein .35s ease forwards;
}
