
/* Contenuto CSS come fornito nella risposta precedente per style_video.css */
/* ... LUNGO BLOCCO CSS ... */
@import url('https://fonts.googleapis.com/css2?family=Nunito+Sans:wght@300;400;600;700;900&display=swap');

:root {
    --primary-bg: #F4F7FC;
    --secondary-bg: #FFFFFF;
    --header-bg: #FFFFFF;
    --text-color: #343a40;
    --text-muted: #6c757d;
    --primary-blue: #0d6efd; 
    --dark-blue-text: #1A3B5A;
    --accent-color: #4371a6;
    --border-color: #E0E7F1;
    --shadow-soft: rgba(0, 0, 0, 0.05);
    --shadow-medium: rgba(0, 0, 0, 0.1);
    --border-radius-main: 12px;
    --border-radius-small: 8px;
    --green-accent: #28a745;
    --red-accent: #dc3545;
    --red-qshops: #7a132f;
}

body { margin: 0; font-family: 'Nunito Sans', sans-serif; background-color: var(--primary-bg); color: var(--text-color); line-height: 1.6; font-size: 15px; }
.container { width: 90%; max-width: 1320px; margin: 0 auto; padding: 0 15px; }
h1, h2, h3, h4, h5, h6 { color: var(--dark-blue-text); margin-top: 0; font-weight: 700;}
a { color: var(--accent-color); text-decoration: none; }
a:hover { color: #3a7bc8; text-decoration: underline; }

/* Header */
header { background-color: var(--header-bg); padding: 12px 0; box-shadow: 0 2px 10px var(--shadow-soft); position: sticky; top: 0; z-index: 1000; }
.header-content { display: flex; justify-content: space-between; align-items: center; }
#logo { height: 40px; }
.user-greeting { font-weight: 600; color: var(--text-muted); font-size: 1.5em; }
.user-actions .btn { margin-left: 10px; padding: 8px 15px; border-radius: var(--border-radius-small); text-decoration: none; font-weight: 600; font-size: 0.9em; transition: all 0.2s ease-in-out; display: inline-flex; align-items: center; }
.btn i { margin-right: 6px; }
.btn-admin { background-color: var(--accent-color); color: white; border:1px solid var(--accent-color); }
.btn-admin:hover { background-color: white; border-color: #3a7bc8;}
.btn-logout { background-color: transparent; color: var(--accent-color); border: 1px solid var(--accent-color); }
.btn-logout:hover { background-color: var(--accent-color); color:white;}
.btn-qshops { background-color: transparent; color: var(--red-qshops); border: 1px solid var(--red-qshops); }
.btn-qshops:hover { background-color: var(--red-qshops); color:white;}

/* Banner Slider */
#banner-slider { background-color: var(--primary-bg); color: white; margin: 30px auto 10px auto; position: relative; max-width: 1315px; }
.slider-container { width: 100%; height: 420px; overflow: hidden; position: relative; border-radius: var(--border-radius-main); }
#banner-slider .slide { display: none; width: 100%; height: 100%; position: absolute; top:0; left:0; opacity: 0; transition: opacity 0.7s ease-in-out; }
#banner-slider .slide.active-slide { display: block; opacity: 1; z-index: 1; }
#banner-slider .slide img { width: 100%; height: 100%; object-fit: cover; }
.slide-caption { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); text-align: center; background-color: rgba(26, 59, 90, 0.7); padding: 15px 25px; border-radius: var(--border-radius-small); z-index: 2; width: auto; max-width: 65%; }
.slide-caption h2 { margin: 0 0 8px 0; font-size: 2em; color: white; font-weight: 700; }
.slide-caption p { margin: 0; font-size: 1em; color: #e0e7f1; }
.slider-control { position: absolute; top: 50%; transform: translateY(-50%); background-color: rgba(255, 255, 255, 0.2); color: white; border: none; padding: 0; cursor: pointer; z-index: 10; font-size: 20px; border-radius: 50%; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; transition: background-color 0.3s ease; }
.slider-control.prev { left: 20px; }
.slider-control.next { right: 20px; }
.slider-control:hover { background-color: rgba(255, 255, 255, 0.4); }
.slider-dots { position: absolute; bottom: 15px; left: 50%; transform: translateX(-50%); z-index: 10; }
.dot { cursor: pointer; height: 10px; width: 10px; margin: 0 4px; background-color: rgba(255,255,255,0.4); border-radius: 50%; display: inline-block; transition: background-color 0.3s ease; border: 1px solid rgba(255,255,255,0.2); }
.dot.active-dot, .dot:hover { background-color: white; }

/* Layout Griglia */
.main-grid { display: grid; grid-template-columns: minmax(0, 2.5fr) minmax(0, 1fr); gap: 30px; margin-top: 30px; }
.main-column-left, .main-column-right { display: flex; flex-direction: column; gap: 30px; }
.content-block { background-color: var(--secondary-bg); padding: 20px 25px; border-radius: var(--border-radius-main); box-shadow: 0 5px 20px var(--shadow-soft); }
.block-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border-color); }
.content-block h2 { margin: 0; color: var(--dark-blue-text); font-size: 1.4em; display: flex; align-items: center; }
.content-block h2 i { margin-right: 10px; color: var(--accent-color); font-size: 0.9em; }
.view-all, .view-all-sidebar { color: var(--accent-color); text-decoration: none; font-weight: 600; font-size: 0.85em; }

