/* ==========================================================================
   IRENE CELIDONI - STYLE SHEET 2026 (FINAL VERSION)
   ========================================================================== */

/* [1] RESET E FONT */

* { box-sizing: border-box; }
html { margin: 0; padding: 0; overflow-x: hidden; overflow-y: scroll !important; height: 100%; scroll-behavior: smooth; }
body { margin: 0; padding: 0; background-color: #faf9f6; color: #000; font-family: 'Inter', sans-serif; display: flex; flex-direction: column; min-height: 100vh; transition: opacity 0.4s ease-in-out;}
.wrapper { width: 94%; margin: 0 auto; flex: 1; display: flex; flex-direction: column; justify-content: space-between; /* Aggiungi questa per bilanciare header e footer */}
/* Questa è la regola chiave: spinge il footer in fondo */
main { flex: 1 0 auto; }

/* [2] HEADER E MENU */
.main-header { padding: 5vh 0 6vh 0; text-align: center; display: flex; flex-direction: column; align-items: center; }
.artist-name { font-family: 'Bodoni Moda', serif !important; font-size: 5rem; font-weight: 500; text-transform: uppercase; letter-spacing: 0.6em; line-height: 1.2; }
.artist-name a { text-decoration: none; color: inherit; }
.sub-nav { margin-top: 10px; display: flex; justify-content: center; align-items: center; height: 30px;}
.nav-item { text-decoration: none; color: #000; margin: 0 15px; letter-spacing: 0.2em; font-size: 0.8rem; transition: color 0.3s; line-height: 1; display: inline-block; }
.nav-item:hover { color: #cc3333; }

/* [3] HOME GRID, RITMO ASIMMETRICO E HOVER */
#grid-fotografica { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    align-items: center; /* Fondamentale per non nascondere le foto */
    width: 95%; 
    margin: 0 auto; 
    padding: 0; 
}

/* [3] HOME GRID - DENSITÀ EDITORIALE */
#grid-fotografica { 
    display: flex; 
    flex-wrap: wrap; 
    justify-content: center; 
    align-items: center; 
    width: 95%; 
    margin: 0 auto; 
}

.photo-item { 
    flex: 0 0 calc(33.333% - 40px); 
    max-width: calc(33.333% - 40px); 
    margin: 1vh 20px; /* Margine minimo, lo spazio lo crea il JS */
    display: flex; 
    justify-content: center; 
    align-items: center; 
    opacity: 0; 
    will-change: transform, opacity;
}

/* ECCEZIONE: La prima riga è subito visibile */
.photo-item:nth-child(-n+3) {
    opacity: 1 !important;
}

.photo-item img { 
    width: 100%;
    height: auto; 
    display: block; 
    cursor: pointer;
    transition: opacity 0.4s ease-in-out !important; 
}

.photo-item img:hover { opacity: 0.7 !important; }

/* RITMO ASIMMETRICO (Larghezze variabili) */
.photo-item:nth-child(6n+1) img { width: 100%; } 
.photo-item:nth-child(6n+2) img { width: 85%; }  
.photo-item:nth-child(6n+3) img { width: 95%; } 
.photo-item:nth-child(6n+4) img { width: 80%; }  
.photo-item:nth-child(6n+5) img { width: 100%; } 
.photo-item:nth-child(6n+6) img { width: 90%; }

/* [4] PAGINA BIO E PREMI */
.content-section { max-width: 1050px; margin: 0 auto; padding: 40px 5% 60px; width: 100%; }
.bio-title { font-family: 'Bodoni Moda', serif; font-size: 2.5rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.2em; text-align: center; margin-bottom: 40px; color: #000000; }
.bio-intro-text p { font-family: 'Inter'; font-size: 1.05rem; line-height: 1.8; text-align: justify; margin-bottom: 25px; }

/* ==========================================================================
   [4.1] HOVER REVEAL - IMMAGINE A COMPARSA (BIO)
   ========================================================================== */

/* La scritta "L'opera HO/TEL" nel testo */
.hover-reveal-trigger {
    color: #000000 !important;
    position: relative;
    cursor: help; /* Meglio 'help' o 'pointer' per indicare che succede qualcosa */
    font-weight: 500;
    display: inline-block;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* Il contenitore (La Cornice Nera + Spazio Bianco) */
.hover-reveal-img {
    position: absolute;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    width: 280px;            /* Larghezza della cornice */
    z-index: 1000;
    
    /* STILE CORNICE (Passe-partout) */
    background: #FAF9F6 !important;
    padding: 10px !important;       /* Spazio bianco attorno alla foto */
    border: 1px solid #000 !important; /* Riga nera esterna */
    
    /* POSIZIONAMENTO RISPETTO AL TESTO */
    bottom: 150%;
    left: 50%;
    transform: translateX(-50%) translateY(10px) scale(0.9);
    
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
}

/* L'immagine all'interno: deve solo riempire il contenitore */
.hover-reveal-img img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    border: none !important; /* Rimuoviamo bordi extra per pulizia */
    /* NOTA: Qui non servono bottom, left o transform! */
}

/* Attivazione al passaggio del mouse (Solo PC) */
@media (min-width: 1025px) {
    .hover-reveal-trigger:hover .hover-reveal-img {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

.first-drop-cap::first-letter {
    float: left;
    color: #cc3333 !important;
    font-family: 'Bodoni Moda', serif !important;
    font-size: 3.0rem;            /* Dimensione della lettera */
    
    /* --- ISTRUZIONI PER L'ALTEZZA --- */
    line-height: 0.2; /* REGOLA: Diminuendo questo valore (es. 0.6) la lettera sale */
    margin-top: -0.0em; /* REGOLA: Se ancora troppo bassa, usa un valore negativo (es. -0.05em) */
    /* -------------------------------- */

    margin-right: 5px;
    font-weight: 500;
    text-transform: uppercase;
    display: block;
}

.award-entry-special { display: flex; align-items: flex-start; gap: 40px; margin: 20px 0; width: 100%; border-bottom: 1px solid #f0f0f0; padding-bottom: 20px; }
.award-link { color: #cc3333; font-weight: 600; text-decoration: none; }

/* [5] PAGINA CONTATTI */
/* Applicato padding uniforme come Bio */
.contacts-container { 
    width: fit-content; 
    margin: 0 auto; 
    display: flex; 
    flex-direction: column; 
    gap: 45px; 
    padding: 40px 10px 60px; 
}
.contact-row { display: flex; align-items: center; gap: 30px; width: 100%; }
.contact-icon { width: 38px !important; height: auto; flex-shrink: 0; display: block; }
.contact-link { font-family: 'Inter'; font-size: 1.1rem; color: #000; text-decoration: none; transition: 0.3s; line-height: 1.4; white-space: nowrap; }
.contact-link:hover { color: #cc3333; }

/* [6] FOOTER STICKY */
.footer { padding: 80px 0 40px; text-align: center; width: 100%; margin-top: auto; background: #FAF9F6; position: relative; z-index: 10; }
.footer-logo { width: 40px !important; margin-bottom: 20px; display: inline-block; }
.legal-links a { font-family: 'Inter', sans-serif !important; font-size: 0.65rem !important; color: #888 !important; text-decoration: none; margin: 0 10px; }
.legal-links a:hover { color: #cc3333 !important; }
.copyright-text {
    font-family: 'Inter', sans-serif !important;
    font-size: 0.75rem !important; /* Stessa dimensione dei link Privacy e Cookie */
    color: #888 !important;
    display: block; /* Lo mette su una riga separata rispetto ai link */
    margin-top: 15px; /* Crea un piccolo distacco dai link sopra */
    letter-spacing: 0.1em; text-transform: uppercase; }

/* [7] LIGHTBOX UI */
#lightbox { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #FAF9F6; z-index: 999999; display: none; align-items: center; justify-content: center; }
.lightbox-brand {
    position: absolute;
    top: 20px;
    left: 40px;
    color: #000;
    font-family: 'Bodoni Moda', serif;
    font-size: 1.5rem;     /* REGOLA: Aumenta (es. 2.2rem) per farlo più grande su PC */
    font-weight: 700;
    letter-spacing: 0.5em !important; /* REGOLA: Aumenta per un look più "Magazine" distanziato */
    z-index: 1000005 !important;
    cursor: pointer !important;
    user-select: none !important;
    -webkit-tap-highlight-color: transparent !important;
}


.lightbox-top-bar { position: absolute; top: 20px; right: 35px; display: flex; align-items: center; gap: 40px; z-index: 1000100; }
.share-container { display: flex; gap: 15px; margin-top: 7px; } 
.share-container .share-btn { color: #cc3333; font-size: 1.2rem; text-decoration: none; }
.close-btn { font-size: 3.5rem; color: #cc3333; cursor: pointer; line-height: 0.7; position: relative; top: -2px; }
#lightbox-main-img { max-width: 90vw; max-height: 90vh; object-fit: contain; }
.nav-btn { position: absolute; top: 50%; transform: translateY(-50%); background: none; border: none; font-size: 5rem; color: #cc3333; cursor: pointer; opacity: 0.6; z-index: 1000100; padding: 20px; display: block; }
.nav-btn:hover { opacity: 1; }
.prev-btn { left: 20px; } .next-btn { right: 20px; }


/* ==========================================================================
   [8] MEDIA QUERIES - iPAD iOS 12 & MOBILE (RITORNO A 2 COLONNE)
   ========================================================================== */

@media (max-width: 1024px) {
    /* [HOME] Centratura Header */
    .main-header { 
        display: block !important; 
        width: 100% !important; 
        text-align: center !important; 
        padding: 40px 0 20px 0 !important;
    }

    .artist-name { 
        display: block !important;
        width: 100% !important;
        text-align: center !important; 
        margin: 0 auto !important;
        font-size: 3rem !important;
    }

/* [HOME] FORZA 2 COLONNE E FIX VISIBILITÀ iPAD (iOS 12) */
#grid-fotografica {
    display: flex !important;
    -webkit-flex-wrap: wrap !important;
    flex-wrap: wrap !important;
    -webkit-box-pack: center !important;
    -webkit-justify-content: center !important;
    justify-content: center !important;
    width: 100% !important;
    margin: 0 auto !important;
}

.photo-item {
    flex: 0 0 46% !important;
    -webkit-flex: 0 0 46% !important;
    width: 46% !important;
    max-width: 46% !important;
    margin: 10px 2% 60px 2% !important; 
    box-sizing: border-box !important;

    /* BLINDO LA VISIBILITÀ: Impedisce allo script di nascondere le foto */
    opacity: 1 !important; 
    visibility: visible !important;
    -webkit-transform: none !important;
    transform: none !important; 
}

.photo-item img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    opacity: 1 !important;
}
    
/* Lightbox UI iPad */
    #lightbox { background: #000 !important; }
    .nav-btn { display: none !important; }
    .lightbox-brand { color: #cc3333 !important; top: 30px !important; left: 25px !important; }
    
    .lightbox-top-bar { 
        top: auto !important; 
        bottom: 30px !important;    /* REGOLA: Distanza dal fondo. Diminuisci (es. 20px) per abbassare ancora */
        right: 0 !important; 
        left: 0 !important;         /* REGOLA: Insieme a right:0 e width:100% garantisce la centratura */
        width: 100% !important; 
        justify-content: center !important; 
    }
    
    .share-container { 
        display: flex !important;
        justify-content: center !important; /* REGOLA: Allinea le icone al centro */
        gap: 40px !important;               /* REGOLA: Spazio tra le icone */
        margin-top: 0 !important; 
    }

    .share-container .share-btn { 
        font-size: 1.4rem !important;       /* REGOLA: Dimensione icone iPad (era 1.8rem) */
        color: #cc3333 !important;          /* REGOLA: Colore icone */
        margin: 10px !important;
    }

    #lightbox-main-img { 
        width: 100% !important; 
        height: 100% !important; 
        max-width: 100vw !important; 
        max-height: 100vh !important; 
        object-fit: contain !important;     /* REGOLA: 'contain' evita tagli alle foto, 'cover' le spalma */
    }

    /* Marchio: NERO a Sinistra */
    .lightbox-brand {
        position: fixed !important;
        top: 30px !important;
        left: 30px !important;
        color: #cc3333 !important;
        cursor: pointer !important; /* Fa apparire la manina su PC */
        z-index: 2000000 !important;
        text-align: left !important;
    }

    .close-btn { 
        position: fixed !important; 
        top: 25px !important; 
        right: 30px !important; 
        color: #cc3333 !important; /* Rosso istituzionale */
        font-size: 45px !important;
        cursor: pointer !important;
        z-index: 1000200 !important; /* Fondamentale: deve stare sopra l'immagine */
    
        /* TRUCCO PER IPHONE: Aumentiamo l'area di tocco senza cambiare la grafica */
        padding: 20px !important; 
        margin: -20px !important; 
    
        /* Evita che il browser selezioni il testo quando clicchi veloce */
        user-select: none !important;
        -webkit-tap-highlight-color: transparent !important;
    }

    /* [SOCIAL] Posizionamento e dimensione */
    .lightbox-top-bar { 
        position: fixed !important;
        top: auto !important; 
        bottom: 35px !important;    /* REGOLA: Distanza dal bordo inferiore (es: 30px o 40px) */
        left: 0 !important;
        right: 0 !important;
        width: 100% !important; 
        text-align: center !important; /* Forza la centratura orizzontale */
        display: block !important;
        z-index: 2000000 !important;
        background: transparent !important;
    }

    .share-container .share-btn { 
        display: inline-block !important; 
        margin: 0 5px !important;    /* REGOLA: Spazio tra un'icona e l'altra (orizzontale) */
        font-size: 1.3rem !important;  /* REGOLA: Dimensione delle icone (es: 1.2rem per farle più piccole) */
        color: #cc3333 !important;    /* Rosso istituzionale */ 
    }

/* [CONTACTS] FIX ICONA AFFIANCATA A DOPPIO LINK (iOS 12 SAFE) */
.contact-row {
    display: -webkit-box !important;      /* Vecchio Safari */
    display: -webkit-flex !important;     /* iOS 12 */
    display: flex !important;
    -webkit-box-align: center !important;
    -webkit-align-items: center !important;
    align-items: center !important;
    -webkit-box-pack: center !important;
    -webkit-justify-content: center !important;
    justify-content: center !important;
    margin-bottom: 55px !important;
}

.contact-icon {
    -webkit-flex-shrink: 0 !important;
    flex-shrink: 0 !important;
    margin-right: 10px !important;
    width: 32px !important;
    height: auto !important;
    display: block !important;
}

/* Contenitore dei link: li tiene uno sopra l'altro a destra dell'icona */
.contact-link-group, 
.contacts-right p, 
.contacts-left p {
    display: -webkit-box !important;
    display: -webkit-flex !important;
    display: flex !important;
    -webkit-box-orient: vertical !important;
    -webkit-flex-direction: column !important;
    flex-direction: column !important;
    text-align: left !important; /* Allineamento testo a sinistra dell'icona */
    margin: 0 !important;
    line-height: 1.4 !important;
}

    /* [UI] Timer Scomparsa */
    .ui-hidden {
        opacity: 0 !important;
        visibility: hidden !important;
        -webkit-transition: opacity 0.5s, visibility 0.5s !important;
        transition: opacity 0.5s, visibility 0.5s !important;
    }
} /* <--- CHIUDE DEFINITIVAMENTE LA SEZIONE iPAD */

/* ==========================================================================
   [9] MEDIA QUERIES - MOBILE (iPhone 12 Pro & Smartphone)
   ========================================================================== */

@media screen and (max-width: 767px) {
    /* HEADER MONUMENTALE */
    body .artist-name {
        font-size: 2.5rem !important;      /* Impatto forte */
        letter-spacing: 0.3em !important;  /* Spaziatura elegante */
        line-height: 1.1 !important;
        white-space: normal !important;    /* Permette al nome di andare su due righe se necessario */
        display: block !important;
        width: 100% !important;
        text-align: center !important;
        padding: 0 10px !important;
    }

    body .main-header {
        padding: 60px 0 40px 0 !important; /* Molto spazio bianco per il look Magazine */
    }

    /* FIX GRID: FORZA LA VISIBILITÀ DELLE IMMAGINI */
    body #grid-fotografica {
        display: block !important; 
        width: 100% !important;
        padding: 0 15px !important;
        opacity: 1 !important;             /* Forza visibilità */
        visibility: visible !important;    /* Forza visibilità */
    }

    body .photo-item {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: none !important; 
        margin: 0 0 60px 0 !important;     /* Ritmo verticale ampio tra le foto */
        opacity: 1 !important;             /* Forza visibilità */
        visibility: visible !important;    /* Forza visibilità */
    }

    body .photo-item img {
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        opacity: 1 !important;             /* FONDAMENTALE: le rende visibili subito */
        visibility: visible !important;    /* FONDAMENTALE */
        transform: none !important;        /* Disattiva parallasse su mobile per stabilità */
        -webkit-transform: none !important;
    }

    body .nav-item {
        font-size: 0.75rem !important;
        margin: 0 8px !important;
    }

    /* Specifiche Lightbox per Mobile */
    .lightbox-top-bar {
        bottom: 25px !important;            /* REGOLA: Più basso dell'iPad perché lo schermo è piccolo */
    }
    
    .share-container .share-btn {
        font-size: 1.2rem !important;       /* REGOLA: Icone ancora più piccole su smartphone */
        color: #cc3333 !important;
    }

    .lightbox-brand {
        font-size: 0.9rem !important;       /* Rimpicciolisce il nome Irene Celidoni in alto */
        width: 100%;
        text-align: center;
        left: 0 !important;
    }
}

/* [10] UTILITY GENERALI */
.stop-scrolling { 
    height: 100% !important; 
    overflow: hidden !important; 
    position: fixed !important; 
    width: 100% !important; 
}
