/**
 * CSS du bloc "Actualités, Vidéos & Événements" (home)
 * Écrit en CSS vanilla (NON compilé via Vite) pour éviter le rebuild du dist.
 * Enqueue dans inc/inc.theme.php.
 */

/* ----- Section ----- */
.actus-videos {
    background-color: #fff;
    padding-top: 3rem;
    padding-bottom: 3rem;
}
@media (min-width: 1024px) {
    .actus-videos {
        padding-top: 6rem;
        padding-bottom: 6rem;
    }
}
.actus-videos > .content {
    padding-left: 1.25rem;
    padding-right: 1.25rem;
    margin-left: auto;
    margin-right: auto;
    max-width: 1200px;
}
@media (min-width: 1024px) {
    .actus-videos > .content {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* ----- En-tête ----- */
.actus-videos__head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
    margin-bottom: 2.5rem;
}
@media (min-width: 1024px) {
    .actus-videos__head {
        margin-bottom: 4rem;
    }
}

.actus-videos__preview-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    background-color: var(--color-ad-orange-200);
    color: var(--color-ad-orange-700);
    border-radius: 9999px;
    border: 1px solid var(--color-ad-orange-500);
}

.actus-videos__title {
    text-transform: uppercase;
    font-family: 'LayarBahtera', sans-serif;
    font-size: 1.875rem;
    line-height: 2.25rem;
    color: var(--ad-primary-500);
    margin: 0;
}
@media (min-width: 1024px) {
    .actus-videos__title {
        font-size: 3rem;
        line-height: 1;
    }
}

.actus-videos__subtitle {
    color: var(--ad-primary-500);
    font-size: 0.875rem;
    font-style: italic;
    margin: 0;
}
@media (min-width: 1024px) {
    .actus-videos__subtitle {
        font-size: 1rem;
    }
}

/* ----- Grille ----- */
.actus-videos__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}
@media (min-width: 768px) {
    .actus-videos__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (min-width: 1024px) {
    .actus-videos__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 2rem;
    }
}

/* ----- Cartes ----- */
.actus-videos__card {
    position: relative;
    background-color: #fff;
    border-radius: 0.375rem;
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
}
.actus-videos__card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    border-color: #d4d4d4;
    transform: translateY(-0.25rem);
}
.actus-videos__card:hover .actus-videos__media img {
    transform: scale(1.05);
}
.actus-videos__card:hover .actus-videos__card-title {
    color: var(--ad-primary-500);
}

.actus-videos__card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 0;
    padding: 0;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    border-radius: 0.375rem;
}
button.actus-videos__card-link {
    cursor: pointer;
}

/* ----- Media (image preview) ----- */
.actus-videos__media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: var(--ad-primary-200);
}
.actus-videos__media > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.actus-videos__media-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-image: linear-gradient(to bottom right, var(--ad-primary-200), var(--ad-primary-500));
    opacity: 0.7;
}
.actus-videos__media-placeholder > .icon {
    width: 4rem;
    height: 4rem;
    fill: #fff;
    opacity: 0.6;
}

/* ----- Bouton play (overlay au centre) ----- */
.actus-videos__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 5rem;
    height: 5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-ad-vert-100);
    border-radius: 9999px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s;
    pointer-events: none;
}
.actus-videos__play > svg {
    width: 2.5rem;
    height: 2.5rem;
    margin-left: 0.25rem;
    fill: var(--color-ad-vert-700);
}
.actus-videos__card:hover .actus-videos__play {
    transform: translate(-50%, -50%) scale(1.1);
}

/* ----- Tag (Vidéo / Actualité / Événement) ----- */
.actus-videos__type {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.25rem 0.75rem;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
    background-color: var(--color-ad-vert-100);
    color: var(--color-ad-vert-700);
    border-radius: 0.125rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    pointer-events: none;
}

/* ----- Body (texte sous l'image) ----- */
.actus-videos__body {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1.25rem;
    flex: 1 1 0%;
}

.actus-videos__date {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ad-primary-500);
    font-weight: 500;
    opacity: 0.7;
}

.actus-videos__card-title {
    font-family: 'LayarBahtera', sans-serif;
    text-transform: uppercase;
    font-size: 1rem;
    line-height: 1.375;
    color: var(--ad-primary-700);
    transition: color 0.3s;
    margin: 0;
}
@media (min-width: 1024px) {
    .actus-videos__card-title {
        font-size: 1.125rem;
    }
}

.actus-videos__excerpt {
    font-size: 0.875rem;
    color: var(--ad-primary-700);
    line-height: 1.625;
    margin-top: 0.5rem;
    opacity: 0.85;
}

/* ---------- Modale vidéo dédiée (namespacée) ---------- */
.actus-videos__modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.85);
}

.actus-videos__modal-inner {
    position: relative;
    width: 100%;
    max-width: 64rem;
}

.actus-videos__modal-close {
    position: absolute;
    top: -3rem;
    right: 0;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.875rem;
    line-height: 1;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: opacity 0.2s;
    opacity: 0.8;
}
.actus-videos__modal-close:hover {
    opacity: 1;
}

.actus-videos__modal-video {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 0.375rem;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}
.actus-videos__modal-video > iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Support du x-cloak pour Alpine.js */
[x-cloak] {
    display: none !important;
}
