/* Tonguestrike front-end switcher */

.tonguestrike-switcher {
	--lng-fg: #1f2937;
	--lng-bg: #ffffff;
	--lng-border: #e5e7eb;
	--lng-hover: #f3f4f6;
	font-size: 14px;
	line-height: 1.2;
}

.tonguestrike-switcher * { box-sizing: border-box; }

/* Flags row */
.tonguestrike-switcher--flags {
	list-style: none;
	display: inline-flex;
	gap: 6px;
	margin: 0;
	padding: 0;
}
.tonguestrike-switcher--flags .tonguestrike-item a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 30px;
	border-radius: 8px;
	text-decoration: none;
	border: 1px solid transparent;
	transition: background 0.12s, border-color 0.12s;
	font-size: 18px;
}
.tonguestrike-switcher--flags .tonguestrike-item a:hover { background: var(--lng-hover); }
.tonguestrike-switcher--flags .tonguestrike-item.is-active a {
	border-color: var(--lng-border);
	background: var(--lng-hover);
}

/* Dropdown */
.tonguestrike-switcher--dropdown { position: relative; display: inline-block; }

.tonguestrike-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--lng-bg);
	color: var(--lng-fg);
	border: 1px solid var(--lng-border);
	border-radius: 10px;
	padding: 7px 12px;
	cursor: pointer;
	font: inherit;
	line-height: 1.2;
	transition: border-color 0.12s, box-shadow 0.12s;
}
.tonguestrike-toggle:hover { border-color: #c7cbd1; }
.tonguestrike-flag { font-size: 16px; }
.tonguestrike-caret { font-size: 11px; opacity: 0.6; transition: transform 0.15s; }
.tonguestrike-switcher--dropdown.is-open .tonguestrike-caret { transform: rotate(180deg); }

.tonguestrike-menu {
	list-style: none;
	margin: 6px 0 0;
	padding: 6px;
	position: absolute;
	right: 0;
	min-width: 180px;
	background: var(--lng-bg);
	border: 1px solid var(--lng-border);
	border-radius: 12px;
	box-shadow: 0 10px 30px rgba(16, 24, 40, 0.12);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity 0.14s ease, transform 0.14s ease, visibility 0.14s;
	z-index: 9999;
}
.tonguestrike-switcher--dropdown.is-open .tonguestrike-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.tonguestrike-menu li { margin: 0; }
.tonguestrike-menu a {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 8px 10px;
	border-radius: 8px;
	text-decoration: none;
	color: var(--lng-fg);
	transition: background 0.1s;
}
.tonguestrike-menu a:hover { background: var(--lng-hover); }
.tonguestrike-label { font-weight: 500; }

/* Floating variant — anchor (top/bottom/left/right) is set inline from settings */
.tonguestrike-floating {
	position: fixed;
	z-index: 99990;
}
.tonguestrike-floating .tonguestrike-toggle {
	box-shadow: 0 6px 20px rgba(16, 24, 40, 0.16);
}
/* Default: open the menu upwards (good for bottom positions) */
.tonguestrike-floating .tonguestrike-menu { bottom: calc(100% + 6px); top: auto; }

/* When anchored to the top, open the menu downwards instead */
.tonguestrike-floating--top-left .tonguestrike-menu,
.tonguestrike-floating--top-center .tonguestrike-menu,
.tonguestrike-floating--top-right .tonguestrike-menu {
	top: calc(100% + 6px);
	bottom: auto;
}

/* Open upwards for floating: flip transform origin */
.tonguestrike-floating .tonguestrike-switcher--dropdown.is-open .tonguestrike-menu {
	transform: translateY(0);
}
