/* ===== RESET & BASE ===== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --gold: #C9A84C;
    --bordeaux: #7B1E3A;
    --dark: #1a1a1a;
    --light-bg: #f9f6f1;
    --alt-bg: #f0ebe2;
    --text: #333;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'EB Garamond', 'Georgia', serif;
    color: var(--text);
    background: #fff;
}

/* ===== NAVBAR ===== */
/* ===== NAVBAR ===== */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
    height: 68px;
    background: rgba(20, 5, 10, 0.88);
    backdrop-filter: blur(6px);
    border-bottom: 2px solid var(--gold);
    transition: background 0.3s;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.nav-logo-img {
    height: 58px; /* Scalato per adattarsi ai 68px della navbar */
    width: auto;  /* Mantiene le proporzioni originali 1560x665 */
    object-fit: contain;
    display: block;
}

.nav-logo-text {
    font-family: 'EB Garamond', serif;
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: 0.06em;
    line-height: 1;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    font-family: 'Cinzel', serif; /* Cambiato da EB Garamond a Cinzel */
    color: #fff;
    text-decoration: none;
    font-size: 0.95rem; /* Leggermente ridotto per compensare l'estensione del font */
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--gold);
}

.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.4rem;
    cursor: pointer;
}

/* ===== HERO ===== */
.hero {
    position: relative;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.hero-parallax {
    position: absolute;
    inset: -20% 0;
    background: url('img/hero.jpg') center/cover no-repeat;
    will-change: transform;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.48);
}

.hero-content {
    position: relative;
    z-index: 1;
    color: #fff;
    padding: 0 1.5rem;
}

.hero-quote {
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    font-style: italic;
    line-height: 1.5;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
    margin-bottom: 0.8rem;
    max-width: 900px;
}

.hero-ref {
    display: block;
    font-size: 1rem;
    color: var(--gold);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-logo {
    display: block;
    width: clamp(160px, 24vw, 320px); /* Moltiplicato x2 rispetto al range originale */
    height: auto;
    margin: 0 auto 1.8rem;
}


/* ===== SPLIT PARALLAX ===== */
/* ===== SPLIT PARALLAX ===== */
.split-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 480px;
    overflow: hidden;
}

.split-section.reverse {
    direction: rtl;
}

.split-section.reverse > * {
    direction: ltr;
}

.split-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 3.5rem 3rem; /* era 5rem 4rem */
    background: var(--light-bg);
}

.split-text h2 {
    font-size: 1.9rem;
    color: var(--bordeaux);
    margin-bottom: 1.2rem;
    text-align: left;
    font-style: italic;
}

.split-text h2::after {
    content: '';
    display: block;
    width: 50px;
    height: 3px;
    background: var(--gold);
    margin: 0.5rem 0 0;
}

.split-text p {
    font-size: 1.15rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 0.8rem;
}

.split-text a {
    color: var(--text);
    text-decoration: none;
    transition: color 0.2s ease;
}

.split-text a:hover {
    color: var(--bordeaux);
}

/* Forzatura dimensioni per la mappa interattiva */
.split-image iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.split-text i {
    color: var(--gold);
    margin-right: 0.5rem;
}

/* Ripristinata allo stato originale per non rompere le altre sezioni */
.split-image {
    position: relative;
    overflow: hidden;
    min-height: 480px;
}

/* Nuova classe per gestire l'immagine in modo statico e coprente */
.static-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.parallax-bg {
    position: absolute;
    inset: -20% 0;
    background-size: cover;
    background-position: center;
    will-change: transform;
}

/* ===== SECTIONS ===== */
.section {
    padding: 50px 1.5rem;
    background: var(--light-bg);
}

.section-alt {
    background: var(--alt-bg);
}

.container {
    max-width: 1000px;
    margin: 0 auto;
}

h2 {
    font-size: 2rem;
    color: var(--bordeaux);
    text-align: center;
    margin-bottom: 1.5rem;
    font-style: italic;
}

h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--gold);
    margin: 0.6rem auto 0;
}

/* ===== ORARI ===== */
.orari-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.orario-card {
    background: #fff;
    border-left: 4px solid var(--gold);
    padding: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    text-align: center;
}

.orario-card h3 {
    color: var(--bordeaux);
    margin-bottom: 0.7rem;
}

