/**
 * Événements Sport — design system "dossard".
 * Palette éditoriale inspirée des terres et du littoral tunisien,
 * signature: badge "dossard de course" perforé sur chaque épreuve.
 */

@import url('https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@600;700;800&family=Work+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@600;700&display=swap');

.ev-page {
  --ev-ink: #14181c;
  --ev-ink-soft: #2b3138;
  --ev-clay: #c24914;
  --ev-clay-dark: #9b380d;
  --ev-teal: #1f6f6b;
  --ev-teal-dark: #164f4c;
  --ev-sand: #f2e9d8;
  --ev-sand-2: #e9dcc0;
  --ev-stone: #6b675f;
  --ev-white: #ffffff;
  --ev-line: rgba(20, 24, 28, 0.12);
  --ev-radius: 14px;
  --ev-shadow: 0 12px 30px -14px rgba(20, 24, 28, 0.35);
  --ev-font-display: 'Big Shoulders Display', 'Arial Narrow', sans-serif;
  --ev-font-body: 'Work Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --ev-font-mono: 'JetBrains Mono', ui-monospace, monospace;

  font-family: var(--ev-font-body);
  color: var(--ev-ink);
  background: var(--ev-white);
  -webkit-font-smoothing: antialiased;
}

.ev-page * {
  box-sizing: border-box;
}

.ev-page img {
  max-width: 100%;
  display: block;
}

.ev-page a {
  color: inherit;
  text-decoration: none;
}

/*
 * Remise à zéro défensive : le thème applique parfois ses propres styles
 * globaux sur les balises h1-h6 (fond coloré, padding) et sur les images
 * (`img { height: auto }` est un reset très répandu) qui entrent en
 * conflit avec nos composants. On neutralise ici avec une spécificité
 * volontairement basse (:where() = spécificité nulle) pour laisser nos
 * classes spécifiques (.ev-hero__title, .ev-card__title, etc.) prendre
 * le dessus normalement dans la cascade, tout en battant les styles du
 * thème grâce à !important sur les seules propriétés à risque.
 */
.ev-page :where(h1, h2, h3, h4, h5, h6) {
  background: none !important;
  padding: 0 !important;
  border: none !important;
  box-shadow: none !important;
  text-align: left;
}

.ev-page img {
  height: auto;
}

.ev-page .ev-card__img,
.ev-page .ev-detail__hero-img {
  width: 540px;
  height: 300px;
  max-width: none !important;
  object-fit: cover !important;
}

.ev-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
}

.ev-icon--xl {
  width: 48px;
  height: 48px;
}

/* ---------- Boutons ---------- */

.ev-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--ev-font-body);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.ev-btn:hover {
  transform: translateY(-1px);
}

.ev-btn--primary {
  background: var(--ev-clay);
  color: var(--ev-white);
}

.ev-btn--primary:hover {
  background: var(--ev-clay-dark);
}

.ev-btn--ghost {
  background: transparent;
  border-color: var(--ev-line);
  color: var(--ev-ink);
}

.ev-btn--ghost:hover {
  border-color: var(--ev-ink);
}

.ev-btn--disabled {
  background: var(--ev-sand-2);
  color: var(--ev-stone);
  cursor: not-allowed;
}

.ev-btn--block {
  width: 100%;
  margin-top: 10px;
}

/* ---------- Hero listing ---------- */

.ev-hero {
  background: var(--ev-ink);
  background-image:
    radial-gradient(circle at 12% 15%, rgba(194, 73, 20, 0.35), transparent 45%),
    radial-gradient(circle at 88% 85%, rgba(31, 111, 107, 0.4), transparent 45%);
  color: var(--ev-sand);
  padding: 76px 24px 64px;
}

.ev-hero__inner {
  max-width: 1180px;
  margin: 0 auto;
}

.ev-hero__eyebrow {
  font-family: var(--ev-font-mono);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--ev-sand-2);
  margin: 0 0 18px;
}

.ev-hero__title {
  font-family: var(--ev-font-display);
  font-weight: 700;
  text-transform: uppercase;
  font-size: clamp(2.6rem, 6vw, 5rem);
  line-height: 0.96;
  letter-spacing: -0.01em;
  margin: 0 0 22px;
  max-width: 14ch;
}

.ev-hero__subtitle {
  font-size: 1.08rem;
  line-height: 1.55;
  color: rgba(242, 233, 216, 0.82);
  max-width: 46ch;
  margin: 0 0 40px;
}

.ev-hero__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  margin: 0;
  border-top: 1px solid rgba(242, 233, 216, 0.18);
  padding-top: 28px;
}

.ev-hero__stat dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(242, 233, 216, 0.6);
  margin-bottom: 6px;
}

