/* ========================================== */
/* BARRA DECORATIVA SUPERIORE                 */
/* ========================================== */
.header-bar {
    width: 100%;
    height: 300px; 
    /* Aggiungiamo un colore di sfondo rosso temporaneo */
    background-color: red; 
    background-image: url('../public/uploads/barra.png');
    background-repeat: repeat-x;
    background-position: center top;
    margin-bottom: 20px;
}


/* ========================================== */
/* BASE E TYPOGRAPHY                          */
/* ========================================== */
body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: #fdfdfd;
}

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

/* ========================================== */
/* HEADER E NAVIGAZIONE                       */
/* ========================================== */
.site-header {
    padding: 0 0 3rem 0; /* Rimosso il 3rem iniziale */
    text-align: center;
    border-bottom: 1px solid #eaeaea;
    margin-bottom: 2rem;
}

.main-nav ul {
    list-style: none; /* Rimuove i pallini neri */
    padding: 0;
    margin: 0;
    display: flex;    /* Affianca le voci in orizzontale */
    justify-content: center; /* Centra perfettamente il menu */
    gap: 2.5rem;      /* Distanza elegante tra una voce e l'altra */
}

.main-nav li {
    display: inline-block;
}

.main-nav a {
    font-family: "Times New Roman", Times, Baskerville, Georgia, serif;
    font-size: 14px; 
    font-weight: normal; 
    text-transform: uppercase;
    text-decoration: none;
    color: #90a4ae; 
    letter-spacing: 1px; 
    transition: color 0.3s ease;
}

.main-nav a:hover,
.main-nav a:active {
    color: #455a64; 
    outline: 0;
}

/* ========================================== */
/* RESPONSIVE MENU PER SMARTPHONE             */
/* ========================================== */
@media (max-width: 600px) {
    .main-nav ul {
        flex-direction: column; /* Rimette in colonna le voci solo sugli schermi piccoli */
        gap: 1.2rem;
    }
}

/* ========================================== */
/* CAROSELLO OPERE                            */
/* ========================================== */
.category-section {
    margin-bottom: 4rem;
    padding: 0 20px;
}

.category-title {
    text-align: center;
    font-family: 'EB Garamond', serif;
    font-size: 1.2rem;
    font-weight: normal;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-bottom: 2rem;
    color: #333;
}

/* Contenitore dello slider */
.swiper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

/* Immagine singola centrata */
.slider-item {
    margin: 0;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.slider-item img {
    max-height: 600px; /* Evita che foto verticali escano dallo schermo */
    width: auto;
    max-width: 100%;
    object-fit: contain;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Didascalia sotto l'immagine */
.slider-caption {
    margin-top: 15px;
    text-align: center;
    font-family: 'EB Garamond', serif;
}

.slider-caption h3 {
    margin: 0 0 5px;
    font-size: 1.1rem;
    color: #222;
}

.opera-description {
    font-size: 1rem;
    line-height: 1.4;
    color: #607d8b;
    margin-bottom: 5px;
}

.opera-year {
    font-size: 0.9rem;
    font-style: italic;
    color: #90a4ae;
    margin-bottom: 10px;
}

.opera-code {
    display: inline-block;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #b0bec5;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-family: monospace; /* Font tecnico per il codice */
}

/* Personalizzazione delle frecce di scorrimento */
.swiper-button-next,
.swiper-button-prev {
    color: #333 !important; /* Frecce scure per adattarsi al design minimale */
}

/* Nasconde le sezioni vuote (es. Quadri e Disegni finché non ci assegniamo le foto) */
.swiper-wrapper:empty {
    display: none;
}

/* ========================================== */
/* HOMEPAGE E RETE ANIMATA                    */
/* ========================================== */

/* Il Canvas della rete: fisso in background */
#reteVita {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; /* Lo manda "dietro" a tutti i contenuti */
    pointer-events: none; /* Impedisce che il canvas blocchi i click sui link o sulle foto */
}

/* Il contenitore di tutto il sito per garantirne la leggibilità sopra la rete */
.content-overlay {
    position: relative;
    z-index: 1; /* Sta "sopra" il canvas */
    background-color: transparent; 
}

/* Formattazione della Homepage */
.homepage-entry {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
    text-align: center;
}

.homepage-featured-image {
    margin-bottom: 3rem;
}

.homepage-featured-image img {
    max-height: 650px;
    width: auto;
    margin: 0 auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1); /* Leggera ombra per staccare l'immagine dalla rete */
}

