/* Orbit Explorers Globe — hero + UI chrome. Scoped under .oe-globe. */

.oe-globe {
	position: relative;
	width: 100%;
	height: var(--oe-globe-height, clamp(420px, 70vh, 760px));
	overflow: hidden;
	border-radius: 16px;
	background:
		radial-gradient(120% 120% at 50% 20%, #0b1830 0%, #060a16 55%, #03050c 100%);
	color: #eaf2ff;
	font-family: inherit;
	isolation: isolate;
}

/* Scrolling: a vertical swipe/drag anywhere on the globe scrolls the page; a
   horizontal drag rotates it (globe.js sets touch-action:pan-y on the canvas,
   overriding the touch-action:none OrbitControls would otherwise force). The UI
   chrome keeps pan-y too so drags starting on it also scroll. */
.oe-globe__controls,
.oe-globe__switcher,
.oe-globe__legend,
.oe-globe__info,
.oe-globe__status,
.oe-globe__hint {
	touch-action: pan-y;
}

/* Full-bleed: break out of the theme's centered content column, edge to edge.
   Uses the container's own centering, so it works inside Astra's constrained
   content width without restructuring blocks. */
.oe-globe--full {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	border-radius: 0;
}

.oe-globe__canvas {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	display: block;
	opacity: 0;
	transition: opacity 0.9s ease;
	/* Vertical swipe scrolls the page, horizontal drag rotates. globe.js also sets
	   this inline after OrbitControls (which forces 'none'); kept here as a backup. */
	touch-action: pan-y;
}
.oe-globe.is-live .oe-globe__canvas { opacity: 1; }

/* Poster: shown first (protects LCP), fades out once the canvas is live. */
.oe-globe__poster {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0.9;
	filter: brightness(0.85) saturate(1.05);
	transition: opacity 1s ease;
	z-index: 0;
}
.oe-globe.is-live .oe-globe__poster { opacity: 0; }
.oe-globe--failed .oe-globe__poster { opacity: 0.9; }

/* Reduced-motion / no-autoplay call to action. */
.oe-globe__hint {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	z-index: 5;
	padding: 0.7em 1.3em;
	border-radius: 999px;
	background: rgba(12, 22, 42, 0.82);
	border: 1px solid rgba(120, 170, 255, 0.5);
	color: #eaf2ff;
	font-size: 0.95rem;
	cursor: pointer;
	backdrop-filter: blur(6px);
}
.oe-globe__hint:hover { background: rgba(24, 42, 76, 0.9); }

.oe-globe__noscript { position: absolute; inset: auto 1rem 1rem; z-index: 5; }

/* Featured object labels (ISS, etc.). */
.oe-globe__label {
	position: absolute;
	z-index: 4;
	transform: translate(-50%, -140%);
	padding: 2px 8px;
	font-size: 11px;
	letter-spacing: 0.02em;
	line-height: 1.5;
	color: #eaf2ff;
	background: rgba(10, 20, 38, 0.72);
	border: 1px solid rgba(124, 246, 200, 0.6);
	border-radius: 6px;
	white-space: nowrap;
	cursor: pointer;
	pointer-events: auto;
}
.oe-globe__label::after {
	content: "";
	position: absolute;
	left: 50%;
	top: 100%;
	width: 1px;
	height: 10px;
	background: rgba(124, 246, 200, 0.6);
	transform: translateX(-50%);
}

/* Info panel. */
.oe-globe__info {
	display: none; /* toggled via .is-open — more robust than the [hidden] attribute */
	position: absolute;
	/* Vertically centered on the right: clears the site's top navigation and the
	   bottom controls/legend. */
	top: 50%;
	right: 14px;
	transform: translateY(-50%);
	z-index: 7;
	width: min(260px, 72%);
	padding: 14px 16px;
	border-radius: 12px;
	background: rgba(9, 17, 33, 0.86);
	border: 1px solid rgba(120, 170, 255, 0.28);
	backdrop-filter: blur(10px);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
	pointer-events: auto;
}
.oe-globe__info.is-open { display: block; }
/* Extra specificity + explicit colour so the theme's heading styles (e.g. Astra's
   dark .entry-content h3) don't make the title dark-on-dark or oversized. */
.oe-globe .oe-globe__info h3 {
	margin: 0 30px 10px 0;
	padding: 0;
	font-size: 1rem;
	line-height: 1.3;
	font-weight: 600;
	color: #eaf2ff;
}
.oe-globe__row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 4px 0;
	font-size: 0.85rem;
	border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.oe-globe__row span { opacity: 0.7; }
.oe-globe__row b { font-weight: 600; }
.oe-globe__close {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: none;
	border: 0;
	color: #eaf2ff;
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	opacity: 0.7;
}
.oe-globe__close:hover { opacity: 1; }

/* Visitor group switcher: vertical chip stack on the left (mirrors the info panel). */
.oe-globe__switcher {
	position: absolute;
	left: 14px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 6;
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-width: 42%;
}
.oe-globe__chip {
	padding: 6px 13px;
	border-radius: 999px;
	border: 1px solid rgba(120, 170, 255, 0.28);
	background: rgba(9, 17, 33, 0.72);
	color: #eaf2ff;
	font-size: 0.8rem;
	line-height: 1.2;
	text-align: left;
	white-space: nowrap;
	cursor: pointer;
	backdrop-filter: blur(8px);
	transition: background 0.15s ease, border-color 0.15s ease;
}
.oe-globe__chip:hover { background: rgba(24, 42, 76, 0.85); }
.oe-globe__chip.is-active {
	border-color: rgba(124, 246, 200, 0.8);
	background: rgba(124, 246, 200, 0.16);
	font-weight: 600;
}

/* Bottom controls. */
.oe-globe__controls {
	position: absolute;
	left: 14px;
	bottom: 14px;
	z-index: 6;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 8px;
	border-radius: 999px;
	background: rgba(9, 17, 33, 0.72);
	border: 1px solid rgba(120, 170, 255, 0.22);
	backdrop-filter: blur(8px);
}
.oe-globe__btn {
	min-width: 34px;
	height: 30px;
	padding: 0 10px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: rgba(255, 255, 255, 0.06);
	color: #eaf2ff;
	font-size: 0.82rem;
	cursor: pointer;
}
.oe-globe__btn:hover { background: rgba(120, 170, 255, 0.22); }

/* Every control here is a <button>; keep their text light even when the theme
   restyles button:hover / :focus (Astra flips it to a dark colour otherwise). */
.oe-globe button { color: #eaf2ff; }
.oe-globe button:hover,
.oe-globe button:focus,
.oe-globe button:active { color: #eaf2ff !important; }

.oe-globe__btn--toggle.is-active {
	background: rgba(124, 246, 200, 0.16);
	border-color: rgba(124, 246, 200, 0.55);
}
.oe-globe__btn--toggle:not(.is-active) { opacity: 0.5; }

/* Zoom +/- : square, monospaced glyphs. Shown on devices with a fine pointer
   (desktop); on touch devices a two-finger pinch zooms instead, so hide them. */
.oe-globe__btn--zoom {
	min-width: 30px;
	padding: 0;
	font-size: 1.05rem;
	line-height: 1;
	font-weight: 600;
}
@media (pointer: coarse) {
	.oe-globe__btn--zoom { display: none; }
}
.oe-globe__count { padding: 0 6px; font-size: 0.78rem; opacity: 0.75; }

/* Legend. */
.oe-globe__legend {
	position: absolute;
	right: 14px;
	bottom: 14px;
	z-index: 6;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 12px;
	max-width: 46%;
	justify-content: flex-end;
	padding: 8px 10px;
	border-radius: 10px;
	background: rgba(9, 17, 33, 0.6);
	font-size: 0.72rem;
}
.oe-globe__legend-item { display: inline-flex; align-items: center; gap: 6px; opacity: 0.85; }
.oe-globe__legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* Loading / error status. */
.oe-globe__status {
	position: absolute;
	left: 50%;
	bottom: 62px;
	transform: translateX(-50%);
	z-index: 6;
	padding: 6px 14px;
	border-radius: 999px;
	background: rgba(9, 17, 33, 0.8);
	font-size: 0.8rem;
}
.oe-globe__status.is-error { color: #ffb4b4; border: 1px solid rgba(255, 120, 120, 0.4); }

@media (max-width: 640px) {
	.oe-globe__legend { display: none; }
	.oe-globe__info { width: min(220px, 78%); }

	/* Wider, edge-to-edge control bar with larger tap targets for touch. */
	.oe-globe__controls {
		left: 12px;
		right: 12px;
		transform: none;
		justify-content: center;
		flex-wrap: wrap;
		gap: 8px;
		padding: 8px 12px;
		border-radius: 16px;
	}
	.oe-globe__btn {
		flex: 1 1 auto;
		min-width: 56px;
		height: 42px;
		font-size: 0.95rem;
	}
	.oe-globe__count {
		flex-basis: 100%;
		order: -1;
		text-align: center;
		padding-bottom: 2px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.oe-globe__canvas,
	.oe-globe__poster { transition: none; }
}
