/* ═══════════════════════════════════════════════════════
   EVENTS.CSS — chargé uniquement sur les pages d'accueil régionales
   Section "Événements" : cartes générées par js/events-renderer.js
   ═══════════════════════════════════════════════════════ */

.events-section {
  position: relative;
  padding: 40px 32px;
  margin: 40px;
  border-radius: 16px;
  overflow: hidden;
  background: #6b5a42;
}

.events-section .titre h2 {
  position: relative;
  z-index: 1;
  font-family: "Poppins", sans-serif;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #ffffff;
}

.events-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

/* ── Carte : même logique que .vaud / .valais / etc. ── */

.event-card {
  border-radius: 14px;
  flex: 0 0 calc((100% - 28px) / 3);
  min-width: 160px;
  height: 220px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  display: block;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.event-card:hover,
.event-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}

/* Image de fond lue depuis la variable --event-bg définie par le script */
.event-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(
    --event-bg,
    linear-gradient(135deg, #8a7a5f 0%, #6b5a42 100%)
  );
  background-size: cover;
  background-position: center;
  filter: blur(0px);
  transition: filter 0.5s ease;
  z-index: 0;
}

.event-card:hover::before {
  filter: blur(6px);
}

/* ── Titre : centré par défaut, monte au hover ── */

.event-card > p {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(-50%);
  top: 50%;
  width: max-content;
  max-width: calc(100% - 24px);
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  color: #ffffff;
  margin: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.5);
  padding: 4px 14px;
  border-radius: 6px;
  transition:
    top 0.35s ease 0.25s,
    transform 0.35s ease 0.25s;
}

.event-card:hover > p {
  top: 16px;
  transform: translateX(-50%) translateY(0);
  transition:
    top 0.35s ease 0s,
    transform 0.35s ease 0s;
}

/* ── Contenu : invisible → visible après le titre ── */

.event-card .card-content {
  position: absolute;
  top: 56px;
  left: 18px;
  right: 18px;
  opacity: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1;
  transition: opacity 0.2s ease 0s;
}

.event-card:hover .card-content {
  opacity: 1;
  transition: opacity 0.3s ease 0.35s;
}

/* ── Badge date ── */

.event-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: fit-content;
  padding: 8px 14px;
  background: rgba(218, 170, 103, 0.9);
  border-radius: 10px;
  text-align: center;
  margin-bottom: 4px;
}

.event-date .day {
  font-size: 22px;
  font-weight: bold;
  color: #ffffff;
  line-height: 1;
}

.event-date .month {
  font-size: 13px;
  color: #ffffff;
  margin-top: 3px;
}

/* ── Textes dans card-content ── */

.event-card .card-content span {
  font-size: 15px;
  color: #ffffff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.event-location {
  color: #e2c396 !important;
}

@media (max-width: 700px) {
  .events-section {
    margin: 20px;
    padding: 28px 20px;
  }

  .events-wrapper {
    flex-direction: column;
  }

  .event-card {
    flex: 1 1 100%;
    min-width: 100%;
  }
}
