/* Language switcher */
.aimt-switcher {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	margin: 0;
	padding: 0;
	list-style: none;
	align-items: center;
}

.aimt-switcher .aimt-lang-item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.aimt-switcher .aimt-lang-item a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	text-decoration: none;
	line-height: 1.2;
}

.aimt-switcher .aimt-lang-item.is-current a {
	font-weight: 700;
	text-decoration: underline;
}

/* Accessible, visible focus indicator (WCAG 2.4.7 / BITV). */
.aimt-switcher-nav a:focus-visible,
.aimt-switcher-nav summary:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
	border-radius: 3px;
}

/* Ensure an adequate interactive target size (WCAG 2.5.8). */
.aimt-switcher.aimt-layout-inline .aimt-lang-item a {
	padding: 4px 2px;
	min-height: 24px;
	box-sizing: border-box;
}

/* Visually-hidden but screen-reader-available text. */
.aimt-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.aimt-switcher .aimt-flag-emoji {
	font-size: 1.15em;
	line-height: 1;
}

.aimt-switcher .aimt-flag-img {
	display: inline-block;
	width: 20px;
	height: 14px;
	object-fit: cover;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
	vertical-align: middle;
}

.aimt-switcher .aimt-flag-wrap {
	display: inline-flex;
	line-height: 0;
}

.aimt-switcher .aimt-flag-svg {
	width: 20px;
	height: 15px;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
	vertical-align: middle;
}

.aimt-switcher .aimt-lang-label {
	font-size: 0.95em;
}

/* ---- Sizes ---- */
.aimt-size-small .aimt-flag-svg,
.aimt-size-small .aimt-flag-img { width: 16px; height: 12px; }
.aimt-size-small .aimt-flag-emoji { font-size: 1em; }
.aimt-size-small .aimt-lang-label { font-size: 0.8em; }

.aimt-size-large .aimt-flag-svg,
.aimt-size-large .aimt-flag-img { width: 28px; height: 21px; }
.aimt-size-large .aimt-flag-emoji { font-size: 1.5em; }
.aimt-size-large .aimt-lang-label { font-size: 1.1em; }

/* ---- Dropdown layout ---- */
details.aimt-switcher {
	position: relative;
	display: inline-block;
	list-style: none;
	padding: 0;
	margin: 0;
}

details.aimt-switcher > summary {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	cursor: pointer;
	padding: 6px 26px 6px 10px;
	border: 1px solid rgba(0, 0, 0, 0.2);
	border-radius: 4px;
	position: relative;
	list-style: none;
	white-space: nowrap;
}

details.aimt-switcher > summary::-webkit-details-marker { display: none; }

details.aimt-switcher > summary::after {
	content: "";
	position: absolute;
	right: 10px;
	top: 50%;
	width: 6px;
	height: 6px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-70%) rotate(45deg);
	opacity: 0.6;
	transition: transform 0.15s ease;
}

details.aimt-switcher[open] > summary::after { transform: translateY(-30%) rotate(225deg); }

details.aimt-switcher .aimt-dropdown-list {
	position: absolute;
	z-index: 999;
	top: calc(100% + 4px);
	left: 0;
	min-width: 100%;
	margin: 0;
	padding: 4px 0;
	list-style: none;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.15);
	border-radius: 4px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

details.aimt-switcher .aimt-dropdown-list .aimt-lang-item a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px;
	white-space: nowrap;
}

details.aimt-switcher .aimt-dropdown-list .aimt-lang-item a:hover,
details.aimt-switcher .aimt-dropdown-list .aimt-lang-item a:focus-visible {
	background: rgba(0, 0, 0, 0.07);
}

/* ---- RTL (Arabic / Hebrew) ---- */
[dir="rtl"] details.aimt-switcher .aimt-dropdown-list,
.rtl details.aimt-switcher .aimt-dropdown-list {
	left: auto;
	right: 0;
}

[dir="rtl"] details.aimt-switcher > summary,
.rtl details.aimt-switcher > summary {
	padding: 6px 10px 6px 26px;
}

[dir="rtl"] details.aimt-switcher > summary::after,
.rtl details.aimt-switcher > summary::after {
	right: auto;
	left: 10px;
}

.rtl .aimt-switcher,
[dir="rtl"] .aimt-switcher {
	direction: rtl;
}

/* ---- Reduced motion (WCAG 2.3.3) ---- */
@media (prefers-reduced-motion: reduce) {
	details.aimt-switcher > summary::after {
		transition: none;
	}
}

/* -------------------------------------------------------------------------
   Floating auto switcher (rendered by SEO_Router::render_auto_switcher)
   ------------------------------------------------------------------------- */
.aimt-auto-switcher {
	position: fixed;
	z-index: 99990;
	background: rgba(255, 255, 255, 0.92);
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 999px;
	padding: 4px 6px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	backdrop-filter: saturate(140%) blur(2px);
	line-height: 1;
}
.aimt-auto-switcher .aimt-switcher-nav ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	gap: 2px;
	align-items: center;
}
.aimt-auto-switcher .aimt-lang-item a {
	display: inline-block;
	padding: 4px 9px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-decoration: none;
	color: #333;
	line-height: 1.2;
}
.aimt-auto-switcher .aimt-lang-item.is-current a {
	background: #111;
	color: #fff;
}
.aimt-auto-switcher .aimt-lang-item a:hover { background: rgba(0, 0, 0, 0.08); }
.aimt-auto-switcher .aimt-lang-item.is-current a:hover { background: #111; }

.aimt-auto-switcher.aimt-pos-top-right    { top: 90px; right: 16px; }
.aimt-auto-switcher.aimt-pos-top-left     { top: 90px; left: 16px; }
.aimt-auto-switcher.aimt-pos-bottom-right { bottom: 16px; right: 16px; }
.aimt-auto-switcher.aimt-pos-bottom-left  { bottom: 16px; left: 16px; }

/* Keep clear of the WP admin bar for logged-in users. */
body.admin-bar .aimt-auto-switcher.aimt-pos-top-right,
body.admin-bar .aimt-auto-switcher.aimt-pos-top-left { top: 122px; }

/* -------------------------------------------------------------------------
   Language switcher entries appended into a nav menu (Menu_Handler)
   ------------------------------------------------------------------------- */
.aimt-lang-menu-item > a { text-transform: uppercase; }
/* Current language: shown as the active menu entry and not re-clickable. */
.aimt-lang-menu-item.aimt-current > a { pointer-events: none; cursor: default; opacity: 0.8; }
