/* ==========================================================================
   RESET E VARIABILI
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;500;700&display=swap');

:root {
    --primary-color: #333; 
    --accent-color: #a38b75; 
    --bg-color: #ffffff;
    --text-muted: #888;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--bg-color);
    color: var(--primary-color);
    margin: 0;
    line-height: 1.6;
}

/* ==========================================================================
   NAVBAR & LOGO
   ========================================================================== */
/* --- NAVBAR MINIMALE --- */
.navbar {
    position: fixed; /* La tiene fissa in alto mentre scorri */
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--bg-color);
    padding: 15px 0;
    z-index: 1000;
    border: none; /* Rimuove eventuali bordi */
    box-shadow: none; /* Rimuove l'ombra grigia che crea l'effetto box */
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: center; /* Centra il logo */
    align-items: center;
    padding: 0 20px;
}

/* Rimuovi o commenta le classi .nav-links e .burger perché non più usate */
.nav-links, .burger {
    display: none;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: 5px;
    text-decoration: none;
    color: var(--primary-color);
    text-transform: uppercase;
    margin: 0;
    line-height: 1;
}

.logo span {
    font-weight: 300;
    color: var(--accent-color);
}


/* ==========================================================================
   STRUTTURA PAGINE E HEADER
   ========================================================================== */
.content-wrapper {
    max-width: 1200px;
    margin: 100px auto 60px; /* Aumentato il margine superiore (100px) */
    padding: 0 30px;
}

.page-header {
    text-align: center;
    margin-bottom: 50px;
}

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 300;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.page-header p {
    color: var(--text-muted);
    font-style: italic;
}

.breadcrumbs {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 10px;
    text-align: center;
}

.breadcrumbs a {
    text-decoration: none;
    color: var(--accent-color);
}

/* --- GRIGLIA ANNI (HOME) 2x2 --- */
.years-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr) !important; /* Forza 2 colonne su PC */
    gap: 30px;
    max-width: 1000px; /* Stringe la griglia per renderla più elegante e proporzionata */
    margin: 40px auto; /* La centra e stacca dal titolo */
}

/* Tablet: mantiene le 2 colonne */
@media (max-width: 900px) {
    .years-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
    }
}

/* Mobile: una colonna sotto l'altra */
@media (max-width: 600px) {
    .years-grid {
        grid-template-columns: 1fr !important;
    }
}

.year-card, .event-card {
    position: relative;
    height: 350px;
    border-radius: 4px;
    overflow: hidden;
    display: block;
    text-decoration: none;
    background-color: #eee;
}

.year-bg, .event-bg {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover;
    background-position: center;
    filter: grayscale(100%);
    transition: filter 0.6s ease, transform 0.8s ease;
    z-index: 1;
}

.year-overlay, .event-info {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 2;
    transition: background 0.4s ease;
    color: white;
}

.year-overlay h2 {
    text-transform: uppercase;
    letter-spacing: 4px;
    font-weight: 700;
}

/* Hover effects */
.year-card:hover .year-bg, .event-card:hover .event-bg {
    filter: grayscale(0%);
    transform: scale(1.05);
}

.year-card:hover .year-overlay, .event-card:hover .event-info {
    background: rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   GALLERIA MOSAICO (PAGINA SINGOLA)
   ========================================================================== */
.masonry-gallery {
    column-count: 3;
    column-gap: 20px;
    padding: 20px 0;
}

.masonry-gallery a {
    display: block;
    margin-bottom: 20px;
    break-inside: avoid;
    text-decoration: none;
}

.masonry-gallery img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    background-color: #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.masonry-gallery a:hover img {
    transform: scale(1.02);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
    z-index: 5;
}

/* ==========================================================================
   RESPONSIVITÀ
   ========================================================================== */
@media (max-width: 900px) {
    .masonry-gallery { column-count: 2; }
}

@media (max-width: 600px) {
    .masonry-gallery { column-count: 1; }
    .nav-container { flex-direction: column; gap: 15px; }
    .years-grid { grid-template-columns: 1fr; }
}

.year-selector {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 50px;
}

.btn-year {
    padding: 10px 20px;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-year:hover {
    background-color: var(--accent-color);
    color: white;
}

.category-year-section {
    margin-bottom: 60px;
    border-top: 1px solid #eee;
    padding-top: 20px;
}

.category-year-section h2 {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 30px;
}


/* Modifica questa sezione per avere la griglia su un'unica linea (3 colonne) */
.years-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* Forza esattamente 2 colonne */
    gap: 25px;
}

/* Modifica la responsività per tablet */
@media (max-width: 900px) {
    .years-grid {
        grid-template-columns: repeat(2, 1fr); /* Su tablet restano 2 sopra e 1 sotto */
    }
}

/* Modifica la responsività per mobile */
@media (max-width: 600px) {
    .years-grid {
        grid-template-columns: 1fr; /* Su smartphone tornano uno sotto l'altro */
    }
}



.category-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.year-dropdown {
    display: none; /* Ora è correttamente nascosto di base */
    background: #f9f9f9;
    padding: 15px;
    border: 1px solid #eee;
    margin-top: 10px;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    border-radius: 4px;
}

/* La classe active forza la visualizzazione */
.year-dropdown.active {
    display: flex !important;
}

.year-dropdown a {
    padding: 8px 15px;
    background: white;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: bold;
    transition: all 0.2s ease;
}

.year-dropdown a:hover {
    background: var(--accent-color);
    color: white;
}



/* FOOTER */
.footer {
    text-align: center;
    padding: 60px 0 30px;
    background-color: var(--bg-color);
    border-top: 1px solid #f0f0f0;
    margin-top: 80px;
}

.footer-logo {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-decoration: none;
    color: var(--primary-color);
    text-transform: uppercase;
}

.copyright {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-top: 15px;
}


/* --- BACK LINK ELEGANTE --- */
.back-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted); /* Colore grigio discreto */
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-bottom: 30px;
    position: relative;
}

/* Freccia personalizzata tramite CSS (più elegante del carattere standard) */
.back-link::before {
    content: '';
    width: 20px;
    height: 1px;
    background-color: var(--text-muted);
    margin-right: 10px;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: var(--primary-color);
    letter-spacing: 3px; /* Effetto espansione al passaggio del mouse */
}

.back-link:hover::before {
    width: 30px; /* La linea si allunga al passaggio del mouse */
    background-color: var(--primary-color);
}
