:root {
    --blu: #5fa0d3;
    --blu-profondo: #2f6fa3;
    --sabbia: #fef9f3;
    --accento: #a85c40;
}

/* ==============================
   RESET
============================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: system-ui, -apple-system, Arial, sans-serif;
    background: var(--sabbia);
    color: #333;
    line-height: 1.6;
}

/* ==============================
   ACCESSIBILITÀ
============================== */
a:focus,
button:focus {
    outline: 3px solid var(--blu);
    outline-offset: 3px;
}

html {
    scroll-behavior: smooth;
}

/* ==============================
   HEADER
============================== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
    background: rgba(254,249,243,0.95);
}

.logo-img {
    height: 60px;
}

/* ==============================
   HAMBURGER
============================== */
.line {
    width: 25px;
    height: 3px;
    background: #333;
}

/* ==============================
   NAV MENU (BASE)
============================== */
.nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100dvh;

    background: var(--sabbia);

    display: flex;
    flex-direction: column;
    align-items: center;

    padding-top: 100px;

    transition: right 0.3s ease;
    z-index: 2000;

    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* stato aperto */
.nav-menu.active {
    right: 0;
}

/* accessibilità ARIA */
.nav-menu[aria-hidden="true"] {
    visibility: hidden;
}

.nav-menu[aria-hidden="false"] {
    visibility: visible;
}

/* lista */
.nav-menu ul {
    list-style: none;
    text-align: center;
}

/* item */
.nav-menu li {
    margin: 1rem 0;
}

/* link */
.nav-menu a {
    text-decoration: none;
    color: #333;
    font-size: 1.2rem;

    padding: 0.5rem 1rem;
    display: inline-block;
}

/* hover + focus */
.nav-menu a:hover,
.nav-menu a:focus {
    color: var(--accento);
    text-decoration: underline;
}

/* focus accessibilità più forte */
.nav-menu a:focus {
    outline: 3px solid var(--blu);
    outline-offset: 4px;
    border-radius: 6px;
}

/* bottone chiusura */
#close-menu {
    position: absolute;
    top: 20px;
    right: 20px;

    font-size: 2rem;
    cursor: pointer;

    background: none;
    border: none;
}

/* focus close */
#close-menu:focus {
    outline: 3px solid var(--blu);
    outline-offset: 4px;
    border-radius: 6px;
}

/* ==============================
   HERO (MIGLIORATA CONTRASTO)
============================== */
.hero {
    width: 100%;
    background: linear-gradient(
        to bottom,
        #3f7fb3 0%,
        #5fa0d3 45%,
        #c9dcec 100%
    );
    color: white;
    padding: 4rem 1rem;
}

