/* Zenesis v2 — Offices page (zn-ofi introduction, zn-ofl office cards + zn-ofm world map). Banner comes from
   service.css. Content, colours, typography and spacing are set in Elementor / Site Settings; markers are placed with
   Elementor's own absolute positioning. This file adds the card grid, the marker / tooltip styling, the map's mobile
   crop and the states set by offices.js (selected office, connection lines, location picker, scroll reveal).
   Without JS the cards and map are simply shown and each marker shows its tooltip on hover. */

:where(.zn-ofi, .zn-ofl) { --zn-ease-out: cubic-bezier(.16, 1, .3, 1); position: relative; }
:is(.zn-ofi, .zn-ofl) .elementor-widget-text-editor p:last-child { margin-bottom: 0; }

/* ════════ Introduction ════════ */
.zn-ofi .zn-ofi__text { min-width: 0; flex: 1 1 auto; }

/* ════════ Office cards ════════ */
.zn-ofl .zn-ofl__grid {
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px;
	background: var(--e-global-color-zn_line); border-block: 1px solid var(--e-global-color-zn_line);
}
.zn-ofl .zn-ofl__card {
	position: relative; isolation: isolate; min-width: 0; width: auto; cursor: pointer;
	background: var(--e-global-color-zn_white); -webkit-tap-highlight-color: transparent;
	transition: background-color .5s ease;
}
.zn-ofl .zn-ofl__card::after { /* gold line along the top edge */
	content: ""; position: absolute; left: 0; top: -1px; width: 100%; height: 2px; z-index: 1; opacity: 1; border: 0;
	background: var(--e-global-color-primary); scale: 0 1; transform-origin: 0 50%; transition: scale .8s var(--zn-ease-out);
}
.zn-ofl .zn-ofl__card:hover, .zn-ofl .zn-ofl__card.is-active { background-color: var(--e-global-color-zn_cream); }
.zn-ofl .zn-ofl__card:hover::after, .zn-ofl .zn-ofl__card.is-active::after { scale: 1 1; }
.zn-ofl .zn-ofl__card:focus-visible { outline: 2px solid var(--e-global-color-primary); outline-offset: -2px; }
/* a small map marker before the country name */
.zn-ofl .zn-ofl__top::before {
	content: ""; position: static; display: block; flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%;
	opacity: 1; border: 0; filter: none; mix-blend-mode: normal;
	background: var(--e-global-color-primary); box-shadow: 0 0 0 4px rgb(200 164 93 / .18);
	transition: background-color .4s ease, box-shadow .6s var(--zn-ease-out);
}
.zn-ofl .zn-ofl__card.is-active .zn-ofl__top::before {
	background: var(--e-global-color-secondary); box-shadow: 0 0 0 3px var(--e-global-color-primary), 0 0 0 8px rgb(200 164 93 / .2);
}
.zn-ofl .zn-ofl__country .elementor-heading-title { transition: translate .6s var(--zn-ease-out); }
.zn-ofl .zn-ofl__card:hover .zn-ofl__country .elementor-heading-title { translate: 3px 0; }
.zn-ofl .zn-ofl__badge .elementor-heading-title {
	padding: 6px 10px; line-height: 1; letter-spacing: .14em; text-transform: uppercase;
	background: var(--e-global-color-primary);
}
@media (max-width: 1199px) { .zn-ofl .zn-ofl__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 767px) {
	.zn-ofl .zn-ofl__grid { grid-template-columns: minmax(0, 1fr); }
	.zn-ofl .zn-ofl__card:hover .zn-ofl__country .elementor-heading-title { translate: none; }
}

/* ════════ World map ════════ */
.zn-ofm .zn-ofm__viewport { position: relative; overflow: hidden; }
.zn-ofm .zn-ofm__canvas { position: relative; display: block; width: min(100%, 1000px); margin-inline: auto; }
.zn-ofm .zn-ofm__img img { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }

