/* INI Translator — language switcher.
 * Layout comes from CSS only: the markup is the same for every visitor. */

.initr-switcher {
	--initr-sw-bg: #ffffff;
	--initr-sw-bg-hover: #f0f0f1;
	--initr-sw-text: #1d2327;
	--initr-sw-text-hover: #1d2327;
	--initr-sw-border: #c3c4c7;
	--initr-sw-border-width: 1px;
	--initr-sw-radius: 6px;
	--initr-sw-gap: 0.4em;
	--initr-sw-pad: 0.35em 0.7em;
	--initr-sw-focus: #2271b1;
	position: relative;
	display: inline-block;
	font-size: 14px;
	line-height: 1.4;
	color: var(--initr-sw-text);
	text-align: start;
}

.initr-switcher.initr-preset-dark {
	--initr-sw-bg: #1d2327;
	--initr-sw-bg-hover: #2c3338;
	--initr-sw-text: #f0f0f1;
	--initr-sw-text-hover: #ffffff;
	--initr-sw-border: #1d2327;
	--initr-sw-focus: #72aee6;
}

.initr-switcher.initr-preset-border {
	--initr-sw-bg: transparent;
	--initr-sw-bg-hover: rgba(0, 0, 0, 0.05);
	--initr-sw-text: inherit;
	--initr-sw-text-hover: inherit;
	--initr-sw-border: currentColor;
}

.initr-switcher.initr-preset-transparent {
	--initr-sw-bg: transparent;
	--initr-sw-bg-hover: transparent;
	--initr-sw-text: inherit;
	--initr-sw-text-hover: inherit;
	--initr-sw-border: transparent;
	--initr-sw-border-width: 0px;
}

.initr-switcher.initr-size-large {
	font-size: 16px;
	--initr-sw-pad: 0.5em 0.9em;
}

.initr-switcher .initr-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.initr-switcher ul.initr-switcher__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.initr-switcher .initr-switcher__toggle,
.initr-switcher .initr-switcher__link {
	display: flex;
	align-items: center;
	gap: var(--initr-sw-gap);
	padding: var(--initr-sw-pad);
	margin: 0;
	font: inherit;
	color: var(--initr-sw-text);
	text-decoration: none;
	background: var(--initr-sw-bg);
	border: 0;
	border-radius: 0;
	cursor: pointer;
	white-space: nowrap;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
}

.initr-switcher .initr-switcher__toggle {
	width: 100%;
	border: var(--initr-sw-border-width) solid var(--initr-sw-border);
	border-radius: var(--initr-sw-radius);
}

.initr-switcher .initr-switcher__toggle:hover,
.initr-switcher .initr-switcher__link:hover,
.initr-switcher .initr-switcher__link:focus {
	background: var(--initr-sw-bg-hover);
	color: var(--initr-sw-text-hover);
}

.initr-switcher .initr-switcher__toggle:focus-visible,
.initr-switcher .initr-switcher__link:focus-visible {
	outline: 2px solid var(--initr-sw-focus);
	outline-offset: 1px;
}

.initr-switcher .initr-switcher__caret {
	width: 0.45em;
	height: 0.45em;
	margin-inline-start: auto;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-25%) rotate(45deg);
	transition: transform 0.15s ease;
}

.initr-switcher .initr-flag {
	display: block;
	flex: none;
	width: 20px;
	height: 15px;
	object-fit: cover;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
	margin: 0;
}

.initr-switcher .initr-flag--square,
.initr-switcher .initr-flag--round {
	width: 16px;
	height: 16px;
}

.initr-switcher .initr-flag--round {
	border-radius: 50%;
}

.initr-switcher.initr-size-large .initr-flag {
	width: 24px;
	height: 18px;
}

.initr-switcher.initr-size-large .initr-flag--square,
.initr-switcher.initr-size-large .initr-flag--round {
	width: 20px;
	height: 20px;
}

.initr-switcher .initr-switcher__draft {
	font-size: 0.75em;
	padding: 0 0.35em;
	border-radius: 3px;
	background: #f0c33c;
	color: #1d2327;
}

