/* Fichier produit par le build (scripts/build/styles.mjs) à partir de styles/ailleurs/*.css : c'est là qu'il faut modifier. */
/* — Ailleurs : un carnet de voyage. La table des étapes (décompte, carte, lieux par année),
   puis un départ après l'autre, du plus récent au plus ancien. — */
.etapes {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 20px 48px;
  max-width: 55rem;
  margin: -8px 0 clamp(36px, 7vh, 72px);
  animation: fade 1s var(--ease) 0.5s both;
}
.etapes__bilan { margin: 0; }

/* La carte : le trait de côte, un trait de Rennes vers chaque départ, un point à l'arrivée */
.carte {
  display: block; width: 100%; height: auto; color: var(--ink);
  /* la carte s'efface vers ses bords, comme une page de carnet qui n'a pas de cadre */
  -webkit-mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(to right, transparent, #000 7%, #000 93%, transparent), linear-gradient(to bottom, transparent, #000 7%, #000 93%, transparent);
  mask-composite: intersect;
}
.carte__cote { fill: color-mix(in srgb, currentColor 4%, transparent); stroke: currentColor; stroke-opacity: 0.34; stroke-width: 0.8; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.carte__traits path { fill: none; stroke: var(--accent); stroke-opacity: 0.6; stroke-width: 1; stroke-linecap: round; vector-effect: non-scaling-stroke; transition: stroke var(--fade); }
.carte__origine { fill: var(--bg); stroke: currentColor; stroke-width: 1.2; vector-effect: non-scaling-stroke; transition: fill var(--fade); }
.carte__point { fill: var(--accent); stroke: var(--bg); stroke-width: 1.5; paint-order: stroke; transition: fill var(--fade), r 0.25s var(--ease); }
.carte__cible { fill: transparent; }
.carte a { cursor: pointer; outline: none; }
.carte a:hover .carte__point, .carte a:focus-visible .carte__point { r: 5.4; fill: currentColor; }
.carte a:focus-visible .carte__cible { stroke: currentColor; stroke-width: 1; vector-effect: non-scaling-stroke; }
.carte__fleche { fill: none; stroke: var(--accent); stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.carte text { font-family: var(--engraved); font-size: 11.5px; letter-spacing: 0.14em; text-transform: uppercase; fill: var(--muted); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; transition: fill 0.3s ease; }
.carte a:hover text, .carte a:focus-visible text { fill: currentColor; }

.etapes__liste { list-style: none; margin: 0; padding: 0; align-self: start; }
.etapes__liste li {
  display: grid;
  grid-template-columns: 3.6rem minmax(0, 1fr);
  column-gap: 16px;
  align-items: baseline;
  padding: 7px 0;
  border-top: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
}
.etapes__liste li:last-child { border-bottom: 1px solid color-mix(in srgb, var(--ink) 16%, transparent); }
.etapes__lieux { display: flex; flex-wrap: wrap; gap: 0 18px; }
.etapes__lieux a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: 18px;
  line-height: 1.2;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--ink) 25%, transparent);
  text-underline-offset: 5px;
  transition: text-decoration-color 0.3s ease;
}
.etapes__lieux a:hover { text-decoration-color: var(--accent); }
.etapes__lieux a:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; }

.depart {
  max-width: 55rem;
  padding: clamp(28px, 5vh, 48px) 0 clamp(36px, 7vh, 72px);
  border-top: 1px solid color-mix(in srgb, var(--ink) 16%, transparent);
  scroll-margin-top: 16px;
}
.depart__meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; }
.depart h2 {
  margin: 14px 0 clamp(20px, 4vh, 36px);
  font-family: var(--serif);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(46px, 8vw, 104px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
  text-shadow: var(--relief);
  text-wrap: balance;
  transition: color var(--fade);
}
/* la note du carnet : une ou deux phrases sous le titre */
.depart__note {
  max-width: 30rem;
  margin: calc(clamp(20px, 4vh, 36px) * -0.45) 0 clamp(22px, 4vh, 36px);
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(19px, 2.1vw, 22px);
  line-height: 1.4;
  color: var(--soft);
  text-wrap: pretty;
}
.depart__photos { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: start; }
.photo { margin: 0; }
.photo picture, .photo img { display: block; width: 100%; height: auto; }
.photo img { border-radius: 3px; background: var(--photo-bg); }
.photo figcaption { margin-top: 10px; font-size: 13px; line-height: 1.5; color: var(--muted); text-wrap: pretty; }
.photo--une, .photo--large { grid-column: 1 / -1; }
.photo--une { margin-bottom: 6px; }
.photo--decale { grid-column: 1 / -1; justify-self: end; width: 64%; }
.photo--demi figcaption, .photo--decale figcaption, .photo--large figcaption { margin-bottom: 8px; }

@media (min-width: 760px) {
  .etapes { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: center; }
  .etapes__bilan { grid-column: 1 / -1; }
  /* Carte postale : un départ d'une seule photo, la photo d'un côté et le texte de l'autre */
  .depart--carte { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); column-gap: clamp(28px, 4vw, 56px); align-items: end; }
  .depart--carte .depart__photos { display: block; grid-row: 1; grid-column: 1; }
  .depart--carte .depart__tete { grid-row: 1; grid-column: 2; padding-bottom: 4px; }
  .depart--carte-droite { grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); }
  .depart--carte-droite .depart__photos { grid-column: 2; }
  .depart--carte-droite .depart__tete { grid-column: 1; }
  .depart--carte .depart__meta { flex-direction: column; }
  .depart--carte h2 { font-size: clamp(44px, 5.4vw, 68px); margin-bottom: 20px; }
  .depart--carte .depart__note { margin: 0; }
  .depart--carte .photo--une { margin-bottom: 0; }
}

/* — Téléphone : la première photo d'un départ va d'un bord à l'autre de l'écran — */
@media (max-width: 600px) {
  .photo--une { margin-inline: calc(var(--gutter) * -1); }
  .photo--une img { border-radius: 0; }
  .photo--une figcaption { padding-inline: var(--gutter); }
}

@media (min-width: 900px) {
  /* sur grand écran, une photo ne dépasse jamais la hauteur de la fenêtre */
  .photo--une img, .photo--large img { width: auto; max-width: 100%; max-height: 84vh; }
}

/* — Mouvement — */
/* La carte d'Ailleurs : les traits partent de Rennes dans l'ordre des départs, chaque point se pose à l'arrivée */
@media (prefers-reduced-motion: no-preference) {
  .carte__cote { animation: fade 1.2s var(--ease) 0.5s both; }
  .carte__traits path { stroke-dasharray: 1; animation: draw 0.9s var(--ease) both; animation-delay: calc(0.9s + var(--i) * 0.07s); }
  .carte__points a, .carte__sorties a { animation: fondu 0.5s ease both; animation-delay: calc(1.6s + var(--i) * 0.07s); }
}

/* Page encore vide (Ailleurs sans photo) : même gabarit qu'un départ, en attente */
.depart--vide { animation: fade 1s var(--ease) 0.55s both; }
.depart--vide p { max-width: 30rem; margin: 0; font-size: 17px; line-height: 1.7; color: var(--soft); text-wrap: pretty; }

/* Au fil du défilement : les photos arrivent quand on arrive à elles.
   Sans prise en charge du navigateur, tout est simplement visible. */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .photo {
      animation: apparait linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 55%;
    }
  }
}