/* lines from the headquarters to each office (drawn by offices.js, viewBox 0 0 150 100) */
.zn-ofm .zn-ofm__arcs { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; overflow: visible; pointer-events: none; }
.zn-ofm .zn-ofm__arcs path { fill: none; }
.zn-ofm .zn-ofm__route { stroke: var(--e-global-color-primary); stroke-width: .16; stroke-dasharray: .5 .7; opacity: .55; }
.zn-ofm .zn-ofm__trace {
	stroke: var(--e-global-color-primary); stroke-width: .3; stroke-linecap: round; stroke-dasharray: 1 1; stroke-dashoffset: 1;
	transition: stroke-dashoffset 1.1s cubic-bezier(.65, 0, .35, 1);
}
.zn-ofm .zn-ofm__trace.is-on { stroke-dashoffset: 0; }
.zn-ofm .zn-ofm__pulse { stroke: var(--e-global-color-primary); stroke-width: .9; stroke-linecap: round; stroke-dasharray: .001 1.2; opacity: 0; transition: opacity .4s ease; }
.zn-ofm .zn-ofm__pulse.is-on { opacity: 1; animation: zn-ofm-pulse 2.6s cubic-bezier(.45, 0, .55, 1) .8s infinite both; }
@keyframes zn-ofm-pulse { from { stroke-dashoffset: .02; } to { stroke-dashoffset: -1.02; } }

/* markers (placed by Elementor: Advanced → Position: absolute, offsets in %) */
.zn-ofm .zn-ofm__canvas > .zn-ofm__pin {
	z-index: 2; display: block; padding: 0; margin: 0; translate: -50% -50%; border-radius: 50%;
	cursor: pointer; -webkit-tap-highlight-color: transparent; outline: none;
}
.zn-ofm .zn-ofm__canvas > .zn-ofm__pin.is-active { z-index: 4; }
.zn-ofm .zn-ofm__canvas > .zn-ofm__pin:hover { z-index: 5; }
.zn-ofm .zn-ofm__canvas > .zn-ofm__pin::before { /* the dot */
	content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; z-index: 1; translate: -50% -50%;
	border-radius: 50%; border: 0; opacity: 1; filter: none; mix-blend-mode: normal;
	background: var(--e-global-color-primary);
	box-shadow: 0 0 0 3px var(--e-global-color-zn_white), 0 6px 14px -4px rgb(15 19 43 / .5);
	transition: background-color .4s ease, box-shadow .4s ease, scale .6s var(--zn-ease-out);
}
.zn-ofm .zn-ofm__canvas > .zn-ofm__pin--hq::before { width: 16px; height: 16px; }
.zn-ofm .zn-ofm__canvas > .zn-ofm__pin::after { /* halo, pings outward on the selected office */
	content: ""; position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; translate: -50% -50%;
	border-radius: 50%; border: 1px solid rgb(200 164 93 / .55); background: rgb(200 164 93 / .14);
	opacity: 1; scale: .55; pointer-events: none; transition: scale .6s var(--zn-ease-out);
}
.zn-ofm .zn-ofm__canvas > .zn-ofm__pin:hover::before { scale: 1.15; }
.zn-ofm .zn-ofm__canvas > .zn-ofm__pin:focus-visible::before { box-shadow: 0 0 0 3px var(--e-global-color-zn_white), 0 0 0 5px var(--e-global-color-secondary); }
.zn-ofm .zn-ofm__canvas > .zn-ofm__pin.is-active::before {
	background: var(--e-global-color-secondary); scale: 1.2;
	box-shadow: 0 0 0 3px var(--e-global-color-primary), 0 8px 18px -6px rgb(15 19 43 / .6);
}
.zn-ofm .zn-ofm__canvas > .zn-ofm__pin.is-active::after { animation: zn-ofm-ping 2.4s cubic-bezier(.2, .6, .35, 1) infinite; }
@keyframes zn-ofm-ping { from { scale: .35; opacity: 1; } to { scale: 1.6; opacity: 0; } }

