.blog-list-container {
    max-width: 1280px;
    margin: 0 auto;
    box-sizing: border-box;
    height: 100svh;
}

.blog-header {
    text-align: center;
    position: relative;
    min-height: 200px;
    /* altezza minima assoluta */
    /* non c'è più height fissa */
}

.blog-header-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* occupa tutto il contenitore */
    object-fit: cover;
    /* l'immagine mantiene le proporzioni, copre l'area (si ritaglia ai lati) */
    display: block;
    z-index: 0;
}

/* Overlay scuro sopra l'immagine */
.blog-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
    pointer-events: none;
}

/* Testo sopra overlay */
.blog-header>*:not(.blog-header-img) {
    position: absolute;
    z-index: 2;
}

.blog-header h1 {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    z-index: 2;
}

.blog-header p {
    position: absolute;
    bottom: 20px;
    /* o quello che preferisci */
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    font-size: 1rem;
    z-index: 2;
    margin: 0;
}

.articles-grid {
    display: grid;
    gap: 1.5rem;
    margin: 3rem 1rem 3rem 1rem;
}

.article-card {
    background: white;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.article-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background-color: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.article-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 20vw;
}

.article-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    margin-top: 0;
}

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

.article-title a:hover {
    color: #2563eb;
}

.article-summary {
    color: #475569;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
}

.article-meta {
    font-size: 0.75rem;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
    display: contents;
}

.read-more {
    background: none;
    border: none;
    color: #2563eb;
    font-weight: 500;
    font-size: 0.875rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.read-more:hover {
    gap: 0.5rem;
}

.pagination-container {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
}

/* ===== GRIGLIA RESPONSIVE ===== */
/* Mobile: 1 colonna */
.articles-grid {
    grid-template-columns: 1fr;
}

/* Tablet: 2 colonne */
@media (min-width: 640px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Schermi medi: 3 colonne */
@media (min-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktop grande: 4 colonne */
@media (min-width: 1280px) {
    .articles-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


@media (min-width: 481px) and (max-width: 1279px) {
    .articles-grid:has(> .reduced) {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .blog-list-container {
        width: 100%;
    }
}

/* Responsive per schermi molto piccoli (280px) */
@media (max-width: 360px) {
    .blog-list-container {
        padding: 1rem 0.75rem;
    }

    .blog-header h1 {
        font-size: 1.75rem;
        color: #d51410;
    }

    .blog-header p {
        font-size: 0.875rem;
        color: #fff;
    }

    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .article-image {
        height: 160px;
    }

    .article-content {
        padding: 1rem;
    }

    .article-title {
        font-size: 1rem;
    }

    .article-summary {
        font-size: 0.8rem;
    }

    .read-more {
        font-size: 0.8rem;
    }
}

@media (max-width: 300px) {
    .blog-list-container {
        padding: 0.75rem 0.5rem;
    }

    .article-content {
        padding: 0.75rem;
    }

    .article-title {
        font-size: 0.95rem;
    }

    .article-summary {
        font-size: 0.75rem;
    }

    .read-more {
        font-size: 0.75rem;
    }
}



/* ===== PAGINAZIONE STYLE (coerente con le card) ===== */
.pagination-container {
    margin-top: 2.5rem;
}

/* Contenitore principale della paginazione (usato da Laravel) */
.pagination-container nav {
    display: flex;
    justify-content: center;
}

/* Lista dei link di paginazione */
.pagination-container .pagination-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Singolo elemento della lista */
.pagination-container .page-item {
    display: inline-block;
}

/* Link (o span corrente) */
.pagination-container .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1e293b;
    background-color: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

/* Hover sui link */
.pagination-container .page-link:hover {
    background-color: #f8fafc;
    border-color: #cbd5e1;
    color: #2563eb;
}

/* Pagina attiva */
.pagination-container .page-item.active .page-link {
    background-color: #2563eb;
    border-color: #2563eb;
    color: white;
    cursor: default;
}

/* Pagina disabilitata (Prev/Next quando non disponibile) */
.pagination-container .page-item.disabled .page-link {
    background-color: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

/* Icone Prev/Next (utilizza SVG inline, ma funziona anche con testo) */
.pagination-container .page-link svg {
    width: 1rem;
    height: 1rem;
    stroke-width: 2;
    fill: none;
    stroke: currentColor;
}

/* Versione mobile: riduci padding e gap */
@media (max-width: 640px) {
    .pagination-container .page-link {
        min-width: 2rem;
        height: 2rem;
        padding: 0 0.5rem;
        font-size: 0.75rem;
    }

    .pagination-container {
        gap: 0.3rem;
    }
}





/* MAIN ARTICLE */
.main-article-card {
    margin-bottom: 2.5rem;
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    transition: transform 0.2s, box-shadow 0.2s;
}

.main-article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 30px -8px rgba(0, 0, 0, 0.2);
}

.main-article-wrapper {
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .main-article-wrapper {
        flex-direction: row;
        align-items: stretch;
    }

    .main-article-image {
        flex: 0 0 45%;
        max-height: 350px;
    }

    .main-article-content {
        flex: 1;
        padding: 2rem 2.5rem;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
}

.main-article-image {
    overflow: hidden;
    background: #f1f5f9;
}

.main-article-image img {
    width: 100%;
    height: 100%;
    max-height: 300px;
    object-fit: cover;
    display: block;
}

@media (min-width: 768px) {
    .main-article-image img {
        max-height: 350px;
    }
}

.main-article-content {
    padding: 1.5rem;
}

.main-article-badge {
    display: inline-block;
    background: #d51410;
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    width: fit-content;
}

.main-article-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
}

.main-article-title a {
    text-decoration: none;
    color: inherit;
}

.main-article-title a:hover {
    color: #2563eb;
}

.main-article-summary {
    color: #475569;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.main-article-meta {
    font-size: 0.875rem;
    color: #64748b;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .main-article-title {
        font-size: 1.25rem;
    }

    .main-article-summary {
        font-size: 0.9rem;
    }
}

/* Nuovo stile per l'indicatore di ultimo aggiornamento */
.last-updated {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 1.5rem;
    margin-top: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.last-updated-icon {
    font-size: 1rem;
}

.last-updated-text {
    font-weight: 400;
    font-style: italic;
}