/*
 * Override these in your theme CSS to restyle.
 * --mar-bg is the toggle's off color and the title pill color.
 * --mar-read-bg is the toggle's color once a post is marked read.
 */
:root {
	--mar-bg: #111111;
	--mar-read-bg: #1100cf;
	--mar-fg: #ffffff;
	--mar-width: 80%;
}

/* Every phone gets the full-width button. */
@media (max-width: 480px) {
	:root {
		--mar-width: 100%;
	}
}

/* ---------- Button ---------- */
/* Fixed 40px minimum height. If the label wraps, the button grows taller to fit. */
.mar-wrap .mar-toggle {
	appearance: none;
	display: flex;
	align-items: center;
	gap: 10px;
	box-sizing: border-box;
	width: var(--mar-width);
	max-width: 100%;
	min-height: 40px;
	margin: 0 auto;
	padding: 5px 14px 5px 5px;
	border: 0;
	border-radius: 999px;
	background: var(--mar-bg);
	color: var(--mar-fg);
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-decoration: none;
	text-align: left;
	cursor: pointer;
}

.mar-wrap .mar-toggle:hover,
.mar-wrap .mar-toggle:focus {
	color: var(--mar-fg);
	opacity: 0.88;
}

.mar-wrap .mar-toggle:focus-visible {
	outline: 2px solid var(--mar-bg);
	outline-offset: 3px;
}

.mar-toggle[aria-busy="true"] {
	cursor: progress;
}

.mar-toggle .mar-knob {
	flex: none;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--mar-fg);
}

.mar-toggle .mar-label {
	min-width: 0;
}

/* On: blue background, READ on the left, knob on the right. */
.mar-wrap .mar-toggle[aria-pressed="true"] {
	justify-content: space-between;
	padding: 5px 5px 5px 18px;
	background: var(--mar-read-bg);
	letter-spacing: 0.08em;
}

.mar-wrap .mar-toggle[aria-pressed="true"]:focus-visible {
	outline-color: var(--mar-read-bg);
}

.mar-toggle[aria-pressed="true"] .mar-knob {
	order: 2;
}

.mar-toggle--preview {
	pointer-events: none;
}

/* ---------- Title indicator: a plain pill, not a toggle ---------- */
.mar-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	box-sizing: border-box;
	height: 24px;
	margin-right: 12px;
	padding: 0 10px;
	border-radius: 12px;
	background: var(--mar-bg);
	color: var(--mar-fg);
	font-family: inherit;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.12em;
	text-transform: none;
	text-decoration: none;
	vertical-align: middle;
}

.mar-pill::before {
	content: "READ";
}
