.site-page {
    background-image: url("../images/pergamena_texture.jpg");
    background-size: cover;
    background-attachment: fixed;
}

html, body {
    height: 100%;
}

body {
    box-sizing: border-box;

  font-family: Arial, sans-serif;
  margin: 0;
  padding: 20px;
  color: #2b2b2b;
  text-align: center;

   display: flex;
    flex-direction: column;
    background-image: url("../images/pergamena_texture.jpg");
    background-size: cover;
    background-attachment: fixed;
}

.section-title {

    color: #5b3920;
font-size: 2.5rem;
    margin-bottom: 24px;
}

/* nascosto alla vista ma letto da motori di ricerca e lettori di schermo */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.subtitle {
    font-size: 1.5rem;
    margin-bottom: 36px;
    font-weight: bold;
}

h1 {
    color: #4a2f1b;
    font-size: 4rem;
    font-weight: bold;
}
h2 {
    color: #4a2f1b;
    font-size: 2rem;
    font-weight: bold;
}

h3 {
    color: #4a2f1b;
    font-size: 1.4rem;
    font-weight: bold;
}
/* ===== HEADER ===== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 500;

    display: flex;
    justify-content: space-between;
    align-items: center;

    /* barra a tutta larghezza, annullando il padding del body */
    margin: -20px -20px 40px -20px;
    padding: 8px 32px;

    background-color: rgba(246, 239, 224, 0.94);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid #b89b6d;
    box-shadow: 0 2px 8px rgba(74, 47, 27, 0.15);
}

.site-logo {
    display: flex;
    align-items: center;
}

.site-logo img {
    height: 56px;
    width: auto;
}

.site-nav {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.site-nav a {
    display: block;
    padding: 14px 16px;

    color: #5b3920;
    text-decoration: none;
    font-weight: bold;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;

    border-bottom: 3px solid transparent;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.active,
.nav-item.active > a {
    color: #4a2f1b;
    border-bottom-color: #b89b6d;
}

.site-nav a.active,
.nav-item.active > a {
    border-bottom-color: #5b3920;
}

/* ===== SOTTOMENU ===== */

.nav-item {
    position: relative;
    display: flex;
    align-items: stretch;
}

.has-submenu > a::after {
    content: "▾";
    margin-left: 6px;
    font-size: 0.8em;
}

.submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;

    background-color: #f6efe0;
    border: 1px solid #b89b6d;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 16px rgba(74, 47, 27, 0.2);
    text-align: left;
}

.submenu a {
    padding: 12px 18px;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(184, 155, 109, 0.4);
}

.submenu a:last-child {
    border-bottom: none;
}

.submenu a:hover,
.submenu a.active {
    background-color: rgba(184, 155, 109, 0.25);
}

.nav-item:hover .submenu,
.nav-item:focus-within .submenu {
    display: block;
}

.menu-toggle {
    display: none;
    font-size: 2rem;
    background: none;
    border: none;
    color: #4a2f1b;
    cursor: pointer;
}

/* ===== MOBILE ===== */

@media (max-width: 768px) {

    .site-header {
        flex-wrap: wrap;
        padding: 8px 16px;
    }

    .menu-toggle {
        display: block;
    }

    .site-nav {
        display: none;
        flex-direction: column;
        width: 100%;
        gap: 0;
        padding-bottom: 8px;
        text-align: left;
    }

    .site-nav.open {
        display: flex;
    }

    .site-nav a {
        padding: 12px 8px;
        border-bottom: 1px solid rgba(184, 155, 109, 0.4);
    }

    .nav-item {
        flex-direction: column;
    }

    /* su mobile il sottomenu è sempre aperto, dentro il menu a comparsa */
    .submenu {
        display: block;
        position: static;
        min-width: 0;
        border: none;
        box-shadow: none;
        background: none;
        padding-left: 16px;
    }

    .has-submenu > a::after {
        content: none;
    }
}
/* ===== FOOTER ===== */

.footer {
    margin-top: 40px;

    padding-top: 4px;
    padding-bottom: 4px;

    font-size: 1rem;
    color: #474747;

    border-top: 1px solid #b89b6d;
}

/* Seconda riga del footer (nota sulle statistiche): più piccola e vicina alla prima */
.footer p + p {
    margin-top: -0.75rem;
    margin-bottom: 0.5rem;
}

.footer p + p small {
    font-size: 0.75rem;
}
#footer-container {
    margin-top: auto;
}