/* ========================================== */
/* TESTO HOMEPAGE (Stile coordinato)          */
/* ========================================== */
.homepage-statement {
    /* Identico font-family del menù */
    font-family: 'EB Garamond', serif;
    font-size: 1.25rem;
    line-height: 1.8;
    color: #333; /* Grigio scuro per buon contrasto */
    font-weight: 400;
    margin-bottom: 4rem;
    letter-spacing: 0.5px;
}

.homepage-signature {
    margin-top: 2rem;
    font-size: 1.1rem;
    font-family: 'EB Garamond', serif;
    font-weight: 500;
    letter-spacing: 1px;
}

/* I due ritratti in basso */
.homepage-portraits {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px; /* Spazio tra le due foto */
    margin-bottom: 3rem;
}

.homepage-portraits img {
    max-height: 300px;
    width: auto;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

/* Responsive per i ritratti su Smartphone */
@media (max-width: 600px) {
    .homepage-portraits {
        flex-direction: column; /* Le impila una sotto l'altra sui telefoni */
    }
}

/* ========================================== */
/* FOOTER E SOCIAL LINKS                      */
/* ========================================== */
.site-footer {
    padding: 3rem 0 2rem 0;
    border-top: 1px solid #eaeaea;
    text-align: center; /* Forza la centratura di tutto il footer */
    margin-top: 4rem;
}

.social-links {
    display: flex;
    justify-content: center; /* Centra orizzontalmente le icone */
    gap: 1.8rem; /* Spazio elegante tra un'icona e l'altra */
    margin-bottom: 1.5rem;
}

.social-links a {
    color: #90a4ae; /* Il grigio originale del tema Olesya */
    font-size: 1.4rem; /* Grandezza delle icone */
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
}

/* Effetto al passaggio del mouse */
.social-links a:hover {
    color: #455a64; /* Diventano grigio scuro */
    transform: scale(1.1); /* Leggero effetto zoom */
}

/* Stile per il pulsante Back to Top */
.back-to-top {
    font-family: "Times New Roman", Times, Baskerville, Georgia, serif;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.back-to-top a {
    color: #90a4ae;
    text-decoration: none;
    font-style: italic;
    transition: color 0.3s ease;
}

.back-to-top a:hover {
    color: #455a64;
}

/* ========================================== */
/* PAGINA CONTATTI                            */
/* ========================================== */
.contact-section {
    text-align: center;
    padding: 2rem 20px;
    margin-bottom: 6rem;
}

.contact-details {
    margin-top: 3rem;
}

.contact-details p {
    margin: 1.5rem 0;
}

.contact-link {
    font-family: "Times New Roman", Times, Baskerville, Georgia, serif;
    font-size: 1.3rem;
    color: #90a4ae;
    text-decoration: none;
    letter-spacing: 2px;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: #455a64;
    text-decoration: underline; /* Aggiunge una sottolineatura delicata al passaggio del mouse */
}
.contact-image {
    margin: 3rem 0;
    display: flex;             /* Attiva Flexbox */
    justify-content: center;   /* Centra il contenuto orizzontalmente in modo assoluto */
    align-items: center;
}

.contact-image img {
    display: block;
    max-width: 200px; 
    height: auto;
    border-radius: 50%; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.08); 
}

/* ========================================== */
/* SIMPLE MIND - FEED MODERNO                 */
/* ========================================== */

.simple-mind-section {
    max-width: 650px;
    margin: 0 auto;
    padding: 0 15px 40px 15px;
}

.sm-header {
    text-align: center;
    margin-bottom: 2rem;
}

.sm-subtitle {
    color: #607d8b;
    font-style: italic;
    font-size: 1.1rem;
}

.error-banner {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-weight: bold;
    border-left: 4px solid #f44336;
}

/* COMPOSER (Area di scrittura) */
.post-composer {
    background: rgba(255, 255, 255, 0.95);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    margin-bottom: 40px;
    border: 1px solid #f0f0f0;
}

.composer-author-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.avatar-placeholder {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.empty-avatar { background: #cfd8dc; color: #78909c; }

.composer-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    outline: none;
}

.composer-textarea {
    width: 100%;
    border: none;
    background: transparent;
    font-family: 'EB Garamond', serif;
    font-size: 1.3rem;
    color: #444;
    outline: none;
    resize: none;
    min-height: 80px;
    padding-left: 55px; /* Allineato col testo sopra */
    box-sizing: border-box;
}

.composer-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    padding-left: 55px;
}

/* Bottone Foto Migliorato */
.hidden-file-input {
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    position: absolute;
    z-index: -1;
}

.upload-btn-modern {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #2196F3;
    font-family: sans-serif;
    font-weight: bold;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 20px;
    transition: background 0.2s;
}

.upload-btn-modern:hover {
    background: #e3f2fd;
}

.file-name-display {
    font-size: 0.85rem;
    margin-left: 10px;
    font-style: italic;
}

.submit-post-btn {
    background: #455a64;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.3s;
}

.submit-post-btn:hover {
    background: #263238;
}

/* ========================================== */
/* SINGOLO POST (Pulizia totale dai vecchi stili) */
/* ========================================== */
.post-card {
    display: flex;
    gap: 20px;
    background: transparent !important; /* Niente sfondo bianco a blocchi */
    padding: 30px 0;
    margin-bottom: 0;
    /* Resettiamo esplicitamente tutti i bordi vecchi (inclusa la striscia blu) */
    border: none !important; 
    border-bottom: 1px solid rgba(0,0,0,0.08) !important; 
    box-shadow: none !important;
}

/* Rimuove il separatore dall'ultimo post */
.post-card:last-child {
    border-bottom: none !important; 
}

.post-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1.4rem;
    flex-shrink: 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.post-content {
    flex-grow: 1;
    min-width: 0;
}

.post-header {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 10px;
}

.post-author {
    font-weight: bold;
    font-family: sans-serif;
    font-size: 1.15rem;
    color: #222;
}

.post-date {
    font-size: 0.9rem;
    color: #888;
    font-family: sans-serif;
    text-transform: lowercase;
}

/* TESTO PIÙ GRANDE */
.post-body p {
    font-family: 'EB Garamond', serif;
    font-size: 1.55rem; /* Ingrandito sensibilmente */
    line-height: 1.6;
    color: #2a2a2a; /* Leggermente più scuro per compensare la grandezza */
    margin: 0 0 20px 0;
}

/* MINIATURA IMMAGINE FORZATA (Sovrascrive qualsiasi 100%) */
.post-image img.sm-thumbnail {
    width: 140px !important; 
    height: 140px !important;
    max-height: 140px !important; /* Blocca le vecchie altezze sfalsate */
    object-fit: cover !important; /* Taglia l'immagine senza deformarla a quadrato */
    border-radius: 8px !important;
    cursor: zoom-in; 
    border: 1px solid #eaeaea;
    transition: opacity 0.2s, transform 0.2s;
    display: block;
}

.post-image img.sm-thumbnail:hover {
    opacity: 0.85;
    transform: scale(1.02);
}

.empty-feed {
    text-align: center;
    padding: 50px 0;
    color: #78909c;
    font-style: italic;
    font-size: 1.2rem;
}

/* ========================================== */
/* MODALE PER LE IMMAGINI                     */
/* ========================================== */
.sm-modal {
    display: none; /* Nascosto di default */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.95); /* Effetto Lightbox bianco elegante */
    backdrop-filter: blur(5px); /* Sfoca leggermente lo sfondo se il browser lo supporta */
    align-items: center;
    justify-content: center;
    cursor: zoom-out;
}

.sm-modal-content {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    object-fit: contain;
}

.sm-modal-close {
    position: absolute;
    top: 25px;
    right: 40px;
    color: #333;
    font-size: 50px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s;
}

.sm-modal-close:hover {
    color: #d32f2f;
}