/* ==========================================================================
 *  GOOGLE FONTS IMPORT
 * ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,300;1,400;1,600&display=swap');

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

body {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.25rem;
    font-weight: 500;
    color: #1a1917;       /* Nero caldo minerale */
    background-color: #F4F6F5;  /* Off-White neutrale riposante */
    line-height: 1.6;
}

/* Layout a due colonne per la Home Page */
body.home-layout {
    display: flex;
    min-height: 100vh;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ==========================================================================
 *  2. MENU VERTICALE A SINISTRA (SIDEBAR)
 * ========================================================================== */
.sidebar-nav {
    width: 300px;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: #F4F6F5;
    border-right: 1px solid rgba(26, 25, 23, 0.08);
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    z-index: 100;
}

.logo a {
    font-size: 2.2rem;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #111111;
    display: block;
    line-height: 1.1;
    margin-bottom: 45px;
}

/* Gruppi di navigazione ed etichette discrete */
.nav-group {
    margin-bottom: 10px;
}

/* Etichette delle sezioni (works / info) */
.nav-label {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-style: normal;
    font-weight: 600;
    letter-spacing: 1.5px;
    color: #1a1917;
    margin-bottom: 12px;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.nav-links a {
    font-size: 1.2rem;
    font-weight: 600;
    letter-spacing: 1px;
    color: #4a4740;
    transition: color 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: #000000;
    font-weight: 700;
}

/* Sezione Inferiore Sidebar */
.sidebar-bottom {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-footer p {
    font-size: 0.9rem;
    color: #666258;
}

/* ==========================================================================
 *  3. CONTENUTO PRINCIPALE (DESTRA)
 * ========================================================================== */
.main-content {
    margin-left: 300px;
    width: calc(100% - 300px);
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

/* ==========================================================================
 *  4. IMMAGINE FISSA IN EVIDENZA (FORMATO 16:9)
 * ========================================================================== */
.hero-featured {
    width: 80%;
    max-width: 1100px;
    margin-bottom: 25px;
}

.hero-image-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
}

.hero-img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
 *  5. SEZIONE CITAZIONE & AUTORE
 * ========================================================================== */
.quotes-section {
    width: 80%;
    max-width: 1100px;
    text-align: left;
}

.quote-text {
    font-family: 'Cormorant Garamond', serif;
    font-style: normal;
    font-weight: 400;
    font-size: 1.35rem;
    color: #1a1917;
    line-height: 1.4;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.quote-author {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    font-size: 1.15rem;
    color: #55524b;
    letter-spacing: 0.5px;
}

/* ==========================================================================
 *  6. RESPONSIVE (MOBILE & TABLET)
 * ========================================================================== */
@media (max-width: 900px) {
    body.home-layout {
        flex-direction: column;
    }

    .sidebar-nav {
        width: 100%;
        height: auto;
        position: relative;
        border-right: none;
        border-bottom: 1px solid rgba(26, 25, 23, 0.08);
        padding: 40px 20px;
        align-items: center;
        text-align: center;
    }

    .logo a {
        margin-bottom: 25px;
    }

    .sidebar-bottom {
        margin-top: 25px;
        gap: 15px;
    }

    .sidebar-footer {
        display: none;
    }

    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 40px 20px;
        min-height: auto;
    }

    .hero-featured,
    .quotes-section {
        width: 100%;
    }

    .quote-text {
        font-size: 1.15rem;
    }

    .quote-author {
        font-size: 1rem;
    }
}

/* ==========================================================================
 *  CURSORE PERSONALIZZATO (PALLINO GLOBALE)
 * ========================================================================== */
body, a, button, img, input, textarea, select {
    cursor: none !important;
}

.custom-cursor {
    width: 12px;
    height: 12px;
    background-color: #1a1917;
    border-radius: 50%;
    position: fixed;
    top: 0;
    left: 0;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: transform 0.15s ease-out, width 0.2s ease-out, height 0.2s ease-out, background-color 0.2s ease-out, border 0.2s ease-out;
    z-index: 99999;
}

.custom-cursor.cursor-hover {
    width: 32px;
    height: 32px;
    background-color: rgba(26, 25, 23, 0.12);
    border: 1px solid #1a1917;
}

@media (max-width: 900px) {
    body, a, button, img, input, textarea, select {
        cursor: auto !important;
    }
    .custom-cursor {
        display: none !important;
    }
}

/* ==========================================================================
 *  STILI PAGINE PORTFOLIO & MASONRY GRID CON PROTEZIONE FOTO
 * ========================================================================== */
.portfolio-content {
    justify-content: flex-start;
    padding: 80px 60px;
}

.story-section {
    width: 100%;
    max-width: 1200px;
    margin-bottom: 70px;
}

.story-section:last-child {
    margin-bottom: 0;
}

.gallery-header {
    width: 100%;
    max-width: 1200px;
    margin-bottom: 40px;
}

.gallery-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    font-weight: 500;
    letter-spacing: 1px;
    color: #1a1917;
    margin-bottom: 10px;
}

/* MODIFICATO: Limitato e allineato alla larghezza della griglia */
.gallery-description {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-weight: 300;
    font-size: 1.25rem;
    color: #55524b;
    max-width: 1200px;
    width: 100%;
}

.gallery-grid {
    width: 100%;
    max-width: 1200px;
    column-count: 3;
    column-gap: 35px;
}

/* Singola scheda immagine con livello protettivo */
.gallery-item {
    width: 100%;
    break-inside: avoid;
    margin-bottom: 35px;
    position: relative; /* Necessario per il posizionamento dell'overlay */
    overflow: hidden;
    background-color: rgba(0, 0, 0, 0.02);
}

/* Protezione 1: Sovrapposizione trasparente che blocca il "Salva con nome" */
.photo-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;            /* Deve stare sopra l'immagine */
    background: rgba(0,0,0,0);  /* Totalmente trasparente */
    pointer-events: auto;       /* FONDAMENTALE: intercetta tutti i click del mouse */
}

/* Protezione 2: Blocco selezione e trascinamento CSS */
.gallery-item img,
.hero-img {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.4s ease, transform 0.4s ease;
    -webkit-user-drag: none;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.gallery-item:hover img {
    opacity: 0.92;
    transform: scale(1.015);
}

@media (max-width: 1100px) {
    .gallery-grid {
        column-count: 2;
        column-gap: 25px;
    }

    .gallery-item {
        margin-bottom: 25px;
    }
}

@media (max-width: 900px) {
    .portfolio-content {
        padding: 40px 20px;
    }

    .gallery-header {
        margin-bottom: 30px;
    }

    .gallery-title {
        font-size: 2rem;
    }

    .gallery-grid {
        column-count: 1;
        column-gap: 0;
    }
}

/* ==========================================================================
 *  STILI PAGINA CONTATTI
 * ========================================================================== */
.contact-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 80px 10%;
}

.contact-container {
    max-width: 600px;
    width: 100%;
}

.contact-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.5rem;
    font-weight: 500;
    letter-spacing: 1px;
    color: #1a1917;
    margin-bottom: 25px;
}

