/* --- RESET E BASI --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: #f4f4f9;
    color: #333;
    line-height: 1.6;
}

/* --- HEADER E HERO --- */
.hero, .hero-simple {
    color: white;
    padding: 60px 20px;
    text-align: center;
    background-image: url(../a/heroimg.webp);
    background-position: center 64%;
    background-size: cover;
}

.hero h1, .hero-simple h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* --- NAVIGAZIONE --- */
nav {
    background: #333;
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.brand {
    font-size: 1.5rem;
    font-weight: bold;
    /*color: #FFFF00;*/
    text-decoration: none;
    color: white;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
}

.nav-links a {
	color: white;
   /* color: #FFFF00;*/
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: #ffcc00;
}

/* --- MENU HAMBURGER (Il pezzo mancante) --- */
.menu-toggle {
    display: none; /* Nascosto su desktop */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1001;
}

.menu-toggle span {
    width: 30px;
    height: 3px;
    background: white;
    border-radius: 10px;
    transition: all 0.3s ease;
}

/* --- LAYOUT E GRID --- */
.containerindex {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    padding: 20px;
}

/* --- TABELLE --- */
.table-wrapper {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: dimgrey;
    color: white;
}

/* --- BADGES E BOTTONI --- */
.badge {
    background: #dc3545;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    color: white;
}

.btn-pdf {
    display: inline-block;
    padding: 8px 15px;
    color: #DC3545;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9rem;
    border: 1px solid #DC3545;
}

/* --- RESPONSIVITÀ (MOBILE) --- */
@media (max-width: 768px) {
    .menu-toggle {
        display: flex; /* Appare l'hamburger */
    }

    .nav-links {
        position: fixed;
        right: -100%; /* Menu fuori schermo */
        top: 0;
        height: 100vh;
        width: 70%;
        background-color: #222;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: 0.4s ease-in-out;
    }

    .nav-links.active {
        right: 0; /* Menu entra */
    }

    .nav-links li {
        margin: 20px 0;
    }

    .table-wrapper {
        overflow-x: auto; /* Tabella scorrevole su cellulare */
    }

    .hero h1 {
        font-size: 1.8rem;
    }
}

footer {
    text-align: center;
    padding: 40px;
    color: #668;
}



/* --- STILE TABELLA RESPONSIVA (NO SCROLL) --- */

@media (max-width: 768px) {
    /* Nascondiamo l'intestazione della tabella (Data, Tipo, ecc.) */
    table thead {
        display: none;
    }

    /* Ogni riga (tr) diventa una "card" separata */
    table tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #ddd;
        border-radius: 8px;
        background: #fff;
        padding: 10px;
    }

    /* Ogni cella (td) diventa una riga dentro la card */
    table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid #eee;
        padding: 10px 5px;
        text-align: right;
    }

    table td:last-child {
        border-bottom: none;
        justify-content: center; /* Centra il bottone "Vedi Media" */
        padding-top: 15px;
    }

    /* Aggiungiamo l'etichetta (Data:, Tipo:, ecc.) prima del valore */
    table td::before {
        content: attr(data-label); /* Prende il testo dall'attributo HTML */
        font-weight: bold;
        text-transform: uppercase;
        font-size: 0.8rem;
        color: #666;
        flex: 1;
        text-align: left;
    }
}


.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}