/* EN version: blue-light background, full width */
.location--en {
  --section-bg: #F3F9FB !important;
  max-width: none !important;
}
@media (max-width: 767px) {
  .location--en { background: #F3F9FB !important; }
}
.location--en .location__head,
.location--en .location__body {
  margin-inline: auto !important;
}
/* EN composite map: full-size, no separate route overlay needed */
.location__map-composite-img {
  object-fit: cover;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Railway legend line */
.location__legend-railway-line {
  width: 32px;
  height: 4px;
  flex-shrink: 0;
  border-top: 3px dashed #3E3E3E;
  align-self: center;
}

.location {
  --section-bg: #F9F7F6;
  width: 100%;
  max-width: 1440px;
  margin-inline: auto;
  padding: 80px 60px 100px;
  background: var(--section-bg);
  display: flex;
  flex-direction: column;
  gap: 60px;
  box-sizing: border-box;
}

.location__head,
.location__body {
  width: 100%;
  max-width: 1320px;
  margin-inline: auto;
  box-sizing: border-box;
}

.location__head {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-inline: 0;
}

.location__tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-grey-800);
  font-size: 15px;
  line-height: 24px;
  font-weight: 500;
}

.location__title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 48px;
  line-height: 56px;
  letter-spacing: -0.96px;
  color: var(--color-dark);
  margin: 0;
}

.location__title-line {
  display: block;
}

.location__title-line--1 {
  white-space: nowrap;
}

.location__body {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Mobile-only map image — hidden on desktop */
.location__mob-map { display: none; }

/* ── Map wrap ── */
.location__map-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 1320 / 640;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-grey-100);
}

.location__map-composite {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ── Map layers (bg + route) ── */
.location__map-bg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
}
.location__map-route {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ── Map pins ── */
.location__pin {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

/* ── Legend ── */
.location__legend {
  position: absolute;
  bottom: 16px;
  right: 16px;
  width: 378px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.location__legend-item {
  display: flex;
  gap: 12px;
  align-items: center;
}
.location__legend-item > img {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  object-fit: contain;
}

.location__legend-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.location__legend-icon--orange { background: var(--color-orange-500); }
.location__legend-icon--dark   { background: #3E3E3E; }
.location__legend-icon--blue   { background: #2A9BC7; }

.location__legend-text { flex: 1 0 0; min-width: 0; }

.location__legend-title {
  font-size: 13px;
  line-height: 20px;
  font-weight: 500;
  color: #121211;
  margin: 0;
}

.location__legend-sub {
  font-size: 12px;
  line-height: 16px;
  color: #696969;
  margin: 2px 0 0;
}

/* ── Distance cards ── */
.location__cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.location-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.location-card__label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 24px;
  font-weight: 500;
  color: #696969;
}
.location-card__label svg {
  width: 24px;
  height: 24px;
  color: var(--color-orange-500);
  flex-shrink: 0;
}

.location-card__num {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.location-card__num-value {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 32px;
  line-height: 40px;
  letter-spacing: -0.64px;
  color: var(--color-dark);
}
.location-card__num-sub {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  line-height: 24px;
  font-weight: 500;
  color: #3E3E3E;
}

.location__note {
  max-width: 872px;
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  color: var(--color-dark);
  margin: 0;
}

@media (max-width: 1279px) {
  .location__cards { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .location__legend { width: 300px; }
  .location__title-line--1 { white-space: normal; }
}

@media (max-width: 1023px) {
  .location { padding: 64px 20px 80px; gap: 40px; }
  .location__head { max-width: 100%; }
  .location__title { font-size: 32px; line-height: 40px; letter-spacing: -0.64px; }
  .location__title-line--1 { white-space: normal; }
  /* Legend: pull out of absolute, show below map */
  .location__map-wrap { overflow: visible; }
  .location__legend {
    position: static;
    width: auto;
    background: var(--color-white);
    backdrop-filter: none;
    border: 1px solid var(--color-grey-100);
    border-radius: 12px;
    margin-top: 16px;
  }
  .location__pin { display: none; }
  .location-card__num-value { font-size: 26px; line-height: 32px; }
}

@media (max-width: 767px) {
  .location {
    padding: 60px 20px 80px;
    gap: 32px;
    background: var(--color-orange-10);
  }
  .location__head { gap: 8px; max-width: none; }
  .location__title {
    font-size: 28px;
    line-height: 36px;
    letter-spacing: -.56px;
  }
  .location__title-line--1 { white-space: normal; }
  .location__body { gap: 16px; display: flex; flex-direction: column; }

  /* Mobile map: use compact SVG, hide desktop layers */
  .location__mob-map {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0;
    flex-shrink: 0;
  }
  .location__map-bg,
  .location__map-route,
  .location__pin { display: none; }

  /* R3: overflow:hidden clips SVG white fields; R4: flex+gap separates legend from map */
  .location__map-wrap {
    height: auto;
    aspect-ratio: unset;
    overflow: hidden;
    background: none;
    border-radius: 0;
    display: flex;
    flex-direction: column;
  }

  /* Mobile: legend below map as separate card with gap */
  .location__legend {
    position: static;
    width: 100%;
    background: var(--color-white);
    border: 1px solid var(--color-grey-100);
    border-radius: 12px;
    padding: 16px;
    gap: 12px;
    backdrop-filter: none;
    box-shadow: var(--shadow-100);
    margin-top: 16px;
  }

  /* Distance cards — stack with 4px gap, overflow rounded 12, padding 24 */
  .location__cards {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 16px;
    border-radius: 12px;
    overflow: hidden;
  }
  .location-card { padding: 24px; border-radius: 0; gap: 8px; }
  .location-card__label {
    font-size: 15px; line-height: 24px; color: var(--color-grey-700);
  }
  .location-card__num { align-items: baseline; gap: 8px; }
  .location-card__num-value {
    font-size: 28px;
    line-height: 34px;
    letter-spacing: -0.56px;
    font-weight: 700;
  }
  .location-card__num-sub {
    font-size: 15px;
    line-height: 24px;
    color: var(--color-grey-900);
  }

  .location__note {
    max-width: none;
    margin-top: 16px;
    font-size: 18px;
    line-height: 24px;
    font-weight: 600;
  }
}
