/* Sinyal haritası — "Nerede varız" as a dot-matrix globe (mechanics in
   map.js). The stage is a column: heading, the board, the departures row.
   The dot grid is canvas; the cities are real <li>s that map.js moves every
   frame with the camera, and hides while they are behind the planet. */

.bp-map {
  display: flex;
  flex-direction: column;
  background: var(--sc-canvas);
  padding: clamp(88px, 12vh, 124px) clamp(20px, 5vw, 48px) clamp(24px, 4vh, 40px);
}

/* ---- heading ---- */
.bp-map__head {
  max-width: 1160px; width: 100%; margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: clamp(24px, 4vw, 64px); align-items: end;
  flex: none;
}
.bp-map__head h2 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: .98; margin: 0; }
.bp-map__head p { margin: 0; font: 400 clamp(.95rem, 1.15vw, 1.08rem)/1.6 var(--sc-font-text); color: var(--sc-ink-soft); max-width: 44ch; }
.bp-map__head p b { color: var(--sc-ink); font-weight: 500; }
.bp-map__side { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
/* the one line abroad: Türkiye is the board, İngiltere is a door to Keşfet */
.bp-map__abroad {
  display: inline-flex; align-items: baseline; gap: 10px; max-width: 44ch;
  font: 400 13px/1.45 var(--sc-font-text); color: var(--sc-ink-soft); text-decoration: none;
  padding-bottom: 3px; border-bottom: 1px solid rgba(242,242,242,.22); transition: color 200ms, border-color 200ms;
}
.bp-map__abroad span {
  flex: none; font: 500 11px/1 var(--sc-font-text); letter-spacing: .14em; text-transform: uppercase; color: var(--sc-ink);
}
.bp-map__abroad span::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--sc-accent); vertical-align: 1px; }
.bp-map__abroad:hover { color: var(--sc-ink); border-color: var(--sc-ink); }
.bp-map__abroad:focus-visible { outline: 2px solid var(--sc-accent); outline-offset: 3px; }

/* ---- the board ---- */
.bp-map__stage {
  position: relative;
  flex: 1 1 auto; min-height: 0;
  max-width: 1160px; width: 100%; margin: clamp(20px, 3vh, 36px) auto;
}
.bp-map__fit {
  position: absolute; inset: 0; margin: auto;   /* sized by JS to the stage */
  overflow: hidden;
}
.bp-map__dots { display: block; width: 100%; height: 100%; }

.bp-map__cities { list-style: none; margin: 0; padding: 0; }
.bp-map__city {
  position: absolute; left: 0; top: 0;   /* translated to its place by map.js */
  width: 0; height: 0;
  --d: 12px;
}
.bp-map__city.is-off { visibility: hidden; }
.bp-map__city[data-tier="2"] { --d: 9px; }
.bp-map__city[data-tier="3"] { --d: 7px; }
/* the hit area: a 0×0 anchor with a 36px disc around it */
.bp-map__city::before { content: ""; position: absolute; inset: -18px; border-radius: 50%; }
.bp-map__city:focus-visible { outline: none; }
.bp-map__city:focus-visible .bp-map__dot { outline: 2px solid var(--sc-accent); outline-offset: 4px; }

.bp-map__dot {
  position: absolute; left: 0; top: 0;
  width: var(--d); height: var(--d); border-radius: 50%;
  background: var(--sc-ink);
  transform: translate(-50%, -50%) scale(.3);
  opacity: 0;
  transition: transform 520ms var(--sc-ease-out), opacity 300ms, box-shadow 420ms;
}
.bp-map__city.is-lit .bp-map__dot {
  opacity: 1;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 12px 2px rgba(242,242,242,.55);
}
.bp-map__city.is-current .bp-map__dot { transform: translate(-50%, -50%) scale(1.25); box-shadow: 0 0 18px 4px rgba(242,242,242,.7); }

/* labels: metropols carry a flap row (its cells bring their own plate);
   the rest are small caps on a canvas-coloured plate so they read over dots */
