@media (max-width: 480px) {
    /*Regole Html*/
    html, body{
        font-size: 15px;
        height: 100%;
        margin: 0;
        padding: 0;
    }
    /*Regole generiche*/
    .pt-serif-regular {
        font-family: "PT Serif", serif;
        font-weight: 400;
        font-style: normal;
      }
      
      .pt-serif-bold {
        font-family: "PT Serif", serif;
        font-weight: 700;
        font-style: normal;
      }
      
      .pt-serif-regular-italic {
        font-family: "PT Serif", serif;
        font-weight: 400;
        font-style: italic;
      }
      
      .pt-serif-bold-italic {
        font-family: "PT Serif", serif;
        font-weight: 700;
        font-style: italic;
      }
      
    .container{
        width: 80%;
        margin: auto;
    }
    /*Regole NavBar*/
    nav{
        background-color: #C0392B;
        border: 1px solid #FAF3E0;
    }
    .NavTitle{
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
    .NavTitle h1{
        color: #FAF3E0;
        font-size: 1.8rem;
        animation: fadeInDown 0.8s ease-in-out;
    }
    @keyframes fadeInDown {
        from {
            opacity: 0;
            transform: translateY(-20px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    .NavTitle span{
        color: #FAF3E0;
        font-size: 1.4rem;
    }
    .NavBar{
        flex-direction: column;
        gap: 10px;
    }
    .NavBar a {
        display: none;
        text-align: center;
        width: 100%;
        font-size: 1.5rem;
        color: #FAF3E0;
        text-decoration: none;
    }
    .NavBar a:hover, .NavBar a:focus{
        text-decoration: none;
        color: #123524;
    }
    .NavBar.responsive a {
        display: block;
        flex-direction: column;
        padding: 10px;
    }
    .NavBar.responsive {
        position: relative;
    }

    /*Regole Header*/
    header{
        background-color: #4E5B31;
    }
    .HeaderDescription{
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        padding: 5px 10px;
        gap: 0px;
    }
    .HeaderDescription h1{
        color: #FAF3E0;
        font-size: 1.8rem;
        text-align: center;
    }
    .HeaderDescription p{
        color: #FAF3E0;
        text-align: justify;
        font-size: 1.1rem;
        line-height: 1.6;
        max-width: 700px;
    }
    .HeaderDescription img {
        max-width: 100%;
        height: auto;
        margin-top: 20px;
    }

    /*Regole main*/
    main{
        background-color: #FAF3E0;
    }
    .scroller{
        max-width: 600px;
    }
    .scroller__inner{
        display: flex;
        flex-wrap: wrap;
        gap: 1.1rem;
        padding-block: 1rem;
    }
    .scroller[data-animated="true"]{
        overflow: hidden;
        mask: linear-gradient(90deg, transparent, rgb(255, 255, 255) 10%, white 90%, transparent);

    }
    .scroller[data-animated="true"] .scroller__inner{
        width: max-content;
        flex-wrap: nowrap;
        animation: 
            scroll 
            var(--_animation-duration, 40s)
            var(--_animation-direction, forwards)
            linear
            infinite;
    }
    .scroller[data-direction="right"]{
        --_animation-direction: reverse;
    }
    @keyframes scroll{
        to{
            transform: translate(calc(-50% - 0.5rem));
        }
    }
    .card{
        display: flex;
        flex-direction: column;
        background-color: #3E3E3E;
        text-align: center;
        border-radius: 10px;
        box-shadow: 5px 5px 10px #000000b3;
        overflow: hidden;
        transition: transform 0.3s ease, box-shadow 0.3s ease;
        cursor: pointer;
    }
    .card:hover {
        transform: scale(1.05);
        box-shadow: 8px 8px 20px #000000c0;
    }
    .card img{
        width: 100%;
        height: 100px;
        object-fit: cover;
        border-bottom: 1px solid white;
    }
    .card h2{
        color: #FAF3E0;
        font-size: 1.45rem;
    }

    /*Regole Footer*/
    footer{
        background-color: #3E3E3E;
        border-top: 1px solid #F4D35E;
    }
    .FooterSocial{
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 10px 0 10px 0;
    }
    .FooterSocial h3{
        color: #F4D35E;
        font-size: 1.4rem;
        letter-spacing: 1px;
    }
    .FooterSocial img{
        width: 50px;
        height: 50px;
        margin: 10px 0 10px 0;
    }
    .switch {
        font-size: 13px;
        position: relative;
        display: inline-block;
        width: 3.1em;
        height: 1.7em;
        align-items: center;
    }
    /* Hide default HTML checkbox */
    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }
    /* The slider */
    .slider {
        --background: #28096b;
        position: absolute;
        cursor: pointer;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--background);
        transition: .5s;
        border-radius: 30px;
    }
    .slider:before {
        position: absolute;
        content: "";
        height: 1.4em;
        width: 1.4em;
        border-radius: 50%;
        left: 10%;
        bottom: 15%;
        box-shadow: inset 8px -4px 0px 0px #fff000;
        background: var(--background);
        transition: .5s;
    }
    input:checked + .slider {
        background-color: #522ba7;
    }
    input:checked + .slider:before {
        transform: translateX(100%);
        box-shadow: inset 15px -4px 0px 15px #fff000;
    }

    /*
    -
    -
    -
    Modalità scura*/
    body.dark-mode {
        background-color: #1C1C1C;
        color: #E0E0E0;
    }
    body.dark-mode nav {
        background-color: #8B1E1E;
        border-color: #3B3B3B;
        border: 1px solid #faeece;
    }
    body.dark-mode header, body.dark-mode .mainDettaglio, body.dark-mode .mainNewRecipe, body.dark-mode .mainRecipe {
        background-color: #2E3A1F;
    }
    body.dark-mode main {
        background-color: #1C1C1C;
    }
    body.dark-mode .card {
        background-color: #2A2A2A;
        color: #F8EAD9;
    }
    body.dark-mode footer {
        background-color: #1F1F1F;
        border-top-color: #FFD56B;
    }
    body.dark-mode .FooterSocial h3 {
        color: #FFD56B;
    }
    
    /*
    -
    -
    -
    -
    Pagina newRecipe
    */
    .newRecipeBody{
        min-height: 100vh;
        display: flex;
        flex-direction: column;
    }
    .mainNewRecipe{
        background-color: #4E5B31;
        flex: 1; /* fa sì che riempia lo spazio disponibile */
    }
    .mainNewRecipe p{
        color: #FAF3E0;
        font-size: 1.2rem;
        text-align: center;
        letter-spacing: 1px;
        margin-top: 0;
        padding-top: 15px;

    }
    .mainNewRecipe form{
        display: flex;
        flex-direction: column;
        gap: 20px;
        justify-content: center;
        align-items: center;
    }
    .mainNewRecipe label{
        color: #FAF3E0;
        font-size: 1.5rem;
        text-align: center;
    }
    .mainNewRecipe input{
        border: none;
        padding: 3px 5px;
        color: black;
        width: 80%;
        border-radius: 8px;
        height: 40px;
        outline: none;
        font-size: 1.3rem;
    }
    .mainNewRecipe textarea{
        border: none;
        padding: 3px 5px;
        color: black;
        width: 80%;
        border-radius: 8px;
        height: 100px;
        outline: none;
        font-size: 1.3rem;
        resize: none;
    }
    .mainNewRecipe button{
        border: none;
        border-radius: 10px;
        font-size: 1.2rem;
        color: #ffffff;
        background-color: #C0392B;
        text-align: center;
        height: 35px;
        width: 30%;
        text-transform: uppercase;
        margin-bottom: 10px;
    }
    .custum-file-upload {
        height: 50px;
        width: 100px;
        display: flex;
        flex-direction: column;
        align-items: space-between;
        gap: 20px;
        cursor: pointer;
        align-items: center;
        justify-content: center;
        border: 2px dashed #cacaca;
        background-color: rgba(255, 255, 255, 1);
        padding: 1.5rem;
        border-radius: 10px;
        box-shadow: 0px 48px 35px -48px rgba(0,0,0,0.1);
    }
    .custum-file-upload .icon {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .custum-file-upload .icon svg {
        height: 20px;
        fill: rgba(75, 85, 99, 1);
    }
    .custum-file-upload .text {
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 1rem;
    }
    .custum-file-upload .text span {
        font-weight: 400;
        color: rgba(75, 85, 99, 1);
    }
    .custum-file-upload input {
        display: none;
    }
    /*
    -
    -
    -
    Pagina recipe*/
    .recipeBody {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
    }
    .containerR{
        width: 90%;
        max-width: 1000px;
        margin: 0 auto;
    }
    .mainRecipe {
        background-color: #4E5B31;
        flex: 1; /* fa sì che riempia lo spazio disponibile */
        padding: 10px 0 10px 0;
    }
    .searching{
        display: flex;
        justify-content: center;
        align-items: center;
        margin: 10px 0 20px 0;
    }
    .searching input{
        border: none;
        padding: 5px 0 5px;
        color: black;
        width: 80%;
        border-radius: 8px;
        height: 40px;
        outline: none;
        font-size: 1.2rem;
        text-align: center;
    }
    .ricetta{
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
        border: 2px solid #F4D35E;
        border-radius: 8px;
        box-shadow: 3px 5px 1px 0px #0000008a;
        margin: 10px 0 10px 0;
        background-color: #C0392B;
        width: 100%;
        height: 90px;
    }
    .ricetta img{
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 8px;
        filter: brightness(60%);
    }
    .ricetta h2{
        color: #FAF3E0;
        font-size: 1.6rem;
        letter-spacing: 1px;
        text-align: center;
        position: absolute;
        z-index: 1;
    }
    /*
    -
    -
    -
    Pagina dettaglio*/
    .containerD{
        width: 90%;
        max-width: 1000px;
        margin: 0 auto;
    }
    .dettagliBody {
        display: flex;
        flex-direction: column;
        min-height: 100vh;
        font-family: 'PT Serif', serif;
    }
    .mainDettaglio {
        flex: 1;
        padding: 18px 0;
        background-color: #4E5B31;
    }
    .details {
        background-color: rgba(255, 255, 255, 0.05);
        backdrop-filter: blur(4px);
        padding: 20px;
        border-radius: 16px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 20px;
        animation: fadeIn 0.5s ease-in-out;
    }
    .details img {
        width: 100%;
        max-height: 300px;
        border-radius: 12px;
        border: 2px solid #FAF3E0;
        object-fit: cover;
        transition: transform 0.3s ease;
    }
    .details img:hover {
        transform: scale(1.15);
    }
    .details h1 {
        color: #FAF3E0;
        font-size: 2.6rem;
        text-align: center;
        border-bottom: 2px solid #FAF3E0;
        padding-bottom: 10px;
        text-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    }
    .details p {
        color: white;
        text-align: justify;
        background-color: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.2);
        border-radius: 8px;
        padding: 12px 16px;
        line-height: 1.6;
        font-size: 1.1rem;
        max-width: 700px;
    }
    /* Animazione Fade-in */
    @keyframes fadeIn {
        from {
            opacity: 0;
            transform: translateY(10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}