/* style.css */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.6;
}

/* --- AGGIUNTE PER HOME PAGE --- */

/* Hero Section con Slider (Desktop) */
.hero-section {
    position: relative;
    height: 500px; /* Altezza Desktop Standard */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
    background-color: #333; 
}

/* Le immagini dello sfondo */
.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}

.hero-slide.active { opacity: 0.6; } 

/* Testo sopra le immagini */
.hero-content {
    position: relative;
    z-index: 2; 
    max-width: 700px;
    padding: 20px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}

.hero-content h1 {
    font-size: 3em;
    margin-bottom: 10px;
    border-bottom: none; 
    color: white;
}

.hero-content p { font-size: 1.3em; line-height: 1.4; }

/* Sezione Materiali (Griglia) */
.materials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.material-card {
    background: white;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 8px;
    text-align: left;
    transition: transform 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.material-card:hover {
    transform: translateY(-5px);
    border-color: #d100d1;
}

.material-card h3 {
    color: #d100d1;
    margin-top: 0;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

/* --- NAVIGAZIONE E HEADER --- */

header {
    background-color: #222;
    padding: 10px 0; 
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav {
    max-width: 800px;
    margin: 0 auto;
    display: flex; 
    justify-content: space-between;
    align-items: center; /* Centra verticalmente Logo e Menu */
    padding: 0 20px;
}

/* Contenitore dei link */
nav div {
    display: flex; 
    white-space: nowrap; 
    align-items: center; 
}

/* --- GESTIONE LOGO IMMAGINE --- */
.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
}

/* Dimensione del logo su Desktop */
.logo img {
    height: 50px; /* Altezza fissa per non rompere il menu */
    width: auto;  /* Larghezza automatica in proporzione */
    display: block;
}

/* Stile Link Menu */
nav a {
    color: #fff;
    text-decoration: none;
    margin-left: 20px; 
    font-weight: 500;
    font-size: 1.1em; 
    white-space: nowrap; 
}
nav a:hover { color: #d100d1; }

/* Contenitore Principale */
.container {
    max-width: 800px;
    margin: 40px auto;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

h1, h2 { color: #333; }
h1 { border-bottom: 3px solid #d100d1; display: inline-block; padding-bottom: 5px; }

/* Bottoni */
.btn {
    display: inline-block;
    background-color: #d100d1;
    color: white;
    padding: 10px 20px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    border: none;
    cursor: pointer;
}
.btn:hover { background-color: #a800a8; }

/* Form */
.form-group { margin-bottom: 15px; }
label { display: block; margin-bottom: 5px; font-weight: bold; }
input[type="text"], textarea, input[type="file"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box; 
}
textarea { height: 100px; resize: vertical; }

/* Messaggi */
.success { background: #d4edda; color: #155724; padding: 10px; border-radius: 4px; margin-bottom: 20px; border: 1px solid #c3e6cb;}
.error { background: #f8d7da; color: #721c24; padding: 10px; border-radius: 4px; margin-bottom: 20px; border: 1px solid #f5c6cb;}


/* ========================================================== */
/* MEDIA QUERIES (Regole per la visualizzazione su Mobile) */
/* ========================================================== */

@media (max-width: 600px) {

    /* 1. Contenitore e Padding Generale */
    .container {
        max-width: 100%; 
        padding: 15px; 
        margin: 20px auto;
    }

    /* 2. Navigazione (Header) */
    header {
        padding: 10px 0;
    }
    nav {
        flex-direction: column; 
        padding: 0 10px;
        max-width: 100%;
        text-align: center;
    }
    .logo, nav div {
        width: 100%; 
        margin: 0;
    }
    
    /* Centra il logo immagine su mobile */
    .logo {
        justify-content: center;
        margin-bottom: 10px;
    }
    .logo img {
        height: 45px; /* Leggermente più piccolo su mobile */
    }

    nav div {
        flex-wrap: wrap; 
        justify-content: center;
        margin-top: 5px; 
        white-space: normal; 
    }
    nav a {
        font-size: 0.9em; 
        margin: 5px 8px; 
        display: inline-block;
    }
    nav a.btn {
        margin-top: 5px;
        padding: 5px 10px;
        font-size: 0.95em;
    }

    /* 3. Sezione Hero (SOLUZIONE ALTEZZA FISSA MOBILE) */
    .hero-section {
        /* Altezza molto elevata per garantire che il bottone non venga coperto */
        height: 600px !important; 
        min-height: 600px !important;
        align-items: center;
    }
    
    .hero-content h1 {
        font-size: 1.8em; 
        line-height: 1.2;
    }
    .hero-content p {
        font-size: 0.95em; 
        margin-bottom: 25px; 
    }

    /* 4. Griglia Materiali */
    .materials-grid {
        grid-template-columns: 1fr; 
    }
}