/*
 * Episode Poll.
 * Out of the box this follows your theme's font and text color. The Appearance screen sets the
 * --ep-poll-* variables on each poll box (inline) and adds the --modifier classes used below.
 */

.ep-poll {
	--ep-poll-accent: #1d4ed8;
	box-sizing: border-box;
	margin: 2em 0;
	max-width: var(--ep-poll-maxw, none);
	padding: var(--ep-poll-pad, 24px);
	background: var(--ep-poll-bg, transparent);
	border: var(--ep-poll-bw, 1px) solid var(--ep-poll-border, rgba(128, 128, 128, 0.35));
	border-radius: var(--ep-poll-radius, 8px);
	font: inherit;
	font-family: var(--ep-poll-font, inherit);
	color: var(--ep-poll-text, inherit);
}

.ep-poll *,
.ep-poll *::before,
.ep-poll *::after {
	box-sizing: border-box;
}

.ep-poll [hidden] {
	display: none !important;
}

.ep-poll--center {
	margin-left: auto;
	margin-right: auto;
}

.ep-poll--shadow {
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
}

.ep-poll__fieldset {
	margin: 0;
	padding: 0;
	border: 0;
	min-width: 0;
}

.ep-poll__question {
	display: block;
	width: 100%;
	margin: 0 0 0.9em;
	padding: 0;
	font-size: var(--ep-poll-q-size, 115%);
	font-weight: var(--ep-poll-q-weight, 700);
	line-height: 1.35;
}

.ep-poll--q-center .ep-poll__question {
	text-align: center;
}

.ep-poll__options {
	display: flex;
	flex-direction: column;
	gap: var(--ep-poll-gap, 8px);
}

.ep-poll__option {
	display: flex;
	align-items: flex-start;
	gap: 0.65em;
	padding: 0.6em 0.8em;
	border: 1px solid var(--ep-poll-border, rgba(128, 128, 128, 0.35));
	border-radius: var(--ep-poll-opt-radius, 6px);
	background: var(--ep-poll-opt-bg, transparent);
	font-size: var(--ep-poll-a-size, 100%);
	cursor: pointer;
	line-height: 1.4;
}

.ep-poll__option:hover {
	border-color: var(--ep-poll-accent);
}

.ep-poll__option input[type="radio"] {
	flex: none;
	width: 1.1em;
	height: 1.1em;
	margin: 0.2em 0 0;
	accent-color: var(--ep-poll-accent);
}

.ep-poll__option:focus-within {
	outline: 2px solid var(--ep-poll-accent);
	outline-offset: 2px;
}

.ep-poll--plain .ep-poll__option {
	padding-left: 0;
	padding-right: 0;
	border-color: transparent;
	background: transparent;
}

.ep-poll--plain .ep-poll__option:hover {
	border-color: transparent;
}

.ep-poll__submit {
	display: inline-block;
	margin-top: 1em;
	padding: 0.6em 1.4em;
	border: 0;
	border-radius: var(--ep-poll-btn-radius, 6px);
	background: var(--ep-poll-accent);
	color: var(--ep-poll-btn-text, #fff);
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}

.ep-poll__submit:hover {
	filter: brightness(1.1);
}

.ep-poll__submit:focus-visible {
	outline: 2px solid var(--ep-poll-accent);
	outline-offset: 2px;
}

.ep-poll__submit[disabled] {
	opacity: 0.6;
	cursor: default;
}

.ep-poll--btn-outline .ep-poll__submit {
	background: transparent;
	color: var(--ep-poll-accent);
	box-shadow: inset 0 0 0 2px var(--ep-poll-accent);
}

.ep-poll--btn-full .ep-poll__submit {
	display: block;
	width: 100%;
}

.ep-poll__message {
	min-height: 1.4em;
	margin: 0.75em 0 0;
	font-size: 0.95em;
	opacity: 0.85;
}

/* Results */

.ep-poll__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ep-poll__row {
	margin: 0 0 0.9em;
	padding: 0;
}

.ep-poll__rowhead {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1em;
	margin-bottom: 0.3em;
	font-size: var(--ep-poll-a-size, 100%);
	line-height: 1.35;
}

.ep-poll__label {
	min-width: 0;
	overflow-wrap: anywhere;
}

.ep-poll__figure {
	flex: none;
	font-size: 0.9em;
	font-variant-numeric: tabular-nums;
	opacity: 0.85;
}

.ep-poll__you {
	display: inline-block;
	margin-left: 0.6em;
	padding: 0.05em 0.5em;
	border-radius: 999px;
	background: var(--ep-poll-accent);
	color: var(--ep-poll-btn-text, #fff);
	font-size: 0.75em;
	font-weight: 600;
	vertical-align: middle;
}

.ep-poll__bar {
	height: var(--ep-poll-bar-h, 10px);
	border-radius: 999px;
	background: var(--ep-poll-track, rgba(128, 128, 128, 0.22));
	overflow: hidden;
}

.ep-poll__fill {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: var(--ep-poll-accent);
	opacity: 0.65;
	transition: width 0.5s ease;
}

.ep-poll--bar-square .ep-poll__bar,
.ep-poll--bar-square .ep-poll__fill {
	border-radius: 0;
}

.ep-poll__row.is-choice .ep-poll__fill {
	opacity: 1;
}

.ep-poll__total {
	margin: 0.5em 0 0;
	font-size: 0.9em;
	opacity: 0.8;
}

@media (prefers-reduced-motion: reduce) {
	.ep-poll__fill {
		transition: none;
	}
}

@media (max-width: 480px) {
	.ep-poll {
		padding: 1em;
	}

	.ep-poll__rowhead {
		flex-direction: column;
		gap: 0.1em;
	}
}
