/**
 * MicroLearn — light/dark switcher button.
 * The dark palette lives in ml-theme-dark.css, which is printed at the end of
 * the document so it wins against the theme's RTL + dynamic option CSS.
 */

.ml-theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0 6px;
	padding: 0;
	border: 1px solid #e5e5e5;
	border-radius: 50%;
	background: #f7f8fc;
	color: #495057;
	cursor: pointer;
	line-height: 1;
	transition: background-color .18s ease, color .18s ease, border-color .18s ease, transform .18s ease;
	-webkit-tap-highlight-color: transparent;
}

.ml-theme-toggle:hover {
	transform: translateY(-1px);
	border-color: var(--ms-green);
	color: var(--ms-green);
}

.ml-theme-toggle:focus-visible {
	outline: 2px solid var(--ms-green);
	outline-offset: 3px;
}

.ml-theme-toggle-track {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
}

.ml-theme-icon {
	position: absolute;
	inset: 0;
	transition: opacity .18s ease, transform .18s ease;
}

.ml-theme-icon-moon { opacity: 0; transform: scale(.6) rotate(-25deg); }

html[data-theme="dark"] .ml-theme-icon-sun { opacity: 0; transform: scale(.6) rotate(25deg); }
html[data-theme="dark"] .ml-theme-icon-moon { opacity: 1; transform: none; }

html[data-theme="dark"] .ml-theme-toggle {
	background: #241a14;
	border-color: #3d2c20;
	color: #ffd166;
}

/* Smooth the swap without animating the first paint */
html.ml-theme-anim,
html.ml-theme-anim body,
html.ml-theme-anim .site-header,
html.ml-theme-anim #footer,
html.ml-theme-anim .ml-app,
html.ml-theme-anim .ml-card,
html.ml-theme-anim .widget {
	transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
