/* =============================================================
   EVT – Styles cartes événements CFDT
   À coller dans : Divi > Theme Customizer > Custom CSS
   ou dans le champ CSS additionnel de votre plugin.
   ============================================================= */

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --evt-orange: #e8690a;
  --evt-orange-dark: #c4580a;
  --evt-text: #1a1a1a;
  --evt-muted: #555;
  --evt-border: #e8e8e8;
  --evt-radius: 6px;
  --evt-shadow: 0 2px 14px rgba(0, 0, 0, 0.08);
  --evt-shadow-hover: 0 8px 28px rgba(0, 0, 0, 0.15);
}

/* ── Titre de section ───────────────────────────────────────── */
.evt-section-titre {
  text-align: center;
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 800;
  color: var(--evt-orange) !important;
  margin: 0 0 44px;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

/* ── Filtres catégories ─────────────────────────────────────── */
.evt-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 16px;
}

.evt-filter-btn {
  appearance: none;
  border: 1px solid var(--evt-border);
  background: #fff;
  color: var(--evt-text);
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.evt-filter-btn:hover,
.evt-filter-btn.is-active {
  border-color: var(--evt-orange);
  background: var(--evt-orange);
  color: #fff;
}

/* ── Grilles ────────────────────────────────────────────────── */
.evt-grille {
  display: grid;
  gap: 28px;
}
.evt-grille--3 {
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.evt-grille--2 {
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
}

/* ── Carte ──────────────────────────────────────────────────── */
.evt-carte {
  background: #fff;
  border: 1px solid var(--evt-border);
  border-radius: var(--evt-radius);
  box-shadow: var(--evt-shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease;
}
.evt-carte:hover {
  transform: translateY(-4px);
  box-shadow: var(--evt-shadow-hover);
}

/* ── Zone image ─────────────────────────────────────────────── */
.evt-media {
  position: relative;
  overflow: hidden;
  background: #e8e8e8;
  flex-shrink: 0;
}
.evt-media img.evt-img {
  width: 100%;
  height: 185px;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
.evt-carte:hover .evt-media img.evt-img {
  transform: scale(1.04);
}
.evt-media--no-img {
  height: 52px;
  background: var(--evt-orange);
}

/* Badge catégorie */
.evt-categorie {
  position: absolute;
  top: 13px;
  left: 13px;
  z-index: 3;
  background: var(--evt-orange);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  padding: 4px 11px;
  border-radius: 3px;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}
.evt-media--no-img .evt-categorie {
  top: 50%;
  transform: translateY(-50%);
  position: absolute;
}

/* ── Corps ──────────────────────────────────────────────────── */
.evt-body {
  padding: 18px 20px 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Lieu */
.evt-lieu {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  color: var(--evt-orange) !important;
  font-size: 12.5px !important;
  font-weight: 600 !important;
  margin: 0 0 9px !important;
  line-height: 1.4 !important;
}
.evt-lieu svg {
  flex-shrink: 0;
  margin-top: 1px;
}

/* Titre */
.evt-titre {
  font-size: 17px !important;
  font-weight: 800 !important;
  line-height: 1.3 !important;
  margin: 0 0 10px !important;
  color: var(--evt-text) !important;
}
.evt-titre a {
  color: inherit !important;
  text-decoration: none !important;
  transition: color 0.15s;
}
.evt-titre a:hover {
  color: var(--evt-orange) !important;
}

/* Contenu / excerpt */
.evt-contenu,
.evt-contenu p {
  font-size: 13.5px !important;
  color: var(--evt-muted) !important;
  line-height: 1.6 !important;
  margin: 0 0 12px !important;
}
.evt-contenu {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}
/* grille-2 : pas de clamp, on affiche le contenu complet */
.evt-grille--2 .evt-contenu {
  -webkit-line-clamp: unset;
  display: block;
}

/* ── Meta (date / heure) ────────────────────────────────────── */
.evt-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: auto 0 0;
  padding: 10px 0 0;
}
.evt-dates {
  font-size: 13px;
  font-weight: 700;
  color: var(--evt-text);
}
.evt-heures {
  font-size: 12.5px;
  color: var(--evt-muted);
}

.evt-time-icon {
  display: inline-block;
  margin-right: 6px;
  color: var(--evt-orange);
  font-family: 'Font Awesome 5 Free', 'FontAwesome';
  font-weight: 900;
  font-size: 20px;
  line-height: 1;
  vertical-align: -1px;
}

.et_pb_text .et_pb_text_inner .evt-time-icon,
.evt-heures .evt-time-icon {
  display: inline-block !important;
  margin-right: 6px !important;
  font-family: 'Font Awesome 5 Free', 'FontAwesome' !important;
  font-weight: 900 !important;
  font-size: 20px !important;
  line-height: 1 !important;
  color: var(--evt-orange) !important;
}

/* ── Actions ────────────────────────────────────────────────── */
.evt-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 0 18px;
  margin-top: 12px;
  border-top: 1px solid var(--evt-border);
}

/* Bouton principal */
.evt-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px !important;
  font-weight: 800 !important;
  letter-spacing: 0.06em !important;
  text-transform: uppercase !important;
  padding: 9px 16px !important;
  border-radius: var(--evt-radius) !important;
  text-decoration: none !important;
  border: none !important;
  cursor: pointer;
  transition:
    background 0.15s ease,
    transform 0.1s ease;
  line-height: 1 !important;
  white-space: nowrap;
}
.evt-btn:active {
  transform: scale(0.97);
}

.evt-btn--info {
  background: var(--evt-orange) !important;
  color: #fff !important;
}
.evt-btn--info:hover {
  background: var(--evt-orange-dark) !important;
  color: #fff !important;
}
/* Icône flèche après le texte */
.evt-btn--info::after {
  content: '→';
  font-weight: 400;
  font-size: 13px;
  line-height: 1;
}

.evt-btn--inscription {
  background: transparent !important;
  color: var(--evt-orange) !important;
  border: 1.5px solid var(--evt-orange) !important;
}
.evt-btn--inscription:hover {
  background: var(--evt-orange) !important;
  color: #fff !important;
}

/* ── Message vide ───────────────────────────────────────────── */
.evt-vide {
  text-align: center;
  color: var(--evt-muted);
  font-style: italic;
  padding: 50px 0;
  font-size: 15px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 700px) {
  .evt-grille--3,
  .evt-grille--2 {
    grid-template-columns: 1fr;
  }
  .evt-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .evt-btn {
    justify-content: center;
    width: 100%;
  }
}

/* ── Couleurs badge par slug de catégorie ───────────────────── */
/* Ajoutez vos propres slugs ici */
/* .evt-carte[data-cat="formation"]        .evt-categorie { background: #1d6fe8; } */
/* .evt-carte[data-cat="assemblee"]        .evt-categorie { background: #16a34a; } */
/* .evt-carte[data-cat="conseil-syndical"] .evt-categorie { background: #7c3aed; } */

/* ── Intégration Divi 5 – neutralisation des surcharges ─────── */
/* Évite que Divi écrase les styles des cartes dans le Loop Builder */
.et_pb_section .evt-carte *,
.et_pb_row .evt-carte * {
  box-sizing: border-box;
}
.et_pb_section .evt-grille,
.et_pb_row .evt-grille {
  max-width: 100%;
}

/* ── Single evenement : containment PDF viewer ─────────────── */
body.single-evenement .et_pb_text .wp-block-file,
body.single-evenement .et_pb_text .fluid-width-video-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden;
  box-sizing: border-box;
}

body.single-evenement .et_pb_text .fluid-width-video-wrapper {
  height: auto !important;
  padding-top: 0 !important;
}

body.single-evenement .et_pb_text .fluid-width-video-wrapper .wp-block-file__embed,
body.single-evenement .et_pb_text .wp-block-file .wp-block-file__embed,
body.single-evenement .et_pb_text .wp-block-file object {
  position: static !important;
  display: block;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

/* Fallback global single evenement: certains templates Divi n'encapsulent
   pas le contenu dans .et_pb_text, on force donc aussi au niveau global. */
body.single-evenement .wp-block-file,
body.single-evenement .wp-block-file .fluid-width-video-wrapper {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

body.single-evenement .wp-block-file .fluid-width-video-wrapper {
  position: relative !important;
  height: auto !important;
  min-height: 600px;
  padding-top: 0 !important;
  overflow: visible !important;
}

body.single-evenement .wp-block-file .fluid-width-video-wrapper > object.wp-block-file__embed,
body.single-evenement .wp-block-file .fluid-width-video-wrapper > object,
body.single-evenement .wp-block-file .fluid-width-video-wrapper > embed,
body.single-evenement .wp-block-file .fluid-width-video-wrapper > iframe {
  position: static !important;
  top: auto !important;
  left: auto !important;
  width: 100% !important;
  height: 600px !important;
  display: block !important;
}
