/*
 * PRONYX — GITEX Global popup
 * Scoped under .px-gx; reads pronyx-v25 theme tokens with fallbacks.
 */

.px-gx {
	--gx-navy: var(--navy, #113255);
	--gx-ink: var(--ink, #0A1B2E);
	--gx-copper: var(--copper, #B5713F);
	--gx-stone: var(--stone, #E7E2D8);
	--gx-lime: var(--lime, #F4F1EB);
	--gx-line: var(--line, #D9D4CA);
	--gx-steel-ink: var(--steel-ink, #4A6582);
	--gx-ease: var(--ease, cubic-bezier(.2, .7, .2, 1));
	--gx-t-fast: var(--t-fast, 160ms);
	--gx-t-base: var(--t-base, 260ms);
	--gx-gap: 24px;
	--gx-mono: "IBM Plex Mono", ui-monospace, monospace;
	/* Shared vertical rhythm so both panels align */
	--gx-pad-top: 48px;
	--gx-pad-bottom: 44px;
	--gx-pad-x: 40px;

	position: fixed;
	inset: 0;
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 0;
	width: min(880px, calc(100vw - var(--gx-gap) * 2));
	max-width: none;
	height: fit-content;
	max-height: calc(100vh - var(--gx-gap) * 2);
	max-height: calc(100dvh - var(--gx-gap) * 2);
	overflow: visible;
	background: transparent;
	color: var(--gx-navy);
	font-family: Archivo, system-ui, sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	text-align: left;
	-webkit-font-smoothing: antialiased;
	opacity: 0;
	transform: translateY(12px);
	transition: opacity var(--gx-t-base) var(--gx-ease), transform var(--gx-t-base) var(--gx-ease);
}

.px-gx:not([open]) { display: none; }
.px-gx:focus { outline: none; }
.px-gx.is-open { opacity: 1; transform: none; }
.px-gx.is-closing { transition-duration: var(--gx-t-fast); transition-timing-function: ease-in; }

.px-gx::backdrop {
	background: rgba(10, 27, 46, .72);
	opacity: 0;
	transition: opacity var(--gx-t-base) linear;
}
.px-gx.is-open::backdrop { opacity: 1; }
.px-gx.is-closing::backdrop { transition-duration: var(--gx-t-fast); }

.px-gx *,
.px-gx *::before,
.px-gx *::after { box-sizing: border-box; }

/* Background scroll lock without layout shift */
html.px-gx-lock { overflow: hidden; scrollbar-gutter: stable; }

/* ---------- Panel ---------- */

.px-gx__panel {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	max-height: inherit;
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #fff;
	/* Hairline keeps the dark brand edge defined over navy page sections */
	outline: 1px solid rgba(255, 255, 255, .16);
	box-shadow: 0 24px 64px rgba(10, 27, 46, .28);
}

/* ---------- Brand panel: Dubai at dusk ---------- */

.px-gx__brand {
	position: relative;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	padding: var(--gx-pad-top) 0 0;
	background:
		radial-gradient(80% 30% at 15% 0%, rgba(255, 255, 255, .06) 0%, rgba(255, 255, 255, 0) 100%),
		linear-gradient(180deg, var(--gx-ink) 0%, #12345A 55%, #1C4470 100%);
	color: #fff;
}

/* Official GITEX logo (reversed artwork), cropped to the GITEX GLOBAL mark */
.px-gx__mark {
	position: relative;
	z-index: 1;
	display: block;
	width: min(calc(100% - var(--gx-pad-x) * 2), 196px);
	aspect-ratio: 514 / 195;
	margin: 0 var(--gx-pad-x);
	overflow: hidden;
}
.px-gx__mark img {
	display: block;
	width: 194.55%;
	max-width: none;
	height: auto;
	margin: 0;
	border: 0;
}

.px-gx__scene {
	display: block;
	width: 100%;
	height: auto;
	margin-top: auto;
	padding-top: 16px;
	overflow: visible;
}

/* Desktop/tablet: logo floats in the sky so both panels share one height */
@media (min-width: 640px) {
	.px-gx__brand { min-height: 400px; padding-top: 0; }
	.px-gx__mark { position: absolute; top: var(--gx-pad-top); left: 0; }
	.px-gx__scene { padding-top: 0; }
}
.px-gx__scene-far { fill: #15385E; }
.px-gx__scene-near { fill: var(--gx-ink); }
.px-gx__scene-ribs path {
	fill: none;
	stroke: var(--gx-copper);
	stroke-opacity: .55;
	stroke-width: .8;
}
.px-gx__scene-beacon { fill: var(--gx-copper); }
.px-gx__scene-beacon-halo { fill: var(--gx-copper); opacity: .28; }
.px-gx.is-open .px-gx__scene-beacon-halo { animation: px-gx-beacon 2400ms ease-in-out infinite; }

@keyframes px-gx-beacon {
	0%, 100% { opacity: .28; }
	50% { opacity: .05; }
}

/* Ground band continues the foreground silhouette */
.px-gx__when {
	position: relative;
	margin-top: -1px;
	padding: 4px var(--gx-pad-x) var(--gx-pad-bottom);
	background: var(--gx-ink);
}

.px-gx__date { margin: 0; color: #fff; }
.px-gx__date-k {
	display: block;
	margin-bottom: 12px;
	font-family: var(--gx-mono);
	font-size: 12px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: .2em;
	color: var(--gx-stone);
}
.px-gx__date-v {
	display: block;
	font-stretch: 125%;
	font-weight: 600;
	font-size: 44px;
	line-height: .95;
	letter-spacing: 0;
	white-space: nowrap;
}

.px-gx__brand-foot {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 16px;
	margin-top: 22px;
	padding-top: 14px;
	border-top: 1px solid rgba(255, 255, 255, .18);
	font-family: var(--gx-mono);
	font-size: 12px;
	line-height: 1.4;
}
.px-gx__venue { margin: 0; font-weight: 500; letter-spacing: .1em; color: var(--gx-stone); }
.px-gx__site { margin: 0; letter-spacing: .04em; color: rgba(255, 255, 255, .7); }

/* ---------- Content ---------- */

.px-gx__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	padding: var(--gx-pad-top) 48px var(--gx-pad-bottom);
	min-width: 0;
}

.px-gx__title {
	margin: 0;
	padding: 0 52px 0 0;
	font-family: inherit;
	font-stretch: 125%;
	font-weight: 600;
	font-size: clamp(30px, 2.8vw, 38px);
	line-height: 1.02;
	letter-spacing: 0;
	text-transform: uppercase;
	text-wrap: balance;
	color: var(--gx-navy);
}

.px-gx__rule {
	display: block;
	width: 56px;
	height: 3px;
	margin: 22px 0 22px;
	background: var(--gx-copper);
}

.px-gx__desc {
	margin: 0;
	max-width: 34ch;
	font-size: 18px;
	line-height: 1.5;
	color: var(--gx-navy);
}

.px-gx__meta {
	width: 100%;
	margin: 28px 0 32px;
	padding: 16px 0 0;
	border-top: 1px solid var(--gx-line);
	font-family: var(--gx-mono);
	font-size: 13px;
	line-height: 1.5;
	letter-spacing: .02em;
}
.px-gx__meta p { margin: 0; }
.px-gx__meta p:first-child { font-weight: 500; color: var(--gx-navy); }
.px-gx__meta p + p { color: var(--gx-steel-ink); }

/* ---------- CTA (mirrors .px-btn.px-btn--navy) ---------- */

.px-gx__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	height: 52px;
	margin-top: auto;
	padding: 0 28px;
	border: 1px solid transparent;
	border-radius: 0;
	background: var(--gx-navy);
	color: #fff;
	font-family: inherit;
	font-stretch: 112%;
	font-weight: 600;
	font-size: 13px;
	line-height: 1;
	letter-spacing: .12em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color var(--gx-t-fast) ease;
}
.px-gx__cta:hover,
.px-gx__cta:focus { background: var(--gx-ink); color: #fff; text-decoration: none; }
.px-gx__cta:active { transform: translateY(1px); }
.px-gx__cta:focus-visible { outline: 2px solid #fff; outline-offset: -6px; }
.px-gx__cta span[aria-hidden] { display: inline-block; transition: transform var(--gx-t-base) var(--gx-ease); }
.px-gx__cta:hover span[aria-hidden] { transform: translateX(4px); }

/* ---------- Close ---------- */

.px-gx__close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--gx-line);
	border-radius: 0;
	background: #fff;
	color: var(--gx-navy);
	box-shadow: none;
	cursor: pointer;
	transition: background-color var(--gx-t-fast) ease, color var(--gx-t-fast) ease, border-color var(--gx-t-fast) ease;
}
.px-gx__close:hover { background: var(--gx-navy); border-color: var(--gx-navy); color: #fff; }
.px-gx__close:focus-visible { outline: 2px solid var(--gx-navy); outline-offset: 2px; }
.px-gx__close svg { display: block; width: 16px; height: 16px; pointer-events: none; }

/* ---------- Tablet ---------- */

@media (max-width: 960px) and (min-width: 640px) {
	.px-gx { --gx-pad-top: 40px; --gx-pad-bottom: 36px; --gx-pad-x: 32px; }
	.px-gx__mark { width: min(calc(100% - var(--gx-pad-x) * 2), 168px); }
	.px-gx__date-v { font-size: 36px; }
	.px-gx__body { padding-left: 36px; padding-right: 36px; }
	.px-gx__desc { font-size: 17px; }
}

/* ---------- Mobile: bottom sheet ---------- */

@media (max-width: 639.98px) {
	.px-gx {
		--gx-pad-x: 20px;
		inset: auto 0 0 0;
		width: 100%;
		max-height: calc(100vh - 16px);
		max-height: calc(100dvh - 16px - env(safe-area-inset-top, 0px));
		margin: 0;
		transform: translateY(32px);
	}

	.px-gx__panel {
		grid-template-columns: minmax(0, 1fr);
		box-shadow: 0 -12px 40px rgba(10, 27, 46, .24);
	}

	/* Header band: logo in open sky top-left, skyline anchored right, date on the ground */
	.px-gx__brand { padding-top: 22px; }
	.px-gx__mark { width: 148px; }
	.px-gx__scene {
		width: 74%;
		margin: -40px 0 0 auto;
		padding-top: 0;
	}
	/* Ground overlaps the scene's own ground strip (21/360 of its width) so the horizon runs edge to edge */
	.px-gx__when {
		display: flex;
		align-items: flex-end;
		justify-content: space-between;
		gap: 16px;
		margin-top: calc(-.74 * 21 / 360 * 100%);
		padding: 2px var(--gx-pad-x) 18px;
	}
	.px-gx__date-k { margin-bottom: 8px; font-size: 11px; }
	.px-gx__date-v { font-size: 30px; }
	.px-gx__brand-foot {
		flex-direction: column;
		align-items: flex-end;
		gap: 2px;
		margin: 0;
		padding: 0;
		border: 0;
		font-size: 11px;
		text-align: right;
	}

	.px-gx__body {
		padding: 24px 20px calc(20px + env(safe-area-inset-bottom, 0px));
	}
	.px-gx__title { padding-right: 0; font-size: 28px; }
	.px-gx__rule { width: 48px; margin: 16px 0 16px; }
	.px-gx__desc { font-size: 16px; }
	.px-gx__meta { margin: 20px 0 20px; padding-top: 14px; font-size: 12.5px; }
	.px-gx__cta { width: 100%; }

	.px-gx__close {
		top: 14px;
		right: 14px;
		border-color: rgba(255, 255, 255, .4);
		background: transparent;
		color: #fff;
	}
	.px-gx__close:hover { background: #fff; border-color: #fff; color: var(--gx-navy); }
	.px-gx__close:focus-visible { outline-color: #fff; }
}

@media (max-width: 359.98px) {
	.px-gx__when { flex-direction: column; align-items: flex-start; }
	.px-gx__brand-foot { align-items: flex-start; text-align: left; }
}

/* Short mobile viewports (e.g. 375×667, landscape) */
@media (max-width: 639.98px) and (max-height: 700px) {
	.px-gx__brand { padding-top: 18px; }
	.px-gx__scene { width: 62%; margin-top: -36px; }
	.px-gx__when { margin-top: calc(-.62 * 21 / 360 * 100%); }
	.px-gx__body { padding-top: 20px; }
	.px-gx__meta { margin: 16px 0; }
}

/* Short desktop viewports */
@media (min-width: 640px) and (max-height: 640px) {
	.px-gx { --gx-pad-top: 32px; --gx-pad-bottom: 32px; }
	.px-gx__meta { margin: 20px 0 24px; }
}

@media (prefers-reduced-motion: reduce) {
	.px-gx,
	.px-gx.is-closing { transform: none; transition: opacity 1ms linear; }
	.px-gx::backdrop { transition: none; }
	.px-gx.is-open .px-gx__scene-beacon-halo { animation: none; }
	.px-gx__cta span[aria-hidden] { transition: none; }
}

@media (forced-colors: active) {
	.px-gx__panel { border: 1px solid CanvasText; }
	.px-gx__rule { background: CanvasText; }
	.px-gx__scene { display: none; }
}
