/* ============================================
   FICHE ÉVÉNEMENT — single-evenement.php
   --------------------------------------------
   Réutilise : .page-hero, .service-layout, .service-content,
   .service-sidebar, .service-section__header, .section-tag,
   .event-card (agenda.css) et .cta-banner (components).
   Ce fichier ne contient QUE le spécifique à la fiche événement.
   La couleur d'accent provient de --event-color (posée sur .single-event).
   ============================================ */

.single-event {
  --event-color: var(--color-primary);
}

/* ============================================
   HERO — image plein cadre + overlay sombre
   On surcharge .page-hero (fond uni) pour afficher l'image de
   l'événement. Le contenu (flag, titre, fil d'Ariane) reste CENTRÉ,
   comme sur les autres pages internes (.page-hero est déjà centré).
   ============================================ */
.single-event__hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 460px;
  padding-top: calc(var(--total-header-height, 120px) + 64px);
  padding-bottom: 64px;
}

.single-event__hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.single-event__hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(26, 26, 46, 0.45) 0%, rgba(26, 26, 46, 0.55) 50%, rgba(26, 26, 46, 0.78) 100%);
}

/* Liseré de couleur thématique en haut du hero (cohérent event-card) */
.single-event__hero::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: var(--event-color);
  z-index: 2;
}

.single-event__hero-inner {
  position: relative;
  z-index: 2;
  /* hérite du centrage de .page-hero__inner (align-items: center) */
}

/* Pastille catégorie (flag) — centrée au-dessus du titre */
.single-event__hero-category {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px 7px 13px;
  border-radius: var(--radius-full, 50px);
  background: var(--event-color);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.2px;
  text-transform: uppercase;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.single-event__hero-category svg {
  width: 16px;
  height: 16px;
}

.single-event__hero-title {
  max-width: 20ch;
  text-wrap: balance;
}

/* ============================================
   CORPS DE LA FICHE
   ============================================ */

/* Image illustrant l'événement, sous le titre « Présentation ». */
.single-event__figure {
  margin: 0 0 28px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-natural);
}

.single-event__figure-img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.single-event__body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  color: var(--color-text);
}

.single-event__body > * + * {
  margin-top: 1.1em;
}

.single-event__body h2,
.single-event__body h3 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--color-text);
  margin-top: 1.6em;
  line-height: 1.25;
}

.single-event__body h2 { font-size: 26px; }
.single-event__body h3 { font-size: 21px; }

.single-event__body a:not(.btn) {
  color: var(--event-color);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-weight: 500;
}

.single-event__body ul,
.single-event__body ol {
  padding-left: 1.4em;
}

.single-event__body li + li {
  margin-top: 0.4em;
}

.single-event__body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}

.single-event__body strong {
  font-weight: 700;
}

/* CTA billetterie inline */
.single-event__cta-inline {
  margin-top: 32px;
}

/* ============================================
   SIDEBAR — liste d'infos pratiques
   ============================================ */
.single-event__infos {
  display: flex;
  flex-direction: column;
  gap: 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.single-event__info {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.single-event__info-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--event-color) 12%, transparent);
  color: var(--event-color);
}

.single-event__info-icon svg {
  width: 19px;
  height: 19px;
}

.single-event__info-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.single-event__info-label {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-secondary);
}

.single-event__info-text strong {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 16px;
  color: var(--color-text);
  line-height: 1.4;
}

.single-event__info-sub {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.4;
}

/* Lien « Itinéraire » sous l'adresse (Google Maps, nouvel onglet). Texte en
   couleur de texte, souligné : la couleur de catégorie (un cyan Sports, un
   orange Travaux) n'atteint pas 4,5:1 sur blanc, l'icône seule la porte.
   24 px de haut au moins (WCAG 2.5.8). */
.single-event__itineraire {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  margin-top: 4px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: var(--color-text);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.single-event__itineraire svg {
  flex-shrink: 0;
  color: var(--event-color);
}

.single-event__itineraire:hover {
  text-decoration-thickness: 2px;
}

.single-event__itineraire:focus-visible,
.single-event__ajouter:focus-visible {
  outline: 2px solid var(--color-text);
  outline-offset: 2px;
}

/* « Ajouter à mon agenda » : le fichier .ics de l'événement */
.single-event__agenda {
  margin-top: 22px;
}

.single-event__ajouter {
  min-height: 44px;
  white-space: normal;
  text-align: center;
}

.single-event__ajouter svg {
  flex-shrink: 0;
  color: var(--event-color);
}

/* btn--white passe au survol le texte en --color-primary-ink, c'est-à-dire
   ici la couleur de la catégorie : illisible pour un cyan ou un orange. Le
   texte reste noir, la bordure prend la couleur. */
.single-event__ajouter:hover {
  color: var(--color-text);
  border-color: var(--event-color);
}

/* Mini-carte du lieu : la carte embarquée des pages service (service.css,
   [data-carte-filter]) en plus court — un point sur un plan de quartier. */
.single-event__carte[data-carte-filter] .carte__map-wrapper,
.single-event__carte[data-carte-filter] .carte__map {
  min-height: 340px;
}

/* Bloc contact dans la sidebar */
.single-event__contact {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--color-border);
}

/* ============================================
   AUTRES ÉVÉNEMENTS — grille de cards
   ============================================ */
.single-event__related {
  background: var(--color-bg-alt);
  padding: var(--section-padding) 0;
}

.single-event__related-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.single-event__related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  margin-top: 36px;
}

/* Le media de l'event-card est un <a> ici : on rétablit le comportement bloc */
.single-event__related-grid .event-card__media {
  display: block;
}

@media (max-width: 1024px) {
  .single-event__related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .single-event__hero {
    min-height: 380px;
    padding-bottom: 40px;
  }

  .single-event__hero-title {
    max-width: none;
  }

  .single-event__related-grid {
    grid-template-columns: 1fr;
  }

  .single-event__carte[data-carte-filter] .carte__map-wrapper,
  .single-event__carte[data-carte-filter] .carte__map {
    min-height: 280px;
  }
}
