/* ===============================
   STRUTTURA DI BASE
==================================*/
html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    font-family: 'Arial', sans-serif;
    background-color: #c2e0ff; /* Azzurro chiaro */
}

main {
    flex: 1;
    padding: 0;
}

/* ===============================
   NAVBAR
==================================*/

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background-color: #F8C8D8;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 80px; /* Altezza fissa per stabilità */
}

.logo-nav {
    height: 60px;
    width: auto;
}

/* Link Navbar */
.nav-links {
    list-style: none;
    display: flex;
    gap: 30px;
}

.nav-links a {
    text-decoration: none; /* Rimuove la sottolineatura */
    color: rgb(252, 4, 202); /* Colore del testo iniziale */
    display: inline-block; /* Rende il link un blocco inline per gestire larghezza e altezza */
    padding: 10px 20px; /* Padding per dare spazio intorno al testo */
    border-radius: 5px; /* Angoli arrotondati */
    transition: color 0.3s, border-color 0.3s; /* Transizione per il colore del bordo e del testo */
}

.nav-links a:hover {
    color: rgb(248, 242, 246); /* Colore del testo bianco al passaggio del mouse */
    border-color: rgb(243, 5, 36); /* Colore del bordo al passaggio del mouse (opzionale) */
}

/* Hamburger */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 22px;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background-color: #333;
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Mobile */
@media (max-width: 768px) {
    .menu-toggle { display: flex; }

    .nav-links {
        flex-direction: column;
        background: linear-gradient(180deg, #c2e0ff, #deeffa);
        position: absolute;
        top: 80px; /* Fissa per evitare sovrapposizioni */
        right: 0;
        width: 260px;
        padding: 40px 30px;
        gap: 25px;
        transform: translateX(100%);
        opacity: 0;
        pointer-events: none;
        transition: all 0.4s ease;
        border-top-left-radius: 25px;
        border-bottom-left-radius: 25px;
    }

    .nav-links.active {
        transform: translateX(0);
        opacity: 1;
        pointer-events: all;
    }

    /* Animazione hamburger in X */
    .menu-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .menu-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
}

/* ===============================
   HOME – FOTO & WELCOME
==================================*/
.home-flex {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
}

.home-flex .foto {
    width: 280px;
    height: 450px;
    border-radius: 15px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

.home-title {
    color: rgb(240, 10, 213);
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
}

.home-subtitle {
    font-family: 'Courier', monospace; /* Uniforma il font */
    font-size: 30px;
    color: #090000;
    text-shadow: 2px 2px 5px rgba(0,0,0,0.3);
    margin-bottom: 20px;
    letter-spacing: 2px;
    text-align: center;
}

.welcome-btn {
    display: inline-block;
    padding: 15px 40px;
    background-color: #ff69b4;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: bold;
    font-size: 22px;
    box-shadow: 0 0 15px rgba(0,0,0,0.3);
    transition: .3s;
    margin-top: 20px;
}

.welcome-btn:hover {
    background-color: #ff85c1;
    transform: scale(1.05);
}

#welcome a {
    transition: color 0.3s ease;
}

.logo-home {
    width: 120px;
    display: block;
    margin: 20px auto;
}
.home-title {
    margin-top: 40px; /* Aggiungi margine superiore */
    text-align: center;
}


/* HOME responsive */
@media (max-width: 768px) {
    .home-flex {
        flex-direction: column;
        gap: 30px;
    }
    .home-flex .foto {
        width: 80%;
        max-width: 320px;
        height: auto;
        aspect-ratio: 3/4;
    }
}

@media (max-width: 480px) {
    .home-flex .foto { width: 100%; }
    .welcome-btn { width: 80%; font-size: 18px; }
}

/* ===============================
   FOOTER
==================================*/
footer {
    width: 100%;
    background-color: #ffb6c1;
    padding: 20px;
    text-align: center;
}

footer a {
    color: #090e00;
    text-decoration: underline;
}

footer img {
    width: 40px;
    height: 40px;
    margin: 0 5px;
}

/* ===============================
   CARD FLIP SISTEMATE
==================================*/
.card {
    perspective: 1000px;
    cursor: pointer;
    height: 400px; /* altezza fissa per evitare sovrapposizioni */
    position: relative;
    overflow: hidden; /* impedisce che la parte girata fuoriesca */
    margin-bottom: 30px;
}

.card-inner {
    position: absolute;
    width: 100%;
    height: 100%;
    transition: transform 0.8s cubic-bezier(.4, .2, .2, 1);
    transform-style: preserve-3d;
}

.card:hover .card-inner {
    transform: rotateY(180deg) scale(1.05);
}

.card-front, .card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 15px;
    backface-visibility: hidden;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 20px;
}

.card-front {
    background-color: #ffc0cb; /* rosa chiaro */
}

.card-back {
    background-color: #593df8; /* rosa più scuro */
    color: white;
    transform: rotateY(180deg);
}

.card-front .card-title,
.card-back h5 {
    font-weight: 900;
    font-size: 1.8rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 5px rgba(244, 0, 0, 0.953);
}

.card-front .card-text,
.card-back p {
    font-weight: 600;
    font-size: 1.1rem;
}

.card-back .btn {
    margin-top: 15px;
    padding: 10px 20px;
    font-weight: bold;
}
.img-large {
    width: 100%; /* Larghezza al 100% del contenitore */
    height: auto; /* Mantiene le proporzioni */
    max-width: 600px; /* Imposta una larghezza massima per l'immagine */
    transition: transform 0.3s; /* Transizione per l'effetto hover */
}

.img-large:hover {
    transform: scale(1.1); /* Effetto zoom al passaggio del mouse */
}

.img-custom {
    width: 100%; /* Larghezza al 100% del contenitore */
    height: auto; /* Altezza automatica per preservare le proporzioni */
    object-fit: cover; /* Ritaglia l'immagine per mantenere l'aspetto */
    transition: transform 0.3s; /* Effetto di transizione */
    border-radius: 10px; /* Angoli arrotondati per un aspetto più moderno */
}
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.rotate {
    animation: rotate 2s ease-in-out;
}
