:root {
    --primary-blue: #003366;
    --accent-blue: #0077cc;
    --light-blue: #e6f2ff;
    --gray-bg: #f8f9fa;
    --text-color: #333333;
    --text-muted: #666666;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 75px;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0 0 45px 0;
    background-color: var(--gray-bg);
    color: var(--text-color);
}

/* Navigazione Desktop Ottimizzata per 6 voci */
.sticky-nav {
    background-color: var(--primary-blue);
    padding: 0 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
}

.nav-container {
    max-width: 1100px;
    display: flex;
    flex-grow: 1;
}

.sticky-nav a {
    color: #e0e0e0;
    text-decoration: none;
    padding: 16px 12px; /* Ridotto il padding laterale per ospitare più voci ordinatamente */
    font-weight: 600;
    font-size: 0.92rem;  /* Dimensioni bilanciate per desktop */
    transition: all 0.3s ease;
    text-align: center;
    flex-grow: 1;
}

.sticky-nav a:hover {
    color: white;
    background-color: rgba(255, 255, 255, 0.1);
}

.sticky-nav a.active-link {
    color: white;
    background-color: var(--accent-blue);
}

.mobile-only {
    display: none !important;
}

/* Bottone logo */
.menu-toggle-logo {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background-color 0.2s;
    margin-right: 10px;
    outline: none;
}

.menu-toggle-logo:hover {
    background-color: rgba(255, 255, 255, 0.15);
}

.nav-logo-icon {
    height: 34px;
    width: 34px;
    object-fit: contain;
    border-radius: 6px;
    background-color: white;
    padding: 2px;
}

/* Footer */
.sticky-footer {
    background-color: var(--primary-blue);
    color: #e0e0e0;
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.1);
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 9px 20px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 500;
    box-sizing: border-box;
    flex-wrap: wrap;
}

.footer-separator {
    margin: 0 10px;
    color: rgba(255, 255, 255, 0.3);
}

.footer-link {
    color: #e0e0e0;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 600;
}

.footer-link:hover {
    color: white;
    text-decoration: underline;
}

/* Contenitore Principale */
.content-container {
    max-width: 1000px;
    margin: 30px auto;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    box-sizing: border-box;
    width: 95%;
}

.page { display: none; }
.page.active { display: block; }

h1 {
    color: var(--primary-blue);
    margin-top: 0;
    border-bottom: 2px solid var(--light-blue);
    padding-bottom: 10px;
    font-size: 1.8rem;
}

.subsection-title {
    font-size: 1.15rem;
    color: var(--primary-blue);
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px dashed #ccc;
    padding-bottom: 5px;
}

/* Logo Home */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 25px;
}

.home-logo {
    width: 180px;
    height: 180px;
    object-fit: contain;
    display: block;
}

/* Ricerca */
.search-wrapper {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
}

.search-bar {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.search-bar:focus {
    border-color: var(--accent-blue);
    outline: none;
}

.clear-search {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    display: none;
    padding: 0;
    line-height: 1;
}

.clear-search:hover {
    color: #333;
}

/* Accordion */
details {
    background-color: white;
    border: 1px solid #dcdcdc;
    margin-bottom: 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
    overflow: hidden;
}

details[open] {
    background-color: var(--light-blue);
    border-color: var(--accent-blue);
}

summary {
    padding: 14px 20px;
    font-weight: 600;
    color: var(--primary-blue);
    cursor: pointer;
}

summary:hover {
    background-color: rgba(0, 119, 204, 0.05);
}

.text-content {
    padding: 20px;
    background-color: white;
    border-top: 1px solid #e0e0e0;
}

/* Stili interni dei testi */
.doc-title {
    color: var(--primary-blue);
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 5px;
    font-weight: 700;
}

.doc-subtitle {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 0;
    margin-bottom: 20px;
    font-style: italic;
}

.doc-heading {
    color: var(--accent-blue);
    font-size: 1.15rem;
    margin-top: 20px;
    margin-bottom: 12px;
    font-weight: 600;
    border-left: 3px solid var(--accent-blue);
    padding-left: 10px;
}

.doc-paragraph {
    font-size: 0.95rem;
    color: var(--text-color);
    margin-top: 0;
    margin-bottom: 12px;
    text-align: justify;
}

.link-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--accent-blue);
    font-weight: bold;
    text-decoration: none;
    border: 1px solid var(--accent-blue);
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.pdf-link {
    display: inline-block;
    margin-top: 15px;
    color: var(--accent-blue);
    font-weight: bold;
    text-decoration: none;
    border: 1px solid var(--accent-blue);
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.pdf-link:hover {
    background-color: var(--light-blue);
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin: 15px 0;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.doc-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
    min-width: 400px;
}

.doc-table th {
    background-color: var(--primary-blue);
    color: white;
    padding: 10px 12px;
    font-weight: 600;
}

.doc-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #e0e0e0;
    color: #444;
}

.doc-table tbody tr:nth-of-type(even) {
    background-color: #f9f9f9;
}

.doc-img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 15px auto;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* ADATTAMENTO PER DISPOSITIVI MOBILI e TABLET PICCOLI */
@media (max-width: 860px) {
    body { padding: 0 0 60px 0; }

    .sticky-nav {
        height: 52px;
        padding: 0 15px;
        justify-content: flex-start;
    }

    .menu-toggle-logo { margin-right: 0; }
    .mobile-only { display: block !important; }

    .nav-container {
        display: none;
        flex-direction: column;
        width: 100%;
        background-color: var(--primary-blue);
        position: absolute;
        top: 52px;
        left: 0;
        z-index: 999;
        box-shadow: 0 4px 5px rgba(0,0,0,0.2);
        max-height: calc(100vh - 112px);
        overflow-y: auto;
    }

    .nav-container.show { display: flex; }
    
    .sticky-nav a {
        padding: 15px 20px;
        text-align: left;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        font-size: 1rem;
    }

    .footer-container {
        padding: 8px 15px;
        font-size: 0.75rem;
        justify-content: center;
    }

    .footer-separator { margin: 0 6px; }
    .content-container { padding: 15px; margin: 15px auto; }
    h1 { font-size: 1.5rem; }
    .subsection-title { font-size: 1rem; margin-top: 20px; }

    .home-logo {
        width: 120px;
        height: 120px;
    }

    summary {
        padding: 12px 15px;
        font-size: 15px;
    }

    .doc-title { font-size: 1.3rem; }
    .doc-heading { font-size: 1.05rem; }
    .doc-paragraph { font-size: 0.9rem; }
}