/**
 * Well Web Multilang Switcher Styles
 */

/* Base Switcher Styles */
.wwml-switcher {
	position: relative;
	display: inline-block;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.4;
}

.wwml-flag {
	display: inline-block;
	vertical-align: middle;
	width: 20px;
	height: 15px;
	margin-right: 6px;
	border-radius: 2px;
	object-fit: cover;
}

.wwml-lang-name,
.wwml-lang-code {
	vertical-align: middle;
}

/* Dropdown Style */
.wwml-switcher-dropdown {
	min-width: 140px;
}

.wwml-dropdown-toggle {
	display: flex;
	align-items: center;
	width: 100%;
	padding: 8px 12px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	cursor: pointer;
	font-size: inherit;
	text-align: left;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.wwml-dropdown-toggle:hover {
	border-color: #999;
}

.wwml-dropdown-toggle:focus {
	outline: none;
	border-color: #0073aa;
	box-shadow: 0 0 0 1px #0073aa;
}

.wwml-dropdown-arrow {
	margin-left: auto;
	border: 5px solid transparent;
	border-top-color: #666;
	transition: transform 0.2s;
}

.wwml-switcher-dropdown.wwml-open .wwml-dropdown-arrow {
	transform: rotate(180deg);
}

.wwml-dropdown-menu {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 1000;
	margin: 4px 0 0;
	padding: 4px 0;
	list-style: none;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-10px);
	transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.wwml-switcher-dropdown.wwml-open .wwml-dropdown-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.wwml-dropdown-item {
	margin: 0;
}

.wwml-dropdown-link {
	display: flex;
	align-items: center;
	padding: 8px 12px;
	color: #333;
	text-decoration: none;
	transition: background-color 0.2s;
}

.wwml-dropdown-link:hover {
	background-color: #f5f5f5;
	color: #333;
	text-decoration: none;
}

.wwml-dropdown-item.wwml-current .wwml-dropdown-link {
	background-color: #f0f7ff;
	font-weight: 600;
}

/* Flags Style */
.wwml-switcher-flags {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.wwml-flag-item {
	display: inline-flex;
	align-items: center;
	padding: 6px 10px;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	color: #333;
	text-decoration: none;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.wwml-flag-item:hover {
	border-color: #999;
	text-decoration: none;
	color: #333;
}

.wwml-flag-item.wwml-current {
	border-color: #0073aa;
	background-color: #f0f7ff;
}

.wwml-flag-fallback {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 15px;
	margin-right: 6px;
	background: #eee;
	border-radius: 2px;
	font-size: 10px;
	font-weight: 600;
}

.wwml-flag-label {
	font-size: 13px;
}

/* Text Links Style */
.wwml-switcher-text {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
}

.wwml-text-item {
	color: inherit; /* Was #333, which vanished on dark headers. */
	text-decoration: none;
	padding: 4px 8px;
	transition: color 0.2s;
}

.wwml-text-item:hover {
	color: #0073aa;
	text-decoration: underline;
}

.wwml-text-item.wwml-current {
	font-weight: 600;
	color: var(--wwml-accent);
}

.wwml-separator {
	color: #999;
}

/* Language Codes Style — plain "UK | RU". Inherits the surrounding text colour so
   it matches the header or menu it is placed in. */
.wwml-switcher-codes {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	color: inherit;
}

.wwml-code-item {
	color: inherit;
	text-decoration: none;
	padding: 2px 4px;
}

a.wwml-code-item:hover,
a.wwml-code-item:focus-visible {
	text-decoration: underline;
}

.wwml-code-item.wwml-current {
	font-weight: 600;
}

.wwml-switcher-codes .wwml-separator {
	color: inherit;
	opacity: 0.6;
	padding: 0 2px;
}

/* Inline Buttons Style — only the inline layout. Up to 2.1.0 these rules
   matched every .wwml-switcher-text, so "Text links" rendered as buttons too. */
.wwml-switcher-inline .wwml-text-item {
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	margin: 2px;
}

.wwml-switcher-inline .wwml-text-item:hover {
	border-color: #999;
	text-decoration: none;
}

.wwml-switcher-inline .wwml-text-item.wwml-current {
	background: #0073aa;
	border-color: #0073aa;
	color: #fff;
}

/* Floating Style */
.wwml-switcher-floating {
	position: fixed;
	z-index: 9999;
}

.wwml-position-top-left {
	top: 20px;
	left: 20px;
}

.wwml-position-top-right {
	top: 20px;
	right: 20px;
}

.wwml-position-bottom-left {
	bottom: 20px;
	left: 20px;
}

.wwml-position-bottom-right {
	bottom: 20px;
	right: 20px;
}

.wwml-floating-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	background: #fff;
	border: none;
	border-radius: 50%;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	transition: transform 0.2s, box-shadow 0.2s;
}

.wwml-floating-toggle:hover {
	transform: scale(1.05);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.wwml-floating-toggle:focus {
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.3), 0 2px 12px rgba(0, 0, 0, 0.15);
}

.wwml-floating-toggle .wwml-flag {
	margin-right: 0;
	width: 24px;
	height: 18px;
}

.wwml-globe-icon {
	color: #333;
}

.wwml-floating-menu {
	position: absolute;
	bottom: 100%;
	right: 0;
	margin-bottom: 8px;
	min-width: 180px;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
}

.wwml-position-top-left .wwml-floating-menu,
.wwml-position-top-right .wwml-floating-menu {
	bottom: auto;
	top: 100%;
	margin-bottom: 0;
	margin-top: 8px;
	transform: translateY(-10px);
}

.wwml-position-top-left .wwml-floating-menu,
.wwml-position-bottom-left .wwml-floating-menu {
	right: auto;
	left: 0;
}

.wwml-switcher-floating.wwml-open .wwml-floating-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.wwml-floating-item {
	display: flex;
	align-items: center;
	padding: 12px 16px;
	color: #333;
	text-decoration: none;
	border-bottom: 1px solid #eee;
	transition: background-color 0.2s;
}

.wwml-floating-item:first-child {
	border-radius: 8px 8px 0 0;
}

.wwml-floating-item:last-child {
	border-bottom: none;
	border-radius: 0 0 8px 8px;
}

.wwml-floating-item:only-child {
	border-radius: 8px;
}

.wwml-floating-item:hover {
	background-color: #f5f5f5;
	text-decoration: none;
	color: #333;
}

.wwml-floating-item.wwml-current {
	background-color: #f0f7ff;
}

.wwml-floating-label {
	flex: 1;
}

.wwml-check-icon {
	color: #0073aa;
	margin-left: 8px;
}

/* Mobile Only */
.wwml-mobile-only {
	display: none;
}

@media (max-width: 768px) {
	.wwml-mobile-only {
		display: block;
	}
}

/* RTL Support */
[dir="rtl"] .wwml-flag {
	margin-right: 0;
	margin-left: 6px;
}

[dir="rtl"] .wwml-dropdown-arrow {
	margin-left: 0;
	margin-right: auto;
}

[dir="rtl"] .wwml-floating-menu {
	right: auto;
	left: 0;
}

[dir="rtl"] .wwml-position-top-left .wwml-floating-menu,
[dir="rtl"] .wwml-position-bottom-left .wwml-floating-menu {
	left: auto;
	right: 0;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
	.wwml-dropdown-menu,
	.wwml-floating-menu,
	.wwml-dropdown-arrow,
	.wwml-floating-toggle,
	.wwml-dropdown-toggle,
	.wwml-dropdown-link,
	.wwml-flag-item,
	.wwml-text-item,
	.wwml-floating-item {
		transition: none;
	}
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
	.wwml-dropdown-toggle,
	.wwml-dropdown-menu,
	.wwml-flag-item,
	.wwml-floating-toggle,
	.wwml-floating-menu {
		background: #2d2d2d;
		border-color: #444;
		color: #eee;
	}

	.wwml-dropdown-link,
	.wwml-floating-item {
		color: #eee;
	}

	.wwml-dropdown-link:hover,
	.wwml-floating-item:hover {
		background-color: #3d3d3d;
		color: #fff;
	}

	.wwml-dropdown-item.wwml-current .wwml-dropdown-link,
	.wwml-floating-item.wwml-current {
		background-color: #1e3a5f;
	}

	.wwml-flag-item.wwml-current {
		background-color: #1e3a5f;
		border-color: #0073aa;
	}

	.wwml-text-item {
		color: #eee;
	}

	.wwml-text-item.wwml-current {
		color: #5cb3ff;
	}

	.wwml-separator {
		color: #666;
	}

	.wwml-globe-icon {
		color: #eee;
	}
}

/* =========================================================================
   Design templates (2.1.1)

   Block styles on the Language Switcher block (is-style-<slug> on the block
   wrapper) and design="<slug>" on [wwml_switch] (wwml-design-<slug>). Any design
   works with any layout. Colours come from the theme's own palette when it has
   one (theme.json presets), otherwise from the surrounding text colour.
   ========================================================================= */
.wwml-switcher {
	--wwml-accent: var(--wp--preset--color--primary, var(--wp--preset--color--contrast, currentColor));
	--wwml-on-accent: var(--wp--preset--color--base, #fff);
	--wwml-surface: var(--wp--preset--color--base, #fff);
	--wwml-surface-fg: var(--wp--preset--color--contrast, #1e1e1e);
	--wwml-line: color-mix(in srgb, currentColor 28%, transparent);
}

/* Shared by every non-default design: inherit the theme's type and colour. */
:is(.is-style-minimal, .is-style-pill, .is-style-segmented, .is-style-underline, .is-style-outline) > .wwml-switcher,
.wwml-switcher:is(.wwml-design-minimal, .wwml-design-pill, .wwml-design-segmented, .wwml-design-underline, .wwml-design-outline) {
	font-size: inherit;
	color: inherit;
}

:is(.is-style-minimal, .is-style-pill, .is-style-segmented, .is-style-underline, .is-style-outline) > .wwml-switcher :is(.wwml-text-item, .wwml-code-item, .wwml-flag-item),
.wwml-switcher:is(.wwml-design-minimal, .wwml-design-pill, .wwml-design-segmented, .wwml-design-underline, .wwml-design-outline) :is(.wwml-text-item, .wwml-code-item, .wwml-flag-item) {
	color: inherit;
	background: transparent;
	box-shadow: none;
	margin: 0;
	text-decoration: none;
	transition: background-color 0.15s, border-color 0.15s, color 0.15s;
}

:is(.is-style-minimal, .is-style-pill, .is-style-segmented, .is-style-underline, .is-style-outline) > .wwml-switcher .wwml-dropdown-toggle,
.wwml-switcher:is(.wwml-design-minimal, .wwml-design-pill, .wwml-design-segmented, .wwml-design-underline, .wwml-design-outline) .wwml-dropdown-toggle {
	color: inherit;
	background: transparent;
	box-shadow: none;
}

:is(.is-style-minimal, .is-style-pill, .is-style-segmented, .is-style-underline, .is-style-outline) > .wwml-switcher .wwml-dropdown-arrow,
.wwml-switcher:is(.wwml-design-minimal, .wwml-design-pill, .wwml-design-segmented, .wwml-design-underline, .wwml-design-outline) .wwml-dropdown-arrow {
	border-top-color: currentColor;
}

:is(.is-style-minimal, .is-style-pill, .is-style-segmented, .is-style-underline, .is-style-outline) > .wwml-switcher .wwml-dropdown-menu,
.wwml-switcher:is(.wwml-design-minimal, .wwml-design-pill, .wwml-design-segmented, .wwml-design-underline, .wwml-design-outline) .wwml-dropdown-menu {
	background: var(--wwml-surface);
	color: var(--wwml-surface-fg);
	border-color: var(--wwml-line);
}

:is(.is-style-minimal, .is-style-pill, .is-style-segmented, .is-style-underline, .is-style-outline) > .wwml-switcher .wwml-dropdown-link,
.wwml-switcher:is(.wwml-design-minimal, .wwml-design-pill, .wwml-design-segmented, .wwml-design-underline, .wwml-design-outline) .wwml-dropdown-link {
	color: inherit;
}

:is(.is-style-minimal, .is-style-pill, .is-style-segmented, .is-style-underline, .is-style-outline) > .wwml-switcher .wwml-dropdown-link:hover,
.wwml-switcher:is(.wwml-design-minimal, .wwml-design-pill, .wwml-design-segmented, .wwml-design-underline, .wwml-design-outline) .wwml-dropdown-link:hover {
	background: color-mix(in srgb, currentColor 8%, transparent);
	color: inherit;
}

:is(.is-style-minimal, .is-style-pill, .is-style-segmented, .is-style-underline, .is-style-outline) > .wwml-switcher .wwml-dropdown-item.wwml-current .wwml-dropdown-link,
.wwml-switcher:is(.wwml-design-minimal, .wwml-design-pill, .wwml-design-segmented, .wwml-design-underline, .wwml-design-outline) .wwml-dropdown-item.wwml-current .wwml-dropdown-link {
	background: color-mix(in srgb, currentColor 6%, transparent);
}

:is(.is-style-minimal, .is-style-pill, .is-style-segmented, .is-style-underline, .is-style-outline) > .wwml-switcher :is(.wwml-dropdown-toggle, .wwml-text-item, .wwml-code-item, .wwml-flag-item):focus-visible,
.wwml-switcher:is(.wwml-design-minimal, .wwml-design-pill, .wwml-design-segmented, .wwml-design-underline, .wwml-design-outline) :is(.wwml-dropdown-toggle, .wwml-text-item, .wwml-code-item, .wwml-flag-item):focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	box-shadow: none;
}

/* --- Minimal: plain text, current language bold. ----------------------- */
:is(.is-style-minimal > .wwml-switcher, .wwml-switcher.wwml-design-minimal) :is(.wwml-text-item, .wwml-code-item, .wwml-flag-item) {
	border: 0;
	border-radius: 0;
	padding: 2px 6px;
}
:is(.is-style-minimal > .wwml-switcher, .wwml-switcher.wwml-design-minimal) :is(.wwml-text-item, .wwml-code-item, .wwml-flag-item):hover {
	text-decoration: underline;
	text-underline-offset: 3px;
}
:is(.is-style-minimal > .wwml-switcher, .wwml-switcher.wwml-design-minimal) :is(.wwml-text-item, .wwml-code-item, .wwml-flag-item).wwml-current {
	font-weight: 600;
}
:is(.is-style-minimal > .wwml-switcher, .wwml-switcher.wwml-design-minimal) .wwml-dropdown-toggle {
	border: 0;
	padding: 4px 2px;
}
:is(.is-style-minimal > .wwml-switcher, .wwml-switcher.wwml-design-minimal) .wwml-dropdown-menu {
	border: 0;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* --- Pill: rounded chips, current one filled. -------------------------- */
:is(.is-style-pill > .wwml-switcher, .wwml-switcher.wwml-design-pill):is(.wwml-switcher-text, .wwml-switcher-codes, .wwml-switcher-flags) {
	display: inline-flex;
	flex-wrap: nowrap; /* A header row would otherwise squeeze it onto two lines. */
	gap: 6px;
}
:is(.is-style-pill > .wwml-switcher, .wwml-switcher.wwml-design-pill) .wwml-separator {
	display: none;
}
:is(.is-style-pill > .wwml-switcher, .wwml-switcher.wwml-design-pill) :is(.wwml-text-item, .wwml-code-item, .wwml-flag-item) {
	border: 1px solid var(--wwml-line);
	border-radius: 999px;
	padding: 5px 14px;
}
:is(.is-style-pill > .wwml-switcher, .wwml-switcher.wwml-design-pill) :is(.wwml-text-item, .wwml-code-item, .wwml-flag-item):hover {
	border-color: currentColor;
}
:is(.is-style-pill > .wwml-switcher, .wwml-switcher.wwml-design-pill) :is(.wwml-text-item, .wwml-code-item, .wwml-flag-item).wwml-current {
	background: var(--wwml-accent);
	border-color: var(--wwml-accent);
	color: var(--wwml-on-accent);
}
:is(.is-style-pill > .wwml-switcher, .wwml-switcher.wwml-design-pill) .wwml-dropdown-toggle {
	border: 1px solid var(--wwml-line);
	border-radius: 999px;
	padding: 6px 14px;
}
:is(.is-style-pill > .wwml-switcher, .wwml-switcher.wwml-design-pill) .wwml-dropdown-menu {
	border-radius: 12px;
	padding: 6px;
}
:is(.is-style-pill > .wwml-switcher, .wwml-switcher.wwml-design-pill) .wwml-dropdown-link {
	border-radius: 999px;
}

/* --- Segmented: one joined control, current segment filled. ------------ */
:is(.is-style-segmented > .wwml-switcher, .wwml-switcher.wwml-design-segmented):is(.wwml-switcher-text, .wwml-switcher-codes, .wwml-switcher-flags) {
	display: inline-flex;
	gap: 0;
	flex-wrap: nowrap;
	border: 1px solid var(--wwml-line);
	border-radius: 6px;
	overflow: hidden;
}
:is(.is-style-segmented > .wwml-switcher, .wwml-switcher.wwml-design-segmented) .wwml-separator {
	display: none;
}
:is(.is-style-segmented > .wwml-switcher, .wwml-switcher.wwml-design-segmented) :is(.wwml-text-item, .wwml-code-item, .wwml-flag-item) {
	border: 0;
	border-radius: 0;
	padding: 6px 14px;
}
:is(.is-style-segmented > .wwml-switcher, .wwml-switcher.wwml-design-segmented) :is(.wwml-text-item, .wwml-code-item, .wwml-flag-item):not(:first-child) {
	border-left: 1px solid var(--wwml-line);
}
:is(.is-style-segmented > .wwml-switcher, .wwml-switcher.wwml-design-segmented) :is(.wwml-text-item, .wwml-code-item, .wwml-flag-item):hover {
	background: color-mix(in srgb, currentColor 8%, transparent);
}
:is(.is-style-segmented > .wwml-switcher, .wwml-switcher.wwml-design-segmented) :is(.wwml-text-item, .wwml-code-item, .wwml-flag-item).wwml-current {
	background: var(--wwml-accent);
	color: var(--wwml-on-accent);
}
:is(.is-style-segmented > .wwml-switcher, .wwml-switcher.wwml-design-segmented) .wwml-dropdown-toggle {
	border: 1px solid var(--wwml-line);
	border-radius: 6px;
}

/* --- Underline: tab-style, a bar under the current language. ----------- */
:is(.is-style-underline > .wwml-switcher, .wwml-switcher.wwml-design-underline):is(.wwml-switcher-text, .wwml-switcher-codes, .wwml-switcher-flags) {
	display: inline-flex;
	gap: 16px;
	flex-wrap: nowrap;
}
:is(.is-style-underline > .wwml-switcher, .wwml-switcher.wwml-design-underline) .wwml-separator {
	display: none;
}
:is(.is-style-underline > .wwml-switcher, .wwml-switcher.wwml-design-underline) :is(.wwml-text-item, .wwml-code-item, .wwml-flag-item) {
	border: 0;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	padding: 4px 1px;
}
:is(.is-style-underline > .wwml-switcher, .wwml-switcher.wwml-design-underline) :is(.wwml-text-item, .wwml-code-item, .wwml-flag-item):hover {
	border-bottom-color: var(--wwml-line);
}
:is(.is-style-underline > .wwml-switcher, .wwml-switcher.wwml-design-underline) :is(.wwml-text-item, .wwml-code-item, .wwml-flag-item).wwml-current {
	border-bottom-color: var(--wwml-accent);
	font-weight: 600;
}
:is(.is-style-underline > .wwml-switcher, .wwml-switcher.wwml-design-underline) .wwml-dropdown-toggle {
	border: 0;
	border-bottom: 2px solid var(--wwml-accent);
	border-radius: 0;
	padding: 4px 1px;
}

/* --- Outline: square boxes in the text colour. ------------------------- */
:is(.is-style-outline > .wwml-switcher, .wwml-switcher.wwml-design-outline):is(.wwml-switcher-text, .wwml-switcher-codes, .wwml-switcher-flags) {
	display: inline-flex;
	flex-wrap: nowrap; /* A header row would otherwise squeeze it onto two lines. */
	gap: 6px;
}
:is(.is-style-outline > .wwml-switcher, .wwml-switcher.wwml-design-outline) .wwml-separator {
	display: none;
}
:is(.is-style-outline > .wwml-switcher, .wwml-switcher.wwml-design-outline) :is(.wwml-text-item, .wwml-code-item, .wwml-flag-item) {
	border: 1px solid currentColor;
	border-radius: 2px;
	padding: 5px 12px;
}
:is(.is-style-outline > .wwml-switcher, .wwml-switcher.wwml-design-outline) :is(.wwml-text-item, .wwml-code-item, .wwml-flag-item).wwml-current {
	box-shadow: inset 0 0 0 1px currentColor;
	font-weight: 600;
}
:is(.is-style-outline > .wwml-switcher, .wwml-switcher.wwml-design-outline) .wwml-dropdown-toggle {
	border: 1px solid currentColor;
	border-radius: 2px;
}
:is(.is-style-outline > .wwml-switcher, .wwml-switcher.wwml-design-outline) .wwml-dropdown-menu {
	border-radius: 2px;
}

/* =========================================================================
   Language menu item (inside a Navigation block). Core Navigation styles the
   item and its submenu; only the extras live here.
   ========================================================================= */
.wwml-nav-switcher .wwml-flag {
	width: 18px;
	height: 13px;
	margin-right: 0.4em;
}

.wwml-nav-lang.wwml-current > .wp-block-navigation-item__content {
	font-weight: 600;
}

/* Editor preview: the server render is a list item inside the block wrapper. */
.wwml-nav-switcher-preview {
	list-style: none;
}

@media (prefers-reduced-motion: reduce) {
	.wwml-switcher :is(.wwml-text-item, .wwml-code-item, .wwml-flag-item) {
		transition: none;
	}
}
