/* ==========================================================================
   AVA Membership — NewsList Divi module styles (lista + grid)
   Migrado desde ava-socios.
   ========================================================================== */

/* ── Shared container ─────────────────────────────────────────────────────── */
.ava-news-module {
    container-type: inline-size;
}

/* ── List mode ────────────────────────────────────────────────────────────── */
.ava-news-module--list .ava-news-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.ava-news-item {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.ava-news-item__image {
    flex-shrink: 0;
    width: 180px;
}

.ava-news-item__image img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.ava-news-item__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ava-news-item__date {
    font-size: 0.8rem;
    color: #888;
}

.ava-news-item__title {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.35;
}

.ava-news-item__title a {
    text-decoration: none;
    color: inherit;
}

.ava-news-item__title a:hover {
    color: var(--primary-color, #2271b1);
}

.ava-news-item__excerpt {
    margin: 0;
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

.ava-news-item__link {
    align-self: flex-start;
    margin-top: 0.5rem;
    font-size: 0.875rem;
}

/* ── Grid mode ────────────────────────────────────────────────────────────── */
.ava-news-module--grid .ava-news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
    align-items: start;
}

.ava-news-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s;
}

.ava-news-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.ava-news-card__image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.ava-news-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.ava-news-card:hover .ava-news-card__image img {
    transform: scale(1.03);
}

.ava-news-card__image--placeholder {
    background: #f0f0f0;
}

.ava-news-card__body {
    flex: 1;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ava-news-card__date {
    font-size: 0.78rem;
    color: #888;
}

.ava-news-card__title {
    margin: 0;
    font-size: 1rem;
    line-height: 1.4;
}

.ava-news-card__title a {
    text-decoration: none;
    color: inherit;
}

.ava-news-card__title a:hover {
    color: var(--primary-color, #2271b1);
}

.ava-news-card__excerpt {
    margin: 0;
    font-size: 0.875rem;
    color: #555;
    line-height: 1.5;

    /* Clamp a 3 líneas */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.ava-news-card__footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid #f0f0f0;
}

.ava-news-card__link {
    font-size: 0.875rem;
}

/* ── Responsive: collapse image in list mode on small screens ─────────────── */
@container (max-width: 520px) {
    .ava-news-item {
        flex-direction: column;
    }

    .ava-news-item__image {
        width: 100%;
    }

    .ava-news-item__image img {
        height: 180px;
    }
}

@container (max-width: 480px) {
    .ava-news-module--grid .ava-news-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   AVA Membership — LastNew Divi module styles (vertical + horizontal)
   Anadido al final del archivo para no tocar las reglas de NewsList.
   ========================================================================== */

.ava-lastnew-module{
    .ava-lastnew-row{
        padding: 1rem;
        display: grid;
        gap: 1rem;
        grid-template-areas: 
            "image"
            "title"
            "date"
            "body"
            "footer";
    }   

    .ava-lastnew__image{
        grid-area: image;
    }

    .ava-lastnew__title{
        grid-area: title;
    }

    .ava-lastnew__date{
        grid-area: date;
        border-top: 1px dotted #e5e5e5;
    }   

    .ava-lastnew__body{
        grid-area: body;
    }

    .ava-lastnew__footer{
        grid-area: footer;
    }

    .ava-lastnew__image img{
        max-width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        margin: 0 auto;
    }
}

@media (min-width: 992px) {
    .ava-lastnew-module .ava-lastnew-row.ava-lastnew-module--horizontal{
        grid-template-areas: 
            "date date image"
            "title body image"
            "footer footer image";

        grid-template-rows: auto auto auto;
        align-items: center;
    }

    .ava-lastnew-module--horizontal .ava-lastnew__date{
        border-top: unset;
    }
}