.ev-hero__stat dd {
  font-family: var(--ev-font-mono);
  font-size: 1.9rem;
  font-weight: 700;
  margin: 0;
  color: var(--ev-white);
}

/* ---------- Barre de filtres ---------- */

.ev-filterbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--ev-white);
  border-bottom: 1px solid var(--ev-line);
  padding: 18px 24px;
}

.ev-filterbar.is-stuck {
  box-shadow: 0 8px 24px -18px rgba(20, 24, 28, 0.5);
}

.ev-filterbar__form {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 14px;
}

.ev-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.85rem;
}

.ev-field label {
  font-weight: 600;
  color: var(--ev-stone);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ev-field select,
.ev-field input[type="text"] {
  font-family: var(--ev-font-body);
  font-size: 0.95rem;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1.5px solid var(--ev-line);
  background: var(--ev-white);
  color: var(--ev-ink);
  min-width: 160px;
}

.ev-field select:focus,
.ev-field input[type="text"]:focus {
  outline: 2px solid var(--ev-teal);
  outline-offset: 1px;
  border-color: var(--ev-teal);
}

.ev-field--search {
  flex: 1 1 240px;
  flex-direction: row;
  align-items: center;
  border: 1.5px solid var(--ev-line);
  border-radius: 10px;
  padding: 0 14px;
  gap: 8px;
}

.ev-field--search .ev-icon {
  color: var(--ev-stone);
  flex-shrink: 0;
}

.ev-field--search input {
  border: none;
  padding: 11px 0;
  min-width: 0;
  flex: 1;
}

.ev-field--search input:focus {
  outline: none;
}

/* ---------- Résultats / grille ---------- */

.ev-results {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 24px 90px;
}

.ev-results__count {
  color: var(--ev-stone);
  font-size: 0.95rem;
  margin: 0 0 22px;
}

.ev-results__count strong {
  color: var(--ev-ink);
  font-family: var(--ev-font-mono);
}

.ev-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 28px;
}

.ev-grid--3 {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

/* Listing principal : empilement de cartes-ligne, comme un calendrier. */
.ev-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ---------- Carte événement : base commune ---------- */

.ev-card {
  display: flex;
  background: var(--ev-white);
  border: 1px solid var(--ev-line);
  border-radius: var(--ev-radius);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.ev-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--ev-shadow);
  border-color: transparent;
}

.ev-card__media {
  position: relative;
  overflow: hidden;
  background: var(--ev-sand-2);
  flex-shrink: 0;
  margin-bottom:15px;
}

.ev-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.ev-card__img--placeholder {
  background: linear-gradient(135deg, var(--ev-sand-2), var(--ev-sand));
}

.ev-card:hover .ev-card__img {
  transform: scale(1.06);
}

/* Bandeau date, ancré au coin supérieur gauche de l'image. */
.ev-tab-date {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: baseline;
  gap: 5px;
  background: var(--ev-clay);
  color: var(--ev-white);
  padding: 8px 14px;
  border-bottom-right-radius: 10px;
  font-weight: 700;
}

.ev-tab-date__day {
  font-family: var(--ev-font-display);
  font-size: 1.1rem;
  line-height: 1;
}

.ev-tab-date__month {
  font-family: var(--ev-font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Bandeau statut, plaqué au bas de l'image. */
.ev-status-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(20, 24, 28, 0.72);
  backdrop-filter: blur(2px);
  color: var(--ev-white);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ev-status-bar__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ev-stone);
  flex-shrink: 0;
}

.ev-status-bar--ouvert .ev-status-bar__dot {
  background: #4fd18b;
}

.ev-status-bar--imminent .ev-status-bar__dot {
  background: var(--ev-clay);
}

.ev-status-bar--termine .ev-status-bar__dot {
  background: #e2544c;
}

/* Petite étiquette "catégorie" façon dossard, dans l'entête de carte. */
.ev-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  background: var(--ev-sand);
  color: var(--ev-ink);
  font-family: var(--ev-font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  padding: 6px 12px;
  border-radius: 8px;
}

.ev-tag .ev-icon {
  color: var(--ev-clay);
}

/* Badge "dossard" plein format — signature visuelle de la page détail. */

.ev-bib {
  position: absolute;
  top: 14px;
  right: 14px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--ev-sand);
  color: var(--ev-ink);
  font-family: var(--ev-font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 7px 12px 7px 10px;
  border-radius: 8px;
  box-shadow: 0 6px 16px -6px rgba(20, 24, 28, 0.45);
  transform: rotate(2deg);
}

.ev-bib__holes {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ev-white);
  box-shadow: 0 -9px 0 var(--ev-white), 0 9px 0 var(--ev-white);
}