/* Notizie */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 20px; }
.news-item-card { background-color: var(--secondary-bg); border-radius: var(--border-radius-small); overflow: hidden; box-shadow: 0 3px 10px rgba(0,0,0,0.06); display: flex; flex-direction: column; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.news-item-card:hover { transform: translateY(-3px); box-shadow: 0 6px 15px rgba(0,0,0,0.1); }
.news-item-card img { width: 100%; height: 170px; object-fit: cover; }
.news-item-content { padding: 15px; flex-grow: 1; display: flex; flex-direction: column; }
.news-item-content h3 { margin: 0 0 8px 0; font-size: 1.1em; color: var(--dark-blue-text); line-height: 1.4; font-weight: 700; }
.news-item-content p { font-size: 0.9em; color: var(--text-muted); margin-bottom: 12px; flex-grow: 1; }
.news-meta { font-size: 0.8em; color: #888; display: flex; justify-content: space-between; align-items: center; padding-top: 10px; border-top: 1px solid var(--border-color); }
.news-meta span i { margin-right: 4px; }
.read-more { color: var(--accent-color); text-decoration: none; font-weight: 600; font-size: 0.85em; align-self: flex-start; }

/* Manager */
.managers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.manager-card { text-align: center; padding: 15px; background-color: #FDFEFF; border-radius: var(--border-radius-small); border: 1px solid var(--border-color); transition: box-shadow 0.2s ease; }
.manager-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.manager-card img { width: 90px; height: 90px; border-radius: 50%; object-fit: cover; object-position: top; margin-bottom: 10px; border: 2px solid var(--accent-color); }
.manager-card h4 { margin: 5px 0 2px 0; font-size: 1.05em; color: var(--dark-blue-text); font-weight: 700;}
.manager-card .manager-role { font-size: 0.8em; color: var(--text-muted); margin-bottom: 6px; }
.manager-card p { font-size: 0.85em; margin: 3px 0; color: var(--text-muted); word-break: break-all; }
.manager-card p i { margin-right: 5px; color: var(--accent-color); font-size: 0.9em; }

/* Colonna Destra */
.side-block h2 { font-size: 1.25em; }
.no-items { color: var(--text-muted); font-style: italic; font-size: 0.9em; padding: 10px 0;}
#birthdays ul { list-style: none; padding: 0; margin: 0; }
#birthdays li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed #e9ecef; font-size: 0.9em; }
#birthdays li:last-child { border-bottom: none; }
.birthday-name { font-weight: 600; color: var(--dark-blue-text); max-width: 260px; }
.birthday-date { color: var(--text-muted); }

/* Eventi */
.event-group { display: flex; margin-bottom: 18px; align-items: flex-start; margin-top: 10px; }
.event-date-badge { background-color: var(--accent-color); color: white; padding: 6px 8px; border-radius: var(--border-radius-small); text-align: center; min-width: 45px; margin-right: 12px; }
.event-day-num { display: block; font-size: 1.3em; font-weight: 700; }
.event-month { display: block; font-size: 0.75em; text-transform: uppercase; }
.event-details-list { flex-grow: 1; }
.event-item-side { background-color: #F8F9FA; padding: 10px 12px; border-radius: var(--border-radius-small); margin-bottom: 8px; border-left: 3px solid var(--accent-color); }
.event-item-side:last-child { margin-bottom: 0; }
.event-item-side .event-time { font-size: 0.8em; color: var(--text-muted); display: block; margin-bottom: 2px; }
.event-item-side h4 { margin: 0 0 4px 0; font-size: 1em; color: var(--dark-blue-text); font-weight: 600; }
.event-item-side .event-location { font-size: 0.85em; color: var(--text-muted); }
.event-item-side .event-location i { margin-right: 4px; }

/* Documenti */
.block-fullwidth { grid-column: 1 / -1; margin-top: 30px; max-width: 1275px;}
.documents-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.document-card { background-color: var(--secondary-bg); border-radius: var(--border-radius-small); padding: 12px 15px; display: flex; align-items: center; gap: 15px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); text-decoration: none; color: inherit; transition: transform 0.2s ease, box-shadow 0.2s ease; border: 1px solid var(--border-color); }
.document-card:hover { transform: translateY(-2px); box-shadow: 0 5px 12px rgba(0,0,0,0.09); border-color: var(--accent-color); }
.doc-icon { font-size: 2em; width: 40px; text-align: center; flex-shrink: 0; }
.fa-file-pdf { color: #e74c3c; } .fa-file-word { color: #2980b9; } .fa-file-excel { color: #1e8449; } .fa-file-powerpoint { color: #d35400; } .fa-file-alt { color: var(--text-muted); } .fa-file-image { color: #208895; }
.doc-info { flex-grow: 1; }
.doc-info h4 { margin: 0 0 3px 0; font-size: 1em; color: var(--dark-blue-text); font-weight: 600;}
.doc-info p { font-size: 0.85em; color: var(--text-muted); margin: 0; }
.doc-meta { text-align: right; font-size: 0.8em; color: var(--text-muted); display: flex; flex-direction: column; align-items: flex-end; }
.doc-meta span { display: block; min-width: max-content; }
.doc-download-btn { background-color: var(--accent-color); color: white; padding: 4px 8px; border-radius: var(--border-radius-small); font-size: 0.75em; margin-top: 4px; display: inline-flex; align-items: center; }
.doc-download-btn i { margin-right: 4px; }
.doc-download-btn:hover { background-color: #3a7bc8; }

/* Commenti */
.comments-layout { display: grid; grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); gap: 30px; }
.comments-list .comment-item { display: flex; gap: 12px; margin-bottom: 18px; padding: 12px; background-color: #F8F9FA; border-radius: var(--border-radius-small); border: 1px solid #e9ecef; }
.comment-avatar { width: 36px; height: 36px; border-radius: 50%; background-color: var(--accent-color); color: white; display: flex; align-items: center; justify-content: center; font-weight: bold; flex-shrink: 0; font-size: 1em; }
.comment-content strong { color: var(--dark-blue-text); display: block; margin-bottom: 2px; font-weight: 600; }
.comment-content p { margin: 0 0 4px 0; font-size: 0.9em; }
.comment-content small { font-size: 0.75em; color: var(--text-muted); }
.comment-form-container h3 { margin-top:0; font-size: 1.25em; color: var(--dark-blue-text); }
.comment-form-container textarea { width: 100%; padding: 10px; border: 1px solid var(--border-color); border-radius: var(--border-radius-small); margin-bottom: 10px; font-family: inherit; box-sizing: border-box; font-size: 0.95em; }
.btn-comment { background-color: var(--accent-color); color: white; padding: 10px 18px; border: none; border-radius: var(--border-radius-small); cursor: pointer; font-weight: 600; }
.btn-comment:hover { background-color: #3a7bc8; }

/* Footer */
footer { background-color: var(--dark-blue-text); color: #bac2cd; text-align: center; padding: 20px 0; margin-top: 35px; font-size: 0.85em; }

/* Responsive */
@media (max-width: 1100px) { .main-grid { grid-template-columns: 1fr; } .main-column-right { margin-top:0; } .document-card { justify-content: space-around; } }
@media (max-width: 768px) { .header-content { flex-direction: column; gap: 8px; } .user-actions, .user-greeting { margin-top: 8px; } .slide-caption h2 { font-size: 1.6em; } .slide-caption p { font-size: 0.9em; } .news-grid { grid-template-columns: 1fr; } .managers-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); } .documents-grid { grid-template-columns: 1fr; } .comments-layout { grid-template-columns: 1fr; } .comment-form-container { margin-top: 25px; } .slider-container { height: 190px; border-radius: 0px; } #banner-slider { margin: 0px auto 10px auto; }}
@media (max-width: 480px) { .slide-caption { max-width: 85%; padding: 10px 15px; } .slide-caption h2 { font-size: 1.3em; } .slide-caption p { font-size: 0.8em; } .block-fullwidth {max-width: 300px;}  .user-actions .btn {padding: 8px 8px; font-size: 0.8em;}}

/* Flash Messages Styling (per index.html se si usa) */
.flash-container { position: fixed; top: 80px; right: 20px; z-index: 1050; width: auto; max-width: 350px; }
.flash-message { padding: 12px 18px; margin-bottom: 10px; border-radius: var(--border-radius-small); font-size: 0.9em; box-shadow: 0 3px 10px rgba(0,0,0,0.1); opacity:0; animation: flashFadeIn 0.5s forwards; }
@keyframes flashFadeIn { to { opacity: 1; } }
.flash-success { background-color: #d1e7dd; color: #0f5132; border: 1px solid #badbcc;}
.flash-danger { background-color: #f8d7da; color: #842029; border: 1px solid #f5c2c7;}
.flash-warning { background-color: #fff3cd; color: #664d03; border: 1px solid #ffecb5;}
.flash-info { background-color: #cff4fc; color: #055160; border: 1px solid #b6effb;}

/* Modal Base Styling */
.modal {
    display: none; /* Nascosta di default */
    position: fixed; /* Rimane fissa durante lo scroll */
    z-index: 1050; /* Sopra tutto il resto */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Permette lo scroll se il contenuto è troppo lungo */
    background-color: rgba(0,0,0,0.6); /* Sfondo semi-trasparente */
    padding-top: 50px; /* Spazio dall'alto */
    animation: fadeInModal 0.3s ease-out;
}

@keyframes fadeInModal {
    from {opacity: 0;}
    to {opacity: 1;}
}

.modal-content {
    background-color: #fff;
    margin: auto;
    padding: 25px 30px;
    border-radius: var(--border-radius-main);
    width: 90%;
    max-width: 750px; /* Larghezza massima della modale */
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    position: relative;
    animation: slideInModal 0.3s ease-out;
    margin-bottom: 80px;
}

@keyframes slideInModal {
    from {transform: translateY(-30px); opacity: 0;}
    to {transform: translateY(0); opacity: 1;}
}

@media (max-width: 480px) { .modal-content {max-width: 300px;} }

.modal-close-btn {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
}

.modal-close-btn:hover,
.modal-close-btn:focus {
    color: #333;
    text-decoration: none;
}

/* Stili specifici per la modale delle notizie */
.modal-news-image {
    width: 100%;
    max-height: 300px; /* Limita altezza immagine */
    object-fit: cover;
    border-radius: var(--border-radius-small);
    margin-bottom: 20px;
}

#modalNewsTitle {
    font-size: 1.8em;
    color: var(--dark-blue-text);
    margin-bottom: 10px;
    line-height: 1.3;
}

.modal-news-meta {
    font-size: 0.9em;
    color: var(--text-muted);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}
.modal-news-meta span {
    margin-right: 10px;
}
.modal-news-meta span i { /* Se usi icone nella meta */
    margin-right: 5px;
}

#modalNewsBody {
    font-size: 1em;
    line-height: 1.7;
    color: var(--text-color);
    max-height: 100%; /* Limita l'altezza del corpo per lo scroll interno */
    overflow-y: auto; /* Scroll verticale se il contenuto è lungo */
    padding-right: 10px; /* Spazio per la scrollbar */
    white-space: pre-wrap; /* Mantiene gli A CAPO del testo */
    text-align: justify;
}

.news-modal-overlay { /* o qualsiasi classe usi per il tuo #newsModal */
    display: none; /* Fondamentale: Nascosto di default */
    position: fixed; /* Overlay sull'intera pagina */
    z-index: 1050;   /* Deve essere sopra gli altri contenuti */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; 
    background-color: rgba(0,0,0,0.7); /* Sfondo scuro semi-trasparente */
    padding-top: 50px; 
}

.news-modal-content {
    background-color: #fff;
    margin: auto; 
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 700px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative; 
    animation: modalFadeIn 0.3s;
}

/* Stili per la scrollbar nella modale (opzionale, per coerenza grafica) */
#modalNewsBody::-webkit-scrollbar {
    width: 8px;
}
#modalNewsBody::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}
#modalNewsBody::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}
#modalNewsBody::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}




/* Homepage Gallery */
#homepage-gallery {
    margin-top: 30px;
}
.gallery-scroll-container {
    overflow-x: auto; /* Permette lo scroll orizzontale */
    overflow-y: hidden; /* Nasconde lo scroll verticale se non serve */
    white-space: nowrap; /* Impedisce alle immagini di andare a capo */
    padding-bottom: 15px; /* Spazio per la scrollbar senza sovrapposizioni */
    -webkit-overflow-scrolling: touch; /* Scroll più fluido su iOS */
}
.gallery-wrapper {
    display: inline-block; /* Permette al wrapper di espandersi con le immagini */
}
.gallery-image-item {
    display: inline-block; /* Allinea le immagini orizzontalmente */
    width: 220px; /* Larghezza fissa per ogni item */
    height: 160px; /* Altezza fissa */
    margin-right: 15px;
    border-radius: var(--border-radius-small);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out;
}
.gallery-image-item:hover {
    transform: scale(1.03);
}
.gallery-image-item:last-child {
    margin-right: 0;
}
.gallery-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Copre l'area mantenendo le proporzioni */
    display: block;
}
.gallery-item-caption-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0,0,0,0.6);
    color: white;
    font-size: 0.8em;
    padding: 5px 8px;
    text-align: center;
    white-space: normal; /* Permetti a capo per didascalie lunghe */
    opacity: 0;
    transition: opacity 0.3s ease;
}
.gallery-image-item:hover .gallery-item-caption-overlay {
    opacity: 1;
}

/* Lightbox (Modal per Immagine Ingrandita) */
.lightbox {
    display: none; /* Nascosto di default */
    position: fixed;
    z-index: 1001;
    padding-top: 60px; /* Spazio dall'alto */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    text-align: center; /* Per centrare l'immagine se più piccola */
}
.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 85vh; /* Limita altezza massima */
    animation-name: lightboxZoom;
    animation-duration: 0.5s;
}
@keyframes lightboxZoom {
    from {transform:scale(0.8)}
    to {transform:scale(1)}
}
.lightbox-caption {
    margin: 15px auto;
    display: block;
    width: 80%;
    max-width: 700px;
    text-align: center;
    color: #ccc;
    padding: 10px 0;
    font-size: 1.1em;
}
.lightbox-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}
.lightbox-close:hover, .lightbox-close:focus {
    color: #bbb;
    text-decoration: none;
}
/* Controlli Prev/Next per Lightbox */
.lightbox-prev, .lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px; /* Per centrare verticalmente rispetto all'immagine */
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.6s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    -webkit-user-select: none;
    background-color: rgba(0,0,0,0.3);
}
.lightbox-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}
.lightbox-prev {
    left: 0;
}
.lightbox-prev:hover, .lightbox-next:hover {
    background-color: rgba(0,0,0,0.6);
}

.btn-primary-outline {
    display: inline-block;
    font-weight: 600;
    color: var(--accent-color); /* O il tuo colore primario */
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    background-color: transparent;
    border: 1px solid var(--accent-color); /* O il tuo colore primario */
    padding: .375rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: var(--border-radius-small);
    transition: color .15s ease-in-out,background-color .15s ease-in-out,border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}
.btn-primary-outline:hover {
    color: #fff;
    background-color: var(--accent-color); /* O il tuo colore primario */
    border-color: var(--accent-color); /* O il tuo colore primario */
}
.btn-primary-outline i {
    margin-right: 6px;
}