/* Poogler Translate switcher — scoped, self-contained, theme-agnostic. */

.pgtr-switcher {
	all: revert;
	position: fixed !important; /* Sole !important: themes must not unfix it. */
	z-index: var(--pgtr-z, 99990);
	display: flex;
	gap: 4px;
	padding: 4px;
	background: #ffffff;
	border: 1px solid #c3c4c7;
	border-radius: 9999px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	line-height: 1;
}

.pgtr-pos-br { right: calc(16px + var(--pgtr-x, 0px)); bottom: calc(16px + var(--pgtr-y, 0px) + env(safe-area-inset-bottom, 0px)); }
.pgtr-pos-bl { left: calc(16px + var(--pgtr-x, 0px)); bottom: calc(16px + var(--pgtr-y, 0px) + env(safe-area-inset-bottom, 0px)); }
.pgtr-pos-tr { right: calc(16px + var(--pgtr-x, 0px)); top: calc(16px + var(--pgtr-y, 0px)); }
.pgtr-pos-tl { left: calc(16px + var(--pgtr-x, 0px)); top: calc(16px + var(--pgtr-y, 0px)); }

.pgtr-switcher.pgtr-inline {
	position: static !important;
	display: inline-flex;
	box-shadow: none;
}

.pgtr-switcher .pgtr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 12px;
	border-radius: 9999px;
	border: 0;
	background: transparent;
	color: #1d2327; /* 14.7:1 on white. */
	text-decoration: none;
	font-weight: 600;
	letter-spacing: 0.02em;
	cursor: pointer;
	transition: background-color 120ms ease;
}

.pgtr-switcher .pgtr-btn:hover {
	background: #f0f0f1;
	color: #1d2327;
}

.pgtr-switcher .pgtr-btn.is-active {
	background: #1d2327;
	color: #ffffff; /* 14.7:1. */
}

.pgtr-switcher .pgtr-btn:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 2px;
}

@media (max-width: 480px) {
	.pgtr-switcher:not(.pgtr-inline) {
		gap: 0;
		padding: 2px;
	}
	/* Shrink to a pill: only the inactive (target) language shows. */
	.pgtr-switcher:not(.pgtr-inline) .pgtr-btn.is-active {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pgtr-switcher .pgtr-btn {
		transition: none;
	}
}
