/* ═══════════════════════════════════════════════════════ */
/* CONTAINER ULTIMI ARTICOLI */
/* ═══════════════════════════════════════════════════════ */
.recent-articles-wrapper {
    max-width: 1320px;
    margin: 60px auto;
    padding: 0 20px;
}

/* ═══════════════════════════════════════════════════════ */
/* GRID LAYOUT */
/* ═══════════════════════════════════════════════════════ */
.recent-grid {
    display: grid;
    gap: 32px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.recent-grid.cols-2 {
    grid-template-columns: repeat(auto-fill, minmax(450px, 1fr));
}

.recent-grid.cols-3 {
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
}

.recent-grid.cols-4 {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* ═══════════════════════════════════════════════════════ */
/* CARD BASE */
/* ═══════════════════════════════════════════════════════ */
.recent-card {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100%;
    animation: fadeInUpRecent 0.6s ease-out backwards;
}

.recent-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}

.recent-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* ═══════════════════════════════════════════════════════ */
/* IMAGE SECTION */
/* ═══════════════════════════════════════════════════════ */
.recent-thumbnail {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.recent-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.recent-card:hover .recent-thumbnail img {
    transform: scale(1.1);
}

.recent-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.recent-placeholder svg {
    width: 80px;
    height: 80px;
    color: rgba(255, 255, 255, 0.5);
}

/* Badge "Nuovo" */
.recent-new-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

.new-icon {
    font-size: 24px;
    line-height: 1;
}

/* Badge Data */
.recent-date-badge {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 8px 14px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 2;
}

.recent-date-badge svg {
    color: #4facfe;
}

.recent-date-badge span {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

/* ═══════════════════════════════════════════════════════ */
/* CONTENT SECTION */
/* ═══════════════════════════════════════════════════════ */
.recent-content {
    padding: 28px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.recent-title {
    font-size: 22px;
    font-weight: 700;
    line-height: 1.4;
    color: #1a1a1a;
    margin: 0 0 16px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s;
}

.recent-card:hover .recent-title {
    color: #4facfe;
}

.recent-excerpt {
    font-size: 16px;
    line-height: 1.7;
    color: #666;
    margin: 0 0 24px 0;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ═══════════════════════════════════════════════════════ */
/* FOOTER / CTA */
/* ═══════════════════════════════════════════════════════ */
.recent-footer {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.recent-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: #4facfe;
    transition: all 0.3s;
}

.recent-card:hover .recent-cta {
    gap: 12px;
    color: #00f2fe;
}

/* ═══════════════════════════════════════════════════════ */
/* NO ARTICLES MESSAGE */
/* ═══════════════════════════════════════════════════════ */
.no-recent-articles {
    text-align: center;
    padding: 80px 20px;
}

.no-recent-articles p {
    font-size: 18px;
    color: #999;
    margin: 0;
}

/* ═══════════════════════════════════════════════════════ */
/* RESPONSIVE */
/* ═══════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .recent-grid.cols-4 {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

@media (max-width: 768px) {
    .recent-articles-wrapper {
        margin: 40px auto;
        padding: 0 16px;
    }

    .recent-grid,
    .recent-grid.cols-2,
    .recent-grid.cols-3,
    .recent-grid.cols-4 {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .recent-thumbnail {
        height: 220px;
    }

    .recent-content {
        padding: 24px;
    }

    .recent-title {
        font-size: 20px;
    }

    .recent-excerpt {
        font-size: 15px;
    }

    .recent-new-badge {
        width: 42px;
        height: 42px;
        top: 12px;
        left: 12px;
    }

    .new-icon {
        font-size: 20px;
    }

    .recent-date-badge {
        bottom: 12px;
        right: 12px;
        padding: 6px 12px;
    }

    .recent-date-badge span {
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .recent-articles-wrapper {
        margin: 30px auto;
    }

    .recent-thumbnail {
        height: 200px;
    }

    .recent-content {
        padding: 20px;
    }

    .recent-title {
        font-size: 18px;
        margin-bottom: 12px;
    }

    .recent-excerpt {
        font-size: 14px;
        margin-bottom: 20px;
    }
}

/* ═══════════════════════════════════════════════════════ */
/* ANIMATIONS */
/* ═══════════════════════════════════════════════════════ */
@keyframes fadeInUpRecent {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.recent-card:nth-child(1) { animation-delay: 0.1s; }
.recent-card:nth-child(2) { animation-delay: 0.2s; }
.recent-card:nth-child(3) { animation-delay: 0.3s; }
.recent-card:nth-child(4) { animation-delay: 0.4s; }
.recent-card:nth-child(5) { animation-delay: 0.5s; }
.recent-card:nth-child(6) { animation-delay: 0.6s; }