/* the label is read by the picker / screen readers; it is not shown on the map */
.zn-ofm .zn-ofm__pin > .zn-ofm__label {
	position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
}
/* tooltip: the original hotspot text */
.zn-ofm .zn-ofm__pin > .zn-ofm__tip {
	--tx: 0px;
	position: absolute; left: 50%; bottom: calc(100% + 4px); z-index: 2; width: 280px; max-width: none; margin: 0;
	padding: 16px 20px 18px; text-align: left; pointer-events: none;
	background: var(--e-global-color-zn_white);
	box-shadow: 0 0 0 1px var(--e-global-color-zn_line), 0 28px 56px -28px rgb(15 19 43 / .45);
	opacity: 0; visibility: hidden; translate: calc(-50% + var(--tx)) 10px;
	transition: opacity .3s ease, translate .5s var(--zn-ease-out), visibility 0s linear .3s;
}
/* Elementor caps widgets at their container's width (the 44px marker) */
.zn-ofm .zn-ofm__canvas > .zn-ofm__pin > .zn-ofm__tip.elementor-widget { max-width: none; }
.zn-ofm .zn-ofm__pin > .zn-ofm__tip::before { /* gold line along the top */
	content: ""; position: absolute; left: 0; top: 0; width: 100%; height: 2px; background: var(--e-global-color-primary);
}
.zn-ofm .zn-ofm__pin > .zn-ofm__tip::after { /* pointer, kept over the marker when the card is shifted */
	content: ""; position: absolute; left: calc(50% - var(--tx)); bottom: -6px; width: 12px; height: 12px; translate: -50% 0; rotate: 45deg;
	background: var(--e-global-color-zn_white); box-shadow: 1px 1px 0 var(--e-global-color-zn_line);
}
.zn-ofm :is(.zn-ofm__tip, .zn-ofm__info) strong + br { display: none; }
.zn-ofm :is(.zn-ofm__tip, .zn-ofm__info) strong {
	display: block; margin-bottom: 6px; color: var(--e-global-color-text);
	font-family: var(--e-global-typography-zn_h6-font-family), sans-serif; font-weight: var(--e-global-typography-zn_h6-font-weight);
}
.zn-ofm .zn-ofm__pin.is-active > .zn-ofm__tip,
.zn-ofm:not(.is-live) .zn-ofm__pin:hover > .zn-ofm__tip {
	opacity: 1; visibility: visible; translate: calc(-50% + var(--tx)) 0; transition-delay: 0s;
}

/* location picker + details (added by offices.js; phones only) */
.zn-ofm .zn-ofm__picker, .zn-ofm .zn-ofm__info { display: none; }

@media (max-width: 767px) {
	/* the map is cropped and moves to the selected office */
	.zn-ofm .zn-ofm__viewport { aspect-ratio: 1.6; }
	.zn-ofm .zn-ofm__canvas {
		position: absolute; left: 0; top: 0; width: 200%; max-width: none; margin: 0;
		translate: -38% -42%; transition: translate 1s cubic-bezier(.65, 0, .35, 1);
	}
	.zn-ofm .zn-ofm__pin > .zn-ofm__tip { display: none; }
	.zn-ofm .zn-ofm__picker {
		display: flex; flex-wrap: wrap; gap: 8px; padding: 20px 20px 0;
	}
	.zn-ofm .zn-ofm__chip {
		min-height: 44px; padding: 0 16px; border: 1px solid var(--e-global-color-zn_gold_line); border-radius: 0;
		background: var(--e-global-color-zn_white); color: var(--e-global-color-text); cursor: pointer;
		font-family: var(--e-global-typography-zn_eyebrow-font-family), sans-serif; font-weight: var(--e-global-typography-zn_eyebrow-font-weight);
		font-size: var(--e-global-typography-zn_eyebrow-font-size); letter-spacing: .12em; text-transform: uppercase;
		-webkit-tap-highlight-color: transparent; transition: background-color .4s ease, color .4s ease, border-color .4s ease;
	}
	.zn-ofm .zn-ofm__chip[aria-pressed="true"] {
		background: var(--e-global-color-secondary); border-color: var(--e-global-color-secondary); color: var(--e-global-color-zn_white);
	}
	.zn-ofm .zn-ofm__chip:focus-visible { outline: 2px solid var(--e-global-color-primary); outline-offset: 2px; }
	.zn-ofm .zn-ofm__info {
		display: block; position: relative; margin: 16px 20px 20px; padding: 18px 20px 20px; min-height: 96px;
		background: var(--e-global-color-zn_white); box-shadow: inset 0 2px 0 var(--e-global-color-primary), 0 0 0 1px var(--e-global-color-zn_line);
		font-family: var(--e-global-typography-zn_small-font-family), sans-serif; font-size: var(--e-global-typography-zn_small-font-size);
		line-height: var(--e-global-typography-zn_small-line-height, 1.6); color: var(--e-global-color-zn_body);
	}
	.zn-ofm .zn-ofm__info p { margin: 0; transition: opacity .3s ease, translate .5s var(--zn-ease-out); }
	.zn-ofm .zn-ofm__info.is-swap p { opacity: 0; translate: 0 6px; transition-duration: .15s; }
	.zn-ofm .zn-ofm__info strong { font-size: 16px; }
}

