/* ACCES 1 - RUBAN D'ITINERAIRE */

.acces-1 {
  --acces1-border: color-mix(in srgb, var(--gray-dark) 14%, transparent);
  --acces1-shadow: 0 14px 34px rgba(0, 0, 0, 0.08);
  --acces1-shadow-hover: 0 26px 54px rgba(0, 0, 0, 0.16);
  --acces1-radius: 20px;
  /* Largeur du vehicule : sert aussi de borne au keyframe, pour que les deux
     valeurs ne puissent pas diverger. */
  --acces1-vehicule: 30px;

  position: relative;
  overflow: hidden;
  padding: clamp(3.5rem, 7vw, 6rem) 5%;
  background: var(--white);
  color: var(--black);
  font-family: var(--font-body);
}

.acces-1__inner {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
}

/* ============ EN-TÊTE ============ */
.acces-1__head {
  margin-bottom: clamp(2.2rem, 5vw, 3.4rem);
}

.acces-1__title {
  margin: 0 0 0.7rem;
  max-width: 22ch;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5.5vw, 3.8rem);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  color: var(--black);
}

.acces-1__subtitle {
  margin: 0;
  max-width: 60ch;
  font-size: clamp(1rem, 1.6vw, 1.12rem);
  line-height: 1.65;
  color: var(--gray-dark);
}

/* ============ LE RUBAN ============ */
.acces-1__trajet {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 1.4fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(0.8rem, 2vw, 1.6rem);
  padding: clamp(1.4rem, 3.5vw, 2.4rem);
  border-radius: clamp(20px, 3vw, 26px);
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--secondary) 8%, var(--white)),
    var(--white)
  );
  border: 1px solid var(--acces1-border);
  box-shadow: var(--acces1-shadow);
  animation: acces1In 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.acces-1__point {
  min-width: 0;
}

.acces-1__point--arrivee {
  text-align: right;
}

.acces-1__point-kicker {
  display: block;
  margin-bottom: 0.4rem;
  font-family: var(--font-modern);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--gray-dark);
}

.acces-1__point-ville {
  margin: 0 0 0.25rem;
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 3vw, 2.1rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--black);
  overflow-wrap: anywhere;
}

.acces-1__point--arrivee .acces-1__point-ville {
  color: var(--secondary);
}

.acces-1__point-detail {
  margin: 0;
  font-family: var(--font-modern);
  font-size: 0.85rem;
  color: var(--gray-dark);
  overflow-wrap: anywhere;
}

/* La route entre les deux points */
.acces-1__route {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 74px;
}

.acces-1__route-ligne {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 3px;
  border-radius: 999px;
  background: repeating-linear-gradient(
    90deg,
    var(--secondary) 0 12px,
    transparent 12px 22px
  );
  background-size: 22px 3px;
  opacity: 0.55;
  animation: acces1Route 1.6s linear infinite;
}

.acces-1__route-badge {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
  background: var(--primary);
  border: 2px solid var(--white);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
  color: var(--on-primary);
}

.acces-1__route-km {
  font-family: var(--font-numeric);
  font-size: clamp(1.2rem, 2.6vw, 1.7rem);
  font-weight: 800;
  line-height: 1;
}

.acces-1__route-unite {
  font-family: var(--font-modern);
  font-size: 0.78rem;
  font-weight: 700;
}

/* Le véhicule glisse le long de la route */
.acces-1__route-vehicule {
  position: absolute;
  /* Les roues de l'icone tombent vers y=19/24 : on remonte le SVG pour qu'elles
     reposent sur la ligne de route plutot que de la chevaucher. */
  top: calc(50% - 25px);
  left: 0;
  width: var(--acces1-vehicule);
  color: var(--secondary);
  /* On anime `left` et non `translateX` : un pourcentage de transform se
     rapporte à la largeur du véhicule, pas à celle de la piste — il ne
     parcourrait qu'une fraction du trajet. */
  animation: acces1Rouler 7s cubic-bezier(0.45, 0, 0.55, 1) infinite;
}

.acces-1__route-vehicule svg {
  display: block;
  width: 100%;
  height: auto;
}

