/* ==========================================================================
   VARIABLES & PALETTE COLORI BASE (GRIGIO ANTRACITE)
   ========================================================================== */
:root {
    --bg-primary: #222222;        /* Grigio antracite per lo sfondo primario e la galleria */
    --bg-card: #2d2d2d;           /* Grigio leggermente più chiaro per le schede delle foto */
    --bg-dark: #111111;           /* Footer / Lightbox background */
    --text-main: #e0e0e0;         /* Testo principale chiaro per leggibilità su antracite */
    --text-dark: #ffffff;         /* Bianco nitido per titoli ed elementi in evidenza */
    --text-muted: #aaaaaa;        /* Testo secondario e note */
    --text-light: #FFFFFF;        /* Testo chiaro */
    
    /* Bordo 2px #333333 simulato per il testo chiaro dell'Hero */
    --text-light-stroke: 
        -2px -2px 0 #333333,
         2px -2px 0 #333333,
        -2px  2px 0 #333333,
         2px  2px 0 #333333,
        -2px  0px 0 #333333,
         2px  0px 0 #333333,
         0px -2px 0 #333333,
         0px  2px 0 #333333;

    --border-color: #444444;      /* Bordo scuro discreto */
    --border-light: #333333;      /* Separatore leggero */
    --accent-blue: #004488;       /* Blu primario per la scheda attiva */
    --accent-blue-hover: #336699; /* Blu secondario */
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Verdana', 'Arial', 'Lucida Grande', 'Tahoma', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-main);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* Container principale */
.container {
    width: 90%;
    max-width: 1300px;
    margin: 0 auto;
    padding: clamp(30px, 5vw, 60px) 0;
}

.text-light {
    color: var(--text-light);
    text-shadow: var(--text-light-stroke);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    background-size: cover;
    background-position: center;
    background-attachment: scroll;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--text-light);
    padding: 20px;
    position: relative;
}

@media (min-width: 1025px) {
    .hero {
        background-attachment: fixed;
    }
}

.hero-content {
    max-width: 800px;
    width: 100%;
}

.hero-content h1 {
    font-size: clamp(2rem, 6vw, 3.8rem);
    letter-spacing: clamp(2px, 1vw, 5px);
    text-transform: uppercase;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-light);
    text-shadow: var(--text-light-stroke);
}

.hero-content .sub-brand {
    display: block;
    font-size: clamp(0.9rem, 2.5vw, 1.3rem);
    letter-spacing: clamp(3px, 1vw, 6px);
    margin-top: 5px;
    margin-bottom: 20px;
    color: var(--text-light);
    text-shadow: var(--text-light-stroke);
    text-transform: uppercase;
}

.hero-content .tagline {
    font-size: clamp(0.9rem, 2vw, 1.15rem);
    max-width: 650px;
    margin: 0 auto 35px auto;
    font-weight: 300;
    color: var(--text-light);
    text-shadow: var(--text-light-stroke);
    padding: 0 10px;
}

.btn-primary {
    display: inline-block;
    padding: 14px 32px;
    border: 1px solid var(--text-light);
    background: transparent;
    color: var(--text-light);
    text-shadow: var(--text-light-stroke);
    text-decoration: none;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--text-light);
    color: #000000;
    text-shadow: none;
}

/* Contenitore pulsanti affiancati nell'Hero */
.hero-buttons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap; /* Su schermi piccoli va a capo mantenendo ordine */
}

/* Link email nel footer */
.footer .email-link {
    color: var(--accent-blue-hover);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer .email-link:hover {
    color: var(--text-light);
}

/* ==========================================================================
   NAVIGAZIONE SCHEDE GALLERIE (MASK, FACES, BODY)
   ========================================================================== */
.portfolio-container {
    background-color: var(--bg-primary);
}

.gallery-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 40px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-main);
    font-size: 0.9rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 2px;
    font-family: inherit;
}

.tab-btn:hover {
    background: var(--border-color);
    color: var(--text-dark);
}

.tab-btn.active {
    background: var(--accent-blue);
    color: var(--text-light);
    border-color: var(--accent-blue);
}

/* Gestione visibilità sezioni */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.empty-msg {
    text-align: center;
    color: var(--text-muted);
    padding: 50px 0;
    font-style: italic;
}

/* ==========================================================================
   IMPAGINAZIONE SFALSATA (STAGGERED GRID / MASONRY LAYOUT)
   ========================================================================== */
.gallery-section {
    margin-bottom: clamp(40px, 8vw, 80px);
    background-color: var(--bg-primary);
}

.gallery-section h2 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    letter-spacing: 2px;
    margin-bottom: 25px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    text-transform: uppercase;
    color: var(--text-dark);
}

/* Griglia Masonry */
.staggered-grid {
    column-count: 1;
    column-gap: 20px;
}

@media (min-width: 600px) {
    .staggered-grid {
        column-count: 2;
    }
}

@media (min-width: 1024px) {
    .staggered-grid {
        column-count: 3;
    }
}

.grid-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 2px;
}

.grid-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

/* Hover per schermi desktop */
@media (hover: hover) {
    .grid-item:hover img {
        transform: scale(1.04);
    }

    .item-overlay {
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0, 0, 0, 0.65);
        opacity: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--text-light);
        text-shadow: var(--text-light-stroke);
        transition: opacity 0.3s ease;
        font-size: 0.9rem;
        letter-spacing: 1px;
        padding: 15px;
        text-align: center;
    }

    .grid-item:hover .item-overlay {
        opacity: 1;
    }
}

/* ==========================================================================
   FOOTER RESPONSIVE
   ========================================================================== */
.footer {
    background-color: var(--bg-dark);
    color: var(--text-muted);
    padding: clamp(40px, 6vw, 60px) 0;
    font-size: 0.85rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

.footer h3, .footer h4 {
    color: var(--text-light);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer .phone-link {
    color: var(--accent-blue-hover);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer .phone-link:hover {
    color: var(--text-light);
}

.footer ul {
    list-style: none;
}

.footer ul li {
    margin-bottom: 8px;
}

/* ==========================================================================
   LIGHTBOX / POPUP MODALE
   ========================================================================== */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.92);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.lightbox-content {
    max-width: 95%;
    max-height: 80vh;
    object-fit: contain;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.9);
}

#lightbox-caption {
    margin-top: 15px;
    color: var(--text-light);
    font-size: clamp(0.85rem, 1.5vw, 1rem);
    letter-spacing: 1px;
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: 15px;
    right: 20px;
    color: var(--text-light);
    font-size: 45px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    user-select: none;
    padding: 10px;
    z-index: 2010;
}

.lightbox-close:hover {
    color: var(--border-color);
}

@media (max-width: 768px) {
    .grid-item .item-overlay {
        display: none !important;
    }
}