/* RESET DI BASE */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f7f4;
    color: #333;
}

/* DISTANZA DAL MENU SUPERIORE - Ottimizzata */
.opera-detail-page {
    padding-top: 140px; 
    padding-bottom: 60px;
    min-height: 85vh;
    display: flex;
    justify-content: center;
}

.artwork-container {
    max-width: 1000px;
    width: 90%;
    margin: 0 auto;
    text-align: center;
}

/* AREA IMMAGINE E CORNICE */
.artwork-viewer {
    margin-bottom: 50px;
}

.artwork-viewer .frame {
    display: inline-block;
    background: #fff;       /* Colore del passpartout */
    padding: 5px;           /* Spessore del passpartout bianco */
    border: 40px solid #000; /* Questa verrà sovrascritta dall'HTML se usi style="..." */
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.artwork-viewer img {
    max-width: 100%;
    max-height: 75vh;
    height: auto;
    display: block;
    transition: filter 0.3s;
}

.artwork-viewer img:hover {
    filter: brightness(1.05);
}

/* TESTI */
.artwork-title {
    font-size: 3rem;
    font-weight: 100;
    margin-bottom: 10px;
    letter-spacing: -1px;
    color: #003366;
}

.artwork-specs {
    font-size: 1.1rem;
    color: #5a8fbb;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 35px;
}

.artwork-description {
    max-width: 700px;
    margin: 0 auto;
    font-weight: 300;
    line-height: 1.8;
    color: #003366;
    text-align: justify;
    font-size: 1.1rem;
}

.artwork-description p {
    margin-bottom: 20px;
}

/* TASTO INDIETRO CIRCOLARE */
.btn-back-circle {
    position: fixed;
    top: 140px;
    left: 40px;
    width: 50px;
    height: 50px;
    background: #ffffff;
    border: 1px solid #eeeeee;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #003366;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.btn-back-circle:hover {
    background: #003366;
    color: #ffffff;
    transform: scale(1.1);
}

/* MODAL */
.modal {
    display: none; 
    position: fixed;
    z-index: 2000; 
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9); 
    justify-content: center;
    align-items: center;
    cursor: zoom-out;
    padding: 20px;
}

.modal-content {
    max-width: 95%;
    max-height: 95vh;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    animation: zoomAnimation 0.3s ease;
}

@keyframes zoomAnimation {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
}

/* --- CORREZIONE PER CELLULARI --- */
@media (max-width: 768px) {
    /* Aumentiamo il padding perché il menu mobile è più alto */
    .opera-detail-page { 
        padding-top: 220px; 
    }
    
    /* Spostiamo il tasto indietro più in basso per non coprire il menu */
    .btn-back-circle {
        top: auto;
        bottom: 30px; /* Lo mettiamo in basso a sinistra, stile app moderna */
        left: 20px;
        width: 45px;
        height: 45px;
        box-shadow: 0 4px 20px rgba(0,0,0,0.2);
    }

    .artwork-title { 
        font-size: 2rem; 
        line-height: 1.1;
    }

    .artwork-viewer .frame { 
        border-width: 15px !important; /* Forza la cornice sottile su mobile */
    }

    .artwork-description {
        text-align: justify; /* <--- CAMBIA DA 'left' A 'justify' */
        font-size: 1rem;
        hyphens: auto;       /* CONSIGLIO: aggiungi questo per evitare grossi spazi bianchi */
    }
}

/* --- STILE BANNER COOKIE --- */
#cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.95); /* Nero quasi totale */
    color: #ffffff;
    padding: 15px 25px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    z-index: 10000; /* Lo tiene sopra a tutto */
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-sizing: border-box;
    border-top: 1px solid #333;
}

#cookie-banner p {
    margin: 0;
    line-height: 1.4;
}

#cookie-banner button {
    background: #ffffff;
    color: #000000;
    border: none;
    padding: 8px 20px;
    cursor: pointer;
    text-transform: uppercase;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 1px;
    transition: background 0.3s;
    margin-left: 20px;
    white-space: nowrap; /* Evita che il testo del bottone vada a capo */
}

#cookie-banner button:hover {
    background: #cccccc;
}

/* OTTIMIZZAZIONE MOBILE */
@media (max-width: 600px) {
    #cookie-banner {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    #cookie-banner button {
        margin-left: 0;
        width: 100%;
    }
}