/* =====================================================================
 * §24. TOUR GUIDE: itinerary, photo gallery, map and practical block
 * Only the 8 mexico-city-to-*-private-driver pages load this file.
 * Every colour comes from the tokens in styles.css, so light, dark and
 * the night bands all work without overrides. Photos are real
 * (Wikimedia Commons, free licences); each figure carries its credit,
 * which the CC BY / CC BY-SA licences require. Credits live in
 * data/gallery-credits.json.
 * ===================================================================== */

.tour-guide__lead { max-width: 68ch; color: var(--ink-2); margin-bottom: var(--space-3); }

/* ---------- Itinerary: a vertical timeline ---------- */
.itinerary {
  list-style: none; margin: 0 0 var(--space-4); padding: 0;
  display: grid; gap: 0;
  counter-reset: stop;
}
.itinerary li {
  position: relative;
  display: grid; grid-template-columns: 84px 1fr; gap: 0 18px;
  padding: 0 0 var(--space-3);
  margin: 0;
}
.itinerary li::before {             /* the rail */
  content: ""; position: absolute; left: 91px; top: 10px; bottom: -4px;
  width: 2px; background: var(--line-2);
}
.itinerary li:last-child::before { display: none; }
.itinerary li::after {              /* the stop dot */
  content: ""; position: absolute; left: 86px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--clay); box-shadow: 0 0 0 4px var(--paper);
}
.section--soft .itinerary li::after { box-shadow: 0 0 0 4px var(--surface); }
.itinerary__time {
  font-size: var(--fs-sm); font-weight: 700; line-height: 1.4;
  color: var(--gold-deep); text-align: right; padding-right: 14px;
  font-variant-numeric: tabular-nums;
}
.itinerary__body { padding-left: 14px; min-width: 0; }
.itinerary__body h3 { font-size: var(--fs-md); margin: 0 0 4px; line-height: 1.3; }
.itinerary__body p { margin: 0; color: var(--ink-2); }

/* ---------- Gallery ---------- */
.tour-gallery {
  display: grid; gap: 18px;
  grid-template-columns: 1fr;
  margin: 0 0 var(--space-4);
}
@media (min-width: 560px) { .tour-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .tour-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* No orphan in the last row: wide tiles fill the gap. A wide tile keeps the
   row height of its neighbours (2 columns + gap over 2/3 of one column ≈ 3.08:1),
   so no blank space opens under the single tiles beside it. */
@media (min-width: 560px) and (max-width: 979px) {
  .tour-gallery__item:last-child:nth-child(odd) { grid-column: span 2; }
  .tour-gallery__item:last-child:nth-child(odd) img { aspect-ratio: 3.08 / 1; object-position: 50% 35%; }
}
@media (min-width: 980px) {
  .tour-gallery__item:first-child,
  .tour-gallery__item:last-child:nth-child(3n+1) { grid-column: span 2; }
  .tour-gallery__item:first-child img,
  .tour-gallery__item:last-child:nth-child(3n+1) img { aspect-ratio: 3.08 / 1; object-position: 50% 35%; }
}
.tour-gallery__item { margin: 0; min-width: 0; display: flex; flex-direction: column; }
.tour-gallery__item img {
  display: block; width: 100%; height: auto;
  aspect-ratio: 3 / 2; object-fit: cover;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface-2);
  box-shadow: var(--shadow-md);
}
.tour-gallery__item figcaption {
  margin-top: 10px; padding-left: 12px; border-left: 2px solid var(--clay);
  font-size: var(--fs-sm); line-height: 1.45; color: var(--ink-2);
}
.tour-gallery__name { display: block; font-weight: 700; color: var(--ink); }
.tour-gallery__credit {
  display: block; margin-top: 4px;
  font-size: var(--fs-xs); color: var(--ink-3);
  overflow-wrap: anywhere;
}
.tour-gallery__credit a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.tour-gallery__credit a:hover { color: var(--clay); }

/* ---------- Map + practical block ---------- */
.tour-plan { display: grid; gap: var(--space-3); grid-template-columns: 1fr; align-items: start; }
@media (min-width: 900px) { .tour-plan { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); } }
.tour-map { margin: 0; min-width: 0; }
.tour-map iframe {
  display: block; width: 100%; aspect-ratio: 4 / 3; height: auto; border: 0;
  border-radius: var(--radius); box-shadow: var(--shadow-md);
  background: var(--surface-2);
}
.tour-map figcaption { margin-top: 8px; font-size: var(--fs-xs); color: var(--ink-3); }
.tour-map figcaption a { color: inherit; }
.tour-facts {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(18px, 2.4vw, 28px);
  min-width: 0;
}
.section--soft .tour-facts { background: var(--paper); }
.tour-facts h3 { margin-top: 0; font-size: var(--fs-lg); }
.tour-facts .fact-list li { margin-bottom: 12px; line-height: 1.5; }
.tour-facts .fact-list li:last-child { margin-bottom: 0; }
.tour-facts .fact-list strong { color: var(--ink); }

@media (max-width: 520px) {
  .itinerary li { grid-template-columns: 64px 1fr; gap: 0 12px; }
  .itinerary li::before { left: 69px; }
  .itinerary li::after { left: 64px; }
  .itinerary__time { padding-right: 10px; font-size: var(--fs-xs); }
  .itinerary__body { padding-left: 10px; }
}
