/* Pages Evenements (liste des courses + fiche) — s'appuie sur results-center.css */
:root {
    --ev-youth: #d6336c;
    --ev-adult: #19954e;
    --ev-special: #6b4fd8;
    --ev-todo: #b45309;
    --ev-todo-bg: #fff3d6;
}

.top-link.is-current { color: var(--white); background: rgba(255,255,255,.08); }
.top-link--cta { color: #fff; background: var(--orange); }
.top-link--cta:hover { background: #e98a19; }

/* Étiquettes */
.ev-tag { display: inline-block; margin: 0 4px 4px 0; padding: 3px 9px; border-radius: 99px; color: #fff; background: var(--ev-adult); font-size: 10px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; }
.ev-tag.is-youth { background: var(--ev-youth); }
.ev-tag.is-special { background: var(--ev-special); }
.ev-tag.is-open { background: var(--teal); }
.ev-tag.is-done { background: #7c8b96; }
.ev-tag.is-new { background: #f58220; }
.ev-news a { color: #25d4b6; font-weight: 700; }
.ev-news { margin: 14px 0 0; padding: 10px 14px; border-left: 4px solid #f58220; background: rgba(255,255,255,.08); border-radius: 0 10px 10px 0; font-size: 14px; line-height: 1.5; }
.todo { display: inline-block; padding: 1px 8px; border: 1px dashed var(--ev-todo); border-radius: 6px; color: var(--ev-todo); background: var(--ev-todo-bg); font-size: .78em; font-weight: 800; }

/* Liste */
.ev-notfound { padding-top: 28px; color: #9d5420; }
.ev-list { position: relative; z-index: 2; margin-top: -31px; padding-bottom: 70px; }
.ev-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; padding: 13px; border-radius: 16px; background: var(--navy-2); box-shadow: var(--shadow); }
.ev-filters button { padding: 9px 15px; border: 1px solid rgba(255,255,255,.14); border-radius: 99px; color: #dce9ed; background: rgba(255,255,255,.04); font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.ev-filters button:hover { border-color: var(--teal); }
.ev-filters button[aria-pressed="true"] { color: var(--navy); background: var(--teal-light); border-color: var(--teal-light); }
.ev-month { margin-bottom: 18px; padding: 18px; border-radius: 18px; color: #fff; background: var(--navy-2); box-shadow: var(--shadow); }
.ev-month[hidden] { display: none; }
.ev-month h2 { margin: 0 0 12px; font-size: 13px; letter-spacing: .16em; }
.ev-month__events { display: grid; gap: 10px; }
.ev-card { display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; border: 1px solid transparent; border-radius: 13px; color: var(--ink); background: #fff; text-decoration: none; transition: transform .2s ease, border-color .2s ease; }
.ev-card:hover { border-color: var(--teal); transform: translateY(-2px); }
.ev-card[hidden] { display: none; }
.ev-card.is-past { opacity: .72; }
.ev-card__date { display: grid; place-content: center; min-height: 66px; border-radius: 10px; color: #fff; background: var(--ev-adult); text-align: center; line-height: 1; }
.ev-card__date.is-youth { background: var(--ev-youth); }
.ev-card__date.is-special { background: var(--ev-special); }
.ev-card__date span { font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.ev-card__date strong { margin-top: 4px; font-size: 26px; }
.ev-card__body { min-width: 0; }
.ev-card__body h3 { margin: 2px 0; color: var(--navy); font-size: 17px; }
.ev-card__body p { margin: 0; color: #738593; font-size: 13px; }
.ev-card__place { color: var(--ink) !important; font-weight: 700; }
.ev-card__arrow { color: #a9b8c5; font-size: 26px; }
.ev-empty { padding: 24px; color: #738593; text-align: center; }

/* Fiche */
.hero--event::before { background: radial-gradient(circle at 85% 15%, rgba(242,154,46,.22), transparent 36%), radial-gradient(circle at 10% 90%, rgba(0,162,136,.2), transparent 36%); }
.hero__inner--event { align-items: stretch; gap: 32px; padding-block: 36px 58px; }
.hero__text { min-width: 0; flex: 1 1 auto; }
.hero__poster { flex: 0 0 240px; align-self: center; border-radius: 14px; overflow: hidden; box-shadow: 0 18px 45px rgba(0,0,0,.35); }
.hero__poster img { display: block; width: 100%; height: auto; }
.ev-back { display: inline-block; margin-bottom: 14px; color: #c8d4dc; font-size: 13px; font-weight: 700; text-decoration: none; }
.ev-back:hover { color: #fff; }
.ev-poster__tags { margin-bottom: 10px; }
.hero--event h1 { font-size: clamp(34px, 5vw, 60px); }
.ev-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 22px; }
.ev-fact { min-width: 0; padding: 10px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 12px; background: rgba(255,255,255,.08); }
.ev-fact span { display: block; color: var(--teal-light); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.ev-fact strong { display: block; margin-top: 3px; font-size: 15px; overflow-wrap: anywhere; }
.ev-fact__link { display: inline-block; margin-top: 4px; color: var(--teal-light); font-size: 12px; font-weight: 800; text-decoration: none; }
.ev-fact__link:hover { text-decoration: underline; }

.ev-detail { position: relative; z-index: 2; margin-top: -31px; padding-bottom: 70px; }
.ev-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.ev-main { min-width: 0; }
.ev-block { margin-bottom: 16px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 18px; background: #fff; box-shadow: 0 9px 30px rgba(7,23,38,.06); min-width: 0; }
.ev-block h2 { margin: 0 0 12px; color: var(--navy); font-size: 21px; }
.ev-block p { margin: 0 0 10px; line-height: 1.6; }
.ev-muted { color: #738593; font-size: 14px; }
.ev-map { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px; border-radius: 12px; background: #eef4f5; }
.ev-access { margin-top: 12px; display: grid; gap: 10px; }
.ev-access__alert { margin: 0; padding: 12px 14px; border-left: 4px solid var(--orange); border-radius: 8px; background: #fff6e8; color: #7a4b10; font-weight: 700; line-height: 1.5; }
.ev-access__steps { margin: 0; padding-left: 22px; display: grid; gap: 6px; line-height: 1.5; }
.ev-access__steps li::marker { color: var(--teal); font-weight: 900; }
.ev-points { display: grid; gap: 8px; }
.ev-point { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; background: #fff; border: 2px solid var(--line, #dce5e9); color: inherit; text-decoration: none; }
.ev-point:hover { border-color: var(--teal); text-decoration: none; }
.ev-point i { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: var(--navy, #071726); color: #fff; font-style: normal; font-weight: 900; display: inline-flex; align-items: center; justify-content: center; }
.ev-point span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ev-point b { color: var(--navy, #071726); }
.ev-point small { font-size: 12px; color: #6b7c88; }
.ev-videos { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; align-items: start; }
.ev-video { margin: 0; min-width: 0; }
.ev-video__frame { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 12px; background: #0b2033; }
.ev-video.is-vertical { max-width: 320px; justify-self: start; }
.ev-video.is-vertical .ev-video__frame { aspect-ratio: 9 / 16; }
.ev-video__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ev-video figcaption { margin-top: 6px; color: #738593; font-size: 13px; font-weight: 700; }
.ev-video figcaption a { color: var(--teal); }
.ev-tablewrap { overflow-x: auto; }
.ev-table { width: 100%; min-width: 0; border-collapse: collapse; font-size: 15px; }
.ev-table thead { color: inherit; background: transparent; }
.ev-table tbody tr:hover { background: #f7fafb; }
.ev-table th, .ev-table td { padding: 10px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; white-space: normal; color: var(--ink); font-size: 15px; }
.ev-table th { color: #738593 !important; font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.ev-table td.num { font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
.ev-route { display: block; overflow: hidden; border-radius: 12px; }
.ev-routes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.ev-route-fig { margin: 0; min-width: 0; }
.ev-route-fig figcaption { margin-top: 6px; color: #738593; font-size: 13px; font-weight: 700; text-align: center; }
.ev-route img { display: block; width: 100%; height: auto; }
.ev-route--empty { display: grid; place-items: center; aspect-ratio: 16 / 8; padding: 16px; border: 1px dashed var(--line); border-radius: 12px; color: #738593; background: repeating-linear-gradient(45deg, #eef4f5 0 12px, #fff 12px 24px); font-weight: 700; text-align: center; }
.ev-steps { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.ev-steps li { display: grid; grid-template-columns: 70px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.ev-steps b { color: var(--teal); font-variant-numeric: tabular-nums; }
.ev-inc { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.ev-inc li { padding: 10px 12px; border-radius: 10px; background: #eef4f5; font-size: 14px; font-weight: 600; }
.ev-inc--list { grid-template-columns: minmax(0, 1fr); }
.ev-inc--list li { font-weight: 500; line-height: 1.5; }
.ev-inc li .ev-tag { vertical-align: 1px; }
.ev-rules { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 6px; }
.ev-rules li { line-height: 1.5; }
.ev-rules li::marker { color: var(--teal); font-weight: 900; }
.ev-block details { padding: 10px 0; border-top: 1px solid var(--line); }
.ev-block summary { cursor: pointer; font-weight: 800; }
.ev-block details p { margin: 6px 0 0; }

.ev-aside { position: sticky; top: 90px; }
.ev-price { padding: 20px; border-radius: 16px; color: #fff; background: var(--navy-2); box-shadow: var(--shadow); }
.ev-price__big { font-size: 34px; font-weight: 900; letter-spacing: -.03em; line-height: 1; }
.ev-price__until { margin-top: 4px; color: #c8d4dc; font-size: 13px; }
.ev-price ul { margin: 14px 0; padding: 0; list-style: none; }
.ev-price li { display: flex; justify-content: space-between; gap: 10px; padding: 8px 0; border-top: 1px solid rgba(255,255,255,.14); font-size: 14px; }
.ev-price li b { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.ev-price li span { min-width: 0; }
.ev-price__note { margin: 0 0 12px; color: #c8d4dc; font-size: 12px; line-height: 1.5; }
.ev-pay { margin-top: 10px; color: #c8d4dc; font-size: 12px; text-align: center; }
.ev-pay b { color: var(--orange); }
.ev-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border: 0; border-radius: 99px; color: #fff; background: var(--orange); font-size: 14px; font-weight: 800; text-decoration: none; cursor: pointer; }
.ev-btn:hover { background: #e98a19; }
.ev-btn--lg { width: 100%; padding: 16px 24px; font-size: 16px; }
.ev-btn--ghost { color: var(--ink); background: #fff; border: 2px solid var(--line); }
.ev-btn--ghost:hover { background: #fff; border-color: var(--teal); }
.ev-btn--inscrits { width: 100%; margin-top: 12px; padding: 11px 16px; color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.28); font-size: 13px; }
.ev-btn--inscrits:hover { background: rgba(255,255,255,.14); border-color: var(--teal); }
.ev-share { display: grid; gap: 8px; margin-top: 12px; }
.ev-share .ev-btn { width: 100%; }
.ev-contact { margin-top: 14px; color: #738593; font-size: 13px; }
.ev-contact a { color: var(--ink); font-weight: 700; text-decoration: none; }
.ev-toast { position: fixed; left: 50%; bottom: 24px; z-index: 50; transform: translateX(-50%); padding: 10px 18px; border-radius: 99px; color: #fff; background: var(--navy); font-weight: 700; box-shadow: var(--shadow); }

/* Lien vers le classement annuel (challenge) : bandeau de la liste, rappel sur les cartes, fiche */
.ev-chalband { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; padding: 16px 20px; border: 1px solid var(--line); border-left: 5px solid var(--orange); border-radius: 16px; background: #fff; box-shadow: 0 9px 30px rgba(7,23,38,.06); }
.ev-chalband__txt { min-width: 0; display: grid; gap: 3px; }
.ev-chalband__txt span { color: var(--teal); font-size: 11px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.ev-chalband__txt strong { color: var(--navy); font-size: 18px; line-height: 1.25; }
.ev-chalband__txt small { color: #738593; font-size: 13px; line-height: 1.4; }
.ev-chalband__cta { display: flex; flex-wrap: wrap; gap: 8px; flex-shrink: 0; }
.ev-chalband__cta .ev-btn { white-space: nowrap; text-transform: none; }
.ev-chalband__cta .ev-btn::first-letter { text-transform: uppercase; }
.ev-card__chal { margin: 4px 0 0 !important; color: var(--teal) !important; font-size: 12px !important; font-weight: 800; }
.ev-herochal { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 14px; padding: 10px 14px; border-left: 4px solid var(--orange); border-radius: 0 10px 10px 0; background: rgba(255,255,255,.08); font-size: 14px; line-height: 1.4; }
.ev-herochal b { color: #fff; }
.ev-herochal a { color: var(--teal-light); font-weight: 800; text-decoration: none; white-space: nowrap; }
.ev-herochal a:hover { text-decoration: underline; }
.ev-chal { margin-top: 12px; padding: 18px 20px; border: 1px solid var(--line); border-top: 4px solid var(--orange); border-radius: 16px; background: #fff; box-shadow: 0 9px 30px rgba(7,23,38,.06); }
.ev-chal__kicker { display: block; color: var(--teal); font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.ev-chal strong { display: block; margin-top: 4px; color: var(--navy); font-size: 16px; line-height: 1.3; }
.ev-chal ul { margin: 10px 0 0; padding: 0; list-style: none; }
.ev-chal li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 14px; }
.ev-chal li b { white-space: nowrap; font-variant-numeric: tabular-nums; }
.ev-chal li sup { font-size: .65em; }
.ev-chal p { margin: 8px 0 12px; color: #738593; font-size: 12px; line-height: 1.5; }
.ev-chal .ev-btn { width: 100%; }
.ev-chal .ev-btn + .ev-btn { margin-top: 8px; }

/* Photos et vidéos : bandeau de la liste, rappel dans l'en-tête de la fiche, bloc de la fiche */
.ev-chalband:has(+ .ev-photoband) { margin-bottom: 10px; }
.ev-photoband { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 22px; padding: 12px 20px; border: 1px solid var(--line); border-left: 5px solid var(--teal); border-radius: 16px; background: #fff; box-shadow: 0 9px 30px rgba(7,23,38,.06); }
.ev-photoband__txt { min-width: 0; display: grid; gap: 2px; }
.ev-photoband__txt strong { color: var(--navy); font-size: 16px; line-height: 1.25; }
.ev-photoband__txt small { color: #738593; font-size: 13px; line-height: 1.5; }
.ev-photoband__txt a { color: var(--teal); font-weight: 800; text-decoration: none; }
.ev-photoband__txt a:hover { text-decoration: underline; }
.ev-photoband .ev-btn { flex-shrink: 0; padding: 10px 18px; white-space: nowrap; }
.ev-herochal--photos { margin-top: 8px; border-left-color: var(--teal-light); }
.ev-photobtns { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 10px; }
.ev-photolink { margin: 10px 0 0; }
.ev-photolink a { color: var(--teal); font-weight: 800; text-decoration: none; }
.ev-photolink a:hover { text-decoration: underline; }

/* Résultats officiels RACE RESULT affichés dans la fiche d'une course disputée */
.ev-block--results { scroll-margin-top: 90px; }
.ev-block--results .aschronos-rrpublish { min-height: 120px; padding: 4px 0 8px; }
.ev-block--results .aschronos-rrpublish:empty { min-height: 0; padding: 0; }
.ev-block--results .rr-loading { min-height: 120px; border-radius: 12px; }
.ev-block--results .aschronos-rrpublish .MainTable { min-width: 0 !important; }
.ev-block--results .ListControl { flex-wrap: wrap; align-items: center; gap: 8px 12px; height: auto !important; }
.ev-block--results .ListControlSearch { flex: 1 1 280px; width: auto !important; max-width: 400px; margin-left: auto; }
.ev-block--results .ListControlSearch input { flex: 1 1 auto; min-width: 0; }
.ev-block--results .ListControlSearch .btnSearch { flex: 0 0 auto; width: auto !important; padding: 0 12px !important; }
.ev-block--results .ev-muted a { color: var(--teal); font-weight: 800; text-decoration: none; white-space: nowrap; }
.ev-block--results .ev-muted a:hover { text-decoration: underline; }

/* Tracé GPS d'une course : carte (Leaflet, fond OpenStreetMap), point de départ, repères kilométriques */
.ev-block--parcours { scroll-margin-top: 90px; }
.ev-map small { display: block; margin-top: 4px; color: #6b7c88; font-size: 13px; line-height: 1.4; }
.ev-map small a { color: var(--teal); font-weight: 800; text-decoration: none; white-space: nowrap; }
.ev-map small a:hover { text-decoration: underline; }
.ev-trace { position: relative; z-index: 0; isolation: isolate; height: 440px; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: #e7efe8; }
.ev-trace__map { position: absolute; inset: 0; }
.ev-trace__fallback { position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; padding: 8px; background: linear-gradient(160deg, #dcebdf, #eef4f5); }
.ev-trace__fallback[hidden] { display: none; }
.ev-trace__fallback svg { width: 100%; height: 100%; }
.ev-trace__hint { position: absolute; left: 50%; bottom: 38px; z-index: 1000; transform: translateX(-50%); padding: 9px 16px; border: 0; border-radius: 99px; color: #fff; background: rgba(7,23,38,.85); font: inherit; font-size: 13px; font-weight: 800; white-space: nowrap; cursor: pointer; }
.ev-trace__hint[hidden] { display: none; }
.ev-trace .leaflet-container { font: inherit; background: #e7efe8; }
.ev-trace .leaflet-popup-content { margin: 12px 14px; font-size: 13px; line-height: 1.5; }
.ev-trace .leaflet-popup-content a { color: var(--teal); font-weight: 800; }
.ev-trace .ev-trace-fit { font-size: 18px; line-height: 30px; text-align: center; text-decoration: none; color: #071726; }
.ev-trace-start::after { content: ""; position: absolute; left: -8px; top: -8px; width: 16px; height: 16px; box-sizing: border-box; border: 3px solid #fff; border-radius: 50%; background: var(--ev-adult); box-shadow: 0 1px 5px rgba(7,23,38,.55); }
.ev-trace-start span { position: absolute; left: 0; top: 0; transform: translate(-50%, 15px); padding: 5px 11px; border: 2px solid #fff; border-radius: 99px; color: #fff; background: var(--ev-adult); font-size: 12px; font-weight: 900; letter-spacing: .05em; text-transform: uppercase; white-space: nowrap; box-shadow: 0 3px 10px rgba(7,23,38,.4); }
.ev-trace-start span::after { content: ""; position: absolute; left: 50%; bottom: 100%; margin-left: -5px; border: 5px solid transparent; border-bottom-color: #fff; }
.ev-trace-km { display: grid; place-items: center; box-sizing: border-box; border: 2px solid #e8590c; border-radius: 50%; color: #071726; background: #fff; font-size: 11px; font-weight: 900; line-height: 1; }
.ev-trace-arrow i { display: block; width: 0; height: 0; margin: 3px auto 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-bottom: 12px solid #071726; filter: drop-shadow(0 0 1px #fff) drop-shadow(0 0 1px #fff); }
.ev-trace__stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin: 12px 0 0; padding: 0; list-style: none; }
.ev-trace__stats li { min-width: 0; padding: 10px 12px; border-radius: 12px; background: #eef4f5; }
.ev-trace__stats span { display: block; color: #738593; font-size: 10px; font-weight: 900; letter-spacing: .12em; text-transform: uppercase; }
.ev-trace__stats strong { display: block; margin-top: 3px; color: var(--navy); font-size: 15px; overflow-wrap: anywhere; }

.ev-btn:focus-visible, .ev-filters button:focus-visible, .ev-card:focus-visible, .top-link:focus-visible { outline: 3px solid var(--teal-light); outline-offset: 2px; }

@media (max-width: 900px) {
    .ev-cols { grid-template-columns: minmax(0, 1fr); }
    .ev-main, .ev-aside { min-width: 0; }
    .ev-aside { position: static; }
    .hero__inner--event { flex-direction: column; }
    .hero__poster { flex-basis: auto; width: min(100%, 320px); }
}
@media (max-width: 560px) {
    .site-header__inner { gap: 10px; }
    .brand__copy { display: none; }
    .top-actions { flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
    .top-link { padding: 8px 10px; font-size: 12px; }
    .top-link:first-child { display: inline-block; }
    .ev-map { grid-template-columns: 1fr; }
    .ev-card { grid-template-columns: 62px minmax(0, 1fr) auto; gap: 10px; }
    .ev-block { padding: 18px; }
    .hero-mark { display: none; }
    .ev-chalband { flex-direction: column; align-items: stretch; }
    .ev-chalband__cta .ev-btn { flex: 1 1 140px; }
    .ev-photoband { padding: 12px 16px; }
    .ev-photoband .ev-btn { padding: 9px 14px; font-size: 13px; }
    .ev-photobtns .ev-btn { flex: 1 1 100%; }
    .ev-trace { height: 360px; }
}
@media (prefers-reduced-motion: reduce) { .ev-card, .ev-btn { transition: none; } }
