/* ARGU Switch: Switch Button + Switch Text. Used on the published page and in the Visual Builder. */

/* ---------- Switch Button ---------- */
.argu_switch_button .argu_switch_button__track {
	--argu-sw-speed: 400ms;
	--argu-sw-pad: 4px;
	position: relative;
	display: inline-grid;
	grid-template-columns: 1fr 1fr;
	box-sizing: border-box;
	padding: var(--argu-sw-pad);
	max-width: 100%;
}

.argu_switch_button .argu_switch_button__pill {
	position: absolute;
	top: var(--argu-sw-pad);
	bottom: var(--argu-sw-pad);
	left: var(--argu-sw-pad);
	width: calc((100% - 2 * var(--argu-sw-pad)) / 2);
	box-sizing: border-box;
	transform: translateX(0);
	transition: transform var(--argu-sw-speed) cubic-bezier(.4, 0, .2, 1);
	pointer-events: none;
}

.argu_switch_button .argu_switch_button__track[data-argu-state="on"] .argu_switch_button__pill {
	transform: translateX(100%);
}

.argu_switch_button .argu_switch_button__opt {
	position: relative;
	z-index: 1;
	appearance: none;
	-webkit-appearance: none;
	margin: 0;
	padding: .55em 1.3em;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	font: inherit;
	line-height: 1.2;
	text-align: center;
	text-transform: none;
	white-space: nowrap;
	cursor: pointer;
	transition: color var(--argu-sw-speed) ease;
}

.argu_switch_button .argu_switch_button__opt:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* ---------- Switch Text ---------- */
.argu_switch_text .argu_switch_text__stage {
	--argu-sw-speed: 400ms;
	display: block;
}

.argu_switch_text .argu_switch_text__base,
.argu_switch_text .argu_switch_text__extra {
	display: grid;
	transition: grid-template-rows var(--argu-sw-speed) cubic-bezier(.4, 0, .2, 1), opacity var(--argu-sw-speed) ease;
}

.argu_switch_text .argu_switch_text__base {
	grid-template-rows: 1fr;
	opacity: 1;
}

.argu_switch_text .argu_switch_text__extra {
	grid-template-rows: 0fr;
	opacity: 0;
	visibility: hidden;
	transition: grid-template-rows var(--argu-sw-speed) cubic-bezier(.4, 0, .2, 1), opacity var(--argu-sw-speed) ease, visibility 0s linear var(--argu-sw-speed);
}

.argu_switch_text .argu_switch_text__in {
	min-height: 0;
	overflow: hidden;
}

.argu_switch_text .argu_switch_text__stage[data-argu-state="on"] .argu_switch_text__extra {
	grid-template-rows: 1fr;
	opacity: 1;
	visibility: visible;
	transition-delay: 0s;
}

/* Replace mode: the extra content takes the place of the text. */
.argu_switch_text--replace .argu_switch_text__stage[data-argu-state="on"] .argu_switch_text__base {
	grid-template-rows: 0fr;
	opacity: 0;
}

/* The folded part must not count in the width of the module: otherwise, in a flex row, the module is as wide as its
   longest text even when that text is folded. Two mechanisms, so it holds in every browser:
   - contain: inline-size  = the element has no intrinsic width;
   - width: 0 + min-width: 100% = a percentage min-width is ignored when the width is measured from the content,
     and applied (full width) once the module is laid out. */
.argu_switch_text .argu_switch_text__extra {
	contain: inline-size;
	width: 0;
	min-width: 100%;
	box-sizing: border-box;
}

.argu_switch_text .argu_switch_text__stage[data-argu-state="on"] .argu_switch_text__extra {
	contain: none;
	width: auto;
	min-width: 0;
}

.argu_switch_text--replace .argu_switch_text__stage[data-argu-state="on"] .argu_switch_text__base {
	contain: inline-size;
	width: 0;
	min-width: 100%;
	box-sizing: border-box;
}

/* ---------- Page load / reduced motion ---------- */
.argu-sw-noanim .argu_switch_button *,
.argu-sw-noanim .argu_switch_text * {
	transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.argu_switch_button *,
	.argu_switch_text * {
		transition-duration: .01ms !important;
		transition-delay: 0s !important;
	}
}