.contact-intro {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.3rem;
    font-weight: 400;
    color: #4a4740;
    line-height: 1.6;
    margin-bottom: 50px;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.contact-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-label {
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    font-style: italic;
    font-weight: 400;
    letter-spacing: 1.5px;
    color: #757167;
    text-transform: lowercase;
}

.contact-link-text,
.contact-info-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: #1a1917;
    letter-spacing: 0.5px;
    transition: opacity 0.3s ease;
}

.contact-link-text:hover {
    opacity: 0.6;
}

@media (max-width: 900px) {
    .contact-content {
        padding: 60px 20px;
    }

    .contact-title {
        font-size: 2rem;
    }

    .contact-intro {
        font-size: 1.15rem;
        margin-bottom: 35px;
    }

    .contact-link-text,
    .contact-info-text {
        font-size: 1.25rem;
    }
}

/* ==========================================================================
 *  LIGHTBOX MODALE (INGRANDIMENTO FOTO COMPATTO)
 * ========================================================================== */
.lightbox-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(18, 28, 24, 0.85); /* Sfondo scuro leggermente più trasparente */
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    padding: 40px; /* Margine di respiro dal bordo dello schermo */
}

.lightbox-modal.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 75vw;  /* Ridotto da 90vw per un ingrandimento più elegante */
    max-height: 75vh; /* Ridotto da 90vh */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.lightbox-content img {
    max-width: 75vw;
    max-height: 75vh;
    object-fit: contain;
    display: block;
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: #F4F6F5;
    font-size: 2.2rem;
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    cursor: pointer !important;
    z-index: 100001;
    transition: opacity 0.2s ease;
}

.lightbox-close:hover {
    opacity: 0.6;
}

/* Cursore per indicare l'interattività */
.gallery-item .photo-overlay {
    cursor: pointer !important;
}
