@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400;1,600&display=swap');

/* ==========================================================================
   1. RESET E VARIABILI (Palette Arricchita)
   ========================================================================== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html, body { overflow-x: hidden; scroll-behavior: smooth; }

:root {
    --bg-silk: #F4F0E6;       /* Crema materico e caldo */
    --text-black: #0F0F0F;    /* Nero inchiostro */
    --text-muted: #5A5A5A;
    --accent-burnt: #B34B30;  /* Terracotta vibrante (Le Mura) */
    --gold: #C5A059;          /* Oro scuro ed elegante */
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Montserrat', sans-serif;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-silk);
    color: var(--text-black);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbar Premium */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-silk); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 10px; }

h1, h2, h3, h4 { font-family: var(--font-serif); font-weight: 600; color: var(--text-black); }
a { text-decoration: none; color: inherit; transition: 0.4s cubic-bezier(0.19, 1, 0.22, 1); }
img { max-width: 100%; height: auto; display: block; object-fit: cover; }

/* --- ANIMAZIONI WOW --- */
.reveal { opacity: 0; transform: translateY(50px); transition: 1.4s cubic-bezier(0.19, 1, 0.22, 1); }
.reveal.active { opacity: 1; transform: translateY(0); }
.bg-dark { background: var(--text-black); color: var(--bg-silk); }
.bg-dark h2, .bg-dark h3 { color: var(--bg-silk); }

/* ==========================================================================
   2. HEADER & NAVIGAZIONE (Effetto Vetro Premium)
   ========================================================================== */
header {
    position: fixed; width: 100%; top: 0; left: 0; padding: 30px 5%;
    display: flex; justify-content: space-between; align-items: center;
    z-index: 1000; transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}
header.scrolled {
    background: rgba(244, 240, 230, 0.95); padding: 15px 5%;
    box-shadow: 0 20px 40px rgba(0,0,0,0.04); backdrop-filter: blur(12px);
}

.logo img { height: 80px; width: auto; transition: 0.6s; }
header.scrolled .logo img { height: 65px; }

.nav-container { display: flex; align-items: center; gap: 40px; }
.nav-links { display: flex; list-style: none; gap: 40px;}

.nav-links a {
    font-size: 0.75rem; text-transform: uppercase; letter-spacing: 2.5px;
    font-weight: 500; position: relative; transition: 0.4s;
    padding-bottom: 5px;
    color: black !important;
}