/* leggera ombra per leggibilità */
.hero h1,
.hero p {
    text-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

/* contenuto centrato */
.hero-content {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;

    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

/* titolo */
.hero h1 {
    font-size: 2.5rem;
    line-height: 1.2;
}

/* testo */
.hero p {
    font-size: 1.1rem;
    max-width: 700px;
}

/* ==============================
   VIDEO HERO (CERCHIO)
============================== */
.hero-video {
    margin-top: 1.5rem;
}

.hero-video video {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* ==============================
   CTA
============================== */
.cta {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    background: white;
    color: var(--blu-profondo);
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
}

/* ==============================
   SEZIONI
============================== */
section:not(.hero) {
    padding: 4rem 2rem;
    max-width: 900px;
    margin: auto;
}

section h2 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

/* ==============================
   EVENTI
============================== */
.programma-container {
    display: grid;
    gap: 2rem;
    margin-top: 2rem;
}

.evento-box {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.evento-box:hover {
    transform: translateY(-4px);
}

.evento-titolo {
    font-size: 1.3rem;
    font-weight: 600;
}

.evento-comune {
    font-size: 0.95rem;
    color: #555;
}

.evento-desc {
    margin-top: 0.5rem;
    font-size: 0.95rem;
}

/* ==============================
   FOOTER
============================== */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 1px solid #ddd;
}

/* ==============================
   MENU OPEN
============================== */
body.menu-open {
    overflow: hidden;
}

/* ==============================
   RESPONSIVE
============================== */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero-video video {
        width: 150px;
        height: 150px;
    }
}

/* ==============================
   ACCESSIBILITÀ TESTO NASCOSTO
============================== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ==============================
   LOGO DENTRO MENU
============================== */
.menu-logo img {
    width: 120px;
    height: auto;
    max-width: 60%;
    margin-bottom: 1.5rem;
    object-fit: contain;
}

@media (max-width: 768px) {
    .menu-logo img {
        width: 90px;
    }
}

/* ==============================
   ARCHIVIO ANNI (CARD)
============================== */

.archivio-anni {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.anno {
    background: white;
    padding: 1.2rem;
    text-align: center;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.2s ease;
}

.anno:hover {
    transform: translateY(-3px);
}

.anno a {
    display: block;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--blu-profondo);
    text-decoration: none;
}

/* ==============================
   STEMMI COMUNI (RESPONSIVE UX/UI)
============================== */

.stemmi-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

/* card cliccabile intera */
.stemma-comune {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    text-decoration: none;
    background: white;
    border-radius: 14px;
    padding: 1rem;

    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* hover + focus accessibilità */
.stemma-comune:hover,
.stemma-comune:focus {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.12);
    outline: none;
}

/* immagine */
.stemma-comune img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

/* nome comune */
.stemma-comune span {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--blu-profondo);
    text-align: center;
}

/* mobile ottimizzato */
@media (max-width: 600px) {
    .stemmi-container {
        grid-template-columns: repeat(2, 1fr);
    }

    .stemma-comune img {
        width: 65px;
        height: 65px;
    }
}

/* ==============================
   BOTTONI SEZIONI
============================== */

.btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    margin-top: 1.5rem;
    padding: 0.9rem 1.6rem;

    background: var(--blu-profondo);
    color: white;

    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.2px;

    border-radius: 999px;

    box-shadow: 0 6px 18px rgba(47,111,163,0.18);

    transition:
        transform 0.2s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

/* hover */
.btn-link:hover {
    background: var(--blu);
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(47,111,163,0.22);
}

/* click */
.btn-link:active {
    transform: translateY(0);
}

/* focus accessibilità */
.btn-link:focus {
    outline: 3px solid rgba(95,160,211,0.35);
    outline-offset: 3px;
}

/* mobile */
@media (max-width: 600px) {
    .btn-link {
        width: 100%;
        text-align: center;
    }
}

.btn-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}



/* ==============================
   HAMBURGER BUTTON ACCESSIBILE
============================== */
.hamburger {
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: transparent;
    border: none;
    padding: 0.5rem;
}

/* migliora area cliccabile */
.hamburger:focus {
    outline: 3px solid var(--blu);
    outline-offset: 4px;
    border-radius: 6px;
}

/* linee hamburger */
.hamburger .line {
    width: 25px;
    height: 3px;
    background: #333;
    display: block;
}

/* ==============================
   CLOSE BUTTON MENU
============================== */
#close-menu {
    position: absolute;
    top: 20px;
    right: 20px;

    font-size: 2rem;
    cursor: pointer;

    background: transparent;
    border: none;

    padding: 0.3rem 0.6rem;
}

#close-menu:focus {
    outline: 3px solid var(--blu);
    outline-offset: 4px;
    border-radius: 6px;
}

/* ==============================
   DISABLE SCROLL WHEN MENU OPEN
============================== */
body.menu-open {
    overflow: hidden;
}

/* FONT */
.hero h1 {
    font-family:
        "Avenir Next",
        "Segoe UI",
        "Helvetica Neue",
        sans-serif;

    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 0.95;
}

/* DISPOSIZIONE HEADER */
@media (min-width: 768px) {

    .hero-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1.2rem 2rem;
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: 1.5rem;
    }

    /* BLOCCO CENTRALE ASSOLUTO */
    .logo-text {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        text-align: center;
    }

    /* hamburger a destra */
    .hamburger {
        margin-left: auto;
    }
}

@media (max-width: 767px) {

    .hero-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 1rem 1.2rem;
        position: relative;
    }

    /* LOGO + TESTO impilati ma compatti */
    .header-left {
        display: flex;
        align-items: center;
        gap: 0.8rem;
    }

    .logo-text {
        position: static;      /* IMPORTANTISSIMO: disattiva il centramento desktop */
        transform: none;
        text-align: left;
    }

    .titolo {
        font-size: 0.9rem;
    }

    .manifesto {
        font-size: 0.9rem;
        line-height: 1.1;
    }

    /* hamburger più “centrato visivamente” */
    .hamburger {
        margin-left: auto;
        padding: 0.4rem;
    }
}