/* ============ LECTURE DU CHIFFRE ============ */
.acces-1__rayon {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin: clamp(1.2rem, 3vw, 1.8rem) 0 0;
  padding: clamp(0.9rem, 2.2vw, 1.2rem) clamp(1.1rem, 2.8vw, 1.6rem);
  border-left: 6px solid var(--secondary);
  border-radius: 0 var(--acces1-radius) var(--acces1-radius) 0;
  background: color-mix(in srgb, var(--secondary) 8%, transparent);
  font-family: var(--font-modern);
  font-size: clamp(0.95rem, 1.6vw, 1.06rem);
  font-weight: 600;
  line-height: 1.55;
  color: var(--black);
}

.acces-1__rayon--etendu {
  border-left-color: var(--primary);
  background: color-mix(in srgb, var(--primary) 14%, transparent);
}

.acces-1__rayon-puce {
  flex: 0 0 auto;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--secondary);
  animation: acces1Pulse 2.4s ease-in-out infinite;
}

.acces-1__rayon--etendu .acces-1__rayon-puce {
  background: var(--primary);
}

/* ============ ACTIONS ============ */
.acces-1__actions {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.7rem, 2vw, 1.1rem);
  margin-top: clamp(1.6rem, 3.5vw, 2.4rem);
}

.acces-1__btn {
  /* Reset explicite du lien */
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  background: none;
  border: 2px solid transparent;
  color: inherit;
  cursor: pointer;
  text-decoration: none;

  padding: clamp(0.85rem, 2vw, 1.1rem) clamp(1.5rem, 3.2vw, 2.2rem);
  border-radius: 999px;
  font-family: var(--font-heading);
  font-size: clamp(0.98rem, 1.7vw, 1.15rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease,
    background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.acces-1__btn-icon {
  display: block;
  width: 1.2em;
}

.acces-1__btn-icon svg {
  display: block;
  width: 100%;
  height: auto;
}

.acces-1__btn--maps {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--on-secondary);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

.acces-1__btn--maps:hover,
.acces-1__btn--maps:focus-visible {
  transform: translateY(-4px);
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
  box-shadow: var(--acces1-shadow-hover);
}

.acces-1__btn--devis {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.16);
}

.acces-1__btn--devis:hover,
.acces-1__btn--devis:focus-visible {
  transform: translateY(-4px);
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
  box-shadow: var(--acces1-shadow-hover);
}

.acces-1__btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--secondary) 55%, transparent);
  outline-offset: 4px;
}

/* ============ ANIMATIONS ============ */
@keyframes acces1In {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* La route défile : le pointillé avance vers l'arrivée */
@keyframes acces1Route {
  from {
    background-position: 0 0;
  }
  to {
    background-position: 22px 0;
  }
}

/* Le véhicule part du départ et rejoint l'arrivée, sur toute la piste */
@keyframes acces1Rouler {
  0% {
    left: 0;
    opacity: 0;
  }
  10%,
  85% {
    opacity: 1;
  }
  100% {
    left: calc(100% - var(--acces1-vehicule));
    opacity: 0;
  }
}

@keyframes acces1Pulse {
  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.55);
    opacity: 0.45;
  }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  /* Le ruban bascule à la verticale : la route devient une colonne */
  .acces-1__trajet {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
  }

  .acces-1__point--arrivee {
    text-align: left;
  }

  .acces-1__route {
    min-height: 64px;
  }

  .acces-1__route-ligne {
    top: 0;
    bottom: 0;
    left: 50%;
    right: auto;
    width: 3px;
    height: auto;
    transform: translateX(-50%);
    background: repeating-linear-gradient(
      180deg,
      var(--secondary) 0 12px,
      transparent 12px 22px
    );
    background-size: 3px 22px;
    animation-name: acces1RouteVerticale;
  }

  .acces-1__route-vehicule {
    display: none;
  }

  @keyframes acces1RouteVerticale {
    from {
      background-position: 0 0;
    }
    to {
      background-position: 0 22px;
    }
  }

  .acces-1__actions {
    flex-direction: column;
    align-items: stretch;
  }

  .acces-1__btn {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .acces-1__rayon {
    align-items: flex-start;
  }

  .acces-1__rayon-puce {
    margin-top: 0.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .acces-1__trajet,
  .acces-1__route-ligne,
  .acces-1__route-vehicule,
  .acces-1__rayon-puce {
    animation: none;
  }

  .acces-1__route-vehicule {
    opacity: 1;
  }
}

/* ── TITRES : couleur de survol explicite (CLAUDE.md §4.13) ──────────
   Le main.css des themes stylise les balises Hn, hover compris. Chaque
   titre reprend ici sa couleur de base pour neutraliser cet heritage. */
.acces-1__title:hover {
  color: var(--black);
}