/* ===== EVENTI GRID MODULARE ===== */
.eventi-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 768px) {
    .eventi-grid {
        grid-template-columns: 3fr 2fr; /* 60% Spazio al Calendario principale, 40% a Locandine e Pellegrinaggi */
        align-items: start;
        gap: 2.5rem;
    }
}

.evento-titolo {
    color: var(--bordeaux);
    font-size: 1.35rem;
    margin-bottom: 1rem;
    text-align: center;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 0.5rem;
    font-family: 'Cinzel', serif;
}

.evento-colonna {
    display: flex;
    flex-direction: column;
}

.evento-master, .evento-card-special {
    position: relative;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease;
    background: #fff;
}

.evento-master:hover, .evento-card-special:hover {
    transform: translateY(-4px);
}

.master-img, .special-img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.hover-overlay {
    position: absolute;
    inset: 0;
    background: rgba(123, 30, 58, 0.85); /* Sfondo Bordeaux semitrasparente */
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    font-size: 1.3rem;
}

.evento-master:hover .hover-overlay, 
.evento-card-special:hover .hover-overlay {
    opacity: 1;
}

.hover-overlay i {
    margin-right: 0.5rem;
}

.eventi-secondari {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}
/* ===== GALLERIA ===== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.gallery-item {
    overflow: hidden;
    border-radius: 6px;
    cursor: pointer;
    aspect-ratio: 4/3;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.35s ease;
    display: block;
}

.gallery-item:hover img {
    transform: scale(1.07);
}

/* ===== LIGHTBOX ===== */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 90vw;
    max-height: 88vh;
    border-radius: 4px;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.5);
}

.lightbox-close {
    position: absolute;
    top: 1.2rem;
    right: 1.8rem;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
}

/* ===== CONTATTI ===== */
.contatto-info p {
    margin-bottom: 0.9rem;
    font-size: 0.97rem;
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

.contatto-info i {
    color: var(--gold);
    width: 18px;
}

/* ===== FOOTER ===== */
footer {
    background: var(--dark);
    color: #aaa;
    text-align: center;
    padding: 1.5rem;
    font-size: 0.85rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: rgba(20, 5, 10, 0.97);
        padding: 1.5rem 2rem;
        gap: 1.2rem;
    }

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

    .split-section {
        grid-template-columns: 1fr;
    }

    .split-section.reverse {
        direction: ltr;
    }

    .split-image {
        min-height: 260px;
    }

    .split-text {
        padding: 3rem 2rem;
    }
}

/* ===== ALBUM SELECTOR ===== */
.album-selector {
    display: flex;
    justify-content: center;
    margin-bottom: 2.5rem;
}

.album-selector select {
    font-family: 'EB Garamond', serif;
    font-size: 1.05rem;
    color: var(--bordeaux);
    background: #fff;
    border: 2px solid var(--gold);
    border-radius: 4px;
    padding: 0.6rem 1.4rem;
    cursor: pointer;
    outline: none;
    min-width: 280px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23C9A84C' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    transition: border-color 0.2s;
}

.album-selector select:hover,
.album-selector select:focus {
    border-color: var(--bordeaux);
}

.gallery-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 2rem 0;
}
/* Frecce navigazione lightbox */
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.12);
    border: none;
    color: #fff;
    font-size: 3rem;
    line-height: 1;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    z-index: 2001;
    user-select: none;
}

.lightbox-nav:hover {
    background: rgba(201, 168, 76, 0.45);
}

#lightbox-prev { left: 1.5rem; }
#lightbox-next { right: 1.5rem; }

/* Contatore foto (es. "3 / 12") */
.lightbox-counter {
    position: absolute;
    bottom: 1.2rem;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.75);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    pointer-events: none;
}

/* Su mobile: frecce più compatte */
@media (max-width: 768px) {
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }
    #lightbox-prev { left: 0.5rem; }
    #lightbox-next { right: 0.5rem; }
}
/* ===== SLIDESHOW CHI SIAMO ===== */
#chisiamo-slider {
    position: relative;
    overflow: hidden;
}

.slider-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease;
}

.slider-slide.active {
    opacity: 1;
}
/* ===== FADE IN PAGINA ===== */
body {
    animation: fadeInPage 0.6s ease forwards;
}

@keyframes fadeInPage {
    from { opacity: 0; }
    to   { opacity: 1; }
}
/* ===== OFFSET ANCORAGGIO NAVBAR ===== */
[id] {
    scroll-margin-top: 80px;
}