/* css/style-index.css */

/* --- Stili per Hero Slider Professionale --- */
.hero-slider-wrapper {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 450px;
    max-height: 600px;
    overflow: hidden;
}
.hero-slider-container {
    width: 100%;
    height: 100%;
    position: relative;
}
.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    opacity: 0;
    transition: opacity 1s ease-in-out;
    z-index: 1;
}
.hero-slide.active {
    opacity: 1;
    z-index: 2;
}
.hero-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}
.hero-content {
    position: relative;
    color: #ffffff;
    max-width: 800px;
    padding: 20px;
}
.hero-content h1 {
    font-size: 48px;
    font-weight: bold;
    margin: 0 0 15px 0;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}
.hero-content p {
    font-size: 18px;
    line-height: 1.6;
    margin-bottom: 30px;
}
.hero-button {
    background-color: #d12727;
    color: white;
    padding: 12px 25px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: background-color 0.2s, transform 0.2s;
    display: inline-block;
}
.hero-button:hover {
    background-color: #a71f1f;
    transform: scale(1.05);
}
.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    font-size: 28px;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    transition: background-color 0.2s;
}
.slider-arrow:hover {
    background-color: rgba(0, 0, 0, 0.7);
}
.slider-arrow.prev { left: 20px; }
.slider-arrow.next { right: 20px; }

