/* WFC — temsilcilik küresi (office globe). Uses tokens from style.css. */
.globe-section { background: var(--white); overflow-x: clip; }

.globe-layout {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-areas: "head stage" "list stage";
  grid-template-rows: auto 1fr;
  column-gap: 72px;
  align-items: start;
}
.globe-head { grid-area: head; margin-bottom: 40px; }
.globe-lead { margin-top: 18px; font-size: 1.12rem; color: var(--muted); max-width: 46ch; }
.globe-offices { grid-area: list; }
.globe-stage { grid-area: stage; align-self: center; justify-self: center; width: 100%; max-width: 580px; }

/* ---------- office list (accordion) ---------- */
.globe-list-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding-bottom: 14px; border-bottom: 2px solid var(--navy-900);
}
.globe-list-title {
  font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.globe-legend { display: flex; gap: 18px; font-size: .8rem; color: var(--muted); }
.globe-legend span { display: inline-flex; align-items: center; gap: 7px; }
.globe-list { max-height: 460px; overflow-y: auto; overscroll-behavior: contain; }
.globe-country { border-bottom: 1px solid var(--line); }
.globe-country-btn {
  display: flex; align-items: center; gap: 14px; width: 100%;
  min-height: 56px; padding: 14px 4px 14px 0; margin: 0;
  background: none; border: 0; border-radius: var(--r); cursor: pointer; text-align: left;
  font: 600 1.12rem/1.3 var(--font); color: var(--navy-900);
  transition: color .2s var(--ease);
}
.globe-swatch {
  width: 14px; height: 14px; flex: none;
  background: #BCD0EC; border: 1.5px solid var(--blue-600);
  transition: background-color .2s var(--ease);
}
.globe-country-name { flex: 1; min-width: 0; }
.globe-count {
  font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
  white-space: nowrap;
}
.globe-chev {
  width: 9px; height: 9px; flex: none; margin: 0 4px 4px 4px;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(45deg); transition: transform .25s var(--ease);
}
.globe-country.is-open .globe-chev { transform: rotate(-135deg); margin-bottom: -4px; }
.globe-country-btn:hover, .globe-country.is-active .globe-country-btn, .globe-country.is-open .globe-country-btn { color: var(--blue-600); }
.globe-country-btn:hover .globe-swatch, .globe-country.is-active .globe-swatch, .globe-country.is-open .globe-swatch { background: var(--blue-600); }
.globe-country-btn:focus-visible { outline: 2px solid var(--blue-600); outline-offset: 2px; }

.globe-panel { padding: 0 0 18px 28px; }
.globe-panel[hidden] { display: none; }
.globe-country.is-open .globe-panel { animation: globe-panel-in .25s var(--ease); }
@keyframes globe-panel-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.globe-cities { display: flex; flex-wrap: wrap; gap: 8px 26px; }
.globe-cities li { display: inline-flex; align-items: center; gap: 9px; font-size: 1rem; color: var(--ink); }

.globe-dot {
  width: 7px; height: 7px; flex: none; border-radius: 50%;
  background: var(--navy-900); box-shadow: 0 0 0 2px var(--white), 0 0 0 3px var(--blue-200);
}
.globe-anchor {
  width: 15px; height: 15px; flex: none;
  fill: none; stroke: var(--blue-600); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

/* ---------- globe ---------- */
.globe-canvas {
  display: block; width: 100%; height: auto; aspect-ratio: 1 / 1;
  touch-action: pan-y; cursor: grab;
  -webkit-tap-highlight-color: transparent;
  opacity: 0; transition: opacity .6s var(--ease);
}
.globe-stage.is-ready .globe-canvas { opacity: 1; }
.globe-canvas.is-hot { cursor: pointer; }
.globe-canvas.is-dragging { cursor: grabbing; }
.globe-hint { margin-top: 10px; text-align: center; font-size: .86rem; color: var(--muted); }
.globe-failed .globe-canvas, .globe-failed .globe-hint { display: none; }

@media (max-width: 900px) {
  .globe-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "stage" "list"; }
  .globe-head { margin-bottom: 24px; }
  .globe-stage { max-width: 520px; margin-bottom: 40px; }
}
@media (max-width: 640px) {
  .globe-country-btn { font-size: 1.05rem; flex-wrap: wrap; row-gap: 2px; }
  .globe-list { max-height: none; }
}
@media (prefers-reduced-motion: reduce) {
  .globe-canvas { transition: none; }
  .globe-chev { transition: none; }
  .globe-country.is-open .globe-panel { animation: none; }
}

/* ---------- trial: flat, scrolling world-map banner ---------- */
.flatmap-section { position: relative; background: var(--white); overflow: hidden; }
.flatmap-stage { position: absolute; inset: 0; }
.flatmap-canvas {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%);
          mask-image: linear-gradient(to bottom, transparent 0, #000 9%, #000 91%, transparent 100%);
}
.flatmap-canvas {
  display: block; width: 100%; height: 100%; opacity: 0; transition: opacity .6s var(--ease);
  /* drag sideways to turn the world; vertical swipes (and pinch) stay with the page */
  cursor: grab; touch-action: pan-y pinch-zoom; -webkit-tap-highlight-color: transparent;
}
.flatmap-stage.is-ready .flatmap-canvas { opacity: 1; }
.flatmap-canvas.is-hot { cursor: pointer; }
.flatmap-canvas.is-dragging { cursor: grabbing; }
.flatmap-layout { position: relative; pointer-events: none; padding-block: 72px; min-height: clamp(600px, 84vh, 760px); display: flex; align-items: center; }
.flatmap-card {
  pointer-events: auto; width: min(420px, 100%);
  background: rgba(255, 255, 255, .94); backdrop-filter: blur(6px);
  border-top: 3px solid var(--navy-900); box-shadow: 0 18px 50px rgba(11, 37, 69, .12);
  padding: 32px 32px 24px;
}
.flatmap-card .globe-lead { margin: 14px 0 26px; font-size: 1.02rem; }
.flatmap-card .globe-list { max-height: 372px; }
.flatmap-hint { margin-top: 14px; font-size: .82rem; color: var(--muted); }
.flatmap-stage.globe-failed { display: none; }

/* city callouts: box on a stick, shown when a country is opened */
.flatmap-callouts { position: absolute; inset: 0; pointer-events: none; opacity: 0; overflow: hidden; }
.flatmap-sticks { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.flatmap-sticks line { stroke: var(--navy-900); stroke-width: 1.4; }
.flatmap-sticks circle { fill: var(--navy-900); }
.fc-box {
  position: absolute; left: 0; top: 0; max-width: 300px;
  background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--blue-600);
  box-shadow: 0 18px 44px rgba(11, 37, 69, .22); padding: 12px 14px 14px;
}
.fc-city { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--blue-600); white-space: nowrap; }
.fc-ports { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.fc-port { display: flex; align-items: center; gap: 7px; font-size: 1rem; font-weight: 600; line-height: 1.25; color: var(--navy-900); white-space: nowrap; }
.fc-anchor { flex: none; width: 16px; height: 16px; fill: none; stroke: var(--blue-600); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* photo boxes: one picture card per port, side by side */
.fc-box.has-photos { max-width: none; padding: 10px 10px 12px; }
.fc-box.has-photos .fc-city { padding: 2px 4px 0; }
.fc-box.has-photos .fc-ports { grid-auto-flow: column; grid-auto-columns: clamp(200px, 17vw, 280px); gap: 10px; margin-top: 8px; }
.fc-ports img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--steel-100); }
.fc-box.has-photos .fc-port { white-space: normal; padding: 9px 4px 0; }
/* short desktop screens (e.g. 1920x1080 at 125% scaling): slightly smaller photos so boxes fit the map */
@media (min-width: 901px) and (max-height: 820px) {
  .fc-box.has-photos .fc-ports { grid-auto-columns: clamp(170px, 14vw, 230px); }
  /* keep the whole map section within one screen under the sticky header (~90px) */
  .flatmap-layout { padding-block: 24px; min-height: min(600px, calc(100vh - 90px)); }
  .flatmap-card { padding: 24px 28px 18px; }
  .flatmap-card .globe-lead { margin: 10px 0 16px; }
  .flatmap-card .globe-list { max-height: max(180px, calc(100vh - 470px)); }
}

