<?php
if (! defined('ABSPATH')) {
    exit;
} $pgo_lang_switcher = PufferGo_Polylang::languages_html();

if ('' === $pgo_lang_switcher) {
    return;
}

if (empty($GLOBALS['puffergo_lang_switcher_css_done'])) : $GLOBALS['puffergo_lang_switcher_css_done'] = true; ?>
	<style>
		.puffergo-language-switcher { display: inline-flex; align-items: center; }
		.puffergo-language-switcher select {
			appearance: none;
			-webkit-appearance: none;
			background-color: transparent;
			color: var(--puffergo-header-text, #171717);
			border: 1px solid color-mix(in srgb, var(--puffergo-header-text, #171717) 25%, transparent);
			border-radius: 0.5rem;
			padding: 0.25rem 1.75rem 0.25rem 0.625rem;
			font-size: 0.875rem;
			font-weight: 600;
			line-height: 1.5;
			cursor: pointer;
			outline: none;
			background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23808080'%3E%3Cpath fill-rule='evenodd' d='M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z' clip-rule='evenodd'/%3E%3C/svg%3E");
			background-repeat: no-repeat;
			background-position: right 0.4rem center;
			background-size: 1.1em;
		}
		.puffergo-language-switcher select:focus-visible {
			border-color: var(--puffergo-header-accent, #2563eb);
		}
		/* Options render in the browser's menu chrome (light), so keep them legible. */
		.puffergo-language-switcher select option { color: #171717; background-color: #ffffff; }
	</style>
	<?php
endif; ?>
<div class="puffergo-language-switcher">
	<?php
 echo $pgo_lang_switcher; ?>
</div>
<?php
unset($pgo_lang_switcher);
