/* --- SEZIONE INTESTAZIONE PUBBLICAZIONI --- */

.latest-posts-section {
    padding: 90px 20px;
    background-color: #f5eaea;
}
.latest-container {
    max-width: 1200px;
    margin: 0 auto;
}

.posts-carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    padding: 10px 0;
}


.post-carousel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background-color: #39001d;
    color: #fff;
    border: none;      
    cursor: pointer;
    z-index: 10;
    font-size: 0.9rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.post-prev-btn { top: -30px; margin-left: 93%; }
.post-next-btn { top: -30px; margin-left: 97%; }

.post-prev-btn:hover { background-color: #310250; }
.post-next-btn:hover { background-color: #310250; }

.posts-grid {
    width: 100%;
    display: flex;
    gap: 30px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0;
}

.posts-grid::-webkit-scrollbar {
    display: none;
}

.post-card {
    min-width: 0;
    width: 100%;
    flex: 0 0 calc(33.333% - 20px);
    background-color: #ffffff;
    box-sizing: border-box;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(11, 31, 54, 0.06);
    border: 1px solid rgba(11, 31, 54, 0.04);
    display: flex;
    flex-direction: column;
    scroll-snap-align: start;
    transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(11, 31, 54, 0.1);
}

.post-image {
    width: 100%;
    height: 220px;
    overflow: hidden;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.post-card:hover .post-image img {
    transform: scale(1.05);
}


.post-body {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.post-category-tema-persone,
.post-category-tema-pa-post-digitale, .post-category-tema-futuro,
 .post-category-tema-ai, .post-category-tema-formazione {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 1px;
    color: #fff;
    padding: 4px 10px;
    align-self: flex-start;
    margin-bottom: 15px;
}

.post-category-tema-persone { background-color: #df998d; }
.post-category-tema-pa-post-digitale { background-color: #dd5e4b; }
.post-category-tema-futuro { background-color: #5b9de9; }
.post-category-tema-ai { background-color: #7030a0; }
.post-category-tema-formazione { background-color: #162584; }



.post-body h3 {
    font-size: 1.2rem;
    color: #0b1f36;
    margin-bottom: 12px;
    line-height: 1.4;
    font-weight: 700;
}

.post-link {
    font-size: 0.85rem;
    font-weight: 600;
    color: #39001d;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.post-link:hover {
    color: #5127ec;
}

.temi-section {
    padding: 130px 20px 30px 20px;
    background-color: #fff;
    width: 100%;
}

.temi-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

.section-header {
    margin-bottom: 20px;
}

/* --- SEZIONE LIBRI IN EVIDENZA (GRIGLIA SUPERIORE) --- */
.coral-books-section {
    width: 100%;
    background-color: #dadada;
    color: #39001d;
    padding: 60px 40px;
}



.coral-container {
    max-width: 1300px;
    margin: 0 auto;
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.coral-half {
    flex: 1;
    min-width: 300px;
}



.book-inner {
    display: flex;
    align-items: center;
    gap: 25px;
    background-color: rgba(255, 255, 255, 0.6);
    padding: 25px;
    border-radius: 16px;
}

.book-image {
    flex: 0 0 130px;
    display: flex;
    justify-content: center;
}


.book-image img {
    width: 100%;
    max-width: 120px;
    height: auto;
    border-radius: 6px;
    object-fit: cover;
}




.book-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.pubblicazioni-book-tag {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    color: #39001d;
    margin-bottom: 8px;
}

.pubblicazioni-libri-title {
    font-size: 1.25rem;
    color: #39001d;
    font-family: 'Playfair Display', Georgia, serif;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 15px;
}

.book-btn {
    display: inline-block;
    background-color: #2f0619;
    color: #fff;
    padding: 8px 18px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    transition: background-color 0.3s, transform 0.2s;
    align-self: flex-start;
    letter-spacing: 0.35px;
}

.book-btn:hover {
    background-color: #5a0933;
    transform: translateY(-2px);
}

/* --- FILTRI E LISTA ELENCO PUBBLICAZIONI --- */
.filter-btn {
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #d3d2d2;
    padding: 8px 14px;
    border-radius: 20px;
    transition: all 0.3s ease;
    margin: 4px;
    cursor: pointer;
    border: none;
    box-sizing: border-box;
}

.filter-btn:hover {
    transform: translateY(-2px);
}

.filter-btn.active {
    outline: 2px solid #39001d;
    outline-offset: -2px;
}

.post-id {
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: block;
}

.post-id:hover {
    background-color: rgba(209, 208, 208, 0.3);
    border-radius: 12px;
}

.temi-news-left {
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #39001d;
    font-weight: 700;
    font-size: 0.95rem;
    min-width: 70px;
}

.temi-news-right {
    padding: 10px;
    flex: 1;
    display: flex;
    align-items: center;
    color: #39001d;
    font-weight: 500;
    font-size: 0.95rem;
}

/* ==========================================================================
   MEDIA QUERIES (SPECIFICHE)
   ========================================================================== */

@media (max-width: 1024px) {
    .coral-container {
        flex-direction: column;
        gap: 20px;
    }
        .posts-carousel-wrapper {
        padding: 10px 45px;
        position: relative;
    }

}

@media (max-width: 768px) {
    .temi-section {
        padding: 100px 15px 20px 15px;
    }

    .coral-books-section {
        padding: 40px 15px;
    }

    .book-inner {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
        .posts-carousel-wrapper {
        padding: 10px 35px;
    }


    .book-image {
        flex: none;
    }

    .book-btn {
        align-self: center;
    }

    div[style*="margin: 10px 10px;"] {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px;
        margin: 10px 0 !important;
    }

    .filter-btn {
        flex: 1 1 30%;
        min-width: 95px;
        margin: 0 !important;
    }

    .temi-news-left {
        min-width: 50px;
        font-size: 0.85rem;
    }

    .temi-news-right {
        font-size: 0.85rem;
    }
}