.bp-map__label {
  position: absolute; white-space: nowrap;
  opacity: 0; transition: opacity 420ms var(--sc-ease-out) 120ms;
  pointer-events: none;
}
.bp-map__city.is-lit .bp-map__label { opacity: 1; }
.bp-map__label [data-flap] { font: 600 clamp(11px, 1.05vw, 15px)/1 var(--sc-font-display); letter-spacing: .02em; }
.bp-map__city[data-tier="2"] .bp-map__label,
.bp-map__city[data-tier="3"] .bp-map__label {
  font: 500 11px/1 var(--sc-font-text); letter-spacing: .1em; text-transform: uppercase;
  color: var(--sc-ink); background: var(--sc-canvas); padding: 3px 5px; border-radius: 2px;
}
.bp-map__city[data-tier="3"] .bp-map__label { color: var(--sc-ink-soft); font-size: 10px; }
.bp-map__city.is-current[data-tier="3"] .bp-map__label { color: var(--sc-ink); }
/* placement, relative to the 0×0 anchor */
.bp-map__city[data-label="r"]  .bp-map__label { left: 12px; top: 0; transform: translateY(-50%); }
.bp-map__city[data-label="l"]  .bp-map__label { right: 12px; top: 0; transform: translateY(-50%); }
.bp-map__city[data-label="t"]  .bp-map__label { bottom: 11px; left: 0; transform: translateX(-50%); }
.bp-map__city[data-label="b"]  .bp-map__label { top: 11px; left: 0; transform: translateX(-50%); }
.bp-map__city[data-label="tr"] .bp-map__label { left: 9px; bottom: 8px; }
.bp-map__city[data-label="tl"] .bp-map__label { right: 9px; bottom: 8px; }
.bp-map__city[data-label="br"] .bp-map__label { left: 9px; top: 8px; }
.bp-map__city[data-label="bl"] .bp-map__label { right: 9px; top: 8px; }

/* ---- the departures row ---- */
.bp-map__board {
  flex: none;
  max-width: 1160px; width: 100%; margin: 0 auto;
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center;
  gap: clamp(16px, 2.4vw, 32px);
  padding: 16px 0 0;
  /* Reserved height: İstanbul's seven tags wrap to a second line, and a row
     that grows shrinks the stage above it, so the map jumped under the
     cursor and the hover flickered on and off. The row is always this tall. */
  min-height: 100px;
  border-top: 1px solid rgba(242,242,242,.14);
  opacity: 0; transform: translateY(6px);
  transition: opacity 500ms var(--sc-ease-out), transform 600ms var(--sc-ease-out);
}
.bp-map-act.is-on .bp-map__board { opacity: 1; transform: none; }
.bp-map__board-name {
  display: inline-flex; align-items: center; gap: 12px;
}
.bp-map__board-name::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--sc-accent); flex: none; }
.bp-map__board-name [data-flap] { font: 600 clamp(1.1rem, 1.7vw, 1.5rem)/1 var(--sc-font-display); letter-spacing: .02em; min-width: 8.8em; }
.bp-map__board-tags {
  display: flex; flex-wrap: wrap; gap: 6px 8px;
  transition: opacity 140ms;
}
.bp-map__board-tags.is-swapping { opacity: 0; }
.bp-map__board-tags span {
  font: 500 12px/1 var(--sc-font-text); letter-spacing: .06em; text-transform: uppercase;
  color: var(--sc-ink); padding: 8px 10px; border-radius: 3px;
  border: 1px solid rgba(242,242,242,.2);
}
.bp-map__board-count {
  font: 500 12px/1 var(--sc-font-text); letter-spacing: .14em; color: var(--sc-ink-soft);
  font-variant-numeric: tabular-nums;
}

/* ---- mobile: the same act, stacked; only the metropols keep a label,
   the row names everything else as it lights ---- */
@media (max-width: 860px) {
  .bp-map { padding: 92px 20px 24px; justify-content: center; }
  .bp-map__head { grid-template-columns: 1fr; align-items: start; gap: 12px; }
  .bp-map__head h2 { font-size: clamp(1.7rem, 7vw, 2.4rem); }
  .bp-map__head p { font-size: 14px; }
  .bp-map__abroad { font-size: 12.5px; }
  .bp-map__stage { flex: 0 0 auto; height: clamp(220px, 38svh, 340px); margin: 24px 0; }
  .bp-map__city:not([data-tier="1"]) .bp-map__label { display: none; }
  .bp-map__label [data-flap] { font-size: 10px; }
  /* İzmir sits on the board's west edge: its label reads to the left on
     desktop and would leave the screen here, so it goes up and right */
  .bp-map__city[data-label="l"] .bp-map__label { right: auto; top: auto; transform: none; left: 8px; bottom: 7px; }
  .bp-map__city { --d: 9px; }
  .bp-map__city[data-tier="2"] { --d: 7px; }
  .bp-map__city[data-tier="3"] { --d: 5px; }
  .bp-map__board { grid-template-columns: 1fr auto; gap: 12px; padding-top: 14px; min-height: 150px; align-content: start; }
  .bp-map__board-tags { grid-column: 1 / -1; }
  .bp-map__board-count { grid-column: 2; grid-row: 1; }
  .bp-map__board-tags span { font-size: 11px; padding: 7px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .bp-map__dot, .bp-map__label, .bp-map__board, .bp-map__board-tags { transition: none; }
}