.ev-bib--lg {
  position: static;
  transform: rotate(-3deg);
  font-size: 1.6rem;
  padding: 14px 22px 14px 16px;
  align-self: flex-start;
  margin: 0 32px 32px auto;
}

.ev-card__body {
  flex: 1;
  min-width: 0;
  padding: 20px;
}

.ev-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.ev-card__title {
  font-family: var(--ev-font-display);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
  color: var(--ev-ink);
}

.ev-card__place {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--ev-stone);
  margin: 14px 0 0;
}

.ev-card__place strong {
  color: var(--ev-ink);
  font-weight: 600;
}

/* Rangée de statistiques, à la manière d'un tableau de course. */
.ev-statrow {
  display: flex;
  gap: 26px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px dashed var(--ev-line);
}

.ev-stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ev-stat__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ev-stone);
}

.ev-stat__value {
  font-family: var(--ev-font-mono);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ev-ink);
}

/* CTA plein, ancré à droite de la carte-ligne. */
.ev-card__cta {
  flex-shrink: 0;
  display: none;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 128px;
  background: var(--ev-ink);
  color: var(--ev-white);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: center;
  line-height: 1.35;
  transition: background-color 0.2s ease;
}

.ev-card:hover .ev-card__cta {
  background: var(--ev-clay);
}

.ev-card__cta .ev-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* ---------- Modificateur : carte-ligne (listing principal) ---------- */

.ev-card--row {
  flex-direction: row;
  align-items: stretch;
}

.ev-card--row .ev-card__media {
  width: 300px;
  aspect-ratio: auto;
  min-height: 200px;
}

.ev-card--row .ev-card__cta {
  display: flex;
}

/* ---------- Modificateur : carte-grille (suggestions / similaires) ---------- */

.ev-card--grid {
  flex-direction: column;
}

.ev-card--grid .ev-card__media {
  width: 100%;
  aspect-ratio: 4 / 3;
  min-height: 200px;
  max-height: 260px;
}

.ev-card--grid .ev-tab-date {
  padding: 7px 12px;
}

.ev-card--grid .ev-statrow {
  gap: 18px;
}

/* ---------- État vide ---------- */

.ev-empty {
  text-align: center;
  padding: 70px 20px;
  color: var(--ev-stone);
}

.ev-empty .ev-icon--xl {
  color: var(--ev-clay);
  margin-bottom: 18px;
}

.ev-empty h2 {
  font-family: var(--ev-font-display);
  font-size: 1.7rem;
  color: var(--ev-ink);
  margin: 0 0 10px;
}

.ev-empty p {
  margin: 0 0 24px;
}

/* ---------- Page détail ---------- */

.ev-breadcrumb {
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 24px 0;
}

.ev-breadcrumb a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ev-stone);
}

.ev-breadcrumb a:hover {
  color: var(--ev-ink);
}

.ev-detail__hero {
  position: relative;
  margin: 20px 24px 0;
  border-radius: 22px;
  overflow: hidden;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: var(--ev-ink);
}

.ev-detail__hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ev-detail__hero-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(20, 24, 28, 0.1) 0%, rgba(20, 24, 28, 0.85) 100%);
}

.ev-detail__hero-content {
  position: relative;
  padding: 32px;
  color: var(--ev-white);
}

.ev-detail__title {
  font-family: var(--ev-font-display);
  text-transform: uppercase;
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
  margin: 14px 0 12px;
  max-width: 22ch;
}

.ev-detail__place {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0;
}

.ev-detail__layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 24px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 56px;
  align-items: start;
}

.ev-detail__section-title {
  font-family: var(--ev-font-display);
  font-size: 1.6rem;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0 0 20px;
  color: var(--ev-ink);
}

.ev-prose {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--ev-ink-soft);
}

.ev-prose--empty {
  color: var(--ev-stone);
  font-style: italic;
}

.ev-prose h2,
.ev-prose h3,
.ev-prose h4 {
  font-family: var(--ev-font-display);
  color: var(--ev-ink);
  text-transform: uppercase;
  margin: 28px 0 12px;
}

.ev-prose p {
  margin: 0 0 16px;
}

.ev-prose ul,
.ev-prose ol {
  margin: 0 0 16px;
  padding-left: 22px;
}

.ev-prose li {
  margin-bottom: 6px;
}

.ev-prose a {
  color: var(--ev-clay);
  text-decoration: underline;
}

.ev-prose strong {
  color: var(--ev-ink);
}

.ev-detail__sidebar {
  position: sticky;
  top: 90px;
}

.ev-infocard {
  border: 1px solid var(--ev-line);
  border-radius: var(--ev-radius);
  padding: 24px;
  background: var(--ev-sand);
}

