/* Destinations map: a dot-matrix land layer, dotted routes from cities across North
   America, and linked destination pins. scripts/build-route-map.py writes the markup
   (including the map's aspect ratio); route-map.js draws the routes and flies them. */
.route-map {
  position: relative;
  width: 100%;
  isolation: isolate;
}
.route-map-land,
.route-map-routes {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.route-map-land { opacity: .42; }
.route-map-routes { overflow: visible; pointer-events: none; }

.route-line {
  fill: none;
  stroke: #e6e9eb;
  stroke-width: .42;
  stroke-linecap: round;
  stroke-dasharray: 0 1.05;
  opacity: .78;
  transition: opacity .35s ease;
}
.route-reveal {
  fill: none;
  stroke: #fff;
  stroke-width: 2.4;
  stroke-dasharray: 1 1;
  stroke-dashoffset: 0;
}
/* Routes start hidden only when the script is present to draw them in. */
.route-map.will-draw .route-reveal { stroke-dashoffset: 1; transition: stroke-dashoffset 1.4s cubic-bezier(.4, 0, .2, 1) calc(var(--i, 0) * .12s); }
.route-map.will-draw.is-drawn .route-reveal { stroke-dashoffset: 0; }
.route-map[data-active] .route-line { opacity: .3; }
.route-map[data-active] .route-line.is-active { opacity: 1; }

/* The looping flight: a solid line drawn behind a small jet along the dotted route,
   kept until the round ends, and a ripple as it lands. Timing lives in route-map.js. */
.route-flight { transition: opacity .35s ease; }
.route-map[data-active] .route-flight:not(.is-active) { opacity: .2; }
.route-trail {
  fill: none;
  stroke: #f4f4f1;
  stroke-width: .3;
  stroke-linecap: round;
}
.route-landing, .route-takeoff { fill: none; stroke: #e6e7e4; stroke-width: .16; }
.route-jet-body { transform: scale(.11); }
.route-jet-shape { fill: #f4f4f1; }
.route-jet-glow { fill: #f4f4f1; opacity: .1; }
@media (max-width: 600px) { .route-jet-body { transform: scale(.15); } }

.route-origin,
.route-pin {
  position: absolute;
  left: var(--x);
  top: var(--y);
  z-index: 1;
}
/* Names and markers are drawn as on the flight planner's map: 13px Inter in the map's light
   ink with a navy edge behind the letters, a dot for a city flights leave from, and a ring
   round a dot for a place they arrive. */
.route-origin {
  --ink: 241, 240, 236;
  --edge: rgba(16, 37, 64, .82);
  display: flex;
  align-items: center;
  gap: 11px;
  transform: translate(-3.6px, -50%);
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.2;
  color: rgba(var(--ink), .8);
  text-shadow: 2px 0 #102540, -2px 0 #102540, 0 2px #102540, 0 -2px #102540, 1.4px 1.4px #102540, -1.4px 1.4px #102540, 1.4px -1.4px #102540, -1.4px -1.4px #102540;
  white-space: nowrap;
  transition: color .4s ease;
}
.route-origin[data-label="left"] { flex-direction: row-reverse; transform: translate(calc(-100% + 3.6px), -50%); }
.route-origin::before {
  content: '';
  flex: 0 0 7.2px;
  width: 7.2px;
  height: 7.2px;
  border-radius: 50%;
  background: rgb(var(--ink));
  box-shadow: 0 0 0 2px var(--edge), 0 0 0 2px var(--edge);
  transition: box-shadow .4s ease;
}
/* The city a jet is leaving from brightens for the length of its flight, and its dot takes
   the planner's halo. */
.route-origin.is-flying { color: rgba(var(--ink), .96); }
.route-origin.is-flying::before { box-shadow: 0 0 0 5.4px rgba(var(--ink), .22), 0 0 0 7.4px var(--edge); }

.route-pin {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  transform: translate(-7.2px, -50%);
  color: #f1f0ec;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.route-pin[data-label="left"] { flex-direction: row-reverse; transform: translate(calc(-100% + 7.2px), -50%); }
.route-pin-dot {
  flex: 0 0 14.4px;
  width: 14.4px;
  height: 14.4px;
  box-sizing: border-box;
  border: 1.4px solid rgba(241, 240, 236, .95);
  border-radius: 50%;
  background: radial-gradient(circle, rgb(241, 240, 236) 0 2.6px, rgba(16, 37, 64, .82) 3.2px);
  box-shadow: 0 0 0 3px rgba(16, 37, 64, .82);
}
.route-pin-label {
  display: grid;
  gap: 1px;
  padding: 6px 11px 7px;
  border: 1px solid rgba(241, 240, 236, .3);
  border-radius: 10px;
  background: rgba(16, 37, 64, .92);
  font-size: .8125rem;
  font-weight: 500;
  line-height: 1.3;
  white-space: nowrap;
  transition: border-color .25s ease;
}
.route-pin[data-label="left"] .route-pin-label { text-align: right; }
.route-pin-label small {
  font-size: .7rem;
  font-weight: 400;
  letter-spacing: .02em;
  color: rgba(232, 232, 232, .68);
}
.route-pin:is(:hover, :focus-visible) .route-pin-label,
.route-map[data-active] .route-pin.is-active .route-pin-label { border-color: rgba(241, 240, 236, .65); }
.route-pin:focus-visible { outline: none; }
.route-pin:focus-visible .route-pin-label { outline: 2px solid #e8e8e8; outline-offset: 3px; }

/* Every pin's label: the region on top and each stay its own link, at least 24px tall to
   tap. The dot lines up with the last link (5px padding + half of 24px = 17px up from the
   label's bottom), so the label grows upward; in Belize that keeps it clear of the
   Los Angeles route below. */
.route-pin-group { align-items: flex-end; transform: translate(-7.2px, calc(-100% + 17px)); }
.route-pin-group[data-label="left"] { transform: translate(calc(-100% + 7.2px), calc(-100% + 17px)); }
.route-pin-group .route-pin-dot { margin-bottom: 9.8px; }
.route-pin-group .route-pin-label { gap: 0; padding: 6px 11px 5px; }
.route-pin-group .route-pin-label a {
  display: flex;
  align-items: center;
  min-height: 24px;
  color: #f1f0ec;
  -webkit-tap-highlight-color: transparent;
}
.route-pin-group[data-label="left"] .route-pin-label a { justify-content: flex-end; }
/* Stay names are always underlined, so they read as links; brighter on hover or focus. */
.route-pin-group .route-pin-label a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(230, 233, 235, .45);
  text-underline-offset: 3px;
  transition: text-decoration-color .25s ease;
}
.route-pin-group .route-pin-label a:is(:hover, :focus-visible),
.route-map[data-active] .route-pin-group a.is-active { text-decoration-color: rgba(230, 233, 235, .9); }
.route-pin-group .route-pin-label a:focus-visible { outline: 2px solid #e8e8e8; outline-offset: 2px; }
.route-map[data-active] .route-pin-group:has(a.is-active) .route-pin-label { border-color: rgba(241, 240, 236, .65); }
.route-pin-group .route-pin-label small { margin-bottom: 1px; }
@media (max-width: 449px) { .route-pin-group .route-pin-label { padding: 5px 8px 5px; } }

@media (max-width: 449px) {
  .route-pin-label { padding: 5px 9px 6px; font-size: .75rem; }
  .route-pin-label small { font-size: .64rem; }
  .route-origin { gap: 8px; font-size: .6875rem; }
}
@media (prefers-reduced-motion: reduce) {
  .route-map.will-draw .route-reveal { transition: none; stroke-dashoffset: 0; }
  .route-flight { display: none; }
}
