/* Styles propres à une page, chargés après style.css par cette page seulement
   (bloc page_css de base.html). Sortis de style.css pour l'alléger. */

.stats-page{ max-width: 1180px; margin: 0 auto; padding: 32px 24px 100px; }

.stats-hero{ max-width: 760px; margin-bottom: 28px; }

.stats-title{ font-style: italic; font-weight: 600; font-size: clamp(30px, 5vw, 46px); color: var(--indigo); margin: 6px 0 12px; }

.stats-lede{ font-size: 17px; line-height: 1.6; color: var(--ink-soft); }

.stats-lede a{ color: var(--indigo); white-space: nowrap; }

.stats-h2{ font-size: clamp(22px, 3vw, 28px); font-weight: 600; color: var(--indigo); margin: 0 0 16px; }

.stats-totals{ display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 28px; }

.stats-tile{
  position: relative;
  display: flex; flex-direction: column; gap: 2px;
  padding: 18px 20px 16px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.stats-tile::after{
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: linear-gradient(90deg, var(--brass), rgba(184, 137, 46, 0));
}

.stats-tile-icon{ position: absolute; right: 14px; top: 12px; font-size: 26px; opacity: 0.22; }

.stats-tile-value{ font-family: var(--font-display); font-size: clamp(28px, 4vw, 40px); font-weight: 600; color: var(--ink); line-height: 1.1; font-variant-numeric: tabular-nums; }

.stats-tile-value small{ font-size: 0.5em; font-weight: 500; color: var(--ink-soft); }

.stats-tile-label{ font-size: 14px; color: var(--ink-soft); }

.stats-tile-note{ margin-top: 6px; font-family: var(--font-ui); font-size: 12.5px; color: var(--brass); font-weight: 600; }

.stats-tile-note a{ color: inherit; }

.stats-columns{ display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px; margin-bottom: 36px; }

.stats-card{ background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px 22px; box-shadow: var(--shadow-sm); }

.stats-card .stats-h2{ font-size: 20px; }

.stats-record-list li{ display: grid; grid-template-columns: 1fr auto; column-gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }

.stats-record-list li:first-child{ border-top: 0; padding-top: 0; }

.stats-record-label{ grid-column: 1 / -1; font-family: var(--font-ui); font-size: 11.5px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }

.stats-record-list a{ color: var(--indigo); font-weight: 600; text-decoration: none; min-width: 0; }

.stats-record-list a:hover{ text-decoration: underline; }

.stats-record-value{ font-variant-numeric: tabular-nums; color: var(--ink); text-align: right; }

.stats-year{ display: grid; grid-template-columns: 3.2em minmax(0, 1fr); align-items: center; column-gap: 12px; row-gap: 2px; padding: 6px 0; }

.stats-year-label{ font-family: var(--font-display); font-weight: 600; color: var(--indigo); }

.stats-year-bar{ height: 12px; border-radius: 999px; background: var(--paper-deep); overflow: hidden; }

.stats-year-bar span{ display: block; height: 100%; width: var(--w); border-radius: inherit; background: linear-gradient(90deg, var(--indigo), var(--brass)); }

.stats-year-value{ grid-column: 2; font-size: 13.5px; font-variant-numeric: tabular-nums; }

.stats-year-value small{ color: var(--ink-soft); font-size: 1em; }

.stats-map-section{ margin-bottom: 44px; }

.stats-map-section .stats-h2{ margin-bottom: 8px; }

.stats-map{ height: 460px; }

.stats-map-legend{ display: flex; gap: 16px; margin-bottom: 12px; font-size: 13.5px; color: var(--ink-soft); }

.stats-legend::before{ content: ""; display: inline-block; width: 22px; height: 4px; border-radius: 2px; margin-right: 6px; vertical-align: middle; background: var(--brass); }

.stats-legend--bikepacking::before{ background: var(--indigo); }

.stats-map-line{ stroke: var(--brass); transition: stroke-width 0.25s ease, opacity 0.25s ease; }

.stats-map-line--bikepacking{ stroke: var(--indigo); }

.stats-map-line.is-current{ stroke-width: 7; opacity: 1; }

.stats-map-start{ overflow: visible; }

.stats-map-pin{
  position: absolute; left: 0; top: 0; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
  background: var(--card); border: 2px solid var(--brass); box-shadow: var(--shadow-md); font-size: 15px;
  transition: transform 0.25s var(--ease-out);
}

.stats-map-pin--bikepacking{ border-color: var(--indigo); }

.stats-map-start.is-current .stats-map-pin{ transform: translate(-50%, -50%) scale(1.25); }

.stats-map-popup img{ aspect-ratio: 16 / 10; object-fit: cover; }

.frise-section{ scroll-margin-top: 80px; }

.frise-head{ display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }

.frise-head .stats-h2{ margin: 0; }

.frise-play[aria-pressed="true"]{ background: var(--indigo); border-color: var(--indigo); color: var(--card); }

.frise-now{
  position: sticky; top: var(--frise-now-top, 78px); z-index: 5;
  display: flex; width: max-content; max-width: 100%; margin: 0 auto 8px; gap: 8px; align-items: center;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(33, 28, 21, 0.86); color: var(--card); box-shadow: var(--shadow-md);
  font-family: var(--font-ui); font-size: 13px;
}

.frise-now[hidden]{ display: none; }

.frise-now span:first-child{ font-weight: 700; color: #E9C77B; }

.frise-now span:last-child{ overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.frise-progress{ position: absolute; inset: 0; pointer-events: none; }

.frise-progress span{ background: linear-gradient(180deg, var(--brass), var(--indigo)); transform-origin: top; transform: scaleY(var(--p)); }

.stats-page:not(.stats-anim) .frise-progress span{ transform: none; }

.frise-year{ position: relative; display: flex; justify-content: center; margin: 18px 0 22px; }

.frise-year span{
  position: relative; z-index: 1;
  font-family: var(--font-display); font-weight: 700; font-size: 22px; color: var(--card);
  background: var(--indigo); padding: 4px 18px; border-radius: 999px; box-shadow: var(--shadow-md);
}

.frise-end{ position: relative; display: flex; justify-content: center; margin-top: 18px; }

.frise-end span{ position: relative; z-index: 1; font-family: var(--font-display); font-style: italic; color: var(--ink-soft); background: var(--paper); padding: 4px 12px; }

.frise-item{ position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 72px minmax(0, 1fr); margin-bottom: 34px; }

.frise-item--even .frise-card{ grid-column: 1; }

.frise-item--odd .frise-card{ grid-column: 3; }

.frise-dot{
  position: absolute; left: var(--rail); top: 26px; z-index: 1; transform: translate(-50%, 0);
  display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%;
  background: var(--card); border: 3px solid var(--brass); box-shadow: var(--shadow-md); font-size: 18px;
  transition: transform 0.35s var(--ease-out), background 0.35s ease;
}

.frise-item--bikepacking .frise-dot{ border-color: var(--indigo); }

.frise-item.is-current .frise-dot{ transform: translate(-50%, 0) scale(1.18); background: #FFF6DE; }

.frise-card{
  position: relative; grid-row: 1;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.frise-item.is-current .frise-card{ box-shadow: var(--shadow-lg); border-color: var(--line-strong); }

.frise-card::before{
  content: ""; position: absolute; top: 38px; width: 14px; height: 14px; background: var(--card);
  border: 1px solid var(--line); transform: rotate(45deg); z-index: 1;
}

.frise-item--even .frise-card::before{ right: -8px; border-left: 0; border-bottom: 0; }

.frise-item--odd .frise-card::before{ left: -8px; border-right: 0; border-top: 0; }

.frise-cover{ display: block; aspect-ratio: 16 / 7; overflow: hidden; background: var(--paper-deep); }

.frise-cover img{ width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 6s ease-out; }

.frise-item.is-current .frise-cover img{ transform: scale(1.06); }

.frise-body{ padding: 16px 20px 18px; }

.frise-date{ font-family: var(--font-ui); font-size: 12.5px; font-weight: 600; letter-spacing: 0.04em; color: var(--brass); text-transform: uppercase; }

.frise-title{ font-size: 22px; font-weight: 600; margin: 4px 0 2px; }

.frise-title a{ color: var(--indigo); text-decoration: none; }

.frise-title a:hover{ text-decoration: underline; }

.frise-place{ font-size: 14px; color: var(--ink-soft); }

.frise-desc{ margin-top: 10px; font-size: 15px; line-height: 1.55; }

.frise-facts{ display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.frise-facts li{ font-size: 13px; padding: 4px 10px; border-radius: 999px; background: var(--paper-deep); color: var(--ink-soft); }

.frise-facts strong{ color: var(--ink); font-variant-numeric: tabular-nums; }

.frise-top{ margin-top: 10px; font-size: 14px; }

.frise-profile{ margin: 12px 0 0; }

.frise-profile-plot{ position: relative; height: 64px; }

.frise-profile svg{ display: block; width: 100%; height: 64px; overflow: visible; }

.frise-profile-area{ fill: rgba(184, 137, 46, 0.16); }

.frise-profile-line{ fill: none; stroke: var(--brass); stroke-width: 2; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

.frise-profile-dot{
  position: absolute; left: var(--x); top: var(--y); width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px;
  border-radius: 50%; background: var(--card); border: 2px solid var(--brass);
}

.frise-profile-dot.is-top{ width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; background: var(--brass); }

.frise-profile figcaption{ display: flex; justify-content: space-between; gap: 8px; margin-top: 4px; font-size: 11.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

.frise-photos{ display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; margin-top: 14px; }

.frise-photos li{ position: relative; aspect-ratio: 1; overflow: hidden; border-radius: var(--radius-xs); background: var(--paper-deep); }

.frise-photos img{ width: 100%; height: 100%; object-fit: cover; display: block; }

.frise-photo-caption{
  position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 6px 4px;
  font-size: 10.5px; line-height: 1.25; color: #fff; background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.frise-actions{ display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 14px; }

.frise-link{ color: var(--indigo); font-weight: 600; text-decoration: none; }

.frise-link:hover{ text-decoration: underline; }

.frise-map-btn{ font: inherit; font-size: 14px; color: var(--ink-soft); background: none; border: 0; padding: 0; cursor: pointer; }

.frise-map-btn:hover{ color: var(--indigo); text-decoration: underline; }

@media (prefers-reduced-motion: no-preference){
  .stats-anim .stats-tile,
  .stats-anim .stats-card{ opacity: 0; translate: 0 18px; transition: opacity 0.6s var(--ease-out), translate 0.6s var(--ease-out); }
  .stats-anim .stats-tile:nth-child(2){ transition-delay: 0.06s; }
  .stats-anim .stats-tile:nth-child(3){ transition-delay: 0.12s; }
  .stats-anim .stats-tile:nth-child(4){ transition-delay: 0.18s; }
  .stats-anim .stats-tile:nth-child(5){ transition-delay: 0.24s; }
  .stats-anim .stats-tile:nth-child(6){ transition-delay: 0.3s; }
  .stats-anim .stats-tile.is-in,
  .stats-anim .stats-card.is-in{ opacity: 1; translate: none; }
  .stats-anim .stats-years:not(.is-in) .stats-year-bar span{ width: 0; }
  .stats-anim .stats-year-bar span{ transition: width 1.1s var(--ease-out) calc(var(--i) * 0.12s + 0.2s); }
  .stats-anim .frise-year span,
  .stats-anim .frise-end span{ opacity: 0; scale: 0.6; transition: opacity 0.5s ease, scale 0.5s cubic-bezier(0.3, 1.6, 0.5, 1); }
  .stats-anim .frise-year.is-in span,
  .stats-anim .frise-end.is-in span{ opacity: 1; scale: 1; }
  .stats-anim .frise-dot{ opacity: 0; scale: 0.3; transition: opacity 0.4s ease, scale 0.5s cubic-bezier(0.3, 1.6, 0.5, 1), transform 0.35s var(--ease-out), background 0.35s ease; }
  .stats-anim .frise-item.is-in .frise-dot{ opacity: 1; scale: 1; }
  .stats-anim .frise-card{ opacity: 0; transition: opacity 0.7s var(--ease-out) 0.1s, translate 0.7s var(--ease-out) 0.1s, box-shadow 0.3s ease, border-color 0.3s ease; }
  .stats-anim .frise-item--even .frise-card{ translate: -40px 0; }
  .stats-anim .frise-item--odd .frise-card{ translate: 40px 0; }
  .stats-anim .frise-item.is-in .frise-card{ opacity: 1; translate: none; }
  .stats-anim .frise-cover img{ scale: 1.12; transition: scale 1.6s var(--ease-out) 0.1s, transform 6s ease-out; }
  .stats-anim .frise-item.is-in .frise-cover img{ scale: 1; }
  .stats-anim .frise-profile svg{ clip-path: inset(-10px 100% -10px 0); transition: clip-path 1.6s ease-in-out 0.5s; }
  .stats-anim .frise-profile-dot{ opacity: 0; scale: 0; transition: opacity 0.3s ease, scale 0.4s cubic-bezier(0.3, 1.6, 0.5, 1); transition-delay: calc(0.5s + var(--i) * 0.12s); }
  .stats-anim .frise-item.is-in .frise-profile svg{ clip-path: inset(-10px 0 -10px 0); }
  .stats-anim .frise-item.is-in .frise-profile-dot{ opacity: 1; scale: 1; }
  .stats-anim .frise-photos li{ opacity: 0; translate: 0 12px; transition: opacity 0.5s ease, translate 0.5s var(--ease-out); transition-delay: calc(0.7s + var(--i) * 0.1s); }
  .stats-anim .frise-item.is-in .frise-photos li{ opacity: 1; translate: none; }
}

@media (max-width: 900px){
  .stats-columns{ grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 720px){
  .stats-page{ padding: 22px 16px 80px; }
  .stats-totals{ grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stats-tile{ padding: 14px 14px 12px; }
  .stats-tile-icon{ font-size: 20px; right: 10px; top: 8px; }
  .stats-map{ height: 320px; }
  .frise-item{ grid-template-columns: 44px minmax(0, 1fr); margin-bottom: 26px; }
  .frise-item--even .frise-card,
  .frise-item--odd .frise-card{ grid-column: 2; }
  .frise-dot{ width: 34px; height: 34px; font-size: 15px; top: 18px; }
  .frise-card::before{ display: none; }
  .frise-year{ justify-content: flex-start; margin-left: 0; }
  .frise-end{ justify-content: flex-start; }
  .frise-body{ padding: 14px 14px 16px; }
  .frise-title{ font-size: 19px; }
  .stats-anim .frise-item--even .frise-card,
  .stats-anim .frise-item--odd .frise-card{ translate: 24px 0; }
}