/* Fix Colori Header */
.nav-links a, .lang-switch a, .hamburger, .close-btn { color: black !important;); }
.header-transparent:not(.scrolled) .nav-links a,
.header-transparent:not(.scrolled) .lang-switch a,
.header-transparent:not(.scrolled) .hamburger,
.header-transparent:not(.scrolled) .close-btn { color: #ffffff; }

/* Hover Navigazione Elegante */
.nav-links a::after {
    content: ''; position: absolute; bottom: 0; left: 50%;
    width: 0; height: 1px; background: var(--accent-burnt);
    transition: 0.4s ease-out; transform: translateX(-50%);
}
.nav-links a:hover::after { width: 100%; }

/* Selettore Lingua */
.lang-switch { display: flex; gap: 15px; border-left: 1px solid rgba(0,0,0,0.15); padding-left: 25px; }
.header-transparent:not(.scrolled) .lang-switch { border-left-color: rgba(255,255,255,0.3); }
.lang-switch a { font-size: 0.7rem; font-weight: 600; opacity: 0.4; letter-spacing: 1px; }
.lang-switch a.active, .lang-switch a:hover { opacity: 1; color: var(--accent-burnt); transform: translateY(-2px); }

.hamburger { display: none; font-size: 1.5rem; cursor: pointer; }
.close-btn { display: none; }

/* ==========================================================================
   3. HERO SECTION (Immersiva e Viva)
   ========================================================================== */
.hero {
    position: relative; width: 100%; height: 100vh; min-height: 700px;
    display: flex; align-items: center; justify-content: center; text-align: center;
    background-color: var(--text-black); overflow: hidden;
}

/* Animazione respiro per l'immagine */
@keyframes slowZoom {
    0% { transform: scale(1); }
    100% { transform: scale(1.1); }
}

.hero-img {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    object-fit: cover; opacity: 0.55; z-index: 1;
    animation: slowZoom 25s ease-in-out infinite alternate;
}

.hero-content { position: relative; z-index: 2; max-width: 1000px; padding: 0 20px; }
.hero-content h1 {
    color: #ffffff; font-size: clamp(3.5rem, 8vw, 7.5rem);
    line-height: 0.95; margin-bottom: 20px; letter-spacing: -2px;
}
.hero-content h1 em {
    color: transparent; -webkit-text-stroke: 1.5px #fff;
    font-style: italic; font-weight: 400; padding-right: 10px;
}

/* ==========================================================================
   4. TIPOGRAFIA & BOTTONI (Look Dinamico)
   ========================================================================== */
.giant-bg-text {
    position: absolute; font-family: var(--font-serif); font-size: clamp(6rem, 18vw, 18rem);
    font-weight: 900; text-transform: uppercase; color: transparent;
    -webkit-text-stroke: 1px rgba(0,0,0,0.03); line-height: 0.8; z-index: 0;
    white-space: nowrap; top: 50%; left: 50%; transform: translate(-50%, -50%);
    pointer-events: none; user-select: none;
}
.bg-dark .giant-bg-text { -webkit-text-stroke: 1px rgba(255,255,255,0.03); }

.sec-title { font-size: clamp(2.8rem, 5vw, 4.8rem); line-height: 1.05; margin-bottom: 30px; text-transform: none; letter-spacing: -1px; }
.sec-title em { font-style: italic; font-weight: 400; color: var(--accent-burnt); }

.btn-wow {
    display: inline-block; padding: 18px 45px; border: 1px solid var(--text-black);
    color: var(--text-black); font-size: 0.75rem; text-transform: uppercase;
    letter-spacing: 3px; font-weight: 600; position: relative;
    overflow: hidden; z-index: 1; transition: 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}
.btn-wow::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: var(--text-black); z-index: -1; transition: 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}
.btn-wow:hover::before { left: 0; }
.btn-wow:hover { color: var(--bg-silk); }

