
/* =========================
   FONT E RESET BASE
========================= */
body {
    font-family: 'Inter', sans-serif; /* AGID consiglia font leggibile */
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: row;
    font-size: 16px;
    line-height: 1.6;
    color: #212121; /* testo principale leggibile e contrastato */
    background-color: #ffffff;
}

/* ================= HEADER ================= */
#header {
    width: 100%;
    background-color: #005a9e; /* colore istituzionale AGID */
    color: white;
    padding: 15px 20px;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 10px;
}

#header h1 {
    margin: 0;
    font-size: 22px;
    flex: 1;
    line-height: 1.3;
}

#home-link {
    color: white;
    text-decoration: none;
    font-size: 20px;
}

#menu-toggle {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

/* ================= MENU ================= */
#menu {
    width: 250px;
    background: #f8f9fa; /* sfondo chiaro secondo AGID */
    padding: 20px;
    position: fixed;
    top: 0;
    left: 0;
    box-sizing: border-box;
    overflow-y: auto;
    transition: max-height 0.3s ease;
    height: 100vh; /* altezza totale */
}

#menu h2 {
    font-size: 18px;
    margin-top: 0;
    font-weight: 600;
    color: #212121;
}

#menu a {
    display: block;
    text-decoration: none; /* rimuove sottolineatura */
    color: #212121; /* contrasto leggibile */
    margin: 5px 0;
    padding: 6px 8px;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

#menu a.active {
    background-color: #005a9e; /* link attivo secondo palette AGID */
    color: white;
    font-weight: 600;
}

/* ================= CONTENUTO ================= */
#contenuto {
    margin-left: 270px;
    padding: 20px;
    flex: 1;
}

#contenuto h2 {
    margin-top: 50px;
    border-bottom: 1px solid #d1d1d1; /* contrasto sufficiente */
    padding-bottom: 5px;
    font-weight: 600;
}

ul {
    list-style-type: disc;
    padding-left: 25px;
}

ul li {
    margin-bottom: 10px;
    font-size: 18px;
}

ul li a {
    text-decoration: none; /* rimuove sottolineatura */
    color: #212121;
    transition: color 0.2s;
}

ul li a:hover, ul li a:focus {
    color: #005a9e; /* colore hover AGID */
    outline: none; /* opzionale, puoi aggiungere focus visibile se necessario */
}

/* ================= OVERLAY ================= */
#overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 998;
}

#overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ================= MOBILE ================= */
@media (max-width: 768px) {

    body {
        flex-direction: column;
    }

    #menu-toggle {
        display: inline-block;
    }

    #menu {
        width: 100%;
        left: 0;
        max-height: 0;
        padding: 0;
        overflow: hidden;
        z-index: 999;
        background: #f8f9fa;
    }

    #menu.open {
        overflow-y: auto;
        padding: 15px 0; /* padding verticale totale 30px */
    }

    #menu a {
        padding: 12px 20px;
        font-size: 16px;
    }

    #contenuto {
        margin-left: 0;
        padding: 20px;
    }
}

/* blocco scroll quando menu aperto */
body.menu-open {
    overflow: hidden;
}

/* ================= PULSANTI (opzionale) ================= */
button, input[type="submit"], .btn {
    font-family: 'Inter', sans-serif;
    font-weight: 600;
    padding: 0.5em 1em;
    background-color: #005a9e;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover, input[type="submit"]:hover, .btn:hover {
    background-color: #004578;
}

/* ================= CLASSI UTILI ================= */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mb-1 { margin-bottom: 0.25em; }
.mb-2 { margin-bottom: 0.5em; }
.mb-3 { margin-bottom: 1em; }

