/*
 * Copyright 2020-Present Titan Informatics LLC. All Rights Reserved.
 *
 * Proprietary and Confidential.
 * Author: Titan Informatics Team
 *
 * This source code is the exclusive property of Titan Informatics LLC.
 * Unauthorized use, reproduction, disclosure, or distribution without written permission is strictly prohibited.
 */
[data-type="poll"] {
	width: 100%;
	min-height: auto;
	height: auto;
	display: flex;
	flex-direction: column;
}
[data-type="poll"] h2,
[data-type="poll"] h3 {
	font-size: 1.063rem;
	line-height: 1.438rem;
	padding: unset;
}
[data-type="poll"] h2 {
	font-weight: 400;
}
[data-type="poll"] h2::before,
[data-type="poll"] h2::after {
	font-size: 1.125rem;
	font-weight: 600;
}
[data-type="poll"] h2::before {content: "Quick Fact: “";}
[data-type="poll"] h2::after {content: "”";}
[data-type="poll"] h2::first-letter {
	text-transform: capitalize;
}
[data-type="poll"] h3 {
	font-weight: 600;
	padding: 10px;
}
[data-type="poll"] ul {
	display: flex;
	flex-wrap: wrap;
	gap: 2.5px;
	height: 100%;
}
[data-type="poll"] ul::after {
	content: attr(data-total) " votes";
	display: block;
	width: 100%;
	margin-top: 10px;
	margin-left: auto;
	text-align: right;
}
[data-type="poll"] li {
	position: relative; /* needed for absolute ::after */
	width: 100%;
	padding: 8.5px 40px 8.5px 8px;
	display: flex;
	align-items: center;
	transition: 0.1s;
	border: var(--border-transparent);
	cursor: pointer;
	z-index: 1;
}
[data-type="poll"] li:hover {
	background: var(--background-hover);
	border: var(--border);
}
[data-type="poll"] li::before {
	content: "\f111";
	font-family: "Font Awesome 6 Sharp";
	font-size: 1.5rem;
	line-height: 1.313rem;
	font-weight: 400;
	margin-right: 7.5px;
}
[data-type="poll"] li.selected {
	color: var(--3285D7);
}
[data-type="poll"] li.selected.pulse {
	animation: pulse 0.5s ease-out;
}
[data-type="poll"] li.selected::before {
	content: "\f192";
}
[data-type="poll"] li::after {
	content: attr(data-percent) "%";
	width: calc(100% - 40px);
	padding: 0 10px 0 0;
	margin: 0 0 0 40px;
	position: absolute;
	inset: 0;

	display: flex;
	align-items: center;
	justify-content: flex-end;

	background: linear-gradient(
		to right,
		var(--text-color-1) 0%,
		var(--text-color-1) var(--percent),
		transparent var(--percent),
		transparent 100%
	) bottom / 100% 5px no-repeat;

	pointer-events: none;
	z-index: -1;
}
[data-type="poll"] li:not([style*="--percent"])::after {
	content: "";
	background: unset;
}
[data-type="poll"] li.selected::after {
	background: linear-gradient(
		to right,
		var(--3285D7) 0%,
		var(--3285D7) var(--percent),
		transparent var(--percent),
		transparent 100%
	) bottom / 100% 5px no-repeat;
}
[data-error="poll"] {
	width: calc(100% - 50px);
	margin: 0 25px;
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	text-align: center;
	z-index: 1;
}
