/* ===== Polylang language switcher — pill (Wix-style) ===== */
/* Owned by ii-brisson-site plugin. Edit values in the :root vars at top. */

/* Wrapper added by language-switcher-wrap.js so the pill stays together
   when the parent menu flex-wraps. The wrapper itself is the flex item. */
li.lang-switcher-group,
ul.lang-switcher-group {
	display: inline-flex;
	list-style: none;
	margin: 0;
	padding: 0;
	flex-shrink: 0;
	align-self: center;
}

/* Standalone (shortcode) variant — no extra left gap; the host container
   (Kadence header element) controls outer spacing. */
ul.lang-switcher-standalone li.lang-item.lang-item-first {
	margin-left: 0;
}
:root {
	--lang-pill-bg:        #fff;
	--lang-pill-fg:        #6b4a2b;
	--lang-pill-active-bg: #6b4a2b;
	--lang-pill-active-fg: #fff;
	--lang-pill-border:    #6b4a2b;
	--lang-pill-hover-bg:  #6b4a2b;
	--lang-pill-hover-fg:  #fff;
	--lang-pill-radius:    999px;
	--lang-pill-pad-y:     8px;
	--lang-pill-pad-x:     16px;
	--lang-pill-font-size: 14px;
	--lang-pill-weight:    700;
	--lang-pill-track:     0.1em;
	--lang-pill-gap-left:  1.25rem;
}

li.lang-item {
	margin: 0;
	padding: 0;
	list-style: none;
	display: inline-flex;
	align-items: stretch;
	position: relative;
	background: var(--lang-pill-bg);
	border-top: 1px solid var(--lang-pill-border);
	border-bottom: 1px solid var(--lang-pill-border);
}

li.lang-item.lang-item-first {
	border-left: 1px solid var(--lang-pill-border);
	border-top-left-radius: var(--lang-pill-radius);
	border-bottom-left-radius: var(--lang-pill-radius);
	margin-left: var(--lang-pill-gap-left);
}

li.lang-item:not(:has(~ li.lang-item)) {
	border-right: 1px solid var(--lang-pill-border);
	border-top-right-radius: var(--lang-pill-radius);
	border-bottom-right-radius: var(--lang-pill-radius);
}

li.lang-item + li.lang-item {
	border-left: 1px solid var(--lang-pill-border);
}

li.lang-item > a {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	padding: var(--lang-pill-pad-y) var(--lang-pill-pad-x) !important;
	background: transparent;
	color: var(--lang-pill-fg);
	text-decoration: none !important;
	font-size: 0 !important;
	line-height: 1 !important;
	height: auto !important;
	min-height: 0 !important;
	transition: background-color 0.15s ease, color 0.15s ease;
}

li.lang-item-en    > a::before { content: "EN"; }
li.lang-item-fr-fr > a::before { content: "FR"; }
li.lang-item-ja    > a::before { content: "JA"; }

li.lang-item > a::before {
	font-size: var(--lang-pill-font-size) !important;
	font-weight: var(--lang-pill-weight) !important;
	letter-spacing: var(--lang-pill-track) !important;
	line-height: 1 !important;
}

/* Inherit pill's outer radius onto the <a> so dark fills (active + hover)
   follow the rounded ends instead of overflowing as a flat rectangle. */
li.lang-item.lang-item-first > a {
	border-top-left-radius: var(--lang-pill-radius) !important;
	border-bottom-left-radius: var(--lang-pill-radius) !important;
}
li.lang-item:not(:has(~ li.lang-item)) > a {
	border-top-right-radius: var(--lang-pill-radius) !important;
	border-bottom-right-radius: var(--lang-pill-radius) !important;
}

li.lang-item.current-lang > a {
	background: var(--lang-pill-active-bg) !important;
	color: var(--lang-pill-active-fg) !important;
}
li.lang-item.current-lang > a::before {
	color: var(--lang-pill-active-fg) !important;
}

li.lang-item:not(.current-lang) > a:hover {
	background: var(--lang-pill-hover-bg) !important;
	color: var(--lang-pill-hover-fg) !important;
}
li.lang-item:not(.current-lang) > a:hover::before {
	color: var(--lang-pill-hover-fg) !important;
}

.main-navigation li.lang-item > a,
.header-navigation li.lang-item > a,
nav li.lang-item > a {
	border: 0 !important;
	padding: var(--lang-pill-pad-y) var(--lang-pill-pad-x) !important;
}
