/*
 * Office & factory locations page (Locations module): the animated route map
 * (loc_route) and the location cards (loc_sites). Every other section uses
 * the Landing and MultiStorey block styles. Logical properties only (RTL for
 * he/ar); the map canvas itself is dir="ltr" because geography does not
 * mirror, so its overlays use inline-start inside a left-to-right box.
 * Mobile rules (VICTOR): button labels never wrap.
 */

/* ---------- Route map ---------- */
.loc-route { position: relative; overflow: hidden; background: radial-gradient(120% 80% at 80% 0%, #13305A 0%, var(--navy-900) 55%, var(--navy-950) 100%); }
.loc-route .loc-head { margin-block-end: clamp(24px, 3vw, 36px); }

.loc-map { margin: 0; }
.loc-canvas { position: relative; aspect-ratio: 800 / 560; border: 1px solid var(--navy-700); background: var(--navy-950); overflow: hidden; isolation: isolate; box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
.loc-canvas::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(180deg, rgba(6, 17, 31, 0) 70%, rgba(6, 17, 31, .55) 100%); }
.loc-stage { position: absolute; inset: 0; }
.loc-svg { display: block; inline-size: 100%; block-size: 100%; }

.loc-bg { fill: #081627; }
.loc-grid-line { fill: none; stroke: rgba(143, 160, 182, .09); stroke-width: 1; }
.loc-sweep-0 { stop-color: #7FB2FF; stop-opacity: 0; }
.loc-sweep-1 { stop-color: #7FB2FF; stop-opacity: .07; }
.loc-scan { animation: loc-scan 9s linear infinite; }
@keyframes loc-scan { from { transform: translateX(0); } to { transform: translateX(1040px); } }

.loc-river { fill: none; stroke: #17456F; stroke-width: 14; stroke-linecap: round; opacity: .85; }
.loc-river.is-thin { stroke-width: 6; opacity: .6; }
.loc-city-0 { stop-color: #1C3D66; stop-opacity: .75; }
.loc-city-1 { stop-color: #10243F; stop-opacity: .15; }
.loc-city { stroke: rgba(127, 178, 255, .18); stroke-width: 1.5; stroke-dasharray: 4 6; }
.loc-road path { fill: none; stroke: rgba(195, 205, 218, .16); stroke-width: 2; stroke-linecap: round; }
.loc-park rect { fill: rgba(212, 161, 46, .22); stroke: rgba(212, 161, 46, .45); stroke-width: 1; }
.loc-area { font-family: var(--f-display); font-size: 22px; font-weight: 600; letter-spacing: 4px; text-transform: uppercase; fill: rgba(195, 205, 218, .32); }
.loc-compass circle { fill: none; stroke: rgba(195, 205, 218, .3); }
.loc-compass path { fill: var(--red); }
.loc-compass text { font-family: var(--f-mono); font-size: 12px; fill: var(--mist-2); }

.loc-leg-base { fill: none; stroke: rgba(195, 205, 218, .35); stroke-width: 3; stroke-dasharray: 2 9; stroke-linecap: round; }
.loc-leg { fill: none; stroke: var(--red); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(255, 64, 64, .55)); }
.loc-plane-path { fill: none; stroke: rgba(212, 161, 46, .5); stroke-width: 2; stroke-dasharray: 3 7; opacity: 0; }

.loc-node .loc-dot { fill: var(--navy-800); stroke: var(--white); stroke-width: 3; }
.loc-node.is-factory .loc-dot { stroke: var(--gold); }
.loc-node .loc-ico path, .loc-node .loc-ico rect { fill: none; stroke: var(--white); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.loc-node.is-factory .loc-ico path { stroke: var(--gold); }
.loc-node.is-airport .loc-ico path { stroke-width: 1.8; }
.loc-ring { fill: none; stroke: var(--red); stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.loc-node.is-factory .loc-ring { stroke: var(--gold); }
.is-reached .loc-ring, .loc-map:not(.is-js) .loc-ring { animation: loc-pulse 2.6s ease-out infinite; }
.is-reached .loc-ring.is-late, .loc-map:not(.is-js) .loc-ring.is-late { animation-delay: 1.3s; }
@keyframes loc-pulse { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(2.1); } }

.loc-car { opacity: 0; pointer-events: none; }
.loc-car-halo { fill: rgba(212, 161, 46, .28); }
.loc-car-body { fill: var(--gold); }
.loc-car-core { fill: var(--white); }
.loc-plane { opacity: 0; pointer-events: none; }
.loc-plane path { fill: var(--white); stroke: var(--navy-950); stroke-width: 1; stroke-linejoin: round; }

/* HTML overlays: positions are the SVG coordinates as percentages (800 × 560). */
.loc-tag, .loc-chip { position: absolute; z-index: 2; white-space: nowrap; pointer-events: none; transition: opacity .45s ease, transform .45s cubic-bezier(.2, .9, .3, 1.3); }
.loc-tag { display: flex; flex-direction: column; gap: 2px; padding: 7px 11px; background: rgba(10, 26, 48, .88); border: 1px solid var(--navy-600); border-inline-start: 3px solid var(--red); color: var(--white); backdrop-filter: blur(4px); }
.loc-tag b { font-family: var(--f-display); font-size: clamp(14px, 1.6vw, 19px); font-weight: 600; letter-spacing: .6px; text-transform: uppercase; line-height: 1.1; }
.loc-tag small { font-size: 12px; color: var(--mist); line-height: 1.3; }
.loc-tag.is-factory { border-inline-start-color: var(--gold); }
.loc-tag.is-airport { inset-inline-start: 78.75%; inset-block-start: 37.5%; transform: translate(-58%, calc(-100% - 34px)); }
.loc-tag.is-office { inset-inline-start: 70%; inset-block-start: 62.5%; transform: translate(-50%, 34px); }
.loc-tag.is-factory { inset-inline-start: 15%; inset-block-start: 53.6%; transform: translate(-22%, calc(-100% - 34px)); }

.loc-chip { padding: 5px 10px; background: var(--red); color: var(--white); font-family: var(--f-mono); font-size: clamp(11px, 1.2vw, 14px); font-weight: 600; letter-spacing: .5px; box-shadow: 0 8px 24px rgba(165, 0, 0, .45); }
.loc-chip.is-office { inset-inline-start: 77%; inset-block-start: 50%; transform: translate(10px, -50%); }
.loc-chip.is-factory { inset-inline-start: 41%; inset-block-start: 60%; transform: translate(-50%, 18px); }

.loc-clock { position: absolute; z-index: 3; inset-block-start: 14px; inset-inline-start: 14px; display: flex; gap: 10px; align-items: center; padding: 8px 14px 8px 8px; background: rgba(6, 17, 31, .82); border: 1px solid var(--navy-700); color: var(--white); }
.loc-clock-face { inline-size: 52px; block-size: 52px; flex: none; }
.loc-clock-face circle:first-child { fill: var(--navy-800); stroke: var(--navy-600); stroke-width: 2; }
.loc-clock-face line { stroke: var(--mist-2); stroke-width: 1.6; stroke-linecap: round; }
.loc-clock-face .loc-hand-h { stroke: var(--white); stroke-width: 2.6; }
.loc-clock-face .loc-hand-m { stroke: var(--red); stroke-width: 2.2; }
.loc-clock-face .loc-hand-pin { fill: var(--white); }
.loc-clock-read { display: flex; flex-direction: column; line-height: 1.15; }
.loc-clock-read small { font-family: var(--f-mono); font-size: 10.5px; letter-spacing: 1.4px; text-transform: uppercase; color: var(--mist-2); }
.loc-clock-read b { font-family: var(--f-display); font-size: 28px; font-weight: 600; font-variant-numeric: tabular-nums; }
.loc-clock-read em { font-style: normal; font-size: 12px; color: var(--mist); white-space: nowrap; }

.loc-replay { position: absolute; z-index: 3; inset-block-end: 14px; inset-inline-end: 14px; display: inline-flex; gap: 8px; align-items: center; min-block-size: 40px; padding: 8px 14px; border: 1px solid var(--navy-600); background: rgba(6, 17, 31, .85); color: var(--white); font: 600 14px/1 var(--f-body); white-space: nowrap; cursor: pointer; }
.loc-replay:hover { border-color: var(--white); }
.loc-replay:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.loc-replay svg { inline-size: 18px; block-size: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.loc-replay[hidden] { display: none; }

.loc-note { margin-block-start: 12px; font-size: 13.5px; line-height: 1.6; color: var(--mist-2); }

/* Animation states (loc.js adds .is-js; without it everything is shown). */
.loc-map.is-js .loc-tag, .loc-map.is-js .loc-chip { opacity: 0; }
.loc-map.is-js .loc-tag.is-on, .loc-map.is-js .loc-chip.is-on { opacity: 1; }
.loc-map.is-js .loc-chip:not(.is-on) { transform: translate(-50%, 30px) scale(.6); }
.loc-map.is-js .loc-chip.is-office:not(.is-on) { transform: translate(10px, -50%) scale(.6); }
.loc-map.is-js .loc-node { opacity: .45; transition: opacity .4s ease; }
.loc-map.is-js .loc-node.is-reached { opacity: 1; }
.loc-map.is-js .loc-node.is-burst .loc-dot { animation: loc-burst .7s cubic-bezier(.2, .9, .3, 1.4); transform-box: fill-box; transform-origin: center; }
@keyframes loc-burst { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
.loc-map.is-done .loc-canvas { box-shadow: 0 30px 80px rgba(0, 0, 0, .35), 0 0 0 1px rgba(212, 161, 46, .35); }

/* ---------- Stop list under the map ---------- */
.loc-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, .8fr); gap: 0; margin-block-start: clamp(20px, 3vw, 32px) !important; counter-reset: loc; }
.loc-step { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 20px clamp(16px, 2vw, 24px); border-block-start: 3px solid var(--navy-700); transition: border-color .4s ease, background-color .4s ease; }
.loc-step + .loc-step { border-inline-start: 1px solid var(--navy-700); }
.loc-step.is-reached { border-block-start-color: var(--red); background: rgba(16, 36, 63, .55); }
.loc-step.is-factory.is-reached { border-block-start-color: var(--gold); }
.loc-step h3 { color: var(--white); font-size: 18px; }
.loc-step p { font-size: 14.5px; line-height: 1.55; color: var(--mist); }
.loc-step .loc-step-place { color: var(--white); font-weight: 500; }
.loc-step .loc-step-leg { font-family: var(--f-mono); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: var(--mist-2); }
.loc-step-btn { display: flex; gap: 12px; align-items: center; justify-content: space-between; inline-size: 100%; margin-block-end: 6px; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; text-align: start; }
.loc-step-btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
.loc-step-no { font-family: var(--f-display); font-size: 34px; font-weight: 600; line-height: 1; color: var(--navy-600); transition: color .4s ease; }
.loc-step.is-reached .loc-step-no { color: var(--white); }
.loc-step-time { padding: 4px 9px; background: var(--red); color: var(--white); font-family: var(--f-mono); font-size: 13px; font-weight: 600; white-space: nowrap; }
.loc-step-time.is-start { background: var(--navy-700); }
.loc-step.is-factory .loc-step-time { background: var(--gold); color: var(--navy-950); }
.loc-step.is-total { justify-content: center; align-items: flex-start; background: var(--red); border-block-start-color: var(--red); }
.loc-total-k { font-family: var(--f-mono); font-size: 12px; letter-spacing: 1.4px; text-transform: uppercase; color: rgba(255, 255, 255, .85); }
.loc-total-v { font-family: var(--f-display); font-size: clamp(34px, 3.4vw, 46px); font-weight: 600; line-height: 1; color: var(--white); white-space: nowrap; }

/* ---------- Location cards ---------- */
.loc-site-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.loc-site { display: flex; flex-direction: column; gap: 10px; padding: clamp(20px, 2.4vw, 28px); background: var(--white); border: 1px solid var(--steel-200); border-block-start: 3px solid var(--navy-900); }
.loc-site.is-head_office { border-block-start-color: var(--red); }
.loc-site.is-factory { border-block-start-color: var(--gold); }
.loc-site-top { display: flex; gap: 12px; align-items: center; }
.loc-site-ico { display: inline-grid; place-items: center; inline-size: 44px; block-size: 44px; flex: none; background: var(--navy-900); color: var(--white); }
.loc-site.is-head_office .loc-site-ico { background: var(--red); }
.loc-site-ico svg { inline-size: 22px; block-size: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.loc-site-k { font-family: var(--f-mono); font-size: 12px; font-weight: 600; letter-spacing: 1.4px; text-transform: uppercase; color: var(--ink-2); }
.loc-site h3 { color: var(--ink); }
.loc-site address { font-style: normal; font-size: 15.5px; line-height: 1.6; color: var(--ink); }
.loc-site .loc-site-note { position: relative; padding-inline-start: 16px; font-size: 14.5px; line-height: 1.55; color: var(--ink-2); }
.loc-site .loc-site-note::before { content: ""; position: absolute; inset-inline-start: 0; inset-block-start: .55em; inline-size: 7px; block-size: 7px; background: var(--red); border-radius: 50%; }
.loc-site-cta { margin-block-start: auto !important; padding-block-start: 8px; }
.loc-site-cta .btn { white-space: nowrap; }
.loc-sites-note, .loc-sites-empty { margin-block-start: 20px !important; font-size: 14.5px; line-height: 1.6; color: var(--ink-2); max-inline-size: 80ch; }

@media (max-width: 960px) {
  .loc-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .loc-step:nth-child(3) { border-inline-start: 0; }
}
@media (max-width: 640px) {
  /* Phones: zoom into the part of the map between the factory and the airport. */
  .loc-canvas { aspect-ratio: 640 / 560; }
  .loc-stage { inset-inline: -12.5% auto; inline-size: 125%; }
  .loc-tag { padding: 4px 7px; }
  .loc-tag small { display: none; }
  .loc-tag b { font-size: 12px; letter-spacing: .3px; }
  .loc-tag.is-airport { transform: translate(-62%, calc(-100% - 20px)); }
  .loc-tag.is-office { transform: translate(-50%, 20px); }
  .loc-tag.is-factory { transform: translate(-28%, calc(-100% - 20px)); }
  .loc-chip { padding: 3px 7px; font-size: 11px; }
  .loc-chip.is-office, .loc-map.is-js .loc-chip.is-office.is-on { transform: translate(calc(-100% - 26px), -50%); }
  .loc-map.is-js .loc-chip.is-office:not(.is-on) { transform: translate(calc(-100% - 26px), -50%) scale(.6); }
  .loc-clock { inset-block-start: 8px; inset-inline-start: 8px; gap: 6px; padding: 5px 9px 5px 5px; }
  .loc-clock-face { inline-size: 34px; block-size: 34px; }
  .loc-clock-read b { font-size: 20px; }
  .loc-clock-read small, .loc-clock-read em { display: none; }
  .loc-replay { inset-block-end: 8px; inset-inline-end: 8px; min-block-size: 34px; padding: 6px 10px; font-size: 13px; }
  .loc-area { display: none; }
  .loc-steps { grid-template-columns: minmax(0, 1fr); }
  .loc-step + .loc-step { border-inline-start: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .loc-scan, .loc-ring { animation: none !important; }
  .loc-tag, .loc-chip, .loc-step, .loc-node { transition: none !important; }
}
