/* Gortex Translations — language switcher
 *
 * The switcher lives inside the theme's navbar, so colour and typography are
 * inherited: that is what keeps it correct as Uncode flips the header between
 * its light and dark states. A native <select> could not do that, which is why
 * it used to render as a white system box in a transparent header.
 *
 * Why !important here, sparingly:
 * Uncode styles EVERY anchor inside a menu, with selectors as specific as
 *   .menu-mobile-centered .main-menu-container .menu-horizontal
 *   .menu-horizontal-inner ul.menu-smart li.menu-item:not(.social-icon) > a
 * (specificity 103). Competing on specificity would mean copying that chain
 * and re-breaking whenever the theme changes it. Only the handful of
 * properties the theme actually sets on menu anchors are forced — display,
 * padding, line-height, colour — and nothing else.
 *
 * Panel styling mirrors the theme's own dropdowns: white, square corners,
 * links in #303133 at weight 600. The shadow is Uncode's own `darker-xs`
 * value; the site's configured `darker-lg` (0 70px 140px) is scaled for a
 * full-bleed mega menu and is invisible behind a 200px panel.
 */

/* ------------------------------------------------------------- container */

.menu-item-gortex-lang {
	position: relative;
}

/* ---------------------------------------------------------------- trigger */

.menu-item-gortex-lang > .gortex-lang-current {
	display: inline-flex !important;
	align-items: center;
	color: inherit;
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
	opacity: 0.85;
	transition: opacity 0.2s ease;
}

.menu-item-gortex-lang > .gortex-lang-current:hover,
.menu-item-gortex-lang.is-open > .gortex-lang-current {
	opacity: 1;
	color: inherit;
}

/* Spacing is a margin, not a flex `gap`: the theme can force these anchors
   back to display:block, and a margin keeps the flag off the text either way. */
.menu-item-gortex-lang .gortex-lang-flag {
	margin-right: 0.5em;
	font-size: 1.05em;
	line-height: 1;
}

.menu-item-gortex-lang .gortex-lang-caret {
	width: 0;
	height: 0;
	margin-left: 0.5em;
	border-left: 0.3em solid transparent;
	border-right: 0.3em solid transparent;
	border-top: 0.3em solid currentColor;
	opacity: 0.7;
	transition: transform 0.2s ease;
}

.menu-item-gortex-lang.is-open .gortex-lang-caret {
	transform: rotate(180deg);
}

/* ------------------------------------------------------------------ panel */

.menu-item-gortex-lang .gortex-lang-panel {
	position: absolute;
	top: 100%;
	right: 0;
	z-index: 9999;
	display: block;
	min-width: 12.5em;
	padding: 9px 0;
	background: #fff;
	border-radius: 0;
	box-shadow: 0 10px 20px rgba(0, 0, 0, 0.25);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-6px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.menu-item-gortex-lang.is-open .gortex-lang-panel {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.menu-item-gortex-lang .gortex-lang-panel > .gortex-lang-option {
	display: flex !important;
	align-items: center;
	padding: 7px 24px !important;
	/* The panel supplies its own light background, so it opts out of the
	   inherited navbar colour on purpose. */
	color: #303133 !important;
	font-size: 15px !important;
	font-weight: 600 !important;
	line-height: 1.5 !important;
	text-align: left;
	text-decoration: none;
	text-transform: none !important;
	white-space: nowrap;
	background: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.menu-item-gortex-lang .gortex-lang-panel > .gortex-lang-option:hover,
.menu-item-gortex-lang .gortex-lang-panel > .gortex-lang-option:focus {
	background: rgba(0, 0, 0, 0.04);
	color: #000 !important;
}

.menu-item-gortex-lang .gortex-lang-panel > .gortex-lang-option.is-active {
	color: #000 !important;
}

/* ------------------------------------------------------ in the icon bar */

.menu-item-gortex-lang.is-in-iconbar > .gortex-lang-current {
	padding: 0 0 0 0.9em !important;
	line-height: 1 !important;
}

/* ---------------------------------------------------------- mobile menu */

@media (max-width: 959px) {
	.menu-item-gortex-lang .gortex-lang-panel {
		position: static;
		min-width: 0;
		margin: 0.25em 0 0;
		padding: 0;
		background: none;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		display: none;
	}

	.menu-item-gortex-lang.is-open .gortex-lang-panel {
		display: block;
	}

	.menu-item-gortex-lang .gortex-lang-panel > .gortex-lang-option {
		padding: 0.45em 0 0.45em 1.6em !important;
		color: inherit !important;
		font-size: inherit !important;
	}

	.menu-item-gortex-lang .gortex-lang-panel > .gortex-lang-option:hover,
	.menu-item-gortex-lang .gortex-lang-panel > .gortex-lang-option:focus {
		background: none;
		color: inherit !important;
		opacity: 0.75;
	}
}

/* ------------------------------------------- shortcode / widget contexts */

.gortex-lang-switcher--flags .gortex-lang-flags,
.gortex-lang-switcher--list .gortex-lang-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em;
	margin: 0;
	padding: 0;
	list-style: none;
}

.gortex-lang-switcher .gortex-lang-link {
	display: inline-flex;
	align-items: center;
	color: inherit;
	text-decoration: none;
	opacity: 0.75;
	transition: opacity 0.2s ease;
}

.gortex-lang-switcher .gortex-lang-link:hover,
.gortex-lang-switcher .gortex-lang-link.is-active {
	opacity: 1;
}

.gortex-lang-switcher .gortex-lang-link.is-active {
	font-weight: 600;
}
