/* Location & Infrastructure page, plus the Anna Nagar office card (.office) that contact.php also loads.
   The office card is self-contained: info panel + an illustrated, privacy-conscious map stage that
   only loads the Google Maps iframe after the visitor presses "Show map" (assets/js/pages/location.js). */

/* ---------- Office card ---------- */
.office {
  --map-block: var(--ink-3);
  --map-street: rgb(var(--fg-rgb) / 0.07);
  --map-major: rgb(var(--fg-rgb) / 0.13);
  --map-glow: rgb(245 197 24 / 0.55);
  container-type: inline-size;
  position: relative;
  border: 1px solid var(--line-strong);
  border-radius: calc(var(--radius) + 8px);
  background: var(--ink-2);
  box-shadow: var(--shadow);
  overflow: clip;
}
:root[data-theme-effective="light"] .office {
  --map-block: var(--ink-4);
  --map-street: var(--ink-2);
  --map-major: var(--ink-2);
  --map-glow: rgb(245 197 24 / 0.75);
}
.office__inner { display: grid; grid-template-columns: minmax(0, 1fr); }
@container (min-width: 820px) {
  .office__inner { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); }
  .office__stage { order: 2; min-height: 100%; aspect-ratio: auto; border-top: 0; border-left: 1px solid var(--line); }
}

/* Info panel */
.office__info { display: grid; gap: clamp(1.25rem, 1rem + 1vw, 1.75rem); align-content: start; padding: clamp(1.4rem, 1rem + 2vw, 2.5rem); order: 2; }
.office__kicker { display: inline-flex; align-items: center; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); }
.office__kicker .icon { width: 1.1em; height: 1.1em; }
.office__title { font-size: var(--step-4); line-height: 0.95; letter-spacing: -0.045em; }
.office__title span { display: block; color: var(--text-3); font-size: 0.5em; letter-spacing: -0.02em; margin-top: 0.3em; }
.office__address { font-style: normal; font-size: var(--step-1); line-height: 1.45; color: var(--text); max-width: 34ch; overflow-wrap: anywhere; }

.office__facts { display: grid; gap: 0.75rem; padding: 0; list-style: none; }
.office__fact { display: flex; align-items: center; gap: 0.85rem; min-height: 44px; }
.office__fact-icon { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--brand-soft); color: var(--accent); }
.office__fact-icon .icon { width: 22px; height: 22px; }
.office__fact-label { display: block; font-family: var(--font-mono); font-size: 0.68rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }
.office__fact-text { display: block; font-weight: 700; color: var(--text); line-height: 1.35; }
a.office__fact { width: fit-content; }
a.office__fact .office__fact-text { border-bottom: 1px solid rgb(245 197 24 / 0.45); transition: color 0.25s, border-color 0.25s; overflow-wrap: anywhere; }
a.office__fact:hover .office__fact-text { color: var(--accent); border-color: var(--accent); }

.office__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; padding-top: clamp(0.5rem, 0.3rem + 0.6vw, 1rem); border-top: 1px solid var(--line); }
.office__copy[data-copied] { --btn-bd: var(--success); color: var(--success); }
.office__copy .icon--done { display: none; }
.office__copy[data-copied] .icon--copy { display: none; }
.office__copy[data-copied] .icon--done { display: block; }
@media (max-width: 479px) { .office__actions .btn { flex: 1 1 100%; } }

/* Map stage */
.office__stage { position: relative; order: 1; aspect-ratio: 4 / 3; min-height: 260px; border-radius: 0; background: var(--map-block); border-top: 0; isolation: isolate; }
@container (min-width: 560px) and (max-width: 819px) { .office__stage { aspect-ratio: 16 / 9; } }
.office__stage.frame--corners::before { --c: var(--accent); --l: 22px; --w: 2px; inset: 16px; z-index: 3; }

.office__art { position: absolute; inset: 0; overflow: hidden; perspective: 900px; transition: opacity 0.5s var(--ease-out); }
.office__plane {
  position: absolute; inset: -40% -35%;
  transform: rotateX(var(--rx, 55deg)) rotateZ(var(--rz, -24deg));
  transform-origin: 50% 50%;
  transition: transform 0.9s var(--ease-out);
  background:
    repeating-linear-gradient(90deg, transparent 0 236px, var(--map-major) 236px 250px),
    repeating-linear-gradient(0deg, transparent 0 318px, var(--map-major) 318px 334px),
    repeating-linear-gradient(90deg, transparent 0 52px, var(--map-street) 52px 58px),
    repeating-linear-gradient(0deg, transparent 0 74px, var(--map-street) 74px 80px),
    var(--map-block);
}
/* Two diagonal avenues break the grid so it reads as a city, not graph paper. */
.office__avenue { position: absolute; left: -10%; right: -10%; top: 50%; height: 18px; margin-top: -9px; background: var(--map-major); transform: rotate(32deg); }
.office__avenue--b { height: 10px; margin-top: 90px; transform: rotate(-58deg); }
.office__route { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.office__route path { fill: none; stroke: var(--brand); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 2 12; vector-effect: non-scaling-stroke; filter: drop-shadow(0 0 6px var(--map-glow)); }
.office__ring { position: absolute; left: 50%; top: 50%; width: 220px; height: 220px; margin: -110px 0 0 -110px; border-radius: 50%; border: 2px solid var(--brand); background: radial-gradient(circle, rgb(245 197 24 / 0.28), transparent 65%); opacity: 0.55; }
.office__ring--b { width: 120px; height: 120px; margin: -60px 0 0 -60px; opacity: 0.8; }

/* Edge fade so the tilted plane dissolves into the card */
.office__art::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse 75% 70% at 50% 52%, transparent 45%, rgb(var(--bg-rgb) / 0.55) 80%, rgb(var(--bg-rgb) / 0.9) 100%); }