@media (max-width: 767px) {
    .hero-slider-wrapper {
        height: 80vh;
        min-height: 400px;
    }
    .hero-content h1 { font-size: 32px; }
    .hero-content p { font-size: 16px; }
    .slider-arrow {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
}

/* --- Stile Professionale per "Ultimi Aggiornamenti" --- */
.content-section {
    padding-top: 60px;
    padding-bottom: 60px;
}
.page-title {
    font-size: 32px;
    margin-bottom: 40px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
    color: #333;
}
.article-grid {
    display: grid;
    gap: 30px;
    grid-template-columns: 1fr;
}
.article-card {
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.article-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}
.card-image {
    overflow: hidden;
    height: 200px;
}
.article-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.article-card:hover img {
    transform: scale(1.05);
}
.card-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.card-date {
    font-size: 13px;
    color: #6c757d;
    margin-bottom: 10px;
}
.card-content h2 {
    font-size: 18px;
    margin: 0 0 15px 0;
    color: #004080;
    line-height: 1.4;
    flex-grow: 1;
}
.card-category {
    font-size: 12px;
    font-weight: bold;
    color: #d12727;
    background-color: #fce8e8;
    padding: 5px 12px;
    border-radius: 20px;
    align-self: flex-start;
    margin-top: 15px;
}

@media (min-width: 768px) {
    .article-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (min-width: 1024px) {
    .article-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* --- Stili per Sezioni Aggiuntive (Eventi & Servizi) --- */
.home-section {
    margin-top: 60px;
}
.full-width-bg {
    /* Grigio leggermente più scuro per un contrasto migliore */
    background-color: #e9ecef;
    padding: 60px 0;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 15px;
    margin-bottom: 30px;
}
.section-header h2 {
    font-size: 28px;
    margin: 0;
    color: #333;
}
.section-link {
    text-decoration: none;
    color: #0056b3;
    font-weight: bold;
}
.section-button {
    text-decoration: none;
    background-color: transparent;
    border: 2px solid #0056b3;
    color: #0056b3;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
    transition: all 0.2s;
}
.section-button:hover {
    background-color: #0056b3;
    color: white;
}
.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.event-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.event-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}
.event-content {
    padding: 20px;
    flex-grow: 1;
}
.event-date {
    font-size: 12px;
    font-weight: bold;
    color: #6c757d;
    margin-bottom: 10px;
    display: block;
}
.event-content h3 {
    font-size: 18px;
    margin: 0 0 10px 0;
    color: #004080;
}
.event-location {
    font-size: 14px;
    color: #495057;
}
.event-category {
    font-size: 12px;
    font-weight: bold;
    color: #d12727;
    text-transform: uppercase;
    border-top: 1px solid #f0f0f0;
    padding: 15px 20px;
}
.services-slider-wrapper {
    position: relative;
}
.services-slider {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
    padding-bottom: 20px;
    scroll-behavior: smooth;
}
.services-slider::-webkit-scrollbar {
    display: none;
}
.service-card {
    flex: 0 0 280px;
    scroll-snap-align: start;
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.service-card h3 {
    font-size: 20px;
    margin: 0 0 10px 0;
    color: #004080;
}
.service-card p {
    font-size: 15px;
    line-height: 1.6;
    color: #495057;
    flex-grow: 1;
}
.service-tags {
    margin-top: 20px;
    border-top: 1px solid #f0f0f0;
    padding-top: 15px;
}
.service-tags span {
    font-size: 12px;
    padding: 5px 10px;
    border-radius: 15px;
    font-weight: bold;
    margin-right: 5px;
}
.tag-cittadini { background-color: #e6f0ff; color: #0056b3; }
.tag-imprese { background-color: #fff0e6; color: #b35900; }

.service-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: white;
    border: 1px solid #dee2e6;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
}
.service-arrow.prev { left: -20px; }
.service-arrow.next { right: -20px; }

@media(max-width: 767px) {
    .service-arrow.prev { left: 5px; }
    .service-arrow.next { right: 5px; }
}
/* css/style-index.css (Completo) */

/* --- Stili per Hero Slider Professionale --- */
.hero-slider-wrapper {
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 450px;
    max-height: 600px;
    overflow: hidden;
}
/* ... (tutti gli altri stili dello slider e della pagina rimangono qui) ... */


/* =================================================================== */
/* --- NUOVI STILI PER VIDEO RESPONSIVE (EFFETTO COVER) --- */
/* =================================================================== */

.media-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #000; /* Sfondo nero di fallback */
}

.media-wrapper iframe {
    /* Posizionamento per l'effetto cover */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    /* Calcoli per forzare il video a riempire lo spazio mantenendo le proporzioni */
    min-width: 100%;
    min-height: 100%;
    width: 177.77vh; /* 100vh * 16/9 (proporzione video) */
    height: 56.25vw; /* 100vw * 9/16 (proporzione video) */
}

/* Applica il contenitore media all'interno della card-image */
.card-image {
    position: relative; /* Necessario per il posizionamento assoluto del video */
    height: 200px;
}

/* Posiziona lo sfondo video dietro al testo nello slider */
.hero-slide .media-wrapper {
    z-index: -1;
}

/* Rimuovi l'interazione con il video quando è uno sfondo */
.hero-slide .media-wrapper iframe {
    pointer-events: none;
}


/* --- Stili Sezione Newsletter --- */
.newsletter-section { text-align: center; }
.newsletter-section h2 { font-size: 28px; color: #333; margin-bottom: 10px; }
.newsletter-section p { max-width: 600px; margin: 0 auto 30px auto; color: #6c757d; }
#newsletter-form { max-width: 500px; margin: 0 auto; }
#newsletter-form input[type="email"] { width: 100%; padding: 12px 15px; border-radius: 5px; border: 1px solid #ced4da; margin-bottom: 15px; box-sizing: border-box; }
#newsletter-form button { width: 100%; padding: 12px; background-color: #d12727; color: white; border: none; border-radius: 5px; font-weight: bold; cursor: pointer; transition: background-color 0.2s; }
#newsletter-form button:hover { background-color: #a71f1f; }
.consent-wrapper { text-align: left; margin-top: 15px; font-size: 12px; color: #495057; }
.consent-item { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.consent-item input { margin-top: 2px; }
.newsletter-message { margin-top: 15px; font-weight: bold; padding: 10px; border-radius: 5px; display: none; }
.newsletter-message.success { background-color: #d4edda; color: #155724; }
.newsletter-message.error { background-color: #f8d7da; color: #721c24; }
/* --- STILI AGGIUNTIVI PER SEZIONE EVENTI IN HOMEPAGE --- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end; /* Allinea in basso per un look migliore */
    flex-wrap: wrap;
    gap: 15px;
}
.section-subtitle {
    margin: 5px 0 0 0;
    font-size: 16px;
    color: #6c757d;
    max-width: 600px;
}
.event-card {
    border: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}
.event-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}
.event-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.event-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Fa in modo che il contenuto riempia lo spazio */
}
.event-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto; /* Spinge le statistiche in fondo alla card */
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
}
.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: bold;
    line-height: 1;
}
.stat-item svg { width: 14px; height: 14px; }
.stat-item.occupied { background-color: #ffe8e8; color: #b32424; }
.stat-item.vacant { background-color: #e3f2e3; color: #1d6a1d; }
.stat-item.maybe { background-color: #fff8e1; color: #b18502; }
/* --- Stili per le reazioni sulla card delle news --- */
.card-ratings {
    display: flex;
    gap: 15px;
    margin-top: auto; /* Spinge le reazioni in fondo alla card */
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    font-size: 14px;
    color: #6c757d;
    font-weight: bold;
}
/* Rimuovi o sostituisci il vecchio stile .card-ratings se presente */
.card-ratings {
    display: none; /* Nascondiamo il vecchio stile */
}

/* NUOVI stili per le statistiche sulla card */
.card-stats {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: auto; /* Spinge le statistiche in fondo alla card */
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
}

.card-stats .stat-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.card-stats .stat-item svg {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}