/* --- style.css --- */

/* 0. FIX GLOBALE CRITICO: Box Model e Scroll */
* {
    box-sizing: border-box; /* Previene overflow causato da padding e border */
}

/* 1. BASE & ATMOSFERA */
@import url('https://fonts.googleapis.com/css2?family=Anton:wght@400&family=Manrope:wght@300;600&display=swap');

:root {
    --bg-color: #0a0a0a;
    --text-color: #e0e0e0;
    --accent: #ff3c00;
    --header-height: 80px;
}

body {
    margin: 0; padding: 0; background-color: var(--bg-color); color: var(--text-color);
    font-family: 'Manrope', sans-serif; overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

/* 2. HEADER & NAVIGAZIONE */
header {
    position: fixed; top: 0; left: 0; width: 100%;
    height: var(--header-height);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 40px; z-index: 1000;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px); -webkit-backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.brand {
    font-family: 'Anton', sans-serif; font-size: 1.5rem; letter-spacing: 1px; color: white; z-index: 1002;
}

nav ul {
    list-style: none; display: flex; gap: 40px; margin: 0; padding: 0;
}

nav a {
    color: rgba(255, 255, 255, 0.9); font-weight: 600; text-transform: uppercase;
    letter-spacing: 2px; font-size: 0.75rem; position: relative; transition: color 0.3s;
}
nav a:hover { color: white; }
nav a::after {
    content: ''; position: absolute; width: 0; height: 2px; bottom: -5px; left: 0;
    background-color: var(--accent); transition: width 0.3s;
}
nav a:hover::after { width: 100%; }

/* Menu Mobile */
.menu-toggle { display: none; flex-direction: column; gap: 6px; cursor: pointer; z-index: 1002; }
.bar { width: 30px; height: 2px; background-color: white; transition: 0.3s; }

/* 3. ELEMENTI COMUNI */
.page-header {
    padding: 150px 5vw 50px 5vw; text-align: center;
}
.page-title {
    font-family: 'Anton', sans-serif; font-size: 4rem; text-transform: uppercase; margin: 0;
    color: transparent; -webkit-text-stroke: 1px rgba(255,255,255,0.3);
}

.hero { height: 100vh; display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.hero-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center; filter: brightness(0.6) contrast(1.2);
    transform: scale(1.1); animation: slowZoom 20s infinite alternate;
}
@keyframes slowZoom { from { transform: scale(1.1); } to { transform: scale(1.2); } }

.hero-title {
    position: relative; z-index: 2; font-family: 'Anton', sans-serif;
    font-size: 9vw; line-height: 0.9; text-transform: uppercase; text-align: center; margin-top: 80px;
}
.hero-title span { display: block; color: transparent; -webkit-text-stroke: 2px rgba(255,255,255,0.5); }
.hero-title span.filled { color: white; -webkit-text-stroke: 0; }

/* 4. LAYOUT HOME (Broken Grid) - CORRETTO */
.section-wrapper { padding: 150px 5vw; position: relative; }
.bg-text {
    position: absolute; top: 50px; left: -20px; font-family: 'Anton', sans-serif;
    font-size: 15rem; color: rgba(255, 255, 255, 0.03); z-index: 0; pointer-events: none; line-height: 0.8;
}
.content-grid {
    display: grid; grid-template-columns: 1fr 1.5fr; gap: 80px; align-items: center; position: relative; z-index: 1;
}
.reverse { grid-template-columns: 1.5fr 1fr; }
.reverse .text-box { order: 2; } .reverse .img-box { order: 1; }

/* Stili specifici per i blocchi immagini della Home */
.img-box {
    /* Rimuove ogni possibile forzatura di altezza fissa */
    height: auto; 
}
.img-box img {
    width: 100%; height: auto; display: block; filter: grayscale(30%); transition: all 0.5s ease;
}
.img-box:hover img { filter: grayscale(0%); transform: scale(1.03); }

.text-box { padding-top: 50px; }
.category-tag { color: var(--accent); font-size: 0.9rem; letter-spacing: 3px; text-transform: uppercase; margin-bottom: 20px; display: block; font-weight: bold; }
.text-box h2 { font-size: 3rem; line-height: 1.1; margin: 0 0 30px 0; font-family: 'Anton', sans-serif; text-transform: uppercase; }
.text-box p { font-size: 1.1rem; opacity: 0.7; max-width: 400px; margin-bottom: 40px; line-height: 1.8; }
.btn-line { border-bottom: 1px solid var(--accent); padding-bottom: 5px; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; }
.overlap-box {
    background: #1a1a1a; padding: 40px; margin-top: -100px; margin-left: -50px;
    position: relative; z-index: 2; box-shadow: 0 20px 50px rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.05);
}

