/* Calendrier en frise chronologique (themes/_shared/timeline.html.twig), familles Educeet et Horizon.
   Couleurs : celles du thème (--it-theme-1 Educeet, --brand Horizon), indigo par défaut. */
.stl {
  --stl-brand: var(--it-theme-1, var(--brand, #4f46e5));
  --stl-ink: var(--it-heading-primary, var(--ink, #1f2937));
  --stl-muted: #6b7280;
  --stl-line: #e5e7eb;
  --stl-card: #fff;
  --stl-soft: color-mix(in srgb, var(--stl-brand) 9%, #fff);
  --stl-step: 190px;      /* écart entre deux événements sur l'axe */
  --stl-card-w: 330px;    /* les cartes alternent au-dessus / au-dessous : elles débordent sur la voisine */
  --stl-card-h: 132px;
  position: relative;
  border-radius: 24px;
  background: linear-gradient(180deg, var(--stl-soft), #fff 70%);
  border: 1px solid color-mix(in srgb, var(--stl-brand) 14%, #fff);
  padding: 20px 0 8px;
  color: var(--stl-ink);
  font-size: 15px;
}
.stl * { box-sizing: border-box; }
.stl__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 24px; flex-wrap: wrap; }
.stl__legend { display: flex; gap: 8px; margin: 0; flex-wrap: wrap; }
.stl__chip { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; background: #fff; border: 1px solid var(--stl-line); font-size: 13px; font-weight: 600; color: var(--stl-muted); }
.stl__chip--up { background: var(--stl-brand); border-color: var(--stl-brand); color: #fff; }
.stl__nav { display: flex; gap: 8px; }
.stl__btn { display: inline-grid; place-items: center; min-width: 42px; height: 42px; padding: 0; border-radius: 999px; border: 1px solid var(--stl-line); background: #fff; color: var(--stl-ink); cursor: pointer; transition: background .2s, color .2s, border-color .2s, opacity .2s; }
.stl__btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.stl__btn--text { padding: 0 16px; font-weight: 600; font-size: 14px; }
.stl__btn:hover:not(:disabled) { background: var(--stl-brand); border-color: var(--stl-brand); color: #fff; }
.stl__btn:disabled { opacity: .4; cursor: default; }
.stl__btn:focus-visible, .stl__card:focus-visible, .stl__toggle:focus-visible, .stl__viewport:focus-visible { outline: 3px solid color-mix(in srgb, var(--stl-brand) 55%, #fff); outline-offset: 2px; }
.stl__toggle { display: none; }

/* —— frise horizontale —— */
.stl__viewport { overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--stl-brand) 35%, #fff) transparent; cursor: grab; border-radius: 0 0 24px 24px; }
.stl--drag .stl__viewport { cursor: grabbing; scroll-snap-type: none; user-select: none; }
.stl__track { position: relative; display: flex; list-style: none; margin: 0; padding: 0 calc(var(--stl-card-w) - var(--stl-step) + 48px) 0 48px; height: calc(2 * var(--stl-card-h) + 120px); width: max-content; min-width: 100%; }
.stl__track::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px; background: linear-gradient(90deg, color-mix(in srgb, var(--stl-brand) 25%, #fff), var(--stl-brand) 12%, var(--stl-brand) 88%, color-mix(in srgb, var(--stl-brand) 25%, #fff)); border-radius: 3px; }
.stl__item { position: relative; flex: 0 0 var(--stl-step); scroll-snap-align: start; scroll-margin-left: 48px; }
.stl__dot { position: absolute; left: 0; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: #fff; border: 3px solid var(--stl-brand); z-index: 2; }
/* tige reliant le point à la carte */
.stl__item::after { content: ''; position: absolute; left: -1px; width: 2px; height: 30px; background: color-mix(in srgb, var(--stl-brand) 40%, #fff); }
.stl__item:nth-child(odd)::after { bottom: calc(50% + 8px); }
.stl__item:nth-child(even)::after { top: calc(50% + 8px); }
.stl__card { position: absolute; left: -24px; width: var(--stl-card-w); height: var(--stl-card-h); display: flex; gap: 14px; align-items: stretch; padding: 14px; text-align: left; font: inherit; color: inherit; background: var(--stl-card); border: 1px solid var(--stl-line); border-radius: 18px; box-shadow: 0 6px 20px -10px rgb(17 24 39 / .25); cursor: pointer; transition: transform .2s, box-shadow .2s, border-color .2s; z-index: 1; }
.stl__item:nth-child(odd) .stl__card { bottom: calc(50% + 38px); }
.stl__item:nth-child(even) .stl__card { top: calc(50% + 38px); }
.stl__card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -12px rgb(17 24 39 / .35); border-color: color-mix(in srgb, var(--stl-brand) 45%, #fff); z-index: 3; }
.stl__date { flex: 0 0 58px; display: flex; flex-direction: column; align-items: center; justify-content: center; border-radius: 14px; background: var(--stl-soft); color: var(--stl-brand); line-height: 1.1; text-align: center; }
.stl__date b { font-size: 26px; font-weight: 800; }
.stl__date span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
.stl__body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.stl__title { font-weight: 700; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--stl-ink); }
.stl__meta { font-size: 13px; color: var(--stl-brand); font-weight: 600; }
.stl__excerpt { font-size: 13px; line-height: 1.4; color: var(--stl-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.stl__badge { align-self: flex-start; padding: 1px 8px; border-radius: 999px; background: var(--stl-brand); color: #fff; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
/* mois : étiquette posée sur l'axe, juste après le premier événement du mois */
.stl__month { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); z-index: 2; padding: 2px 10px; border-radius: 999px; background: #fff; border: 1px solid color-mix(in srgb, var(--stl-brand) 30%, #fff); color: var(--stl-brand); font-size: 12px; font-weight: 700; white-space: nowrap; text-transform: capitalize; }
/* passé : estompé ; prochain : point plein et halo */
.stl__item--past .stl__card { background: #fafafa; }
.stl__item--past .stl__card > * { opacity: .62; }
.stl__item--past .stl__dot { border-color: #c4c8d0; }
.stl__item--next .stl__dot { background: var(--stl-brand); box-shadow: 0 0 0 6px color-mix(in srgb, var(--stl-brand) 22%, transparent); animation: stl-pulse 2.4s ease-out infinite; }
.stl__item--next .stl__card { border-color: var(--stl-brand); box-shadow: 0 12px 30px -14px color-mix(in srgb, var(--stl-brand) 70%, #000); }
@keyframes stl-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--stl-brand) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 12px transparent; } }
@media (prefers-reduced-motion: reduce) { .stl__item--next .stl__dot { animation: none; } .stl__card { transition: none; } }

/* —— détail (popover) —— */
.stl__pop { width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); margin: auto; padding: 0; border: 0; border-radius: 22px; background: #fff; color: #1f2937; box-shadow: 0 30px 80px -20px rgb(17 24 39 / .5); overflow: auto; }
.stl__pop::backdrop { background: rgb(17 24 39 / .45); backdrop-filter: blur(3px); }
.stl__pop-img { display: block; width: 100%; aspect-ratio: 16 / 7; object-fit: cover; }
.stl__pop-body { padding: 24px 28px 28px; }
.stl__pop-date { margin: 0 0 6px; color: var(--it-theme-1, var(--brand, #4f46e5)); font-weight: 700; font-size: 14px; }
.stl__pop-title { margin: 0 0 12px; font-size: 22px; line-height: 1.25; }
.stl__pop-text { font-size: 15px; line-height: 1.6; color: #4b5563; }
.stl__pop-text > :last-child { margin-bottom: 0; }
.stl__pop-close { position: absolute; top: 12px; right: 12px; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgb(255 255 255 / .92); box-shadow: 0 2px 10px rgb(0 0 0 / .15); cursor: pointer; color: #1f2937; }
.stl__pop-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

/* —— téléphone et petite tablette : frise verticale —— */
@media (max-width: 767.98px) {
  .stl { --stl-card-h: auto; padding: 16px 0 12px; border-radius: 20px; }
  .stl__bar { padding: 0 16px; }
  .stl__nav { display: none; }
  .stl__viewport { overflow: visible; cursor: auto; }
  .stl__track { flex-direction: column; height: auto; width: auto; padding: 8px 16px 4px 44px; }
  .stl__track::before { left: 27px; right: auto; top: 12px; bottom: 12px; width: 3px; height: auto; margin: 0; background: linear-gradient(180deg, color-mix(in srgb, var(--stl-brand) 30%, #fff), var(--stl-brand) 10%, var(--stl-brand) 90%, color-mix(in srgb, var(--stl-brand) 30%, #fff)); }
  .stl__item { flex: none; padding: 0 0 14px; }
  .stl__item::after { display: none; }
  .stl__dot { left: -17px; top: 30px; }
  .stl__item .stl__month { position: static; transform: none; display: inline-block; margin: 6px 0 10px; }
  .stl__item .stl__card, .stl__item:nth-child(n) .stl__card { position: relative; inset: auto; left: 0; width: 100%; min-height: 96px; }
  .stl__item .stl__month + .stl__dot { top: 70px; }
  .stl__card:hover { transform: none; }
  .stl--js .stl__toggle { display: block; margin: 12px 16px 0 44px; padding: 10px 14px; width: calc(100% - 60px); border: 1px dashed color-mix(in srgb, var(--stl-brand) 45%, #fff); border-radius: 14px; background: #fff; color: var(--stl-brand); font: inherit; font-weight: 600; font-size: 14px; cursor: pointer; }
  .stl--js:not(.stl--past-open) .stl__item--past { display: none; }
}
