/* ═══════════════════════════════════════════════════════════════
   ONHYM Maps Tabs — [onhym_maps_tabs]
   Two-tab container around existing ONHYM maps.
   All classes prefixed with `omt-` to avoid conflicts.
   ═══════════════════════════════════════════════════════════════ */

.omt-tabs {
	--omt-emerald: #1C4B42;        /* ONHYM deep emerald   */
	--omt-emerald-dark: #0f2e29;
	--omt-emerald-text: #14524a;
	--omt-gold: #d4a017;
	--omt-gold-soft: rgba(212, 160, 23, 0.28);
	--omt-white: #ffffff;
	--omt-border: #d7e0dd;
	--omt-radius: 14px;

	position: relative;
	width: 100%;
	box-sizing: border-box;
}

.omt-tabs *,
.omt-tabs *::before,
.omt-tabs *::after {
	box-sizing: inherit;
}

/* ── Tab bar ─────────────────────────────────────────────────── */
.omt-tabs__bar {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 10px;
	margin: 0 auto 18px;
	padding: 6px;
	width: fit-content;
	max-width: 100%;
	background: var(--omt-white);
	border: 1px solid var(--omt-border);
	border-radius: 999px;
	box-shadow: 0 8px 24px rgba(20, 60, 52, 0.08);
}

/* ── Individual tab button ───────────────────────────────────── */
.omt-tab {
	appearance: none;
	-webkit-appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	height: 46px;
	padding: 0 24px;
	margin: 0;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0.01em;
	color: var(--omt-emerald-text);
	background: var(--omt-white);
	border: 1px solid var(--omt-border);
	border-radius: 999px;
	cursor: pointer;
	white-space: nowrap;
	user-select: none;
	position: relative;
	overflow: hidden;
	transition:
		color 0.28s ease,
		background-color 0.28s ease,
		border-color 0.28s ease,
		box-shadow 0.28s ease,
		transform 0.18s ease;
}

.omt-tab__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	color: currentColor;
	transition: transform 0.28s ease;
}

.omt-tab__icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* Subtle gold accent line at the bottom of each tab */
.omt-tab::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: 7px;
	width: 0;
	height: 2px;
	border-radius: 2px;
	background: var(--omt-gold);
	transform: translateX(-50%);
	transition: width 0.28s ease;
}

/* Hover (inactive) */
.omt-tab:hover {
	border-color: var(--omt-gold-soft);
	box-shadow: 0 4px 14px rgba(20, 60, 52, 0.10);
}

.omt-tab:hover .omt-tab__icon {
	transform: scale(1.08);
}

/* Active tab — emerald background, white text */
.omt-tab.is-active {
	color: var(--omt-white);
	background: linear-gradient(135deg, var(--omt-emerald) 0%, var(--omt-emerald-dark) 100%);
	border-color: var(--omt-emerald);
	box-shadow:
		0 10px 26px rgba(20, 60, 52, 0.30),
		inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.omt-tab.is-active::after {
	width: 26px;
}

.omt-tab:active {
	transform: scale(0.98);
}

/* Focus visibility */
.omt-tab:focus-visible {
	outline: 2px solid var(--omt-gold);
	outline-offset: 2px;
}

/* ── Panels ──────────────────────────────────────────────────── */
.omt-tabs__panels {
	position: relative;
	width: 100%;
}

.omt-panel {
	position: relative;
	width: 100%;
	/* Fade/slide transition when a panel is shown */
	animation: omt-panel-in 0.34s ease;
}

.omt-panel[hidden] {
	display: none !important;
}

@keyframes omt-panel-in {
	from { opacity: 0; transform: translateY(6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Make the existing map wrappers fill the panel width cleanly */
.omt-panel .onhym-map-wrap,
.omt-panel .ogp-section {
	width: 100%;
}

/* Loading skeleton shown over a deferred Midstream canvas while hidden.
   Mirrors the shimmer used by onhym-global-map for visual consistency. */
.omt-panel .onhym-map-canvas[data-oms-defer] {
	position: relative;
	background: #eef2f5;
	border-radius: 12px;
}

.omt-panel .onhym-map-canvas[data-oms-defer]::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, #eef2f5 30%, #f8fafc 50%, #eef2f5 70%);
	background-size: 300% 100%;
	animation: omt-shimmer 1.3s ease-in-out infinite;
	border-radius: 12px;
}

@keyframes omt-shimmer {
	0%   { background-position: 100% 0; }
	100% { background-position: 0 0; }
}

/* ── Responsive ──────────────────────────────────────────────── */
@media screen and (max-width: 900px) {
	.omt-tabs__bar {
		gap: 8px;
		margin-bottom: 14px;
	}
	.omt-tab {
		height: 42px;
		padding: 0 18px;
		font-size: 13px;
	}
}

@media screen and (max-width: 560px) {
	.omt-tabs__bar {
		flex-direction: column;
		align-items: stretch;
		width: 100%;
		border-radius: var(--omt-radius);
		padding: 8px;
		gap: 6px;
	}
	.omt-tab {
		width: 100%;
		height: 44px;
		justify-content: center;
	}
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
	.omt-tab,
	.omt-tab__icon,
	.omt-tab::after {
		transition: none;
	}
	.omt-panel {
		animation: none;
	}
	.omt-panel .onhym-map-canvas[data-oms-defer]::after {
		animation: none;
	}
}
