/* css/style-articolo-evento.css (Versione Finale Completa e Corretta) */

body {
    background-color: #f4f6f9;
}

/* --- Layout a due colonne --- */
.page-wrapper { display: flex; gap: 40px; padding: 40px 0; align-items: flex-start; }
.article-main-content { flex: 3; min-width: 0; }
.article-sidebar { flex: 1; position: sticky; top: 20px; }

/* --- Stile dell'articolo principale --- */
.event-post { background: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 5px 25px rgba(0,0,0,0.07); }
.event-header { position: relative; padding-bottom: 15px; }
.event-header h1 { font-size: 38px; margin: 0 0 15px 0; color: #004080; line-height: 1.3; }
.event-meta { display: flex; flex-wrap: wrap; gap: 20px; font-size: 14px; color: #6c757d; border-bottom: 1px solid #eee; padding-bottom: 15px; margin-bottom: 30px; }
.featured-media { margin-bottom: 30px; }
.featured-media img, .featured-media iframe { max-width: 100%; height: auto; border-radius: 8px; display: block; }
.event-content { font-size: 17px; line-height: 1.8; color: #333; }

/* --- Stili Badge Disponibilità Posti (CORRETTO) --- */
.event-availability { padding: 8px 15px; border-radius: 20px; font-size: 14px; font-weight: bold; color: #fff; box-shadow: 0 2px 5px rgba(0,0,0,0.15); margin-top: 15px; text-align: center; }
.event-availability.status-open { background-color: #28a745; }
.event-availability.status-limited { background-color: #ffc107; color: #212529; }
.event-availability.status-full { background-color: #dc3545; }

/* --- Stili per Azioni e Commenti --- */
.article-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 40px 0; padding: 20px 0; border-top: 1px solid #e9ecef; border-bottom: 1px solid #e9ecef; }
.action-btn { flex: 1 1 auto; padding: 10px 15px; border-radius: 50px; border: 1px solid #dee2e6; background-color: #f8f9fa; font-weight: 600; color: #495057; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: all 0.2s; font-size: 14px; text-decoration: none; }
.action-btn:hover { background-color: #e9ecef; border-color: #adb5bd; }
.action-btn:disabled { cursor: not-allowed; opacity: 0.7; }

/* Sezione RSVP (Bottoni Parteciperò, Forse, etc.) */
.interaction-wrapper { margin-top: 40px; padding-top: 30px; border-top: 1px solid #eee; }
.rsvp-buttons { display: flex; justify-content: center; align-items: center; gap: 15px; margin-bottom: 15px; flex-wrap: wrap; }
.rsvp-btn { background: #f8f9fa; border: 1px solid #dee2e6; color: #495057; border-radius: 25px; padding: 10px 20px; font-size: 15px; font-weight: bold; cursor: pointer; transition: all 0.2s ease; }
.rsvp-btn:hover:not(.active) { background-color: #e9ecef; transform: translateY(-2px); }
.rsvp-btn.active { background-color: #0056b3; color: white; border-color: #0056b3; }
.rsvp-counts { display: flex; justify-content: center; gap: 25px; font-size: 14px; color: #6c757d; }
.event-status-notice { padding: 15px 20px; border-radius: 8px; font-weight: bold; text-align: center; margin: 40px 0 20px 0; border: 1px solid transparent; }
.status-terminated { background-color: #e9ecef; color: #495057; border-color: #dee2e6; }
.status-closed { background-color: #f8d7da; color: #721c24; border-color: #f5c6cb; }

/* Sezione Commenti */
.comments-section { margin-top: 40px; padding-top: 20px; }
.comments-section h2 { font-size: 24px; color: #004080; margin-bottom: 25px; }
#comments-list { margin-bottom: 40px; }
.comment-item { display: flex; gap: 15px; padding: 20px; border-radius: 8px; background-color: #f8f9fa; margin-bottom: 15px; }
.comment-avatar { width: 40px; height: 40px; border-radius: 50%; background-color: #dee2e6; color: #495057; display: flex; align-items: center; justify-content: center; font-weight: bold; font-size: 18px; flex-shrink: 0; }
.comment-header { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.comment-content .author { font-weight: bold; color: #212529; }
.comment-content .date { font-size: 12px; color: #6c757d; }
.comment-content .text { line-height: 1.7; color: #343a40; word-break: break-word; }

/* Form Commenti */
#comment-form { padding-top: 30px; border-top: 1px solid #e9ecef; }
#comment-form h3 { font-size: 20px; color: #333; margin-bottom: 20px; }
#comment-form p { font-size: 14px; padding: 10px; background-color: #e3f2fd; border-radius: 5px; color: #0c5460; }
#comment-form .form-group { margin-bottom: 15px; }
#comment-form label { display: block; font-weight: bold; margin-bottom: 5px; font-size: 14px; }
#comment-form input, #comment-form textarea { width: 100%; padding: 12px; border-radius: 5px; border: 1px solid #ced4da; box-sizing: border-box; font-size: 16px; font-family: inherit; }
#comment-form textarea { min-height: 120px; resize: vertical; }
#comment-message { margin-top: 15px; font-weight: bold; padding: 10px; border-radius: 5px; }

/* Galleria Media */
.media-gallery { margin-top: 40px; padding-top: 30px; border-top: 1px solid #eee; }
.media-gallery h2 { font-size: 24px; color: #004080; margin-bottom: 20px; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 15px; }
.gallery-item img { width: 100%; height: 120px; object-fit: cover; border-radius: 5px; display: block; transition: opacity 0.2s; }
.gallery-item a:hover img { opacity: 0.8; }

/* --- Stili Pop-up Iscrizione --- */
.popup-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6); display: flex; justify-content: center;
    align-items: center; z-index: 1000; padding: 20px; box-sizing: border-box;
    opacity: 0; visibility: hidden; transition: opacity 0.3s, visibility 0.3s;
}
.popup-overlay.visible { opacity: 1; visibility: visible; }
.popup-content {
    background: #fff; padding: 30px; border-radius: 8px; max-width: 500px;
    width: 100%; position: relative; transform: scale(0.95); transition: transform 0.3s;
}
.popup-overlay.visible .popup-content { transform: scale(1); }
.popup-content h2 { margin-top: 0; text-align: center; color: #004080; }
.close-popup-btn { position: absolute; top: 10px; right: 15px; font-size: 28px; font-weight: bold; color: #6c757d; cursor: pointer; border: none; background: none; }
.registration-info { text-align: center; margin-bottom: 25px; font-weight: bold; font-size: 16px; padding: 10px; border-radius: 5px; }
.info-full { color: #721c24; background-color: #f8d7da; }
.info-registered { color: #0c5460; background-color: #d1ecf1; }
.info-limited { color: #856404; background-color: #fff3cd; }
#event-registration-form .form-group { margin-bottom: 15px; }
#event-registration-form label { font-weight: bold; font-size: 14px; }
#event-registration-form input { padding: 10px 12px; }
.consent-item { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.consent-item input { width: 1.15em; height: 1.15em; }
.btn-submit { width: 100%; padding: 12px; background-color: #28a745; color: white; border: none; border-radius: 5px; font-size: 16px; font-weight: bold; }
.registration-message { margin-top: 15px; padding: 12px; border-radius: 5px; font-weight: bold; text-align: center; }

/* Stile Professionale Sidebar */
.sidebar-widget { background: #fff; padding: 25px; border-radius: 8px; box-shadow: 0 5px 25px rgba(0,0,0,0.07); }
.sidebar-widget h3 { font-size: 20px; margin: 0 0 20px 0; padding-bottom: 15px; border-bottom: 1px solid #eee; color: #004080; }
.recent-news-list { list-style: none; padding: 0; margin: 0; }
.recent-news-list li { margin-bottom: 20px; }
.recent-news-list li:last-child { margin-bottom: 0; }
.recent-news-list .post-link { display: flex; gap: 15px; text-decoration: none; color: #333; }
.recent-news-list .post-thumbnail { width: 80px; height: 80px; object-fit: cover; border-radius: 8px; flex-shrink: 0; }
.post-info { display: flex; flex-direction: column; justify-content: center; }
.post-info .post-title { font-size: 15px; line-height: 1.4; font-weight: normal; margin-bottom: 10px; color: #343a40; }
.post-stats { display: flex; align-items: center; gap: 15px; font-size: 13px; color: #6c757d; }
.post-stats .stat-item { display: flex; align-items: center; gap: 5px; }
.post-stats svg { width: 16px; height: 16px; opacity: 0.7; }

/* Responsive */
@media (max-width: 992px) {
    .page-wrapper { flex-direction: column; }
    .article-sidebar { position: static; width: 100%; margin-top: 40px; }
}
@media (max-width: 767px) {
    .event-header h1 { font-size: 28px; }
    .event-post { padding: 20px; }
}
/* --- Stili per i campi del form nel popup di iscrizione --- */
#event-registration-form .form-group input[type="text"],
#event-registration-form .form-group input[type="email"],
#event-registration-form .form-group input[type="tel"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    font-size: 16px;
    box-sizing: border-box;
    transition: box-shadow 0.2s, border-color 0.2s;
    font-family: inherit;
}

#event-registration-form .form-group input[type="text"]:focus,
#event-registration-form .form-group input[type="email"]:focus,
#event-registration-form .form-group input[type="tel"]:focus {
    outline: none;
    border-color: #0056b3;
    box-shadow: 0 0 0 0.2rem rgba(0, 86, 179, .25);
}