/* EVENTI */
.evento-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 1rem;
}

/* POP UP EVENTI*/
/* =========================
   MODAL POPUP
========================= */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    z-index: 9999;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 16px;
    padding: 1.5rem;
    position: relative;
}

.modal-content img {
    width: 100%;
    border-radius: 12px;
    margin-bottom: 1rem;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    background: none;
    border: none;
    cursor: pointer;
}

/* ANTEPRIMA EVENTI*/
.evento-desc {
    display: -webkit-box;
    -webkit-line-clamp: 2; /* numero righe anteprima */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* FOCUS LOGO */
.menu-logo a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.menu-logo a:focus {
    outline: 3px solid var(--blu);
    outline-offset: 6px;
    border-radius: 12px;
}

/* STRADE MONDO */
.hero-subtitle {
    display: block !important;
    font-size: 1.8rem !important;
    line-height: 1.2 !important;

    margin: 0.8rem 0 1rem 0 !important;

    font-family: "Palatino Linotype", Palatino, serif !important;
    font-style: italic !important;
    font-weight: normal !important;

    color: rgba(255,255,255,0.95) !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.25) !important;
}

/* ==============================
   HEADER LAYOUT STABILE
============================== */

.hero-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 1.2rem 2rem;

    position: relative;

    /* 🔥 AGGIUNTO: più respiro verso la hero */
    margin-bottom: 1.2rem;
}

.header-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
    min-width: 0;
}

/* ==============================
   MANIFESTO
============================== */

.manifesto {
    position: relative;
    padding-bottom: 0.4rem;
    margin-bottom: 0.4rem;
}

.manifesto::after {
    content: "";
    display: block;
    width: 90px;
    height: 1px;
    background: var(--blu-profondo);
    opacity: 0.35;
    margin-top: 0.4rem;
}

/* ==============================
   MOBILE
============================== */

@media (max-width: 767px) {
    .hero-header {
        padding: 1rem 1.2rem;
        align-items: center;

        /* 🔥 meno spazio su mobile */
        margin-bottom: 0.6rem;
    }

    .manifesto::after {
        width: 70px;
        opacity: 0.25;
    }
}

/* LUOGO EVENTI */
.evento-location {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;

    margin-top: 0.6rem;

    font-size: 0.85rem;
    font-weight: 600;

    color: var(--blu-profondo);
    background: rgba(95,160,211,0.12);

    padding: 0.35rem 0.6rem;
    border-radius: 999px;

    width: fit-content;
}

/* MIGLIORIE CARDS */
/* ==============================
   EVENTI – MIGLIORAMENTO UX LISTA
============================== */

/* contenitore: layout responsive vero */
.programma-container {
    display: grid;
    gap: 2.5rem;
    margin-top: 2rem;
}

/* CARD: più separazione visiva */
.evento-box {
    background: white;
    padding: 1.6rem;
    border-radius: 14px;

    border: 1px solid rgba(0,0,0,0.06);

    box-shadow: 0 6px 18px rgba(0,0,0,0.06);

    transition: transform 0.25s ease, box-shadow 0.25s ease;

    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* hover più leggibile (non solo movimento) */
.evento-box:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.12);
}

/* IMMAGINE più “card-like” */
.evento-img {
    border-radius: 12px;
    margin-bottom: 0.5rem;
    aspect-ratio: 16 / 9;
    height: auto;
}

/* LOCATION già buona ma più stacco */
.evento-location {
    margin-top: 0.3rem;
}

/* TESTO: più leggibile tra card */
.evento-comune,
.evento-desc {
    color: #444;
}

/* ==============================
   TABLET (2 colonne)
============================== */
@media (min-width: 768px) {
    .programma-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
}

/* ==============================
   DESKTOP (2 colonne + più aria)
============================== */
@media (min-width: 1100px) {
    .programma-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
        max-width: 1100px;
        margin-left: auto;
        margin-right: auto;
    }

    .evento-box {
        padding: 1.8rem;
    }
}

