﻿

@media (max-width: 768px) {

    .page-width {
        padding-left: 16px;
        padding-right: 16px;
    }


    .content-article {
        padding: 16px;
    }


    .hero-wrapper {
        padding: 0;
    }

    .hero-content {
        position: static;
        padding: 16px;
        background: rgba(0,0,0,0.10);
    }

        .hero-content h1 {
            font-size: 1.8rem;
        }

        .hero-content .btn {
            width: 100%;
            text-align: center;
        }

    .content-article li {
        margin: 1rem 16px;
    }


    .hero-image {
        height: 180px; /* invece di 300–400 */
        min-height: 180px;
    }

    .content-card {
        margin-top: 16px; /* normale spacing */
        position: relative;
    }

    .hero-overlay {
        display: none;
    }

    .error-card {
        border-radius: 16px;
        margin: 16px;
        padding: 20px;
        box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    }

    .hero-title {
        position: static;
        color: #ffffff;
        font-size: 28px;
        margin: 16px;
        z-index: 1;
    }

    .hero-wrapper {
        padding-bottom: 0;
        min-height: auto;
    }
    .error-card {
        margin-top: -24px; /* leggero overlap controllato */
    }

    .hero-content,
    .error-card {
        position: static !important;
        transform: none !important;
    }

    .hero,
    .hero-wrapper {
        min-height: auto !important;
        height: auto !important;
        padding-bottom: 0 !important;
    }

    .error-card {
        position: relative;
        z-index: 1;
    }

    .hero {
        padding-bottom: 120px; /* regola il valore finché la card sta sotto */
    }

    .hero {
        padding-bottom: 40px;
    }

    .error-card {
        margin-top: 16px;
    }
    .hero::before,
    .hero::after {
        bottom: auto; /* ❗ fondamentale */
        height: 100%; /* NON 100vh */
    }

    .hero-overlay {
        position: absolute;
        inset: 0; /* top/right/bottom/left */
        z-index: 0;
    }

    .hero-content {
        position: relative;
        z-index: 1;
    }

    .hero-wrapper {
        position: relative;
        max-height: 360px; /* scegli tu: 320 / 360 / 400 */
        overflow: hidden;
    }

    .hero-banner img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }
    .content-article {
        position: relative;
        z-index: 2;
        margin-top: 32px; /* solo spacing, non hack */
    }

    .hero-wrapper {
        position: relative;
        max-height: 360px;
        overflow: hidden;
        padding-bottom: 80px; /* SPAZIO DI STACCO */
    }

    .card-wrapper {
        display: flex;
        justify-content: center;
        padding: 0 16px; /* mobile safe */
    }

    .welfare-card {
        max-width: 720px; /* o 680 */
        width: 100%;
        margin-top: -40px; /* SOLO questo overlap controllato */
    }
    .hero-wrapper {
        background: transparent; /* IMPORTANTE */
    }

    .hero-strip {
        background: #e6e6e6;
        padding: 40px 0 60px;
    }

    /* STACCO NETTO */
    .content-article {
        background: #ffffff;
        padding-top: 48px;
    }

    .card-wrapper {
        display: flex;
        justify-content: center;
        padding: 0 16px;
    }

    .welfare-card {
        max-width: 720px;
        width: 100%;
        margin: 0 auto;
    }

    .card-wrapper {
        display: flex;
        justify-content: center;
        padding: 0 16px;
    }

    .welfare-card {
        max-width: 720px;
        width: 100%;
        margin: 0 auto;
    }

    .hero-strip {
        padding: 24px 0 40px;
    }

    .content-article {
        padding-top: 32px;
    }
}