/* ════════ Scroll reveal (armed by offices.js) ════════ */
.is-armed :is(.zn-ofi__accent, .zn-ofl__accent) { scale: 1 0; transform-origin: 50% 0; }
.is-armed .zn-ofl__rule { scale: 0 1; transform-origin: 0 50%; }
.is-armed :is(.zn-ofi__text, .zn-ofl-rv) { opacity: 0; translate: 0 28px; }
.zn-ofl.is-armed .zn-ofl__card > * { opacity: 0; translate: 0 22px; }
.zn-ofm.is-armed .zn-ofm__img { opacity: 0; scale: 1.03; }
.zn-ofm.is-armed:not(.is-in) .zn-ofm__pin::before { scale: 0; }
.zn-ofm.is-armed .zn-ofm__route { opacity: 0; }

.is-in :is(.zn-ofi__accent, .zn-ofl__accent) { scale: 1 1; transition: scale 1s var(--zn-ease-out) .3s; }
.is-in .zn-ofl__rule { scale: 1 1; transition: scale 1.6s var(--zn-ease-out) .4s; }
.is-in :is(.zn-ofi__text, .zn-ofl-rv) { opacity: 1; translate: 0 0; transition: opacity 1s ease, translate 1.2s var(--zn-ease-out); transition-delay: var(--zn-d, .2s); }
.zn-ofl.is-in .zn-ofl__card > * { opacity: 1; translate: 0 0; transition: opacity 1s ease var(--zn-d, 0s), translate 1.2s var(--zn-ease-out) var(--zn-d, 0s); }
.zn-ofl.is-in .zn-ofl__card.is-settled > * { transition: none; }
.zn-ofm.is-in .zn-ofm__img { opacity: 1; scale: 1; transition: opacity 1.4s ease .1s, scale 2.4s var(--zn-ease-out) .1s; }
.zn-ofm.is-in .zn-ofm__pin::before { transition: scale .9s cubic-bezier(.34, 1.56, .64, 1) var(--zn-d, .6s), background-color .4s ease, box-shadow .4s ease; }
.zn-ofm.is-in.is-settled .zn-ofm__pin::before { transition: background-color .4s ease, box-shadow .4s ease, scale .6s var(--zn-ease-out); }
.zn-ofm.is-in .zn-ofm__route { opacity: .55; transition: opacity 1.2s ease 1.2s; }

@media (prefers-reduced-motion: reduce) {
	:where(.zn-ofi, .zn-ofl) *, :where(.zn-ofi, .zn-ofl) *::before, :where(.zn-ofi, .zn-ofl) *::after { transition: none !important; animation: none !important; }
	.zn-ofm .zn-ofm__pulse { display: none; }
}