/* 5. NUOVO LAYOUT VOLTI (Griglia Rigida) */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 colonne uguali */
    gap: 20px;
    padding: 0 5vw 100px 5vw;
}
.gallery-item {
    position: relative; 
    overflow: hidden;
    height: 400px; /* Altezza fissa per uniformità */
}

/* Forziamo l'immagine a coprire l'altezza fissa */
.gallery-item img {
    width: 100%; 
    height: 100%;
    object-fit: cover; /* Ritaglia l'immagine per riempire il contenitore */
    display: block; 
    filter: grayscale(100%); 
    transition: 0.5s;
}

.gallery-item:hover img { 
    filter: grayscale(0); 
    transform: scale(1.05); 
}

/* Caption (invariata) */
.caption-overlay {
    position: absolute; bottom: 0; left: 0; width: 100%; padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    opacity: 0; transition: 0.3s; transform: translateY(20px);
}
.gallery-item:hover .caption-overlay { opacity: 1; transform: translateY(0); }
.caption-overlay h3 { margin: 0; font-family: 'Anton', sans-serif; letter-spacing: 1px; }
.caption-overlay p { margin: 5px 0 0; font-size: 0.8rem; opacity: 0.8; }

/* 6. LAYOUT PROGETTI (Storie.html - Invariato) */
.projects-list { padding: 0 10vw 100px 10vw; }
/* ... (altri stili progetti invariati) ... */


/* 7. LAYOUT MANIFESTO (Manifesto.html - Invariato) */
.manifesto-container { max-width: 800px; margin: 0 auto; padding: 0 20px 150px 20px; }
/* ... (altri stili manifesto invariati) ... */

/* 8. NUOVO LAYOUT GALLERIA (galleria.html) */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* 300px min width */
    gap: 15px;
    padding: 0 5vw 100px 5vw;
}
.photo-item {
    cursor: pointer;
    overflow: hidden;
    position: relative;
}
.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s, filter 0.3s;
}
.photo-item:hover img {
    transform: scale(1.05);
    filter: brightness(0.7);
}
.caption-label {
    position: absolute; bottom: 10px; left: 10px;
    color: white; font-size: 0.8rem; opacity: 0.9;
    background: rgba(0, 0, 0, 0.4); padding: 3px 8px;
    font-weight: 600;
}


/* 9. MODAL LIGHTBOX (per ingrandimento e scorrimento) */
.modal-lightbox {
    display: none; /* Inizialmente nascosto */
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: opacity 0.3s;
}

.lightbox-nav {
    position: absolute;
    width: 100%;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 20px;
}

.lightbox-nav button,
.close-btn {
    background: none;
    border: none;
    color: white;
    font-size: 2.5rem;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s;
    font-family: sans-serif;
    padding: 10px 15px;
}

.lightbox-nav button:hover,
.close-btn:hover {
    opacity: 1;
}

.close-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2001;
    font-size: 2rem;
}


/* RESPONSIVE */
@media (max-width: 1024px) {
    .content-grid, .reverse { gap: 40px; }
    .hero-title { font-size: 14vw; }
    .gallery-grid { columns: 2; }
}
@media (max-width: 768px) {
    header { padding: 0 20px; }
    
    .menu-toggle { display: flex; }
    nav {
        position: fixed; top: var(--header-height); right: -100%; width: 100%; 
        height: calc(100vh - var(--header-height)); background: #0a0a0a; 
        flex-direction: column; justify-content: flex-start; align-items: flex-start; 
        padding-top: 50px; padding-left: 50px; transition: 0.4s; z-index: 1001;
    }
    nav.active { right: 0; }
    nav ul { flex-direction: column; gap: 15px; padding-left: 0; margin: 0; }
    nav a { font-size: 1.5rem; }

    .menu-toggle.open .bar:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
    .menu-toggle.open .bar:nth-child(2) { opacity: 0; }
    .menu-toggle.open .bar:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

    .hero-title { font-size: 16vw; -webkit-text-stroke: 1px rgba(255,255,255,0.5); }
    .section-wrapper { padding: 80px 20px; }
    .content-grid, .reverse, .project-card { grid-template-columns: 1fr; display: flex; flex-direction: column; }
    .reverse .text-box { order: 2; } .reverse .img-box { order: 1; }

    .overlap-box { margin: -40px 20px 0 20px; padding: 30px; width: auto; }
    .bg-text { display: none; } 
    .text-box h2 { font-size: 2.2rem; }
    .project-card img { width: 100%; height: auto; }
    .project-card:hover { padding: 60px 0; background-color: transparent; }
    .page-title { font-size: 3.5rem; }
    .gallery-grid { grid-template-columns: 1fr; } /* Assicura una colonna singola su mobile */
	.projects-list { padding: 0 5vw 100px 5vw; }
    .project-card { gap: 20px; }
    .photo-grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
    
    .lightbox-nav button { font-size: 2rem; }
    .close-btn { font-size: 1.5rem; }
}