/* =========================================================
   Latest Posts – h-ultimas-noticias.css
   Standard: 4-col CSS Grid aligned with Hero section
   ========================================================= */

/* ---- Desktop Grid (4 columns) ---- */
.desktop-latest-posts-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
    width: 100%;
}

.desktop-latest-posts-container a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.desktop-latest-posts-container a:hover {
    color: #ff5100;
}

.desktop-latest-post-item {
    display: flex;
    flex-direction: column;
    min-width: 0; /* prevent overflow */
}

.desktop-latest-post-item > a > img,
.desktop-latest-post-item img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin-bottom: 12px;
    border-radius: 6px;
    display: block;
}

.desktop-latest-post-item h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 8px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.desktop-latest-post-item h3 a {
    color: inherit;
    text-decoration: none;
}

.desktop-latest-post-item h3 a:hover {
    color: #ff5100;
}

.desktop-latest-post-item .post-date {
    font-size: 12px;
    color: #777;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.desktop-latest-post-item p.excerpt {
    font-size: 14px;
    font-weight: 400;
    color: #555;
    margin: 6px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---- Tablet (2 columns) ---- */
@media (max-width: 1024px) {
    .desktop-latest-posts-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
    }
}

/* ---- Mobile (1 column – card style) ---- */
@media (max-width: 640px) {
    .desktop-latest-posts-container {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .desktop-latest-post-item {
        flex-direction: row;
        align-items: center;
        gap: 12px;
        border-bottom: 1px solid #f0f0f0;
        padding: 14px 0;
    }

    .desktop-latest-post-item:last-child {
        border-bottom: none;
    }

    .desktop-latest-post-item > a {
        flex-shrink: 0;
        width: 110px;
    }

    .desktop-latest-post-item > a > img,
    .desktop-latest-post-item img {
        width: 110px !important;
        height: 62px !important;
        aspect-ratio: 16 / 9 !important;
        margin-bottom: 0;
        border-radius: 4px !important;
    }

    .desktop-latest-post-item h3 {
        font-size: 14px !important;
        font-weight: 700;
        margin: 0 0 4px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        height: auto !important; /* Override desktop height */
    }

    .desktop-latest-post-item .post-date {
        font-size: 10px;
    }

    .desktop-latest-post-item p.excerpt {
        display: none;
    }

    .desktop-latest-post-item:nth-child(n+4) {
        display: none !important; /* Muestra solo 3 notas en mobile */
    }
}

/* ---- Legacy mobile container (keep for compat) ---- */
.mobile-latest-posts-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 5px 0;
}

.mobile-latest-post-item {
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 15px;
}

.mobile-latest-post-item:last-child {
    border-bottom: none;
}

.mobile-latest-post-item > a > img {
    width: 110px;
    height: 62px;
    object-fit: cover;
    border-radius: 4px;
}

.mobile-latest-post-item h3 {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mobile-latest-post-item h3 a {
    text-decoration: none;
    color: inherit;
}

.mobile-latest-post-item p {
    margin: 4px 0 0;
    font-size: 13px;
    color: #666;
}
