/*
 * Homepage offices map (template-parts/offices.php, assets/offices.js). Sizes, colours and
 * timings follow the public M08 component (docs/ANIMATION_INVENTORY.md): the map fills the
 * 794px section, selecting an office splits it 35% map / 65% panel above 900px (the panel
 * alone below), and green bands fade the top and bottom edges. The OpenStreetMap attribution
 * the public component hides is shown.
 */
.eiatec-offices {
	--padding-top: 0; --padding-right: 0; --padding-bottom: 0; --padding-left: 0; --gap: 0;
	position: relative;
	isolation: isolate;
	gap: 0;
	align-items: flex-start;
	height: 794px;
	padding: clamp(30px, 6vw, 50px) clamp(20px, 5vw, 60px) 0;
	overflow: hidden;
	background: #000;
	color: #fff;
}
.eiatec-offices > .eiatec-offices-title, .eiatec-offices > .eiatec-offices-subtitle { position: relative; z-index: 600; width: auto; pointer-events: none; transition: all .5s ease; }
.elementor-editor-active .eiatec-offices > .eiatec-offices-title, .elementor-editor-active .eiatec-offices > .eiatec-offices-subtitle { pointer-events: auto; }
.eiatec-offices.is-office-open > .eiatec-offices-title, .eiatec-offices.is-office-open > .eiatec-offices-subtitle { opacity: 0; transform: translateY(-20px); }
.eiatec-offices .eiatec-offices-title .elementor-heading-title { margin: 0; color: #fff; font-family: inherit; font-size: clamp(1.8rem, 5vw, 2.8rem); font-weight: 800; line-height: normal; letter-spacing: -.5px; text-transform: uppercase; }
.eiatec-offices .eiatec-offices-title .elementor-heading-title span { color: #2c6957; }
.eiatec-offices .eiatec-offices-subtitle .elementor-heading-title { margin: 4px 0 0; color: rgba(255, 255, 255, .7); font-family: inherit; font-size: clamp(.8rem, 1.4vw, 1.1rem); font-weight: 400; line-height: normal; }
.eiatec-offices > .eiatec-offices-widget { position: absolute; inset: 0; width: auto; max-width: none; margin: 0; }
.eiatec-offices-widget > .elementor-widget-container, .eiatec-offices-widget .elementor-shortcode { height: 100%; }

.eiatec-offices-app { position: relative; display: flex; height: 100%; overflow: hidden; background: #000; font-family: inherit; }
.eiatec-offices-app.is-enhancing, .eiatec-offices-app.is-enhancing * { transition: none !important; }
.eiatec-offices-app button { font-family: inherit; }
.eiatec-offices-edge { position: absolute; inset: 0; z-index: 500; pointer-events: none; background: linear-gradient(to bottom, #2c6957 0%, transparent 10%, transparent 88%, #2c6957 100%); }

/* Map and panel. The map has no z-index of its own, so Leaflet's attribution (z-index 1000)
 * stays above the edge bands (500) while the tiles and markers sit below them. */
.eiatec-offices-map { flex: 1 1 0; min-width: 0; height: 100%; background: #000; transition: all .8s cubic-bezier(.4, 0, .2, 1); }
.eiatec-offices-map.leaflet-container { font-family: inherit; }
.eiatec-offices-map .leaflet-control-attribution { padding: 1px 6px; background: rgba(255, 255, 255, .78); color: #333; font-size: 10px; }
.eiatec-offices-map .leaflet-control-attribution a { color: #0e3f3a; }
.eiatec-offices-panel { position: relative; display: flex; flex: 0 0 0; height: 100%; overflow: hidden; background: #01120f; transition: all .8s cubic-bezier(.4, 0, .2, 1); }
.eiatec-office { display: none; flex: 1 1 auto; width: 100%; height: 100%; }
.eiatec-office.is-current { display: flex; }
.eiatec-office-info {
	z-index: 2; display: flex; flex-direction: column; justify-content: center; width: 45%; height: 100%; padding: clamp(20px, 4vw, 60px);
	background: linear-gradient(to right, rgba(1, 18, 15, 1) 40%, rgba(1, 18, 15, .8) 100%); color: #fff;
	opacity: 0; transform: translateX(40px); transition: all .6s .4s ease;
}
.eiatec-offices-app.is-active .eiatec-office-info { opacity: 1; transform: translateX(0); }
.eiatec-office-title { margin: 0 0 5px; color: #fff; font-family: inherit; font-size: clamp(1.8rem, 5vw, 3.2rem); font-weight: 800; line-height: 1.2; letter-spacing: -.5px; text-transform: none; }
.eiatec-office-title span { color: #eaad26; }
.eiatec-office-address { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 25px; color: #8a9e95; font-size: clamp(.85rem, 2vw, 1.1rem); font-weight: 600; }
.eiatec-office-divider { flex-shrink: 0; width: 50px; height: 3px; margin-bottom: 25px; border-radius: 5px; background: #62b455; }
.eiatec-office-desc { margin: 0; color: #c1d1c8; font-size: clamp(.95rem, 1.8vw, 1.25rem); font-weight: 400; line-height: 1.7; }
.eiatec-office-media { position: relative; width: 55%; height: 100%; }
/* Outranks Elementor's `.elementor img { height: auto }`. */
.eiatec-office-media .eiatec-office-video, .eiatec-office-media .eiatec-office-poster { display: block; width: 100%; max-width: none; height: 100%; object-fit: cover; background: #000; }
@media (min-width: 901px) {
	.eiatec-offices-app.is-active .eiatec-offices-map { flex: 0 0 35%; }
	.eiatec-offices-app.is-active .eiatec-offices-panel { flex: 0 0 65%; }
	.eiatec-office-media .eiatec-office-video, .eiatec-office-media .eiatec-office-poster { -webkit-mask-image: linear-gradient(to left, #000 60%, transparent 100%); mask-image: linear-gradient(to left, #000 60%, transparent 100%); opacity: .9; }
}

/* Back button, zoom and the office buttons. */
.eiatec-offices-back {
	position: absolute; z-index: 1000; display: flex; align-items: center; gap: 6px; padding: 10px 20px;
	border: 1px solid rgba(255, 255, 255, .2); border-radius: 50px; background: rgba(14, 63, 58, .9);
	-webkit-backdrop-filter: blur(15px); backdrop-filter: blur(15px); color: #fff;
	font-size: clamp(.7rem, 1.2vw, .9rem); font-weight: 700; line-height: normal; letter-spacing: 1px; text-transform: uppercase;
	cursor: pointer; opacity: 0; pointer-events: none; visibility: hidden;
	transition: all .4s ease, visibility 0s .4s;
}
.eiatec-offices-back[hidden] { display: none; }
.eiatec-offices-back:hover, .eiatec-offices-back:focus { background: rgba(14, 63, 58, .9); color: #fff; }
.eiatec-offices-app.is-active .eiatec-offices-back { opacity: 1; pointer-events: all; visibility: visible; transition: all .4s ease, visibility 0s; }
.eiatec-offices-zoom { position: absolute; top: 50%; right: 15px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; transform: translateY(-50%); }
.eiatec-offices-zoom[hidden] { display: none; }
.eiatec-offices-zoom-button {
	display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; padding: 0;
	border: 1px solid rgba(255, 255, 255, .2); border-radius: 50%; background: rgba(14, 63, 58, .9);
	-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; transition: .3s;
}
.eiatec-offices-zoom-button:hover, .eiatec-offices-zoom-button:focus-visible { background: #eaad26; color: #0e3f3a; }
.eiatec-offices-controls {
	position: absolute; bottom: 45px; left: 50%; z-index: 900; display: flex; flex-wrap: wrap; justify-content: center; gap: clamp(10px, 2vw, 15px);
	transform: translateX(-50%); transition: all .5s ease, visibility 0s;
}
.eiatec-offices-app.is-active .eiatec-offices-controls { opacity: 0; transform: translate(-50%, 40px); pointer-events: none; visibility: hidden; transition: all .5s ease, visibility 0s .5s; }
.eiatec-office-button {
	padding: 10px 20px; border: 1px solid rgba(255, 255, 255, .2); border-radius: 50px; background: rgba(255, 255, 255, .1);
	-webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); color: #fff;
	font-size: clamp(.7rem, 1.1vw, .85rem); font-weight: 700; line-height: normal; letter-spacing: 1px; text-transform: uppercase; white-space: nowrap;
	/* The public 0.3s, minus visibility: the button must be focusable the moment the panel closes. */
	cursor: pointer; transition: background-color .3s, color .3s, transform .3s, border-color .3s;
}
.eiatec-office-button:hover, .eiatec-office-button:focus-visible { background: #eaad26; color: #0e3f3a; transform: translateY(-3px); }
.eiatec-offices-back:focus-visible, .eiatec-offices-zoom-button:focus-visible, .eiatec-office-button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/* Office markers: a gold core with a 2.5s radar pulse. */
.eiatec-office-marker { position: relative; width: 24px; height: 24px; }
.eiatec-office-core { position: absolute; top: 5px; left: 5px; z-index: 2; width: 14px; height: 14px; box-sizing: border-box; border: 2px solid #fff; border-radius: 50%; background: #eaad26; }
.eiatec-office-pulse { position: absolute; top: 0; left: 0; z-index: 1; width: 24px; height: 24px; border-radius: 50%; background: #eaad26; opacity: .8; animation: eiatec-office-pulse 2.5s infinite ease-out; }
@keyframes eiatec-office-pulse { 0% { transform: scale(1); opacity: .8; } 100% { transform: scale(3.5); opacity: 0; } }

/* Without JavaScript: the offices are listed in the section instead of the map. */
.eiatec-offices-app:not(.is-enhanced) .eiatec-offices-map, .eiatec-offices-app:not(.is-enhanced) .eiatec-offices-controls { display: none; }
.eiatec-offices-app:not(.is-enhanced) .eiatec-offices-panel { display: block; flex: 1 1 auto; padding-top: 150px; overflow-y: auto; }
.eiatec-offices-app:not(.is-enhanced) .eiatec-office { display: flex; height: 420px; }
.eiatec-offices-app:not(.is-enhanced) .eiatec-office-info { opacity: 1; transform: none; }

@media (max-width: 900px) {
	.eiatec-offices { padding: 20px 20px 0; }
	.eiatec-offices-app.is-active .eiatec-offices-map { display: none; }
	/* The public component keeps ± over the video here, where they zoom a hidden map. */
	.eiatec-offices-app.is-active .eiatec-offices-zoom { display: none; }
	.eiatec-offices-app.is-active .eiatec-offices-panel { flex: 0 0 100%; }
	.eiatec-office { flex-direction: column-reverse; }
	.eiatec-office-info { align-items: center; width: 100%; height: auto; min-height: 40%; padding: clamp(16px, 4vw, 30px); text-align: center; }
	.eiatec-office-divider { margin-right: auto; margin-left: auto; }
	.eiatec-office-address { justify-content: center; }
	.eiatec-office-media { width: 100%; height: 50%; }
	.eiatec-offices-back { top: 15px; left: 15px; padding: 8px 16px; transform: translateY(-20px); }
	.eiatec-offices-app.is-active .eiatec-offices-back { transform: translateY(0); }
	.eiatec-offices-controls { bottom: 20px; width: 90%; max-width: 400px; }
	.eiatec-office-button { flex: 1; min-width: 80px; padding: 10px 12px; text-align: center; }
}
@media (min-width: 901px) {
	.eiatec-offices-back { bottom: 130px; left: 50%; transform: translateX(-50%) translateY(20px); }
	.eiatec-offices-app.is-active .eiatec-offices-back { transform: translateX(-50%) translateY(0); }
}
@media (max-width: 480px) {
	.eiatec-offices { height: 754px; }
	.eiatec-offices .eiatec-offices-title .elementor-heading-title { font-size: 1.4rem; }
	.eiatec-office-button { padding: 8px 14px; font-size: .75rem; }
}

/* Reduced motion: still markers, no fly-to (assets/offices.js) and instant panel changes. */
@media (prefers-reduced-motion: reduce) {
	.eiatec-office-pulse { animation: none; opacity: .35; }
	.eiatec-offices > .eiatec-offices-title, .eiatec-offices > .eiatec-offices-subtitle, .eiatec-offices-map, .eiatec-offices-panel,
	.eiatec-office-info, .eiatec-offices-back, .eiatec-offices-controls, .eiatec-office-button, .eiatec-offices-zoom-button { transition: none; }
	.eiatec-office-button:hover, .eiatec-office-button:focus-visible { transform: none; }
}
