/*
 * Sélecteur de langue Protéalpes Traduction.
 *
 * CHARTE PROTÉALPES — à renseigner : toutes les couleurs, la police et les arrondis
 * du sélecteur sont regroupés dans ce bloc. Par défaut, le sélecteur hérite de la police
 * et de la couleur de texte du thème (rien n'est imposé tant que la charte n'est pas saisie).
 */
:root {
	--ptr-font: inherit;                  /* police : ex. "Montserrat", sans-serif */
	--ptr-text: inherit;                  /* couleur du texte */
	--ptr-bg: #ffffff;                    /* fond du sélecteur et de la liste */
	--ptr-border: rgba(0, 0, 0, .18);     /* contour */
	--ptr-accent: currentColor;           /* langue active, focus */
	--ptr-hover-bg: rgba(0, 0, 0, .05);   /* survol */
	--ptr-radius: 6px;                    /* arrondi */
	--ptr-shadow: 0 6px 18px rgba(0, 0, 0, .12);

	/* Pastilles rondes (affichage par défaut : FR / EN / DE), reprises du sélecteur actuel du site */
	--ptr-circle-size: 34px;              /* diamètre des pastilles (30px sur mobile) */
	--ptr-circle-font: 12px;              /* taille du code de langue */
	--ptr-circle-color: currentColor;     /* contour + texte de la langue en cours (hérite de l'en-tête) */
	--ptr-option-bg: #000000;             /* fond des autres langues */
	--ptr-option-text: #ffffff;           /* texte des autres langues */
	--ptr-circle-gap: 8px;                /* espace identique entre FR et la 1re langue, puis entre les langues suivantes */
}

.ptr-switcher {
	font-family: var(--ptr-font);
	font-size: 1em;
	line-height: 1.3;
	color: var(--ptr-text);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* --- Menu déroulant (sans JavaScript : <details>) --- */
.ptr-switcher--dropdown {
	position: relative;
	display: inline-block;
}

.ptr-switcher__box {
	position: relative;
}

.ptr-switcher__current {
	display: inline-flex;
	align-items: center;
	gap: .45em;
	padding: .45em .8em;
	cursor: pointer;
	list-style: none;
	background: var(--ptr-bg);
	border: 1px solid var(--ptr-border);
	border-radius: var(--ptr-radius);
	color: inherit;
	user-select: none;
}

.ptr-switcher__current::-webkit-details-marker { display: none; }

.ptr-switcher__current::after {
	content: "";
	width: .45em;
	height: .45em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg) translateY(-15%);
	transition: transform .15s ease;
}

.ptr-switcher__box[open] > .ptr-switcher__current::after {
	transform: rotate(-135deg) translateY(-15%);
}

.ptr-switcher__current:focus-visible,
.ptr-switcher__list a:focus-visible {
	outline: 2px solid var(--ptr-accent);
	outline-offset: 2px;
}

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

.ptr-switcher__item { margin: 0; padding: 0; list-style: none; }

.ptr-switcher__list a {
	display: block;
	padding: .45em .9em;
	color: inherit;
	text-decoration: none;
	white-space: nowrap;
}

.ptr-switcher__list a:hover { background: var(--ptr-hover-bg); }

.ptr-switcher__item.is-current > a {
	font-weight: 600;
	box-shadow: inset 3px 0 0 var(--ptr-accent);
}

/* --- Liste horizontale ([ptr_switcher style="list"]) --- */
.ptr-switcher--list {
	display: flex;
	flex-wrap: wrap;
	gap: .25em .9em;
}

.ptr-switcher--list .ptr-switcher__list a { padding: .2em 0; }
.ptr-switcher--list a { display: inline; padding: .2em 0; color: inherit; text-decoration: none; }
.ptr-switcher--list .is-current > a { box-shadow: none; text-decoration: underline; text-underline-offset: .25em; }

/* --- Dans un menu WordPress --- */
.ptr-switcher--menu { display: inline-block; vertical-align: middle; }

/* --- Bouton flottant --- */
.ptr-switcher--floating {
	position: fixed;
	z-index: 99998;
	margin: 16px;
}

.ptr-switcher--floating.ptr-pos-bottom-right { bottom: 0; right: 0; }
.ptr-switcher--floating.ptr-pos-bottom-left  { bottom: 0; left: 0; }
.ptr-switcher--floating.ptr-pos-top-right    { top: 0; right: 0; }
.ptr-switcher--floating.ptr-pos-top-left     { top: 0; left: 0; }

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

.ptr-switcher--floating.ptr-pos-bottom-right .ptr-switcher__list,
.ptr-switcher--floating.ptr-pos-top-right .ptr-switcher__list { left: auto; right: 0; }

/* --- Pastilles rondes : langue en cours (contour), autres langues (disques pleins) --- */
.ptr-switcher--round { font-size: var(--ptr-circle-font); line-height: 1; }

.ptr-switcher--round .ptr-switcher__box { display: block; }

.ptr-switcher--round .ptr-switcher__current {
	display: flex;
	box-sizing: border-box;
	justify-content: center;
	width: var(--ptr-circle-size);
	height: var(--ptr-circle-size);
	padding: 0;
	gap: 0;
	background: transparent;
	border: 1px solid var(--ptr-circle-color);
	border-radius: 50%;
	color: var(--ptr-circle-color);
	font-size: inherit;
	line-height: 1;
	text-align: center;
}

.ptr-switcher--round .ptr-switcher__current::after { display: none; }

.ptr-switcher--round .ptr-switcher__list {
	top: 100%;
	left: 0;
	min-width: 0;
	width: var(--ptr-circle-size);
	margin: 0;
	padding: var(--ptr-circle-gap) 0 0;   /* même espace entre la pastille en cours et la 1re langue qu'entre les langues */
	display: flex;
	flex-direction: column;
	gap: var(--ptr-circle-gap);
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.ptr-switcher--round .ptr-switcher__item { margin: 0; padding: 0; }

/* Bouton flottant en bas de page : le menu s'ouvre vers le haut, avec le même espacement */
.ptr-switcher--round.ptr-switcher--floating.ptr-pos-bottom-right .ptr-switcher__list,
.ptr-switcher--round.ptr-switcher--floating.ptr-pos-bottom-left .ptr-switcher__list {
	top: auto;
	bottom: 100%;
	padding: 0 0 var(--ptr-circle-gap);
	flex-direction: column-reverse;
}

.ptr-switcher--round .ptr-switcher__list a {
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: var(--ptr-circle-size);
	height: var(--ptr-circle-size);
	padding: 0;
	background: var(--ptr-option-bg);
	border: 1px solid var(--ptr-option-bg);
	border-radius: 50%;
	color: var(--ptr-option-text) !important;   /* texte toujours blanc, quel que soit le style du thème */
	font-size: inherit;
	line-height: 1;
	text-decoration: none !important;
	transition: background-color .4s, color .4s ease-in-out;
}

.ptr-switcher--round .ptr-switcher__list a:hover,
.ptr-switcher--round .ptr-switcher__list a:focus,
.ptr-switcher--round .ptr-switcher__list a:active,
.ptr-switcher--round .ptr-switcher__list a:visited {
	background: var(--ptr-option-bg) !important;
	color: var(--ptr-option-text) !important;
}

@media screen and (max-width: 690px) {
	.ptr-switcher--round { --ptr-circle-size: 30px; }
}
