/*
 * Podium Translate — front-end.
 * Deliberately neutral: the switcher takes the site's font and colour and stays out of the way.
 * Override the variables in the theme to adapt it: .pt-switcher { --pt-bg: ...; }
 */

.pt-switcher {
	--pt-bg: #fff;
	--pt-fg: inherit;
	--pt-border: rgba(0, 0, 0, .12);
	--pt-hover: rgba(0, 0, 0, .05);
	--pt-shadow: 0 8px 24px rgba(0, 0, 0, .08);
	--pt-radius: 6px;
	position: relative;
	display: inline-block;
	font: inherit;
	font-size: 14px;
	line-height: 1.2;
	color: var(--pt-fg);
	text-align: left;
}

.pt-switcher *,
.pt-detection * {
	box-sizing: border-box;
}

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

.pt-switcher__current {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 36px;
	margin: 0;
	padding: 8px 12px;
	background: var(--pt-bg);
	color: inherit;
	border: 1px solid var(--pt-border);
	border-radius: var(--pt-radius);
	box-shadow: none;
	font: inherit;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	transition: background-color .15s ease;
}

.pt-switcher__current:hover {
	background: var(--pt-bg);
	background-image: linear-gradient(var(--pt-hover), var(--pt-hover));
	color: inherit;
}

.pt-switcher__current:focus-visible,
.pt-switcher__list a:focus-visible,
.pt-detection a:focus-visible,
.pt-detection button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.pt-switcher__chevron {
	flex: none;
	opacity: .6;
	transition: transform .15s ease;
}

.pt-switcher.is-open .pt-switcher__chevron {
	transform: rotate(180deg);
}

.pt-switcher__list {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	z-index: 9999;
	min-width: 100%;
	margin: 0;
	padding: 4px;
	list-style: none;
	background: var(--pt-bg);
	border: 1px solid var(--pt-border);
	border-radius: var(--pt-radius);
	box-shadow: var(--pt-shadow);
}

.pt-switcher__list[hidden] {
	display: none;
}

.pt-switcher__list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.pt-switcher__list li::before,
.pt-switcher__list li::marker {
	content: none;
}

.pt-switcher__list a {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
	border-radius: calc(var(--pt-radius) - 2px);
	transition: background-color .15s ease;
}

.pt-switcher__list a:hover {
	background: var(--pt-hover);
	color: inherit;
}

/* Desktop: open on hover as well. */
@media (hover: hover) {
	.pt-switcher--dropdown:hover > .pt-switcher__list {
		display: block;
	}

	.pt-switcher--dropdown:hover .pt-switcher__chevron {
		transform: rotate(180deg);
	}
}

/* Invisible bridge so the list stays open while the pointer travels to it. */
.pt-switcher--dropdown > .pt-switcher__list::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -6px;
	height: 6px;
}

.pt-flag {
	display: inline-block;
	flex: none;
	width: 18px;
	height: 13.5px;
	object-fit: cover;
	vertical-align: middle;
	border-radius: 2px;
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .06);
}

/* Inline list */
.pt-switcher--list .pt-switcher__list {
	position: static;
	display: flex;
	flex-wrap: wrap;
	gap: 2px;
	padding: 0;
	background: none;
	border: 0;
	box-shadow: none;
}

.pt-switcher--list .is-current a {
	font-weight: 600;
}

/* Floating button */
.pt-switcher--floater {
	position: fixed;
	z-index: 99990;
	margin: 0;
}

.pt-switcher--floater .pt-switcher__current {
	box-shadow: 0 2px 12px rgba(0, 0, 0, .10);
}

.pt-switcher--bottom-right { right: 16px; bottom: 16px; }
.pt-switcher--bottom-left { left: 16px; bottom: 16px; }
.pt-switcher--top-right { right: 16px; top: 16px; }
.pt-switcher--top-left { left: 16px; top: 16px; }

.admin-bar .pt-switcher--top-right,
.admin-bar .pt-switcher--top-left {
	top: 48px;
}

.pt-switcher--bottom-right > .pt-switcher__list,
.pt-switcher--bottom-left > .pt-switcher__list {
	top: auto;
	bottom: calc(100% + 4px);
}

.pt-switcher--bottom-right > .pt-switcher__list::before,
.pt-switcher--bottom-left > .pt-switcher__list::before {
	top: auto;
	bottom: -6px;
}

.pt-switcher--bottom-right > .pt-switcher__list,
.pt-switcher--top-right > .pt-switcher__list {
	left: auto;
	right: 0;
}

.pt-theme-dark {
	--pt-bg: #1c1c1c;
	--pt-fg: #f5f5f5;
	--pt-border: rgba(255, 255, 255, .14);
	--pt-hover: rgba(255, 255, 255, .08);
	--pt-shadow: 0 8px 24px rgba(0, 0, 0, .35);
}

/* Menu items */
.trp-menu-ls-label,
.pt-menu-language__label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* Browser language suggestion */
.pt-detection {
	position: fixed;
	left: 16px;
	right: 16px;
	bottom: 16px;
	z-index: 100000;
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 520px;
	margin: 0 auto;
	padding: 12px 12px 12px 16px;
	background: #fff;
	color: #1d1d1f;
	border: 1px solid rgba(0, 0, 0, .12);
	border-radius: 8px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, .12);
	font: inherit;
	font-size: 14px;
	line-height: 1.4;
	animation: pt-detection-in .24s cubic-bezier(.2, .8, .2, 1) both;
}

.pt-detection__text {
	flex: 1;
	margin: 0;
	padding: 0;
	font: inherit;
	color: inherit;
}

.pt-detection__action {
	flex: none;
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 8px 14px;
	background: #1d1d1f;
	color: #fff;
	border-radius: 6px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

.pt-detection__action:hover,
.pt-detection__action:focus {
	background: #000;
	color: #fff;
}

.pt-detection__close {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	background: none;
	color: rgba(0, 0, 0, .55);
	border: 0;
	border-radius: 6px;
	cursor: pointer;
}

.pt-detection__close:hover {
	background: rgba(0, 0, 0, .05);
	color: #1d1d1f;
}

/* The floating switcher makes room for the suggestion while it is shown. */
@media (max-width: 900px) {
	.pt-detection-open .pt-switcher--bottom-left,
	.pt-detection-open .pt-switcher--bottom-right {
		bottom: 96px;
	}
}

@media (max-width: 480px) {
	.pt-detection-open .pt-switcher--bottom-left,
	.pt-detection-open .pt-switcher--bottom-right {
		bottom: 136px;
	}

	.pt-detection {
		flex-wrap: wrap;
	}

	.pt-detection__text {
		flex-basis: calc(100% - 44px);
	}

	.pt-detection__action {
		flex: 1;
		justify-content: center;
	}
}

@keyframes pt-detection-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
	.pt-detection { animation: none; }
	.pt-switcher__chevron,
	.pt-switcher__current,
	.pt-switcher__list a { transition: none; }
}
