/* --- IMPOSTAZIONI GENERALI --- */
body {
    margin: 0;
    padding: 0;
    background-color: #fbfbfb;
    font-family: 'Courier New', Courier, monospace;
    color: #000;
    text-transform: uppercase;
    font-size: 12px;
    height: 100vh;
    overflow: hidden;
    opacity: 1; 
    transition: opacity 0.5s ease-in-out;
}

body.fade-out { opacity: 0; }

body.project-body {
    height: auto !important;
    overflow-y: auto !important;
    overflow-x: hidden;
}

/* --- STILE LINK CURRICULUM --- */
.btn-cv {
    text-decoration: underline; /* Aggiunge la sottolineatura */
    color: inherit;             
    font-weight: bold;          
    font-size: 12px;            
    transition: opacity 0.3s ease; 
}

.btn-cv:hover {
    opacity: 0.6;               
    text-decoration: none;      /* Opzionale: la sottolineatura sparisce quando ci passi sopra */
    cursor: pointer;
}

/* --- HEADER & FOOTER --- */
header, footer {
    padding: 20px 40px;
    display: flex;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    z-index: 100;
    background-color: #fbfbfb; 
}

.nav-center { text-align: center; }
.nav-right { text-align: right; }

/* --- HOME MAIN --- */
main {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    position: relative;
}

.gallery-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px; 
    height: 80vh; 
    padding: 0 20px;
    width: 100%;
}

/* --- GALLERY ITEM --- */
.gallery-item {
    position: relative;
    width: 200px;  
    height: 300px; 
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    overflow: hidden;
    filter: grayscale(100%);
    flex-shrink: 1;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1); 
    border: 1px solid rgba(0,0,0,0.05); 
}

.gallery-item img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.img-default { opacity: 1; z-index: 1; }
.img-hover { opacity: 0; z-index: 2; }

/* --- EFFETTI MOUSE --- */
.gallery-item:hover {
    width: 450px;
    height: 550px;
    filter: grayscale(0%);
    z-index: 50;
    box-shadow: 0 30px 60px rgba(0,0,0,0.25); 
    border-color: transparent;
}

.gallery-item:hover .img-hover { opacity: 1; }

.item-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    color: #000;
    background-color: rgba(255, 255, 255, 0.9);
    padding: 12px;
    font-size: 11px;
    line-height: 1.4;
    font-weight: bold;
    min-width: 140px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.4s ease;
    pointer-events: none;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.gallery-item:hover .item-info {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 0.2s;
}

.gallery-container:has(.gallery-item:hover) .gallery-item:not(:hover) {
    opacity: 0.4;
    filter: grayscale(100%);
    box-shadow: none;
}

/* --- STILI UTILITY PROGETTO --- */
.fullscreen-img { display: block; width: 100%; height: 100vh; object-fit: cover; object-position: center; }
.project-content { background-color: #fbfbfb; padding: 80px 40px; max-width: 900px; margin: 0 auto; min-height: 60vh; }
.project-title { font-size: 32px; margin-bottom: 30px; letter-spacing: -1px; }
.project-description { font-size: 16px; line-height: 1.8; color: #333; text-transform: none; }
.project-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 40px; }
.img-full { grid-column: span 2; width: 100%; height: auto; display: block; }
.img-half { width: 100%; height: 100%; object-fit: cover; display: block; }
.caption { font-size: 10px; color: #888; margin-top: 5px; text-align: right; font-style: italic; }
.back-button { position: fixed; top: 30px; left: 30px; z-index: 200; text-decoration: none; color: #000; background: rgba(255,255,255, 0.9); padding: 10px 20px; font-weight: bold; border: 1px solid rgba(0,0,0,0.1); box-shadow: 0 4px 10px rgba(0,0,0,0.1); transition: transform 0.2s; }
.back-button:hover { transform: scale(1.05); }

/* --- NUOVO LOADER PROJECTS --- */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    
    /* CAMBIAMENTO 1: Sfondo bianco (uguale al sito) invece di nero */
    background-color: #fbfbfb; 
    
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loader-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Stile del testo mascherato */
.masked-text {
    font-family: 'Impact', 'Arial Black', sans-serif;
    font-size: 10vw; 
    font-weight: 900;
    text-transform: uppercase;
    margin: 0;
    
    /* La magia della maschera */
    background-image: url('https://images.unsplash.com/photo-1518640467707-6811f4a6ab73?q=80&w=1000&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    
    -webkit-background-clip: text;
    background-clip: text;
    
    /* Rende l'interno trasparente */
    color: transparent; 
    
    /* CAMBIAMENTO 2: AGGIUNTO IL BORDO NERO */
    /* Questo crea un contorno nero di 2px attorno alle lettere.
       Così si legge perfettamente anche su sfondo bianco! */
    /*-webkit-text-stroke: 1px #000; */
    
    transition: background-image 0.1s ease-in-out;
}
