/* 台北到馬爾地夫轉機路線地圖；視覺語言沿用 /maldives-map/。 */
.ml-trmap-section {
  --tr-sea: #3b82bd;
  --tr-endpoint: #c9a24b;
  --tr-transfer: #38a6a5;
  --tr-other: #d7dfe3;
  margin: 0;
  background: var(--tr-sea);
}

.ml-trmap {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  height: min(88vh, 940px);
  min-height: 520px;
  border-block: 1px solid var(--c-gray-300);
}

.ml-trmap__mapcol { position: relative; min-width: 0; overflow: hidden; border-inline-end: 1px solid var(--c-gray-300); background: var(--tr-sea); }

.ml-trmap__canvas { height: 100%; min-height: 0; }
.ml-trmap__svg { display: block; width: 100%; height: 100%; min-height: 0; }

.ml-trmap__svg .ml-trmap__route { transition: stroke-opacity 0.2s ease, stroke-width 0.2s ease; }
.ml-trmap__svg .ml-trmap__route.is-active { stroke-opacity: 1; stroke-width: 2.4; }
.ml-trmap__svg .ml-trmap__route.is-dim { stroke-opacity: 0.14; }

.ml-trmap__float {
  position: absolute;
  z-index: 2;
  top: 1rem;
  left: 1rem;
  max-width: min(31rem, calc(100% - 2rem));
  pointer-events: none;
}

.ml-trmap__float h1 {
  margin: 0;
  color: #fff;
  font-family: var(--f-display);
  font-size: var(--fs-xl);
  font-weight: 600;
  line-height: 1.12;
  text-shadow: 0 1px 5px rgba(12, 60, 92, 0.78);
}

.ml-trmap__selectlabel {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.ml-trmap__selectwrap { position: relative; width: 100%; margin-bottom: 1.15rem; pointer-events: auto; }
.ml-trmap__selectwrap::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0.8rem;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid var(--c-gray);
  border-bottom: 2px solid var(--c-gray);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.ml-trmap__select {
  width: 100%;
  padding: 0.65rem 2.3rem 0.65rem 0.85rem;
  border: 1px solid var(--c-gray-300);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 16px rgba(19, 42, 56, 0.2);
  color: var(--c-text);
  font: inherit;
  font-size: var(--fs-sm);
  cursor: pointer;
  appearance: none;
}
.ml-trmap__select:hover { border-color: var(--c-accent); }
.ml-trmap__select:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }

.ml-trmap__guide {
  position: absolute;
  z-index: 2;
  left: 1rem;
  bottom: 1rem;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  gap: 0.4rem;
  max-width: calc(100% - 2rem);
  pointer-events: none;
}

.ml-trmap__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  padding: 0.45rem 0.65rem;
  border-radius: 8px;
  background: rgba(255,255,255,0.92);
  color: var(--c-text);
  font-size: var(--fs-xs);
  font-weight: 700;
}

.ml-trmap__legend span { display: inline-flex; align-items: center; gap: 0.4rem; }
.ml-trmap__legend i { width: 0.7rem; height: 0.7rem; border-radius: 50%; }
.ml-trmap__legend .is-endpoint { background: var(--tr-endpoint); }
.ml-trmap__legend .is-transfer { background: var(--tr-transfer); }
.ml-trmap__legend .is-other { background: var(--tr-other); }
.ml-trmap__legend .is-route { width: 1.6rem; height: 0.18rem; border-radius: 999px; background: rgba(224, 59, 47, 0.75); }

.ml-trmap__footnote {
  margin: 0;
  max-width: min(54ch, 100%);
  color: #fff;
  font-size: calc(var(--fs-xs) * 0.9);
  line-height: 1.5;
  text-shadow: 0 1px 3px rgba(12,60,92,0.85);
}

.ml-trmap__side { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: #fff; }
.ml-trmap__sidehead { padding: 1.5rem; border-bottom: 1px solid var(--c-gray-300); background: #fff; }
.ml-trmap__sidehead .ml-eyebrow { margin: 0 0 0.25rem; }
.ml-trmap__sidehead h2 { margin: 0; font-size: 1.65rem; }

.ml-trmap__infos { min-height: 0; overflow-y: auto; }
.ml-trmap__info { padding: 1.5rem; }
.ml-trmap__info[hidden] { display: none; }
.ml-trmap__infoairport { display: grid; grid-template-columns: 3.2rem minmax(0, 1fr); gap: 0.9rem; align-items: center; padding-bottom: 1.25rem; border-bottom: 1px solid var(--c-gray-300); }
.ml-trmap__code { display: grid; place-items: center; width: 3.2rem; height: 3.2rem; border-radius: 50%; background: var(--tr-transfer); color: #fff; font-weight: 800; letter-spacing: 0.06em; }
.ml-trmap__infoairport h3 { margin: 0; font-size: 1.25rem; }
.ml-trmap__infoairport p { margin: 0.15rem 0 0; color: var(--c-gray); font-size: var(--fs-xs); }
.ml-trmap__infoblock { padding: 1.15rem 0; border-bottom: 1px solid var(--c-gray-300); }
.ml-trmap__infoblock > span { display: block; margin-bottom: 0.35rem; color: var(--c-gray); font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.08em; }
.ml-trmap__infoblock p { margin: 0; color: var(--c-gray); font-size: var(--fs-sm); line-height: 1.7; }
.ml-trmap__infoblock.is-note { margin-top: 1rem; padding: 1rem; border: 0; border-radius: 10px; background: var(--c-accent-100); }
.ml-trmap__infoblock.is-note > span, .ml-trmap__infoblock.is-note p { color: var(--c-text); }
.ml-trmap__path { color: var(--c-accent-700); font-weight: 800; }
.ml-trmap__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

@media (max-width: 900px) {
  .ml-trmap { display: block; height: auto; min-height: 0; }
  .ml-trmap__mapcol { height: 580px; border-inline-end: 0; }
  .ml-trmap__infos { overflow: visible; }
}

@media (max-width: 600px) {
  .ml-trmap__mapcol { height: 460px; }
  .ml-trmap__float h1 { font-size: var(--fs-lg); }
  .ml-trmap__select { font-size: var(--fs-xs); }
  .ml-trmap__footnote { display: none; }
  .ml-trmap__legend { gap: 0.35rem 0.65rem; font-size: calc(var(--fs-xs) * 0.9); }
}

@media (prefers-reduced-motion: reduce) {
  .ml-trmap__svg .ml-trmap__route { transition: none; }
}
