:root {
    --primary-color: #d32f2f;
    --secondary-color: #1976d2;
    --text-color: #333;
    --bg-color: #f4f4f4;
    --white: #ffffff;
    --dark: #333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-color);
    overflow-x: hidden;
}

.container {
    width: 90%;
    max-width: 1100px;
    margin: auto;
    padding: 0 15px;
}

/* Header & Navigation */
header {
    background: var(--white);
    padding: 1rem 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    height: 50px;
    width: auto;
}

/* Menu Toggle (Hamburger) */
.menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 5px;
}

.menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--dark);
    border-radius: 2px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    padding: 0 15px;
}

nav ul li a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: bold;
    transition: color 0.3s;
    font-size: 0.95rem;
}

nav ul li a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), url('images/sfondo.png') no-repeat center center/cover;
    min-height: 300px;
    color: var(--white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero p {
    font-size: 1.1rem;
}

/* Sections */
.section {
    padding: 3rem 0;
    background: var(--white);
    margin-bottom: 1.2rem;
}

.section p {
    margin-bottom: 1.2rem; 
}
.section p:last-child {
    margin-bottom: 0; /* Rimuove lo spazio inutile sull'ultimo paragrafo */
}


.section h2 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-size: 2rem;
}

/* Grids */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.card {
    background: var(--bg-color);
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
    transition: transform 0.3s;
}

.card:hover {
    transform: translateY(-5px);
}

.card img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    margin-bottom: 1rem;
}

/* Tables Responsive */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 1.5rem;
}

table {
    width: 100%;
    min-width: 600px; /* Ensure table doesn't get too squashed */
    border-collapse: collapse;
    background: #fff;
}

th, td {
    padding: 0.8rem;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}

th {
    background-color: var(--primary-color);
    color: white;
}

/* Footer */
footer {
    background: #333;
    color: var(--white);
    text-align: center;
    padding: 2.5rem 0;
}

.footer-content p {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

/* Responsive Media Queries */
@media (max-width: 992px) {
    nav ul li {
        padding: 0 10px;
    }
    nav ul li a {
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    nav {
        display: none; /* Hidden by default on mobile */
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--white);
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
    }

    nav.active {
        display: block;
    }

    nav ul {
        flex-direction: column;
    }

    nav ul li {
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .section {
        padding: 2rem 0;
    }

    .section h2 {
        font-size: 1.6rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
    }
}
