/*
 * Vehicle tax calculator (template-parts/vehicle-tax/calculator.php).
 * Loaded on that page only. Colours are the site's own: the logo red, and
 * the greys of the original stylesheet.
 */
.vt {
	--vt-red: #c00;
	--vt-red-soft: #fbeaea;
	--vt-green: #1e7e34;
	--vt-ink: #212529;
	--vt-muted: #6c757d;
	--vt-line: #dee2e6;
	--vt-wash: #f7f7fd;
	color: var(--vt-ink);
	padding-bottom: 1.5rem;
}

.vt [hidden] {
	display: none !important;
}

/* Heading */

.vt-head {
	margin: 1.25rem 0 1.25rem;
}

.vt-kicker {
	margin: 0 0 0.375rem;
	color: var(--vt-red);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.vt-title {
	margin: 0 0 0.625rem;
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1.2;
}

.vt-lead {
	margin: 0 0 0.875rem;
	font-size: 1.0625rem;
	line-height: 1.5;
	max-width: 42em;
}

.vt-status {
	position: relative;
	margin: 0;
	padding: 0.5rem 0.75rem 0.5rem 1.625rem;
	border-radius: 4px;
	background: var(--vt-wash);
	color: #495057;
	font-size: 0.875rem;
	line-height: 1.45;
}

/* Marks the line as a notice: the figures are a bill, not yet law. */
.vt-status::before {
	content: "";
	position: absolute;
	top: 0.95em;
	left: 0.75rem;
	width: 0.4375rem;
	height: 0.4375rem;
	border-radius: 50%;
	background: var(--vt-red);
}

.vt-updated {
	margin: 0.5rem 0 0;
	color: var(--vt-muted);
	font-size: 0.8125rem;
}

@media (min-width: 768px) {
	.vt-title {
		font-size: 2.125rem;
	}
}

/* Cards */

.vt-tool {
	display: grid;
	gap: 1rem;
	margin-bottom: 1rem;
}

@media (min-width: 992px) {
	.vt-tool {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		align-items: start;
	}
}

.vt-card {
	margin: 0;
	padding: 1.125rem 1rem 1.25rem;
	border: 1px solid var(--vt-line);
	border-radius: 6px;
	background: #fff;
}

@media (min-width: 576px) {
	.vt-card {
		padding: 1.25rem 1.375rem 1.5rem;
	}
}

.vt-card-title {
	margin: 0 0 1rem;
	font-size: 1.1875rem;
	font-weight: 700;
	line-height: 1.3;
}

/* Form */

.vt-field {
	margin: 0 0 1rem;
	padding: 0;
	border: 0;
	min-width: 0;
}

.vt-field > label,
.vt-field > legend {
	display: block;
	width: auto;
	margin: 0 0 0.375rem;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.3;
}

.vt-unit {
	color: var(--vt-muted);
	font-weight: 400;
}

.vt input[type="number"],
.vt select {
	display: block;
	width: 100%;
	height: 2.75rem;
	padding: 0 0.75rem;
	border: 1px solid #ced4da;
	border-radius: 4px;
	background-color: #fff;
	color: var(--vt-ink);
	font-size: 1rem;
	font-variant-numeric: tabular-nums;
}

.vt select {
	appearance: none;
	padding-right: 2.25rem;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23495057' stroke-width='1.6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.875rem center;
}

.vt input[type="number"]:focus,
.vt select:focus {
	border-color: var(--vt-red);
	outline: 2px solid rgba(204, 0, 0, 0.25);
	outline-offset: 0;
}

.vt-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	column-gap: 0.75rem;
}

.vt-row > .vt-field[data-vt-field="weight"] {
	grid-column: 1 / -1;
}

.vt-hint {
	margin: 0.375rem 0 0;
	color: var(--vt-muted);
	font-size: 0.8125rem;
	line-height: 1.4;
}

.vt-hint:empty {
	display: none;
}

.vt-form > .vt-hint {
	margin: -0.25rem 0 1rem;
}

/* Fuel choice: four buttons in a row, two by two on the narrowest phones. */
.vt-segments {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 0.375rem;
}

