/**
 * Fade Tabs — front-end styles (Modern 2026)
 * @version 2.7.2
 */

.jx-fadetabs {
	--ft-accent: #1819ed;
	--ft-accent-soft: color-mix(in srgb, var(--ft-accent) 12%, transparent);
	--ft-speed: 350ms;
	--ft-ink: #1a1d23;
	--ft-muted: #5c6470;
	--ft-line: #e6e9ef;
	--ft-surface: #ffffff;
	--ft-panel: #f7f8fb;
	font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
	color: var(--ft-ink);
	margin: 0;
}

.jx-fadetabs *,
.jx-fadetabs *::before,
.jx-fadetabs *::after {
	box-sizing: border-box;
}

.jx-ft-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	align-items: center;
	margin-bottom: 1rem;
}

.jx-ft-search {
	position: relative;
	flex: 1 1 220px;
	max-width: 360px;
}

.jx-ft-search-input {
	width: 100%;
	border: 1px solid var(--ft-line);
	border-radius: 999px;
	padding: 0.55rem 2.5rem 0.55rem 1rem;
	background: var(--ft-surface);
	color: var(--ft-ink);
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.jx-ft-search-input:focus {
	border-color: var(--ft-accent);
	box-shadow: 0 0 0 3px var(--ft-accent-soft);
}

.jx-ft-search-clear {
	position: absolute;
	right: 0.4rem;
	top: 50%;
	transform: translateY(-50%);
	border: 0;
	background: transparent;
	color: var(--ft-muted);
	cursor: pointer;
	font-size: 0.8rem;
	padding: 0.25rem 0.5rem;
}

.jx-ft-cats {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.jx-ft-cat {
	border: 1px solid var(--ft-line);
	background: var(--ft-surface);
	color: var(--ft-muted);
	border-radius: 999px;
	padding: 0.35rem 0.85rem;
	font-size: 0.85rem;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.jx-ft-cat:hover {
	border-color: color-mix(in srgb, var(--ft-accent) 40%, var(--ft-line));
	color: var(--ft-ink);
}

.jx-ft-cat.is-active {
	background: var(--ft-accent);
	border-color: var(--ft-accent);
	color: #fff;
}

.jx-ft-shell {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.jx-ft-orient-vertical .jx-ft-shell {
	flex-direction: row;
	align-items: stretch;
	gap: 1.25rem;
}

.jx-ft-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.15rem;
	align-items: stretch;
	overflow: visible;
	border-bottom: 1px solid var(--ft-line);
	padding: 0 0.15rem;
}

.jx-ft-orient-vertical .jx-ft-nav {
	flex-direction: column;
	flex-wrap: nowrap;
	flex: 0 0 220px;
	overflow: visible;
	border-bottom: 0;
	border-right: 1px solid var(--ft-line);
	padding: 0.25rem 0.75rem 0.25rem 0;
}

.jx-ft-tab {
	appearance: none;
	flex: 0 1 auto;
	border: 0;
	border-bottom: 2px solid transparent;
	background: transparent;
	color: var(--ft-muted);
	padding: 0.85rem 1.05rem;
	margin-bottom: -1px;
	font: inherit;
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.35;
	cursor: pointer;
	white-space: nowrap;
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	position: relative;
	border-radius: 0.65rem 0.65rem 0 0;
	transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.jx-ft-orient-vertical .jx-ft-tab {
	white-space: normal;
	border-radius: 0.65rem;
	justify-content: flex-start;
	width: 100%;
	text-align: left;
	border-bottom: 0;
	border-right: 2px solid transparent;
	margin-bottom: 0;
	margin-right: -1px;
}

.jx-ft-tab:hover {
	color: var(--ft-ink);
	background: var(--ft-accent-soft);
}

.jx-ft-tab.is-active {
	color: var(--ft-accent);
	background: linear-gradient(180deg, var(--ft-accent-soft), transparent);
	border-bottom-color: var(--ft-accent);
}

.jx-ft-orient-vertical .jx-ft-tab.is-active {
	border-right-color: var(--ft-accent);
}

.jx-ft-tab.is-hidden,
.jx-ft-panel.is-filtered-out {
	display: none !important;
}

.jx-ft-tab:focus-visible {
	outline: 2px solid var(--ft-accent);
	outline-offset: 2px;
}

.jx-ft-icon {
	display: inline-flex;
	opacity: 0.9;
}

.jx-ft-badge {
	display: inline-flex;
	align-items: center;
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	padding: 0.15rem 0.45rem;
	border-radius: 999px;
	background: var(--ft-accent-soft);
	color: var(--ft-accent);
}

.jx-ft-panels {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	background: var(--ft-panel);
	border: 1px solid var(--ft-line);
	border-top: 0;
	border-radius: 0 0 1rem 1rem;
	padding: 1.25rem 1.35rem 1.4rem;
	box-shadow: 0 10px 30px rgba(16, 24, 40, 0.04);
}

.jx-ft-orient-vertical .jx-ft-panels {
	border-top: 1px solid var(--ft-line);
	border-radius: 1rem;
}

.jx-ft-panel {
	display: none;
	opacity: 0;
}

.jx-ft-panel.is-active {
	display: block;
}

.jx-ft-effect-fade .jx-ft-panel.is-active {
	animation: jxFtFade var(--ft-speed) ease both;
}

.jx-ft-effect-slide .jx-ft-panel.is-active {
	animation: jxFtSlide var(--ft-speed) ease both;
}

.jx-ft-effect-none .jx-ft-panel.is-active {
	opacity: 1;
}

@keyframes jxFtFade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes jxFtSlide {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.jx-ft-effect-fade .jx-ft-panel.is-active,
	.jx-ft-effect-slide .jx-ft-panel.is-active {
		animation: none;
		opacity: 1;
		transform: none;
	}
}

.jx-ft-panel-meta {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 0.65rem;
}

.jx-ft-copy {
	border: 1px solid var(--ft-line);
	background: var(--ft-surface);
	color: var(--ft-muted);
	border-radius: 999px;
	padding: 0.3rem 0.75rem;
	font-size: 0.78rem;
	cursor: pointer;
	transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.jx-ft-copy:hover,
.jx-ft-copy.is-copied {
	color: var(--ft-accent);
	border-color: color-mix(in srgb, var(--ft-accent) 35%, var(--ft-line));
	background: var(--ft-accent-soft);
}

.jx-ft-panel-body {
	line-height: 1.65;
	color: var(--ft-ink);
	font-size: 0.98rem;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.jx-ft-panel-body > *:first-child {
	margin-top: 0;
}

.jx-ft-panel-body > *:last-child {
	margin-bottom: 0;
}

.jx-ft-panel-body mark.jx-ft-hl {
	background: color-mix(in srgb, var(--ft-accent) 22%, #fff);
	color: inherit;
	padding: 0 0.1em;
	border-radius: 0.15em;
}

.jx-ft-article-image img {
	max-width: 100%;
	height: auto;
	border-radius: 0.75rem;
}

.jx-ft-readmore a {
	color: var(--ft-accent);
	font-weight: 600;
	text-decoration: none;
}

.jx-ft-readmore a:hover {
	text-decoration: underline;
}

/* Theme variants */
.jx-ft-theme-minimal {
	--ft-panel: transparent;
}

.jx-ft-theme-minimal .jx-ft-panels {
	border: 0;
	border-radius: 0;
	box-shadow: none;
	padding-left: 0;
	padding-right: 0;
}

.jx-ft-theme-outline .jx-ft-nav {
	border-bottom: 0;
	gap: 0.5rem;
}

.jx-ft-theme-outline .jx-ft-tab {
	border: 1px solid var(--ft-line);
	border-radius: 0.65rem;
	margin-bottom: 0.75rem;
}

.jx-ft-theme-outline .jx-ft-tab.is-active {
	border-color: var(--ft-accent);
	border-bottom-color: var(--ft-accent);
	background: var(--ft-accent-soft);
}

.jx-ft-theme-outline .jx-ft-panels {
	border: 1px solid var(--ft-line);
	border-radius: 1rem;
}

.jx-ft-theme-dark {
	--ft-ink: #eef1f6;
	--ft-muted: #a7b0bd;
	--ft-line: #2c3340;
	--ft-surface: #151922;
	--ft-panel: #10141c;
}

.jx-ft-theme-rounded .jx-ft-panels {
	border-radius: 1.35rem;
}

.jx-ft-theme-rounded .jx-ft-tab {
	border-radius: 999px;
	margin-bottom: 0.65rem;
	border-bottom-width: 0;
}

.jx-ft-theme-rounded .jx-ft-tab.is-active {
	border-bottom-color: transparent;
	box-shadow: inset 0 0 0 2px var(--ft-accent);
}

.jx-ft-theme-gradient .jx-ft-tab.is-active {
	background: linear-gradient(135deg, var(--ft-accent-soft), transparent);
	border-image: linear-gradient(90deg, var(--ft-accent), color-mix(in srgb, var(--ft-accent) 40%, #fff)) 1;
}

.jx-ft-empty {
	padding: 1.25rem;
	color: var(--ft-muted);
	text-align: center;
}

/* Shared scroll-strip helpers (tablet + phone) */
.jx-ft-scroll-strip {
	flex-wrap: nowrap;
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
}

.jx-ft-scroll-strip::-webkit-scrollbar {
	display: none;
	height: 0;
	width: 0;
}

/* ── Tablet (landscape phones / small tablets) ── */
@media (max-width: 991px) {
	.jx-fadetabs {
		max-width: 100%;
	}

	.jx-ft-toolbar {
		gap: 0.65rem;
		margin-bottom: 0.85rem;
	}

	.jx-ft-search {
		flex: 1 1 100%;
		max-width: none;
	}

	.jx-ft-cats {
		flex: 1 1 100%;
		flex-wrap: nowrap;
		overflow-x: auto;
		overflow-y: hidden;
		gap: 0.35rem;
		padding-bottom: 0.15rem;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.jx-ft-cats::-webkit-scrollbar {
		display: none;
	}

	.jx-ft-cat {
		flex: 0 0 auto;
		min-height: 2.25rem;
		padding: 0.4rem 0.9rem;
		font-size: 0.82rem;
		scroll-snap-align: start;
	}

	.jx-ft-orient-vertical .jx-ft-shell {
		flex-direction: column;
		gap: 0;
	}

	.jx-ft-nav,
	.jx-ft-orient-vertical .jx-ft-nav {
		flex: none;
		flex-direction: row;
		flex-wrap: nowrap;
		width: 100%;
		max-width: 100%;
		overflow-x: auto;
		overflow-y: hidden;
		overscroll-behavior-x: contain;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
		border-right: 0;
		border-bottom: 1px solid var(--ft-line);
		padding: 0;
		gap: 0;
		mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
		-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 12px), transparent 100%);
	}

	.jx-ft-nav::-webkit-scrollbar,
	.jx-ft-orient-vertical .jx-ft-nav::-webkit-scrollbar {
		display: none;
		height: 0;
	}

	.jx-ft-tab,
	.jx-ft-orient-vertical .jx-ft-tab {
		flex: 0 0 auto;
		width: auto;
		min-height: 2.75rem;
		padding: 0.7rem 0.95rem;
		margin-bottom: -1px;
		margin-right: 0;
		white-space: nowrap;
		border-radius: 0.55rem 0.55rem 0 0;
		border-right: 0;
		border-bottom: 2px solid transparent;
		scroll-snap-align: start;
		font-size: 0.9rem;
		touch-action: manipulation;
	}

	.jx-ft-tab.is-active,
	.jx-ft-orient-vertical .jx-ft-tab.is-active {
		border-right-color: transparent;
		border-bottom-color: var(--ft-accent);
	}

	.jx-ft-panels,
	.jx-ft-orient-vertical .jx-ft-panels {
		border-top: 0;
		border-radius: 0 0 0.9rem 0.9rem;
		padding: 1.1rem 1.15rem 1.2rem;
	}

	.jx-ft-theme-outline .jx-ft-nav {
		gap: 0.4rem;
		padding: 0.2rem 0.35rem 0.55rem;
		mask-image: none;
		-webkit-mask-image: none;
		border-bottom: 0;
	}

	.jx-ft-theme-outline .jx-ft-tab {
		border: 1px solid var(--ft-line);
		border-radius: 999px;
		margin-bottom: 0;
		min-height: 2.5rem;
	}

	.jx-ft-theme-rounded .jx-ft-tab {
		border-radius: 999px;
		margin-bottom: 0.45rem;
	}
}

/* ── Phones ── */
@media (max-width: 575px) {
	.jx-ft-toolbar {
		margin-bottom: 0.75rem;
	}

	.jx-ft-search-input {
		font-size: 1rem; /* avoids iOS zoom on focus */
		min-height: 2.75rem;
		padding: 0.65rem 2.75rem 0.65rem 1rem;
	}

	.jx-ft-search-clear {
		min-width: 2.5rem;
		min-height: 2.5rem;
	}

	.jx-ft-tab,
	.jx-ft-orient-vertical .jx-ft-tab {
		min-height: 2.85rem;
		padding: 0.75rem 0.85rem;
		font-size: 0.88rem;
		gap: 0.35rem;
	}

	.jx-ft-badge {
		font-size: 0.62rem;
		padding: 0.12rem 0.38rem;
	}

	.jx-ft-panels,
	.jx-ft-orient-vertical .jx-ft-panels {
		padding: 0.95rem 0.9rem 1.05rem;
		border-radius: 0 0 0.75rem 0.75rem;
		box-shadow: 0 6px 18px rgba(16, 24, 40, 0.035);
	}

	.jx-ft-panel-body {
		font-size: 0.95rem;
		line-height: 1.6;
	}

	.jx-ft-panel-meta {
		margin-bottom: 0.5rem;
	}

	.jx-ft-copy {
		min-height: 2.25rem;
		padding: 0.4rem 0.85rem;
		font-size: 0.8rem;
	}

	.jx-ft-theme-minimal .jx-ft-panels {
		padding-left: 0;
		padding-right: 0;
	}
}

/* Touch: prefer active styles without sticky hover */
@media (hover: none) {
	.jx-ft-tab:hover {
		color: var(--ft-muted);
		background: transparent;
	}

	.jx-ft-tab.is-active:hover {
		color: var(--ft-accent);
		background: linear-gradient(180deg, var(--ft-accent-soft), transparent);
	}

	.jx-ft-cat:hover {
		border-color: var(--ft-line);
		color: var(--ft-muted);
	}

	.jx-ft-cat.is-active:hover {
		border-color: var(--ft-accent);
		color: #fff;
	}
}
