/* ==========================================================================
   Version Château de La Ferté-Saint-Aubin : carte d'accès
   ========================================================================== */

.access {
  padding-block: clamp(80px, 10vw, 150px) clamp(40px, 6vw, 80px);
  background: linear-gradient(180deg, var(--night), var(--night-2) 50%, var(--night));
}
.access__grid {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  grid-template-areas: "head stage" "steps stage";
  column-gap: clamp(40px, 6vw, 96px);
}
.access__head { grid-area: head; }
.access__story { display: contents; }
.access__lede { margin-top: 1.4rem; max-width: 30rem; color: var(--mist); font-size: var(--fs-lg); }
.access__stage {
  grid-area: stage;
  align-self: start;
  position: sticky;
  top: calc(12vh + env(safe-area-inset-top, 0px));
  margin: 0;
  display: grid;
  gap: .9rem;
}
.access__stage.is-3d { height: 76vh; height: 76svh; grid-template-rows: minmax(0, 1fr) auto; }
.access__canvas {
  display: none;
  width: 100%;
  height: 100%;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: var(--night);
  touch-action: pan-y;
}
.access__stage.is-3d .access__canvas { display: block; }
.access__stage.is-3d .access__fallback { display: none; }
.access__fallback { display: block; width: 100%; max-width: 560px; height: auto; }
.access__labels { position: absolute; top: 0; left: 0; overflow: hidden; pointer-events: none; border-radius: 22px; }
.access__stage:not(.is-3d) .access__labels { display: none; }
.access__caption { font-size: var(--fs-xs); letter-spacing: .22em; text-transform: uppercase; color: var(--gold); }

.map-label {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  justify-items: center;
  gap: 1px;
  white-space: nowrap;
  text-align: center;
  color: var(--ivory);
  font: 600 13px/1.25 var(--font-body);
  letter-spacing: .02em;
  text-shadow: 0 2px 12px rgba(5, 7, 15, .95), 0 0 2px rgba(5, 7, 15, .9);
  opacity: 0;
  will-change: transform;
}
.map-label small { font-size: 11px; font-weight: 500; color: var(--gold); letter-spacing: .06em; }
.map-label.is-venue strong { font: italic 600 19px/1.2 var(--font-display); color: var(--gold-hi); }
.map-label.is-equestrian small { color: var(--team-5); }
.map-label.is-river strong { font: italic 500 16px var(--font-display); color: var(--team-1); }
.map-label.is-region strong { font: italic 500 20px var(--font-display); color: var(--team-5); }
.map-label.is-road strong, .map-label.is-rail strong {
  padding: 2px 7px;
  border-radius: 5px;
  font-size: 11px;
  letter-spacing: .08em;
  text-shadow: none;
}
.map-label.is-road strong { background: var(--gold); color: var(--night); }
.map-label.is-rail strong { background: var(--ivory); color: var(--night); }

.access__steps { grid-area: steps; margin: clamp(32px, 5vw, 64px) 0 0; padding: 0; list-style: none; }
.access__step {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1.4rem;
  align-content: center;
  min-height: 62vh;
  padding-block: 2rem;
  border-top: 1px solid var(--line-soft);
  transition: opacity .5s var(--ease-out);
}
.access.is-live .access__step:not(.is-active) { opacity: .28; }
.access__num {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(2.6rem, 2rem + 2vw, 4rem);
  line-height: .9;
  color: var(--gold);
}
.access__step h3 { font-family: var(--font-display); font-size: var(--fs-h3); line-height: 1.15; }
.access__step p { margin-top: .6rem; color: var(--mist); max-width: 30rem; }

.access__river { fill: none; stroke: var(--team-1); stroke-width: 5; stroke-linecap: round; opacity: .55; }
.access__river-label,
.access__region { font: italic 500 18px var(--font-display); fill: var(--mist); }
.access__region { fill: var(--team-5); opacity: .85; }
.access__rail { fill: none; stroke: var(--ivory); stroke-opacity: .35; stroke-width: 2; stroke-dasharray: 2 7; stroke-linecap: round; }
.access__route-bg { fill: none; stroke: var(--gold); stroke-opacity: .16; stroke-width: 7; stroke-linecap: round; }
.access__route { fill: none; stroke: var(--gold); stroke-width: 4; stroke-linecap: round; }
.access__spur { fill: none; stroke: var(--gold); stroke-width: 3; stroke-dasharray: 5 6; opacity: .8; }
.access__km { font: 600 13px var(--font-body); letter-spacing: .08em; fill: var(--gold-hi); }
.access__km--soft { fill: var(--mist); }

.access__city circle { fill: var(--ivory); }
.access__city text { font: 600 17px var(--font-body); fill: var(--ivory); }
.access__city .access__sub { font: 500 13px var(--font-body); letter-spacing: .04em; fill: var(--gold); }
.access__city--venue circle { fill: var(--gold); }
.access__city--venue text { font: italic 600 21px var(--font-display); fill: var(--gold-hi); }
.access__city .access__pulse {
  fill: none;
  stroke: var(--gold);
  stroke-width: 2;
  transform-box: fill-box;
  transform-origin: center;
  animation: venue-pulse 2.4s ease-out infinite;
}
@keyframes venue-pulse {
  0% { transform: scale(1); opacity: .9; }
  100% { transform: scale(2.8); opacity: 0; }
}
.access__north path { fill: var(--gold); }
.access__north text { font: 700 12px var(--font-body); fill: var(--mist); }
.access__legend text { font: 500 12px var(--font-body); fill: var(--mist); }
.access__legend-road { stroke: var(--gold); stroke-width: 4; stroke-linecap: round; }
.access__legend-rail { stroke: var(--ivory); stroke-opacity: .5; stroke-width: 2; stroke-dasharray: 2 6; stroke-linecap: round; }

@media (max-width: 960px) {
  .access__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "stage" "steps"; }
  .access__stage {
    z-index: 3;
    top: calc(60px + env(safe-area-inset-top, 0px));
    margin-top: 2rem;
    padding-block: 10px;
    background: var(--night-2);
  }
  .access__stage.is-3d { height: 52vh; height: 52svh; }
  .access__stage:not(.is-3d) { position: static; }
  .access__step { min-height: 48vh; }
  .access__grid { display: block; }
  .access__story { display: block; }
  .access.is-pinned-story .access__stage { position: relative; top: auto; margin-top: 2rem; padding-block: 0; background: transparent; }
  .access.is-pinned-story .access__stage.is-3d { height: 46vh; height: 46svh; }
  .access.is-pinned-story .access__steps { position: relative; min-height: 12.5rem; margin-top: 1rem; }
  .access.is-pinned-story .access__step {
    position: absolute;
    inset: 0 0 auto 0;
    min-height: 0;
    padding-block: 1rem 0;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .45s var(--ease-out), transform .45s var(--ease-out);
  }
  .access.is-pinned-story .access__step.is-active { opacity: 1; transform: none; }
  .access.is-pinned-story .access__step:not(.is-active) { opacity: 0; }
  .map-label.is-venue strong { font-size: 16px; }
}