@media (max-width: 359.98px) {
	.vt-segments {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.vt-segment {
	position: relative;
	margin: 0;
}

.vt-segment input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.vt-segment span {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 2.5rem;
	padding: 0 0.25rem;
	border: 1px solid #ced4da;
	border-radius: 4px;
	background: #fff;
	font-size: 0.875rem;
	font-weight: 500;
	text-align: center;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.vt-segment span:hover {
	border-color: var(--vt-red);
}

.vt-segment input:checked + span {
	border-color: var(--vt-red);
	background: var(--vt-red);
	color: #fff;
}

.vt-segment input:focus-visible + span {
	outline: 2px solid var(--vt-red);
	outline-offset: 2px;
}

.vt-check {
	padding: 0.75rem;
	border-radius: 4px;
	background: var(--vt-wash);
}

.vt-check > label {
	display: flex;
	gap: 0.5rem;
	align-items: flex-start;
	margin: 0;
	font-weight: 500;
	cursor: pointer;
}

.vt-check input {
	flex: none;
	width: 1.125rem;
	height: 1.125rem;
	margin-top: 0.125rem;
	accent-color: var(--vt-red);
}

.vt-error {
	margin: 0;
	padding: 0.5rem 0.75rem;
	border-radius: 4px;
	background: var(--vt-red-soft);
	color: #8a0000;
	font-size: 0.875rem;
	font-weight: 500;
}

/* Result */

.vt-result {
	border-top: 3px solid var(--vt-red);
}

.vt-total {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25rem 0.5rem;
	margin: 0;
}

.vt-total-number {
	font-size: 2.75rem;
	font-weight: 700;
	line-height: 1.05;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.01em;
}

.vt-total-unit {
	color: var(--vt-muted);
	font-size: 1rem;
}

.vt-delta {
	min-height: 1.5em;
	margin: 0.375rem 0 1rem;
	font-size: 1rem;
	font-weight: 600;
}

.vt-delta.vt-up,
.vt-tone-up dd {
	color: var(--vt-red);
}

.vt-delta.vt-down,
.vt-tone-down dd {
	color: var(--vt-green);
}

.vt-bars {
	display: grid;
	gap: 0.5rem;
	margin: 0 0 1.25rem;
}

.vt-bar {
	display: grid;
	grid-template-columns: 2.5rem minmax(0, 1fr) auto;
	align-items: center;
	gap: 0.625rem;
	font-size: 0.875rem;
}

.vt-bar-label {
	color: var(--vt-muted);
}

.vt-bar-track {
	height: 0.625rem;
	border-radius: 999px;
	background: #f1f3f5;
	overflow: hidden;
}

.vt-bar-fill {
	display: block;
	width: 0;
	height: 100%;
	border-radius: 999px;
	transition: width 0.3s ease;
}

.vt-bar-current {
	background: #adb5bd;
}

.vt-bar-proposed {
	background: var(--vt-red);
}

.vt-bar-value {
	min-width: 6.5rem;
	font-weight: 600;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.vt-subtitle {
	margin: 1.25rem 0 0.5rem;
	font-size: 1rem;
	font-weight: 700;
}

.vt-result .vt-subtitle {
	margin-top: 0;
	color: var(--vt-muted);
	font-size: 0.8125rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.vt-lines,
.vt-notes,
.vt-changes,
.vt-sources {
	margin: 0;
	padding: 0;
	list-style: none;
}

.vt-lines li {
	display: flex;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.5rem 0;
	border-bottom: 1px dashed var(--vt-line);
	font-size: 0.875rem;
	line-height: 1.4;
}

.vt-lines strong {
	flex: none;
	font-variant-numeric: tabular-nums;
}

.vt-notes:not(:empty) {
	margin-top: 0.875rem;
}

.vt-notes li {
	position: relative;
	margin: 0 0 0.375rem;
	padding-left: 1rem;
	color: #495057;
	font-size: 0.8125rem;
	line-height: 1.45;
}

.vt-notes li::before {
	content: "";
	position: absolute;
	top: 0.5em;
	left: 0.125rem;
	width: 0.3125rem;
	height: 0.3125rem;
	border-radius: 50%;
	background: var(--vt-red);
}

/* Fuel */

.vt-fuel {
	margin-bottom: 1rem;
}

.vt-text {
	margin: 0 0 1rem;
	font-size: 0.9375rem;
	line-height: 1.55;
}

.vt-figures {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 0.5rem;
	margin: 0 0 0.75rem;
}

.vt-figures:empty {
	display: none;
}

.vt-figures div {
	padding: 0.625rem 0.75rem;
	border-radius: 4px;
	background: var(--vt-wash);
}

.vt-figures dt {
	color: var(--vt-muted);
	font-size: 0.8125rem;
	font-weight: 400;
}

.vt-figures dd {
	margin: 0.125rem 0 0;
	font-size: 1.125rem;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

@media (min-width: 768px) {
	.vt-figures {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.vt-fuel-note {
	margin: 0;
	color: #495057;
	font-size: 0.875rem;
}

/* Explanation */

.vt-section {
	margin: 2rem 0 0;
}

.vt-h2 {
	position: relative;
	max-width: fit-content;
	margin: 0 0 1rem;
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.25;
}

/* The slash after section titles, as elsewhere on the site. */
.vt-h2::after {
	content: "";
	position: absolute;
	top: 0.25rem;
	right: -0.625rem;
	width: 3px;
	height: 1rem;
	background: #f40000;
	transform: rotate(20deg);
}

.vt-changes li {
	position: relative;
	margin: 0 0 0.625rem;
	padding-left: 1.125rem;
	font-size: 0.9375rem;
	line-height: 1.55;
}

.vt-changes li::before {
	content: "";
	position: absolute;
	top: 0.6em;
	left: 0;
	width: 0.4375rem;
	height: 2px;
	background: var(--vt-red);
}

.vt-formula {
	margin: 0 0 0.875rem;
	padding: 0.75rem 1rem;
	border-radius: 4px;
	background: var(--vt-wash);
	font-weight: 600;
	text-align: center;
}

.vt-table-wrap {
	margin: 0 0 1rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.vt-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.875rem;
	font-variant-numeric: tabular-nums;
}

.vt-table caption {
	caption-side: top;
	padding: 0 0 0.5rem;
	color: var(--vt-ink);
	font-weight: 600;
	text-align: left;
}

.vt-table th,
.vt-table td {
	padding: 0.4375rem 0.5rem;
	border-bottom: 1px solid var(--vt-line);
	text-align: right;
	vertical-align: bottom;
}

.vt-table th[scope="row"],
.vt-table thead tr:first-child th:first-child {
	text-align: left;
}

.vt-table thead th {
	border-bottom-width: 2px;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.3;
}

.vt-table thead .vt-th-group {
	border-bottom-width: 1px;
	color: var(--vt-red);
	text-align: center;
}

.vt-table tbody tr:nth-child(even) {
	background: #fafafc;
}

.vt-table-compact th,
.vt-table-compact td {
	padding: 0.3125rem 0.5rem;
}

.vt-th-note {
	display: block;
	color: var(--vt-muted);
	font-size: 0.75rem;
	font-weight: 400;
}

.vt-details {
	margin: 0 0 0.75rem;
	border: 1px solid var(--vt-line);
	border-radius: 6px;
}

.vt-details summary {
	padding: 0.75rem 1rem;
	font-weight: 600;
	cursor: pointer;
}

.vt-details[open] summary {
	border-bottom: 1px solid var(--vt-line);
}

.vt-details > .vt-table-wrap,
.vt-details > .vt-hint {
	margin: 0.75rem 1rem 1rem;
}

.vt-question {
	margin: 1.25rem 0 0.375rem;
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.35;
}

.vt-faq .vt-h2 + .vt-question {
	margin-top: 0;
}

.vt-faq .vt-text {
	margin-bottom: 0;
}

.vt-sources li {
	margin: 0 0 0.5rem;
	font-size: 0.9375rem;
}

.vt-sources a {
	color: var(--vt-red);
	text-decoration: underline;
	text-underline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.vt-bar-fill,
	.vt-segment span {
		transition: none;
	}
}
