h1 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 20px;
    color: #0056b3;
}

p.intro {
    max-width: 800px;
    margin: 0 auto 40px auto;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
    text-align: center;
}

.category-wrapper {
    margin-bottom: 40px;
    border: 1px solid #e0e0e0;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.category-wrapper:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
}

.category-header {
    background: linear-gradient(90deg, #f9f9f9, #f1f1f1);
    padding: 20px 24px;
    cursor: pointer;
    display: flex;
    justify-content: center; /* 🔹 Centra orizzontalmente */
    align-items: center;     /* 🔹 Allinea verticalmente al centro */
    flex-direction: column;  /* 🔹 Titolo e descrizione uno sotto l’altro */
    font-weight: 600;
    font-size: 1.25rem;
    color: #222;
    transition: background 0.3s ease;
    border-bottom: 1px solid #ddd;
    position: relative;
    text-align: center; /* 🔹 Centra il testo */
}

.category-header:hover {
    background: #ededed;
}

.category-header h2 {
    margin: 0;
    font-size: 1.35rem;
    color: #222;
}

.category-header .category-description {
    font-size: 1rem;
    font-weight: 400;
    color: #555;
    margin-top: 6px;
    line-height: 1.4;
    max-width: 90%;
}

/* 🔹 Freccia a destra del blocco, centrata verticalmente */
.category-header .arrow {
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.5rem;
    transition: transform 0.3s ease;
    color: #666;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-header.open .arrow {
    transform: translateY(-50%) rotate(180deg);
}

.category-content {
    display: none;
    padding: 24px;
    animation: fadeIn 0.3s ease-in-out;
    background-color: #fbfbfb;
}

.projects-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
}

.project-card {
    background: #ffffff;
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    width: calc(50% - 12px);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.12);
}

.project-slide {
    width: 100%;
    text-align: center;
}

.project-card picture {
    display: block;
    width: 100%;
    max-height: 360px;
    overflow: hidden;
    background: #f9f9f9;
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.project-card img {
    max-height: 360px;
    width: auto;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    transition: transform 0.3s ease;
}

.project-card img:hover {
    transform: scale(1.03);
    opacity: 0.95;
}

.project-title {
    font-weight: 700;
    margin-top: 16px;
    font-size: 1.3rem;
    color: #004085;
}

.project-desc {
    font-size: 1rem;
    color: #555;
    margin: 10px 0;
    line-height: 1.6;
    padding: 0 10px;
}

.visit-button {
    display: inline-block;
    margin-top: 12px;
    padding: 10px 20px;
    background-color: #1e90ff;
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color 0.3s ease, transform 0.2s;
}

.visit-button:hover {
    background-color: #0d6efd;
    transform: scale(1.05);
}

.slider-buttons {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    gap: 12px;
}

.slider-buttons button {
    padding: 8px 16px;
    background-color: #ffb936;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s;
}

.slider-buttons button:hover {
    background-color: #e69500;
    transform: scale(1.05);
}

.hero-section {
    text-align: center;
    padding: 2rem 1rem;
    max-width: 900px;
    margin: 0 auto 3rem;
}

.highlight {
    color: #f97316;
    font-weight: 600;
}

.cta-box {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem auto;
    border: 1px solid #e9ecef;
    max-width: 700px;
}

.cta-button, .visit-button {
    display: inline-block;
    background: #ff8935;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.cta-button:hover, .visit-button:hover {
    background: #ea580c;
    transform: translateY(-2px);
}

.final-cta {
    text-align: center;
    padding: 3rem 1rem;
    background: #f8f9fa;
    margin-top: 3rem;
}

.benefits {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
    margin: 2rem 0;
}

.benefit-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    flex: 1;
    min-width: 250px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.project-slide {
    display: none;
}

.project-slide.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
        margin-bottom: 15px;
        padding: 0 15px;
    }

    p.intro {
        font-size: 1rem;
        padding: 0 15px;
        margin-bottom: 30px;
    }

    .hero-section {
        padding: 1.5rem 15px;
        margin-bottom: 2rem;
    }

    .hero-section h1 {
        font-size: 1.8rem;
        line-height: 1.3;
    }

    .cta-box {
        padding: 1.2rem;
        margin: 1.5rem 15px;
        border-radius: 10px;
    }

    .cta-box p {
        font-size: 0.95rem;
    }

    .category-wrapper {
        margin: 0 15px 20px;
        border-radius: 10px;
    }

    .category-header {
        padding: 18px 20px;
        flex-direction: column;
        text-align: center;
        position: relative;
        min-height: 80px; /* Altezza minima per evitare sovrapposizioni */
    }

    .category-header h2 {
        font-size: 1.2rem;
        margin-bottom: 6px;
        padding-right: 40px; /* Spazio per la freccia */
        padding-left: 40px;  /* Spazio bilanciato */
        line-height: 1.3;
    }

    .category-header .category-description {
        font-size: 0.9rem;
        margin-top: 4px;
        max-width: 100%;
        padding: 0 40px; /* Spazio bilanciato per la descrizione */
        line-height: 1.4;
    }

    /* 🔹 Freccia più piccola e posizionata meglio */
    .category-header .arrow {
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 1.3rem;
        width: 30px;
        height: 30px;
        display: flex;
        align-items: center;
        justify-content: center;
        background: rgba(255, 255, 255, 0.8);
        border-radius: 50%;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }

    .category-header.open .arrow {
        transform: translateY(-50%) rotate(180deg);
    }

    /* 🔹 Assicura che il contenuto non vada sotto la freccia */
    .category-header > *:not(.arrow) {
        width: calc(100% - 60px); /* Lascia spazio per la freccia */
        margin-left: auto;
        margin-right: auto;
    }

    .projects-grid {
        flex-direction: column;
        gap: 20px;
        padding: 0;
    }

    .project-card {
        width: 100%;
        margin-bottom: 0;
        border-radius: 10px;
        padding: 15px;
    }

    .project-card picture {
        max-height: 400px;
    }

    .project-card img {
        max-height: 400px;
    }

    .project-title {
        font-size: 1.1rem;
        margin-top: 12px;
    }

    .project-desc {
        font-size: 0.95rem;
        margin: 8px 0;
    }

    .visit-button {
        display: block;
        text-align: center;
        margin: 10px auto 0;
        width: 90%;
        padding: 10px;
        font-size: 0.95rem;
    }

    .slider-buttons {
        margin-top: 20px;
    }

    .slider-buttons button {
        padding: 7px 12px;
        font-size: 0.9rem;
    }

    /* Sezione finale più persuasiva */
    .final-cta {
        padding: 2rem 15px;
        margin-top: 2rem;
    }

    .final-cta h2 {
        font-size: 1.5rem;
    }

    .final-cta p {
        font-size: 1rem;
        padding: 0 10px;
    }

    .benefits {
        flex-direction: column;
        gap: 15px;
        margin: 1.5rem 0;
    }

    .benefit-item {
        min-width: 100%;
        padding: 1.2rem;
        text-align: center;
    }

    .benefit-item h3 {
        font-size: 1.1rem;
        margin-bottom: 8px;
    }

    .benefit-item p {
        font-size: 0.9rem;
    }
}