/* Varianti Bottoni */
.bg-dark .btn-wow { border-color: var(--bg-silk); color: var(--bg-silk); }
.bg-dark .btn-wow::before { background: var(--bg-silk); }
.bg-dark .btn-wow:hover { color: var(--text-black); }
.hero-content .btn-wow { border-color: #ffffff !important; color: #ffffff !important; }
.hero-content .btn-wow::before { background: #ffffff; }
.hero-content .btn-wow:hover { color: var(--text-black) !important; }

/* ==========================================================================
   5. LAYOUT & IMMAGINI (L'Effetto "Arco Storico")
   ========================================================================== */
.section { padding: 150px 5%; position: relative; }
.container { max-width: 1300px; margin: 0 auto; position: relative; z-index: 1; }

.editorial-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 100px; align-items: center; }
.editorial-grid.reverse { direction: rtl; }
.editorial-grid.reverse > * { direction: ltr; }

/* Il tocco di design: Le immagini ad Arco */
.img-box { position: relative; overflow: visible; display: inline-block; width: 100%; }
.editorial-grid .img-box img {
    max-height: 700px; width: 100%; object-fit: cover;
    border-radius: 200px 200px 0 0; /* Cima arrotondata a forma di arco/mura */
    box-shadow: 0 30px 60px rgba(0,0,0,0.08);
}

/* Cornice sfalsata che segue l'arco */
.img-box::after {
    content: ''; position: absolute; top: -15px; left: -15px;
    width: 100%; height: 100%; border: 1px solid var(--gold);
    border-radius: 200px 200px 0 0; z-index: -1;
    transition: 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}
.editorial-grid.reverse .img-box::after { left: auto; right: -15px; }
.img-box:hover::after { top: 10px; left: 10px; }
.editorial-grid.reverse .img-box:hover::after { right: 10px; }

/* ==========================================================================
   6. RESPONSIVE MOBILE
   ========================================================================== */
@media (max-width: 1024px) {
    .section { padding: 100px 5%; }
    .hamburger { display: block; }
    .close-btn { display: block; position: absolute; top: 30px; right: 5%; font-size: 2.5rem; cursor: pointer; color: var(--text-black); transition: transform 0.3s; }
    .close-btn:hover { transform: rotate(90deg); }

    .nav-container {
        position: fixed; top: 0; right: -100%; width: 100%; height: 100vh;
        background: var(--bg-silk); flex-direction: column; justify-content: center;
        transition: 0.7s cubic-bezier(0.19, 1, 0.22, 1); gap: 40px; z-index: 1001;
    }
    .nav-container.active { right: 0; }

    .nav-links { flex-direction: column; align-items: center; gap: 30px; }
    .nav-links a { font-size: 1.8rem; letter-spacing: 1px; color: var(--text-black) !important; font-family: var(--font-serif); font-weight: 400; text-transform: capitalize; }
    .nav-links a::after { display: none; } /* Rimuove linea hover su mobile */

    .lang-switch { border-left: none; padding-left: 0; font-size: 1.4rem; justify-content: center; color: var(--text-black); }

    .editorial-grid, .editorial-grid.reverse { grid-template-columns: 1fr; gap: 60px; direction: ltr; text-align: center; }

    .img-box::after { display: none; } /* Su mobile rimuoviamo la cornice esterna per pulizia */
    .editorial-grid .img-box img { border-radius: 100px 100px 0 0; } /* Arco più morbido su mobile */
}
#main-header{
    background-color: white !important;
}
.hamburger{
    color: black;
}

.gallery-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

.gallery-container {
    display: flex;
    gap: 30px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none;  /* Nasconde scrollbar su IE e Edge */
    scrollbar-width: none;     /* Nasconde scrollbar su Firefox */
    padding: 20px 0;
    width: 100%;
}

/* Nasconde la scrollbar su Chrome, Safari e Opera */
.gallery-container::-webkit-scrollbar {
    display: none;
}

.gallery-item {
    /* Su desktop mostra circa 3 immagini alla volta */
    flex: 0 0 calc(33.333% - 20px);
    scroll-snap-align: center;
    border-radius: 120px 120px 0 0; /* Richiama l'arco stile "Mura" del tuo layout */
    overflow: hidden;
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
    transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
}

.gallery-item img {
    width: 100%;
    height: 450px;
    object-fit: cover;
    display: block;
    transition: transform 0.8s cubic-bezier(0.19, 1, 0.22, 1);
}

.gallery-item:hover {
    transform: translateY(-10px);
}

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

/* Pulsanti di navigazione slider */
.gallery-btn {
    background: var(--bg-silk);
    color: var(--text-black);
    border: none;
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    position: absolute;
    z-index: 10;
    box-shadow: 0 5px 20px rgba(0,0,0,0.4);
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.gallery-btn:hover {
    background: var(--gold);
    color: var(--bg-silk);
    transform: scale(1.1);
}

.gallery-btn.left { left: -25px; }
.gallery-btn.right { right: -25px; }

/* Responsive */
@media (max-width: 1024px) {
    .gallery-item { flex: 0 0 calc(50% - 15px); } /* 2 immagini su tablet */
}

@media (max-width: 768px) {
    .gallery-item {
        flex: 0 0 80%; /* 1 immagine e mezza su mobile per far capire che si scorre */
        border-radius: 80px 80px 0 0;
    }
    .gallery-item img { height: 350px; }
    .gallery-btn { display: none; } /* Su mobile rimuoviamo i tasti, si usa il touch (swipe) */
    .gallery-container { padding: 10px 5%; gap: 15px; scroll-padding: 0 5%; }
    .gallery-wrapper { margin-left: -5%; margin-right: -5%; width: 110%; } /* Fa sbordare lo slider per un look moderno */
}