/* city name tags for countries without port boxes */
.fc-label {
  position: absolute; left: 0; top: 0; display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 9px 4px 8px; background: rgba(255, 255, 255, .95); border-left: 3px solid var(--blue-600);
  box-shadow: 0 4px 14px rgba(11, 37, 69, .16); font-size: .86rem; font-weight: 600; line-height: 1.2;
  color: var(--navy-900); white-space: nowrap;
}
.fc-label .fc-anchor { width: 13px; height: 13px; }
@media (max-width: 600px) { .fc-label { font-size: .74rem; padding: 3px 7px 3px 6px; } }

/* ports listed under a city in the country list */
.globe-cities:has(.globe-ports) { display: grid; gap: 10px; }
.globe-cities > li:has(.globe-ports) { flex-wrap: wrap; }
.globe-ports { list-style: none; flex-basis: 100%; margin: 2px 0 0 22px; padding: 0; display: grid; gap: 3px; }
.globe-ports li { font-size: .86rem; color: var(--muted); }
.globe-port-name { display: inline-flex; align-items: center; gap: 6px; }
.globe-port-photo { display: none; }
.globe-ports .globe-anchor { width: 13px; height: 13px; }

@media (max-width: 900px) {
  /* phones/tablets: same boxes with pictures, just smaller */
  .fc-box { padding: 6px 9px 7px; border-top-width: 3px; }
  .fc-box.has-photos { padding: 6px 6px 7px; }
  .fc-city { font-size: .62rem; }
  .fc-box.has-photos .fc-city { padding: 0 2px; }
  .fc-port { font-size: .74rem; white-space: nowrap; }
  .fc-box.has-photos .fc-port { font-size: .72rem; line-height: 1.2; white-space: normal; align-items: flex-start; padding: 4px 2px 0; }
  .fc-anchor { width: 11px; height: 11px; }
  .fc-box.has-photos .fc-ports { grid-auto-columns: clamp(84px, 21vw, 150px); gap: 6px; margin-top: 5px; }
}

@media (max-width: 900px) {
  .flatmap-stage { position: relative; inset: auto; height: clamp(320px, 92vw, 520px); }
  .flatmap-layout { padding-block: 0 56px; min-height: 0; display: block; }
  .flatmap-card { width: 100%; padding: 26px 22px 20px; box-shadow: none; border: 1px solid var(--line); border-top: 3px solid var(--navy-900); }
  .flatmap-card .globe-list { max-height: none; }
}
@media (prefers-reduced-motion: reduce) { .flatmap-canvas { transition: none; } }