/* The pin stands upright above the tilted plane, its tip on the stage centre. */
.office__pin { position: absolute; left: 50%; top: 50%; z-index: 2; width: 58px; height: 58px; margin: -66px 0 0 -29px; display: grid; place-items: center; }
.office__pin-head { position: relative; width: 100%; height: 100%; display: grid; place-items: center; transition: transform 0.4s var(--ease-out); }
.office__pin-head::before { content: ""; position: absolute; inset: 0; border-radius: 50% 50% 50% 0; background: var(--brand); transform: rotate(-45deg); box-shadow: 0 0 0 6px rgb(245 197 24 / 0.18), 0 0 46px 6px var(--map-glow), 0 14px 22px -6px rgb(0 0 0 / 0.45); }
.office__pin .icon { position: relative; width: 26px; height: 26px; color: var(--brand-ink); margin-top: -6px; }
.office__pin::after { content: ""; position: absolute; left: 50%; bottom: -22px; width: 26px; height: 8px; margin-left: -13px; border-radius: 50%; background: rgb(0 0 0 / 0.35); filter: blur(3px); }

.office__frame { position: absolute; inset: 0; z-index: 1; }
.office__frame iframe { width: 100%; height: 100%; border: 0; }
:root:not([data-theme-effective="light"]) .office__frame iframe { filter: invert(0.9) hue-rotate(180deg) saturate(0.7) contrast(0.95); }
.office__stage.is-map .office__art { opacity: 0; visibility: hidden; transition: opacity 0.5s var(--ease-out), visibility 0s 0.5s; }
.office__stage.is-map .office__bar { display: none; }

.office__bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 4; display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.9rem; padding: clamp(1.4rem, 1rem + 1.5vw, 2rem); }
.office__show { --btn-bg: var(--panel-solid); --btn-bd: var(--line-strong); box-shadow: 0 12px 30px -14px rgb(0 0 0 / 0.55); }
.office__show:hover { --btn-bd: var(--accent); }
.office__note { font-family: var(--font-mono); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-2); }

/* Motion: pin drop, ring pulse, hover lift. Only transform/opacity, only without reduced motion. */
@media (prefers-reduced-motion: no-preference) {
  .office.is-in .office__pin { animation: office-drop 0.9s var(--ease-out) 0.25s both; }
  .office__ring { animation: office-pulse 3.2s var(--ease-out) infinite; }
  .office__ring--b { animation-delay: 1.6s; }
  .office__route path { animation: office-route 1.6s var(--ease-out) 0.5s both; }
  .office__stage:hover .office__pin-head, .office__stage:focus-within .office__pin-head { transform: translateY(-8px); }
}
@keyframes office-drop { 0% { opacity: 0; transform: translateY(-60px) scale(0.8); } 60% { opacity: 1; transform: translateY(4px) scale(1.04); } 100% { opacity: 1; transform: none; } }
@keyframes office-pulse { 0% { opacity: 0.9; transform: scale(0.35); } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes office-route { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Location page layout ---------- */
.loc-office__head { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 0.7fr); gap: clamp(1.25rem, 1rem + 3vw, 4rem); align-items: end; margin-bottom: clamp(1.75rem, 1rem + 2.5vw, 3.25rem); }
.loc-office__head .h2 { max-width: 22ch; }
.loc-office__aside { display: grid; gap: 1.1rem; justify-items: start; }
@media (max-width: 1023px) { .loc-office__head { grid-template-columns: minmax(0, 1fr); align-items: start; } }

/* ---------- Infrastructure photo mosaic (real photos, lightbox via [data-gallery]) ---------- */
.infra__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: clamp(1.25rem, 1rem + 1.5vw, 2.25rem); }
.infra-wall__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: clamp(140px, 6rem + 9vw, 260px); grid-auto-flow: dense; gap: clamp(6px, 0.3rem + 0.4vw, 12px); }
.infra-wall .zoomable { position: relative; display: block; height: 100%; border-radius: var(--radius-sm); overflow: hidden; background: var(--ink-3); }
.infra-wall .zoomable picture { display: block; height: 100%; }
.infra-wall .zoomable img { width: 100%; height: 100%; object-fit: cover; filter: saturate(0.85); transition: filter 0.6s var(--ease-out), transform 0.9s var(--ease-out); }
.infra-wall .zoomable:hover img, .infra-wall .zoomable:focus-visible img { filter: none; transform: scale(1.04); }
.infra-wall .zoomable::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 2px var(--brand); opacity: 0; transition: opacity 0.35s; pointer-events: none; }
.infra-wall .zoomable:hover::after, .infra-wall .zoomable:focus-visible::after { opacity: 1; }
.infra-wall__item--feature { grid-column: span 2; grid-row: span 2; }
.infra-wall__item--wide { grid-column: span 2; }
@media (max-width: 1023px) {
  .infra-wall__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .infra-wall__item--wide { grid-column: auto; }
}
@media (max-width: 599px) {
  .infra-wall__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 132px; }
  .infra-wall__item--wide { grid-column: span 2; }
}
