/*
 * websun-i18n — language bar.
 *
 * Self-contained on purpose: the bar is rendered at wp_body_open(), outside the
 * header part, so nothing here may depend on a header class name. The only
 * shared things are the theme's design tokens, read through var() with fallbacks
 * so a token rename degrades to a readable bar instead of an invisible one.
 *
 * Dark strip, because the header is near-white: a light bar on top of a light
 * header reads as a rendering artefact rather than as a control. `brand-dark`
 * keeps it in the palette.
 */

.wpb-lang-bar {
	background: var(--brand-dark, #3d2b1f);
	color: rgba(255, 255, 255, .78);
	font-size: 12px;
	line-height: 1;
}

.wpb-lang-bar-inner {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	min-height: 30px;
}

/* The theme sets `ul { padding-left: 20px }` globally; reset it here. */
.wpb-lang-list {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wpb-lang-list li {
	margin: 0;
	padding: 0;
}

.wpb-lang-list a,
.wpb-lang-list .is-current {
	display: inline-block;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	text-decoration: none;
	color: rgba(255, 255, 255, .72);
}

.wpb-lang-list a:hover,
.wpb-lang-list a:focus {
	color: #fff;
	text-decoration: none;
}

/* Current language: a rule under it rather than a different weight, so the line
   height of the bar does not change between languages. */
.wpb-lang-list .is-current {
	color: #fff;
	box-shadow: inset 0 -2px 0 var(--brand, #8a5a34);
	padding-bottom: 2px;
}

/* ---- dropdown form, used when a site has more than four languages ---- */

.wpb-lang-more {
	position: relative;
}

.wpb-lang-more > summary {
	list-style: none;
	cursor: pointer;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #fff;
	box-shadow: inset 0 -2px 0 var(--brand, #8a5a34);
	padding-bottom: 2px;
}

.wpb-lang-more > summary::-webkit-details-marker {
	display: none;
}

.wpb-lang-more > summary::marker {
	content: none;
}

/* With the summary carrying the current language, the list repeats it as a
   non-link, which is correct: it is where the visitor already is. */
.wpb-lang-more > .wpb-lang-nav {
	position: absolute;
	right: 0;
	top: calc(100% + 8px);
	z-index: 120;
	display: none;
	min-width: 112px;
	background: var(--brand-dark, #3d2b1f);
	border: 1px solid rgba(255, 255, 255, .18);
	border-radius: var(--radius, 10px);
	box-shadow: var(--shadow-md, 0 12px 28px rgba(28, 26, 23, .10));
	padding: 12px 18px;
}

.wpb-lang-more[open] > .wpb-lang-nav {
	display: block;
}

/* The dropdown is a column; the inline form stays a row. */
.wpb-lang-more .wpb-lang-list {
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
}

/* ===========================================================================
 * In-header switcher (placement marker).
 *
 * The bar above is a dark strip on a near-white page: it works because it is
 * its own block. Inside the header these rules would be a dark slab in a light
 * row, so the in-header forms get their own, header-native styling: no
 * background, the header's own text colour, and the same letter-spacing /
 * uppercase rhythm the nav links use.
 *
 * Names are prefixed `wpb-lang-` like the bar, but no class is shared with it -
 * the bar's rules must not leak into the header.
 * ======================================================================== */

/* ---- shared by both in-header forms ---- */

.wpb-lang-drop,
.wpb-lang-inline {
	font-size: 12px;
	line-height: 1;
}

.wpb-lang-drop {
	position: relative;
	align-self: center;
}

.wpb-lang-drop-list,
.wpb-lang-inline-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wpb-lang-drop-list a,
.wpb-lang-drop-list .is-current,
.wpb-lang-inline-list a,
.wpb-lang-inline-list .is-current {
	display: inline-block;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	text-decoration: none;
	color: inherit;
}

.wpb-lang-inline-list {
	display: flex;
	align-items: center;
	gap: 16px;
}

/* Current language: a rule underneath, so switching does not change the
   trigger's own height and the header never nudges. */
.wpb-lang-drop-list .is-current,
.wpb-lang-inline-list .is-current {
	box-shadow: inset 0 -2px 0 var(--brand, #8a5a34);
	padding-bottom: 2px;
}

/* ---- dropdown form (desktop nav) ---- */

.wpb-lang-trigger {
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	cursor: pointer;
	font: inherit;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: inherit;
	opacity: .72;
}

.wpb-lang-trigger::after {
	content: "";
	display: inline-block;
	width: 5px;
	height: 5px;
	margin-left: 7px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	vertical-align: middle;
}

.wpb-lang-trigger:hover,
.wpb-lang-trigger:focus {
	opacity: 1;
}

/* Absolutely positioned: an open list must not widen the header row, or it
   would push the single-line breakpoint on its own. */
.wpb-lang-drop-list {
	position: absolute;
	right: 0;
	top: calc(100% + 10px);
	z-index: 130;
	display: none;
	min-width: 84px;
	background: var(--surface, #fff);
	border: 1px solid rgba(28, 26, 23, .12);
	border-radius: var(--radius, 10px);
	box-shadow: var(--shadow-md, 0 12px 28px rgba(28, 26, 23, .10));
}

/* Hover + focus-within, matching the theme's existing Products dropdown rather
   than introducing a second interaction model in the same flex row. Keyboard
   users reach it by tabbing to the trigger; the trigger never gains focus
   without the list being reachable because :focus-within covers both. */
.wpb-lang-drop:hover .wpb-lang-drop-list,
.wpb-lang-drop:focus-within .wpb-lang-drop-list {
	display: block;
}

/* Panel box. Scoped to .wpb-lang-drop on purpose. Measured, not assumed: with
   the bare `.wpb-lang-drop-list { padding: 12px }` the panel rendered at 0px of
   padding while every other declaration in the same rule (gap, flex-direction,
   align-items) applied. It was not cascade order - deleting the zeroing rule
   live changed nothing, and re-appending the panel rule at EOF changed nothing
   either. Raising the selector's specificity is the only thing that made the
   padding stick, so the extra class is functional, not cosmetic: dropping it
   silently re-flattens the panel. */
.wpb-lang-drop .wpb-lang-drop-list {
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	/* Airier than the bar's list: this is a floating panel, not a strip, so the
	   labels need room on all four sides. */
	padding: 12px;
}

/* The theme styles every anchor inside .site-nav (font-size 15px, weight 500,
   padding 6px 2px, plus its own scaleX underline) because it assumes they are
   menu labels. The panel's labels also live there, so re-assert our own row
   metrics at a specificity that wins without !important. */
.site-nav .wpb-lang-drop-list li {
	margin: 0;
}

.site-nav .wpb-lang-drop-list a,
.site-nav .wpb-lang-drop-list .is-current {
	padding: 0;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
}

/* The theme also styles list containers inside .site-nav, so the 24px gap it
   uses between menu items reaches this list as well and wins on specificity. */
.site-nav .wpb-lang-drop-list {
	gap: 12px;
}

.site-nav .wpb-lang-drop-list a::after {
	display: none;
}

/* ---- inline form (mobile drawer) ---- */

.wpb-lang-inline {
	padding: 0 0 12px;
}

.wpb-lang-inline-list {
	gap: 20px;
}

@media (max-width: 600px) {
	.wpb-lang-trigger {
		font-size: 13px;
	}
}

@media print {
	.wpb-lang-drop,
	.wpb-lang-inline {
		display: none;
	}
}

@media print {
	.wpb-lang-bar {
		display: none;
	}
}