/* ==============================
   ULTRA WIDE (opzionale: 3 colonne leggere)
============================== */
@media (min-width: 1500px) {
    .programma-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ==============================
   EVENTI – LOOK PIÙ PROFESSIONALE
============================== */
/* LUOGO = DOVE */
.evento-location {
    background: rgba(168,92,64,0.10);
    color: var(--accento);

    display: inline-flex;
    align-items: center;
    gap: 0.4rem;

    width: fit-content;

    padding: 0.35rem 0.7rem;

    border-radius: 999px;

    font-size: 0.85rem;
    font-weight: 600;
}

/* TITOLO PIÙ FORTE */
.evento-titolo {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.25;
}

/* TESTI SECONDARI PIÙ LEGGERI */
.evento-comune {
    font-size: 0.85rem;
    color: #777;
    line-height: 1.4;
}

/* DESCRIZIONE PIÙ LEGGIBILE */
.evento-desc {
    color: #444;
    line-height: 1.6;
}

/* CARD PIÙ ORDINATA */
.evento-box {
    gap: 0.9rem;
}

/* BOTTONE SEMPRE IN FONDO:
   mantiene le card allineate anche con testi diversi */
.evento-btn {
    margin-top: auto;
}

/* CARDS */
.evento-location {
    background: rgba(168,92,64,0.10);
    color: var(--accento);
}

/* HEADER DISPOSIZIONE */
@media (max-width: 767px) {
  .header-left {
    flex-direction: row;   /* logo + testo affiancati */
    align-items: center;
    gap: 0.8rem;
  }

  .logo-text {
    display: flex;
    flex-direction: column; /* titolo sotto, ma tutto a destra del logo */
  }
}

/* ==============================
   CATEGORIE HEADER (PULITO)
============================== */

.categorie {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;

    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.5px;
    line-height: 1.2;
    color: #333;

    max-width: 100%;
}

/* ogni parola */
.categorie span {
    display: inline-block;
    white-space: nowrap;
}

/* evidenziato */
.categorie .verde {
    color: #00bf63;
    font-weight: 700;
}

/* ==============================
   DESKTOP OTTIMIZZATO
============================== */

@media (min-width: 768px) {
    .categorie {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 0.8rem;
    }
}

/* ==============================
   MOBILE
============================== */

@media (max-width: 767px) {
    .categorie {
        font-size: 0.7rem;
        gap: 0.3rem;
    }
}

/* ==============================
   MICRO MOBILE
============================== */

@media (max-width: 420px) {
    .categorie {
        font-size: 0.65rem;
        letter-spacing: 0.3px;
    }
}

/* EVENTO DATA */
.evento-data {
    display: inline-block;
    width: fit-content;

    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;

    padding: 0.35rem 0.7rem;
    border-radius: 6px;

    background: var(--blu-profondo);
    color: white;
}

/* ==================================
   HEADER FUSO CON HERO
================================== */

.hero-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;

    z-index: 1000;

    background: transparent !important;
}

/* Il blu sale fino in cima,
   ma manteniamo il respiro originale */
.hero {
    padding-top: 140px; /* aumenta o diminuisci di 20px se serve */

    background: linear-gradient(
        to bottom,
        #2f6fa3 0%,
        #5fa0d3 45%,
        #c9dcec 100%
    );
}

/* colori header */
.hero-header .titolo,
.hero-header .manifesto,
.hero-header .categorie,
.hero-header .categorie span:not(.verde) {
    color: white;
}

.hero-header .manifesto::after {
    background: rgba(255,255,255,0.4);
}

.hero-header .line {
    background: white;
}

@media (max-width: 767px) {
    .hero {
        padding-top: 140px; /* DISTANZA */
    }
}

/* ==============================
   NERIO BRIAN
============================== */

.nerio {
    text-align: center;
    margin-bottom: 2rem;
}

.nerio-foto {
    width: 220px;
    height: 220px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    margin: 0 auto 1.5rem auto;
}

.nerio-citazione {
    font-style: italic;
    color: var(--accento);
    margin-top: 0.5rem;
}

/* NEW TROLLS */
.nerio-fonte {
    display: block;
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 0.3rem;
}

/* ACCA UNO */
.hero h1 {
    font-size: clamp(2.8rem, 5vw, 4.5rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
    margin-top: 0.5rem;
}

