/* --- SEZIONE INTESTAZIONE EVENTI --- */
.temi-section {
    padding: 130px 20px 20px 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 TIMELINE (PROSSIME TAPPE) --- */
.timeline-section {
    padding: 60px 20px;
    background-color: #dadada;
}

.timeline-container {
    max-width: 1200px;
    margin: 0 auto;
}

.timeline-header-flex {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-bottom: 30px;
}

.timeline-nav-buttons {
    display: flex;
    gap: 10px;
}

.timeline-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: #39001d;
    color: #fff;
    border: 1px solid #39001d;
    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;
}

.timeline-btn:hover {
    background-color: #340521;
    color: #ebd9ba;
    border-color: #340521;
}

.timeline-track-wrapper {
    width: 100%;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 20px;
    box-sizing: border-box;
}

.timeline-track-wrapper::-webkit-scrollbar {
    display: none;
}

.timeline-track {
    display: flex;
    gap: 40px;
    position: relative;
    padding-top: 25px;
}

.timeline-track::before {
    content: '';
    position: absolute;
    top: 51px;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #c1bbaf;
    z-index: 1;
}

.timeline-item {
    min-width: 270px;
    flex: 0 0 calc(25% - 30px);
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 2;
}

.timeline-node {
    width: 52px;
    height: 52px;
    background-color: #34051c;
    border: 1px solid #34051c;
    font-family: 'Playfair Display', Georgia, serif;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 1.4rem;
    color: #ebd9ba;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.timeline-content {
    display: flex;
    flex-direction: column;
}

.t-date {
    font-size: 0.75rem;
    font-weight: 700;
    color: #39001d;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.timeline-content h3 {
    font-size: 1.1rem;
    color: #0b1f36;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 8px;
    min-height: 50px;
}

.t-location {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 18px;
}

.t-tag {
    display: inline-block;
    padding: 6px 14px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    color: #ffffff;
    align-self: flex-start;
}

.tag-persone { background-color: #df998d; }
.tag-valore { background-color: #dd5e4b; }
.tag-futuro { background-color: #5b9de9; }
.tag-ai { background-color: #7030a0; }
.tag-formazione { background-color: #162584; }

/* --- SEZIONE ULTIMI CONTENUTI (CAROSELLO) --- */
.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;
}

.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;
}

.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; }

/* --- SEZIONE ELENCO EVENTI PER TEMA & FILTRI --- */
.coral-books-section {
    width: 100%;
    background-color: #fff;
    padding: 80px 40px;
}

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

.coral-half {
    flex: 1;
    width: 100%;
}

.book-inner {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 15px 0;
}

.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) {
    .posts-carousel-wrapper {
        padding: 10px 45px;
        position: relative;
    }

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

    .post-card {
        min-width: 280px;
        flex: 0 0 auto;
    }
}

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

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

    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;
    }

    .posts-carousel-wrapper {
        padding: 10px 35px;
    }

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

    .timeline-nav-buttons {
        margin-left: 80%;
        top: -40px !important;
        position: relative;
    }
}