/*
 * Articles Liés Elementor – Frontend CSS
 * Compatible FlyingPress / cache de page (pas de JS inline requis)
 */

/* ── Grille responsive ────────────────────────────────────────────────────── */

.ale-grid {
    display: grid;
    grid-template-columns: repeat( var(--ale-cols-desktop, 3), 1fr );
    gap: 24px; /* valeur par défaut, surchargée par le widget */
    width: 100%;
}

/* Tablette : breakpoint Elementor à 1024px */
@media (max-width: 1024px) {
    .ale-grid {
        grid-template-columns: repeat( var(--ale-cols-tablet, 2), 1fr );
    }
}

/* Mobile : breakpoint Elementor à 767px */
@media (max-width: 767px) {
    .ale-grid {
        grid-template-columns: repeat( var(--ale-cols-mobile, 1), 1fr );
    }
}

/* ── Item wrapper ─────────────────────────────────────────────────────────── */

.ale-item {
    /* Permet aux Loop Templates d'utiliser height: 100% */
    display: flex;
    flex-direction: column;
}

.ale-item > * {
    flex: 1;
}

/* ── Titre de section ─────────────────────────────────────────────────────── */

.ale-section-title {
    margin-top: 0;
    margin-bottom: 24px;
}

/* ── Message "aucun article" ─────────────────────────────────────────────── */

.ale-empty {
    opacity: 0.6;
    font-style: italic;
}

/* ──────────────────────────────────────────────────────────────────────────── */
/* FALLBACK CARD                                                                */
/* Utilisée uniquement si aucun Loop Template n'est configuré.                 */
/* ──────────────────────────────────────────────────────────────────────────── */

.ale-fallback-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
    transition: box-shadow 0.2s ease;
}

.ale-fallback-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.10);
}

/* Miniature */
.ale-card-thumb {
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.ale-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.ale-fallback-card:hover .ale-card-thumb img {
    transform: scale(1.04);
}

/* Corps */
.ale-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 20px;
    gap: 8px;
}

/* Catégories */
.ale-card-cats {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    opacity: 0.6;
}

.ale-card-cats a {
    color: inherit;
    text-decoration: none;
}

/* Titre */
.ale-card-title {
    margin: 0;
    font-size: 17px;
    line-height: 1.35;
}

.ale-card-title a {
    color: inherit;
    text-decoration: none;
}

.ale-card-title a:hover {
    text-decoration: underline;
}

/* Extrait */
.ale-card-excerpt {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    opacity: 0.75;

    /* Troncature à 3 lignes */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Pied de carte */
.ale-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 12px;
    gap: 8px;
}

.ale-card-date {
    font-size: 12px;
    opacity: 0.5;
}

.ale-card-more {
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    color: inherit;
    white-space: nowrap;
}

.ale-card-more:hover {
    text-decoration: underline;
}

/* ──────────────────────────────────────────────────────────────────────────── */
/* PREVIEW ÉDITEUR ELEMENTOR                                                   */
/* ──────────────────────────────────────────────────────────────────────────── */

.ale-editor-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 32px 20px;
    border: 2px dashed rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    text-align: center;
    gap: 6px;
    min-height: 120px;
}

.ale-editor-icon {
    font-size: 32px;
    opacity: 0.3;
    line-height: 1;
    margin-bottom: 8px;
}

.ale-editor-preview p {
    margin: 0;
}
