/* ============================================================
   1. STRUTTURA PRINCIPALE E TESTO
   ============================================================ */
main[role="main"] {
    max-width: 700px; 
    margin: 40px auto;
    padding: 0 20px;
    font-family: Georgia, serif;
    line-height: 1.8; 
    color: #1a1a1a;
}

.opera-header {
    text-align: center;
    margin-bottom: 50px;
}

.opera-header h4 {
    font-size: 1.4rem;
    font-weight: normal;
    margin-bottom: 10px;
    color: #000;
}

.sottotitolo {
    font-size: 1.2rem;
    color: #555;
}

.sottotitolo a {
    color: #c0392b;
    text-decoration: none;
}

.testo-opera {
    font-size: 1.15rem;
    text-align: justify;
    margin-bottom: 60px;
}

.testo-opera p {
    margin-bottom: 1.5rem; /* Corretto errore sintassi */
    text-indent: 0; 
}

/* ============================================================
   2. GALLERIA MUSEALE (Griglia Responsive)
   ============================================================ */
   .museum-intro {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    line-height: 1.6;
    color: #333;
    border-left: 4px solid #b58900; /* Un tocco d'oro antico */
    background-color: #fdf6e3;
}

.gallery-container {
    max-width: 1000px; /* Più largo del testo per dare respiro alle immagini */
    margin: 40px auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.museum-grid {
    display: grid;
    /* Crea colonne da almeno 200px che si adattano allo schermo */
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    padding: 20px 0;
}

.museum-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: #ffffff; /* Sfondo bianco per far risaltare le foto */
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    transition: background 0.3s ease;
}

.museum-item:hover {
    background: #fdfdfd;
}

.museum-item img {
    display: block;
    max-width: 100%;
    height: auto;
    max-height: 220px; /* Mantiene uniformità visiva */
    object-fit: contain;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08); /* Ombra più morbida */
    border-radius: 4px;
    transition: transform 0.3s ease;
}

.museum-item img:hover {
    transform: translateY(-5px) scale(1.02);
}

.museum-item figcaption {
    font-size: 0.9rem;
    color: #333;
    margin-top: 12px;
    line-height: 1.4;
    font-weight: 500;
}

/* Link extra nelle didascalie */
.reconstruction-link {
    display: block;
    font-size: 0.8rem;
    font-style: italic;
    color: #0066cc;
    text-decoration: none;
    margin-top: 6px;
}

.sub-links {
    font-size: 0.8rem;
    margin-top: 8px;
}

.sub-links a {
    color: #0077aa;
    text-decoration: none;
    background: #f0f4f8;
    padding: 3px 8px;
    border-radius: 4px;
    margin: 0 2px;
}

/* ============================================================
   3. NAVIGAZIONE E FOOTER
   ============================================================ */
.navigazione-opera {
    margin-top: 60px;
    background-color: #f9f9f9;
    padding: 30px;
    border: 1px solid #eee;
    border-radius: 8px;
}

