/* === Card Section === */
.container {
    max-width: 75rem;
    margin: 0 auto;
    padding: 0 30px;
}

.section-title {
    font-size: 2.2rem;
    color: #333;
    margin: 0;
    text-align: center;
}

.card-container {
    padding: 20px 20px 0;
}

.card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    z-index: 1;
}

.card-content {
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.5rem;
    color: #333;
    margin: 0;
}

.card-description {
    font-size: 1rem;
    color: #555;
    text-align: justify;
    margin-bottom: 0;
}

/* === Stili specifici per la card "Chi Sono" === */
.section:first-of-type .card {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
}

.section:first-of-type .image-wrapper {
    padding: 20px;
    overflow: hidden;
}

.section:first-of-type .card img {
    width: 250px;
    object-fit: contain;
    border-radius: 6px;
}

.section:first-of-type .card-content {
    padding: 20px;
    flex: 1;
    text-align: left;
}

.section:first-of-type .card-title {
    font-size: 2rem;
    margin-bottom: 10px;
}

.section:first-of-type .button-container {
    padding-top: 20px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
}

/* === Media Queries === */
@media (max-width: 1023px) {

    /* === Card Section === */
    .section-title {
        margin: 32px 0 0;
        font-size: 2rem;
    }

    .card-container {
        display: flex;
        flex-direction: column;
        gap: 20px;
        width: 100%;
    }

    .card {
        display: flex;
        flex-direction: column;
        width: 100%;
        max-width: 25rem;
        margin: 0 auto;
    }

    .card-title {
        font-size: 1.4rem;
    }

    /* === Stili specifici per la card "Chi Sono" su mobile === */
    .section:first-of-type .card {
        flex-direction: column;
        align-items: center;
    }

    .section:first-of-type .image-wrapper {
        padding: 8px;
    }

    .section:first-of-type .card img {
        width: 100%;
        max-width: 180px;
        border-radius: 6px;
    }

    .section:first-of-type .card-content {
        text-align: center;
    }

    .section:first-of-type .card-title {
        font-size: 1.7rem;
    }

    .section:first-of-type .button-container {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }

    .section:first-of-type .button-container .button {
        width: 100%;
        max-width: 300px;
    }

    /* === Aggiunta per evitare sovrapposizione con l'header === */
    .section:first-of-type {
        padding-top: calc(3rem + 10vh);
    }

    /* === Form Section === */
    #message {
        min-height: 12.5rem;
    }
}

@media (max-width: 470px) {

    /* === Card Section === */
    .container {
        padding: 0 16px !important;
    }

    .section-title {
        padding: 0 10px;
        font-size: 1.8rem;
    }

    .card-description {
        font-size: 0.9rem;
    }

    /* === Aggiustamento specifico per la card "Chi Sono" === */
    .section:first-of-type .card {
        padding: 8px;
        max-width: 100%;
        width: auto;
    }

    .section:first-of-type .card-content {
        padding: 0;
    }

    .section:first-of-type .card-title {
        margin-bottom: 0;
    }

    .section:first-of-type {
        padding-top: calc(2.5rem + 7vh);
    }
}

@media (max-width: 380px) {
    .section:first-of-type {
        padding-top: calc(1.5rem + 6vh);
    }

    .container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    .card-container {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }
}