/**
 * Gloty front-end language switcher.
 *
 * Loaded on the public site (only when 2+ languages are active) for the
 * auto-injected floating switcher, the [gloty_lang_switcher] shortcode, and the
 * widget. Styles are namespaced under .gloty-lang-switcher to avoid theme clashes.
 */

.gloty-lang-switcher,
.gloty-lang-switcher * {
	box-sizing: border-box;
}

.gloty-lang-switcher ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.gloty-lang-switcher a {
	display: flex;
	align-items: center;
	gap: 8px;
	text-decoration: none;
	color: inherit;
}

.gloty-lang-switcher__flag {
	font-size: 1.1em;
	line-height: 1;
}

/* ---- Floating wrapper (auto-injected in the footer) ---- */
.gloty-lang-switcher-float {
	position: fixed;
	z-index: 99999;
	max-width: calc(100vw - 24px);
}

.gloty-lang-switcher-float--top-left {
	top: 16px;
	left: 16px;
}

.gloty-lang-switcher-float--top-right {
	top: 16px;
	right: 16px;
}

.gloty-lang-switcher-float--bottom-left {
	bottom: 16px;
	left: 16px;
}

.gloty-lang-switcher-float--bottom-right {
	bottom: 16px;
	right: 16px;
}

/* ---- Static footer bar (position: footer) ---- */
/* A non-floating, full-width strip appended at wp_footer that renders the
   switcher as an inline list of languages. Neutral styling — themes can
   override via .gloty-lang-switcher-footer. */
.gloty-lang-switcher-footer {
	width: 100%;
	padding: 16px;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.gloty-lang-switcher-footer__inner {
	display: flex;
	justify-content: center;
	max-width: 1200px;
	margin: 0 auto;
}

/* The footer list should read as plain links, not the boxed inline pills. */
.gloty-lang-switcher-footer .gloty-lang-switcher--inline {
	justify-content: center;
	gap: 8px 20px;
}

.gloty-lang-switcher-footer .gloty-lang-switcher--inline a {
	padding: 0;
	background: transparent;
	border: 0;
}

.gloty-lang-switcher-footer .gloty-lang-switcher--inline a:hover,
.gloty-lang-switcher-footer .gloty-lang-switcher--inline a:focus {
	text-decoration: underline;
}

.gloty-lang-switcher-footer .gloty-lang-switcher__item--active a {
	font-weight: 600;
	border-color: transparent;
}

/* ---- Dropdown (default) ---- */
.gloty-lang-switcher--dropdown {
	display: inline-block;
	position: relative;
	font-size: 14px;
}

.gloty-lang-switcher__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	background: #fff;
	color: #1e1e1e;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 999px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	cursor: pointer;
	list-style: none;
	white-space: nowrap;
}

.gloty-lang-switcher__toggle::-webkit-details-marker {
	display: none;
}

.gloty-lang-switcher__toggle::after {
	content: "";
	width: 6px;
	height: 6px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	margin-top: -3px;
	opacity: 0.5;
}

.gloty-lang-switcher__list {
	position: absolute;
	min-width: 100%;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 10px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
	padding: 6px;
	margin: 8px 0;
}

.gloty-lang-switcher__list a {
	padding: 8px 12px;
	border-radius: 6px;
	color: #1e1e1e;
	white-space: nowrap;
}

.gloty-lang-switcher__list a:hover,
.gloty-lang-switcher__list a:focus {
	background: #f0f0f1;
}

.gloty-lang-switcher__item--active a {
	font-weight: 600;
}

/* Bottom-anchored floats open the menu upward; right-anchored align to the right. */
.gloty-lang-switcher-float--bottom-left .gloty-lang-switcher__list,
.gloty-lang-switcher-float--bottom-right .gloty-lang-switcher__list {
	bottom: 100%;
}

.gloty-lang-switcher-float--top-right .gloty-lang-switcher__list,
.gloty-lang-switcher-float--bottom-right .gloty-lang-switcher__list {
	right: 0;
}

/* ---- Inline links ---- */
.gloty-lang-switcher--inline {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	font-size: 14px;
}

.gloty-lang-switcher--inline a {
	padding: 6px 10px;
	border-radius: 6px;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.12);
	color: #1e1e1e;
}

.gloty-lang-switcher--inline .gloty-lang-switcher__item--active a {
	font-weight: 600;
	border-color: currentColor;
}

/* ---- Flags only ---- */
.gloty-lang-switcher--flags {
	display: flex;
	gap: 10px;
	font-size: 20px;
}

.gloty-lang-switcher--flags a {
	opacity: 0.65;
	transition: opacity 0.15s ease;
}

.gloty-lang-switcher--flags a:hover,
.gloty-lang-switcher--flags a:focus,
.gloty-lang-switcher--flags .gloty-lang-switcher__item--active a {
	opacity: 1;
}