.approfondimenti h5 {
    margin-top: 0;
    font-size: 1.1rem;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.approfondimenti ul {
    list-style-type: none;
    padding: 0;
}

.approfondimenti li {
    margin-bottom: 12px;
    padding-left: 15px;
    border-left: 2px solid #ccc;
}

.approfondimenti a {
    color: #004a99;
    text-decoration: none;
}

.fine-lettura {
    text-align: center;
    margin-top: 30px;
    font-style: italic;
    color: #999;
}

/* 24 - 02 - 26 */
/* ============================================================
   4. CORREZIONE TABELLA OPERE (Galleria Capitolini)
   ============================================================ */

/* Rimuove i vincoli della tabella classica per renderla fluida */
table {
    width: 100% !important;
    border-collapse: collapse;
    table-layout: fixed; /* Impedisce a immagini grandi di deformare le celle */
}

td {
    padding: 20px 10px;
    vertical-align: top !important; /* Allinea le immagini in alto */
    border-bottom: 1px solid #eee;
}

/* Formattazione paragrafi e link dentro la tabella */
td p {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 0.9rem;
}

/* Stile per le immagini delle statue */
td img {
    display: block;
    margin: 0 auto 10px auto;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

td img:hover {
    transform: scale(1.05);
}

/* Stile per i link delle didascalie (quelli con onmouseover) */
td a[href^="javascript"] {
    display: inline-block;
    color: #c0392b; /* Rosso coerente con il tuo sottotitolo */
    text-decoration: none;
    font-weight: 600;
    margin-top: 5px;
    border-bottom: 1px dotted #c0392b;
}

/* Ottimizzazione Mobile: trasforma la tabella in una colonna singola */
@media (max-width: 600px) {
    table, tbody, tr, td {
        display: block;
        width: 100% !important;
    }
    
    td {
        box-sizing: border-box;
        border-bottom: 2px solid #f0f0f0;
        padding: 30px 0;
    }
}

.search-container {
    max-width: 800px;
    margin: 20px auto 40px auto;
    padding: 0 20px;
    text-align: center;
}

#museumSearch {
    width: 100%;
    padding: 15px 25px;
    font-size: 1.1rem;
    border: 2px solid #ddd;
    border-radius: 50px; /* Effetto pillola */
    outline: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

#museumSearch:focus {
    border-color: #a38560; /* Un colore bronzo/oro che richiama i musei */
    box-shadow: 0 6px 12px rgba(163, 133, 96, 0.2);
}

#searchCounter {
    display: block;
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* Animazione per la comparsa delle opere filtrate */
.museum-item {
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.museum-item {
    transition: opacity 0.3s ease, transform 0.3s ease;
}
#descrizione-opera {
    display: block;
    width: 100%;
    min-height: 120px; /* Altezza fissa: così la pagina non "salta" */
    max-height: 250px;
    overflow-y: auto;  /* Se il testo è lunghissimo, appare la rotellina */
    background-color: #f4f4f4;
    border: 1px solid #ccc;
    padding: 15px;
    margin-bottom: 10px;
    box-sizing: border-box;
    font-size: 1.1em;
    color: #333;
    border-radius: 4px;
}

/* Sfondo oscurato */
.modal {
    display: none; 
    position: fixed;
    z-index: 20000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

/* Contenitore testo */
.modal-content {
    background-color: #fff;
    /* MODIFICA QUESTA RIGA */
    margin: 10vh auto; /* Usa 'vh' (view height) per un controllo più preciso */
    
    padding: 25px;
    border-radius: 8px;
    width: 85%;
    max-width: 600px;
    max-height: 70vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    font-family: sans-serif;
    line-height: 1.6;
}

/* Tasto chiusura */
.close-modal {
    position: sticky;
    top: 0;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #ff0000;
}
.close-modal:hover { color: #000; }

.museum-item figcaption a {
    cursor: pointer;
    text-decoration: none;
    border-bottom: 1px dashed #666; /* Una sottile linea tratteggiata suggerisce l'interazione */
    color: #0056b3;
}

.museum-item figcaption a:hover {
    color: #c00;
    border-bottom: 1px solid #c00;
}

/* Immagini con “ombra” */
/* Immagini con “ombra” moderna */
#opera .shad {
    float: right;
    margin: 1em 0 1em 1.5em;
    padding: 0;
    display: block;
}
#opera .shad span {
    border: 1px solid #a9a9a9;
    background-color: #fff;
    display: block;
    text-align: center; /* Ripristina l'allineamento al centro */
    padding: 3px;
    /* Ombra reale senza file .gif */
    box-shadow: 4px 4px 5px rgba(0,0,0,0.2); 
}

#opera .shad img {
    margin: 0 auto;
    display: block;
}

#opera .shad .alt {
    border-top: 1px solid #eee; /* Una riga sottile per separare il testo */
    font-size: 10px;
    text-transform: uppercase;
    font-variant: small-caps; /* Ripristina l'effetto maiuscoletto/strong */
    font-weight: bold;       /* Lo rende effettivamente "strong" */
    padding: 2px 0;
}
/* -------------- 3_3_26 --------- */
.shad {
    display: flex;       /* Allinea gli elementi internamente */
    align-items: center; /* Centra verticalmente l'immagine e il testo */
    gap: 15px;           /* Spazio tra immagine e testo */
    margin-bottom: 20px; /* Distanza dal testo successivo */
    clear: both;         /* Impedisce sovrapposizioni con elementi precedenti */
}

.shad img {
    display: block;      /* Rimuove spazi vuoti indesiderati sotto l'immagine */
}