.ev-infocard__title {
  font-family: var(--ev-font-display);
  text-transform: uppercase;
  font-size: 1.15rem;
  margin: 0 0 18px;
}

.ev-infocard__list {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ev-infocard__list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.ev-infocard__list .ev-icon {
  width: 20px;
  height: 20px;
  color: var(--ev-clay);
  margin-top: 2px;
  flex-shrink: 0;
}

.ev-infocard__label {
  display: block;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ev-stone);
  margin-bottom: 2px;
}

.ev-infocard__value {
  display: block;
  font-weight: 600;
  color: var(--ev-ink);
}

/* ---------- Similaires ---------- */

.ev-similar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px 90px;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .ev-detail__layout {
    grid-template-columns: 1fr;
  }

  .ev-detail__sidebar {
    position: static;
  }

  .ev-bib--lg {
    margin: 0 20px 20px auto;
    font-size: 1.3rem;
  }
}

@media (max-width: 760px) {
  .ev-card--row {
    flex-direction: column;
  }

  .ev-card--row .ev-card__media {
    width: 100%;
    aspect-ratio: 16 / 10;
  }

  .ev-card--row .ev-card__cta {
    display: flex;
    width: 100%;
    flex-direction: row;
    padding: 14px;
  }

  .ev-card--row .ev-card__cta span {
    display: inline;
  }

  .ev-card--row .ev-card__cta br {
    display: none;
  }
}

@media (max-width: 640px) {
  .ev-hero {
    padding: 52px 18px 44px;
  }

  .ev-hero__stats {
    gap: 26px;
  }

  .ev-filterbar {
    padding: 14px 18px;
  }

  .ev-filterbar__form {
    flex-direction: column;
    align-items: stretch;
  }

  .ev-field select,
  .ev-field--search {
    min-width: 0;
    width: 100%;
  }

  .ev-btn {
    width: 100%;
  }

  .ev-results {
    padding: 28px 18px 70px;
  }

  .ev-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .ev-detail__hero {
    margin: 14px 14px 0;
    min-height: 320px;
    border-radius: 16px;
  }

  .ev-detail__hero-content {
    padding: 22px;
  }

  .ev-detail__layout {
    padding: 34px 18px;
  }

  .ev-breadcrumb {
    padding: 16px 18px 0;
  }

  .ev-similar {
    padding: 0 18px 70px;
  }
}

/* ---------- Pagination (thème Drupal core .pager) ---------- */

.ev-pager {
  margin-top: 44px;
  display: flex;
  justify-content: center;
}

.ev-pager .pager__items {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.ev-pager .pager__item {
  display: flex;
}

.ev-pager .pager__item a,
.ev-pager .pager__item.is-active > * {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1.5px solid var(--ev-line);
  font-family: var(--ev-font-mono);
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ev-ink);
}

.ev-pager .pager__item a:hover {
  border-color: var(--ev-clay);
  color: var(--ev-clay);
}

.ev-pager .pager__item.is-active > * {
  background: var(--ev-ink);
  border-color: var(--ev-ink);
  color: var(--ev-white);
}

.ev-pager .pager__item--ellipsis {
  color: var(--ev-stone);
  padding: 0 4px;
  align-self: center;
}

/*
 * Pages du module en pleine largeur.
 * Best-effort générique : neutralise les sélecteurs de bandeau/sidebar les
 * plus courants (core + thèmes basés sur les conventions Drupal). Si ton
 * thème actif utilise d'autres classes, inspecte l'élément concerné et
 * ajoute son sélecteur ici — ou, mieux, désactive ces blocs pour
 * /evenements et /evenements/* directement depuis Structure > Disposition
 * des blocs (condition "Chemin de la requête", case "Négliger").
 */
body.ev-fullwidth-page .region-sidebar,
body.ev-fullwidth-page .region-sidebar-first,
body.ev-fullwidth-page .region-sidebar-second,
body.ev-fullwidth-page .layout-sidebar-first,
body.ev-fullwidth-page .layout-sidebar-second,
body.ev-fullwidth-page .sidebar,
body.ev-fullwidth-page .page-banner,
body.ev-fullwidth-page .hero-banner,
body.ev-fullwidth-page .region-banner,
body.ev-fullwidth-page .page-header-banner {
  display: none !important;
}

body.ev-fullwidth-page .layout-content,
body.ev-fullwidth-page .region-content,
body.ev-fullwidth-page .main-content {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
}


@media (prefers-reduced-motion: reduce) {
  .ev-card,
  .ev-card__img,
  .ev-btn {
    transition: none;
  }
}
.path-evenements .breadcrumb-content-inner { display:none !important;}
