
:root {
  --primary: #bdbb31;
  --primary-dark: #000000;
  --white: #efe9b8;
  --text-dark: #333;
  --text-light: #f5f5f5;
  --accent: #ff9800;
  --success: #4caf50;
  --bg-light: #f9f9f9;
}
.hero-carousel {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  max-height: 90vh;
  overflow: hidden;
}


.carousel-wrapper {
  height: 100%;
  width: 100%;
  position: absolute;
}

.carousel-img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease;
  filter: brightness(0.6); 
}

.carousel-img.active {
  opacity: 1;
}

.carousel-overlay {
  position: absolute;
  z-index: 10;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: white;
  text-shadow: 1px 1px 5px rgba(0,0,0,0.6);
}

.carousel-overlay h1 {
  font-size: 3rem;
}

.carousel-overlay p {
  font-size: 1.4rem;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.events-container {
  padding: 2rem 0;
}

.filters {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.search-box {
  position: relative;
  flex-grow: 1;
  max-width: 400px;
}

.search-box input {
  width: 100%;
  padding: 0.8rem 1rem 0.8rem 3rem;
  border: 2px solid #ddd;
  border-radius: 50px;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #777;
}

.filter-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--white);
  border: 2px solid var(--primary);
  color: var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
}

.filter-btn.active {
  background: var(--primary);
  color: var(--white);
}

/* Reset e palette principali */


/* Contenitore grid */
.events-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* griglia flessibile */
  gap: 2rem;
  margin-top: 2rem;
}

.event-header {
  background: linear-gradient(135deg, var(--primary), #a1a12a);
 
  padding: 20px;
  text-align: center;
  position: relative;
}

/* Card evento */
.event-card {
  background-color: rgba(249, 251, 251, 0.881);
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}
.event-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.20);
}

/* Immagine evento */
.event-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

/* Titolo e contenuto */
.event-body {
  padding: 20px;
  text-align: center;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.event-card h3 {
  font-size: 1.4rem;
  margin-bottom: 6px;
  color: var(--primary-dark);

}

.event-description {
  font-size: 0.95rem;
  margin-bottom: 1rem;
  color: var(--text-dark);
  line-height: 1.6;
  max-height: none;
  overflow: visible;
}
.event-date-large {
  font-size: 2rem;
  font-weight: bold;
  margin-bottom: 8px;
}
.event-date-large .month {
  font-size: 1rem;
  text-transform: uppercase;
  margin-left: 5px;
}


.event-body {
  padding: 20px;
  text-align: center;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.event-date {
  font-size: 0.9rem;
  font-weight: bold;
  color: #00000091;
  margin-bottom: 10px;
}
.event-title {
  font-size: 1.3rem;
  margin-bottom: 5px;
}
.event-time {
  font-size: 0.9rem;
  opacity: 0.9;
}

.event-badges {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.event-badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: bold;
}

.badge-public {
  background-color: rgba(76, 175, 80, 0.15);
  color: var(--success);
}

.badge-private {
  background-color: rgba(255, 82, 82, 0.15);
  color: #c0392b;
}

.badge-recurring {
  background-color: rgba(155, 89, 182, 0.15);
  color: #8e44ad;
}
.event-location {
  font-size: 0.85rem;
  color: #777;
}
.event-footer {
  padding: 16px;
  border-top: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.event-action {
  font-size: 0.85rem;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.event-action:hover {
  color: var(--primary-dark);
}

/* Responsive */


.loading {
  text-align: center;
  padding: 3rem 0;
  font-size: 1.2rem;
  color: #777;
}

.modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: #fff;
  z-index: 1000;
  padding: 2rem;
  justify-content: center;
  align-items: center;
  overflow-y: auto;
}

.modal-content {
  background: #fff;
  color: #222;
  border-radius: 20px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.3);
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
  border: 4px solid var(--primary);
  animation: modalFadeIn 0.35s ease;
}

.modal-header {
  padding: 2rem;
  background: linear-gradient(135deg, white, white);
  color: black;
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
}

.modal-title {
  color: black;
  font-size: 2.2rem;
  font-weight: 700;
}

.modal-body {
  padding: 2rem;
  font-size: 1rem;
  color: black;
  line-height: 1.7;
}

.modal-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  background: rgba(0, 0, 0, 0.3);
  color: var(--white);
  border: none;
  font-size: 1.3rem;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 768px) {
  .hero {
    height: 100vh; /* oppure 100vh per fullscreen */
    background-size: cover;
    background-position: center;
  }
   .hero-content {
    padding-top: 50vh; /* spinge il testo in basso, opzionale */
  }
  .filters {
    flex-direction: column;
    align-items: stretch;
  }
.hero img {
    width: 100%;
    height: auto;
    object-fit: cover; /* opzionale */
  }
  .events-grid {
    grid-template-columns: 1fr;
  }

  .modal-content {
    max-height: 95vh;
  }
  
    .events-grid {
      flex-direction: column;
      align-items: center;
    }
  
    .event-card {
      width: 90%;
    }
  .carousel-overlay h1 {
    font-size: 2rem;
  }

  .carousel-overlay p {
    font-size: 1rem;
  }
}

@media screen and (max-width: 768px) {
  .hero {
    min-height: 80vh; /* o anche 100vh se vuoi usare tutto lo schermo */
    padding-top: 2rem;
    padding-bottom: 2rem;
  }
}