/* Dropdown */
.initr-switcher--dropdown .initr-switcher__list {
	position: absolute;
	inset-inline-start: 0;
	top: 100%;
	z-index: 99999;
	min-width: 100%;
	background: var(--initr-sw-bg);
	border: var(--initr-sw-border-width) solid var(--initr-sw-border);
	border-radius: var(--initr-sw-radius);
	overflow: hidden;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
	visibility: hidden;
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.15s;
}

.initr-switcher--dropdown.is-open .initr-switcher__list,
.initr-switcher--dropdown.initr-open-hover:not(.is-closed):hover .initr-switcher__list,
.initr-switcher--dropdown:not(.initr-js):focus-within .initr-switcher__list {
	visibility: visible;
	opacity: 1;
	transform: none;
	transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s;
}

.initr-switcher--dropdown.is-open .initr-switcher__caret {
	transform: translateY(15%) rotate(225deg);
}

.initr-switcher--dropdown .initr-switcher__item.is-current .initr-switcher__link {
	font-weight: 600;
}

/* Side by side */
.initr-switcher--inline .initr-switcher__list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25em;
}

.initr-switcher--inline .initr-switcher__link,
.initr-switcher--opposite .initr-switcher__link {
	border: var(--initr-sw-border-width) solid var(--initr-sw-border);
	border-radius: var(--initr-sw-radius);
}

.initr-switcher--inline .is-current .initr-switcher__link {
	font-weight: 600;
	background: var(--initr-sw-bg-hover);
}

/* Floating */
.initr-switcher.initr-floating {
	position: fixed;
	z-index: 99998;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
	border-radius: var(--initr-sw-radius);
}

.initr-floating.initr-pos-bottom-right { right: 16px; bottom: 16px; }
.initr-floating.initr-pos-bottom-left { left: 16px; bottom: 16px; }
.initr-floating.initr-pos-top-right { right: 16px; top: calc(16px + var(--wp-admin--admin-bar--height, 0px)); }
.initr-floating.initr-pos-top-left { left: 16px; top: calc(16px + var(--wp-admin--admin-bar--height, 0px)); }

.initr-floating.initr-pos-bottom-right .initr-switcher__list,
.initr-floating.initr-pos-bottom-left .initr-switcher__list {
	top: auto;
	bottom: 100%;
	transform: translateY(4px);
}

.initr-floating.initr-pos-bottom-right.is-open .initr-switcher__list,
.initr-floating.initr-pos-bottom-left.is-open .initr-switcher__list {
	transform: none;
}

.initr-floating.initr-pos-bottom-right .initr-switcher__caret,
.initr-floating.initr-pos-bottom-left .initr-switcher__caret {
	transform: translateY(15%) rotate(225deg);
}

.initr-floating.initr-pos-bottom-right.is-open .initr-switcher__caret,
.initr-floating.initr-pos-bottom-left.is-open .initr-switcher__caret {
	transform: translateY(-25%) rotate(45deg);
}

/* Narrow screens: a smaller floating switcher, closer to the edge. */
@media (max-width: 600px) {
	.initr-switcher.initr-floating {
		font-size: 13px;
	}
	.initr-floating.initr-pos-bottom-right { right: 8px; bottom: 8px; }
	.initr-floating.initr-pos-bottom-left { left: 8px; bottom: 8px; }
	.initr-floating.initr-pos-top-right { right: 8px; }
	.initr-floating.initr-pos-top-left { left: 8px; }
}

/* Menus: the theme styles the links. */
.initr-menu-item > a {
	display: inline-flex;
	align-items: center;
	gap: 0.4em;
}

.initr-menu-item .initr-flag {
	display: inline-block;
	width: 20px;
	height: 15px;
	object-fit: cover;
	vertical-align: middle;
}

.initr-menu-item .initr-flag--square,
.initr-menu-item .initr-flag--round {
	width: 16px;
	height: 16px;
}

.initr-menu-item .initr-flag--round {
	border-radius: 50%;
}

/* Inside a Navigation block */
.wp-block-navigation .initr-switcher {
	font-size: inherit;
}

.initr-switcher.initr-no-anim *,
.initr-switcher.initr-no-anim .initr-switcher__list {
	transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.initr-switcher *,
	.initr-switcher .initr-switcher__list {
		transition: none !important;
	}
}
