/*
 * MHI Energy & Unit Calculators - shared styles
 */

.mhi-calc {
	box-sizing: border-box;
	max-width: 900px;
	margin: 1.5em 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.5;
	color: #222;
}

.mhi-calc *,
.mhi-calc *::before,
.mhi-calc *::after {
	box-sizing: inherit;
}

.mhi-calc__title {
	margin: 0 0 0.75em;
	padding: 0.5em 0.75em;
	background: #222;
	color: #fff;
	font-size: 1.1em;
	font-weight: bold;
	text-align: center;
	border-radius: 4px 4px 0 0;
}

.mhi-calc__body {
	padding: 1em;
	background: #f5f5f5;
	border: 1px solid #ddd;
	border-radius: 0 0 4px 4px;
}

.mhi-calc__note {
	margin-top: 1em;
	font-size: 0.85em;
	color: #555;
}

.mhi-calc__note strong {
	color: #c00;
}

/* Unit converter */

.mhi-uc__row {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5em;
	justify-content: center;
	margin-bottom: 1em;
}

.mhi-uc__field {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.mhi-uc__field label {
	margin-bottom: 0.35em;
	font-weight: bold;
}

.mhi-uc__field select {
	min-width: 220px;
}

.mhi-uc__what {
	width: 140px;
	text-align: center;
}

.mhi-uc__actions {
	text-align: center;
	margin-bottom: 1em;
}

.mhi-uc__answer {
	display: block;
	width: 100%;
	max-width: 640px;
	margin: 0 auto;
	text-align: center;
	font-weight: bold;
	background: #fff;
}

/* Energy / power calculator */

.mhi-epc table {
	width: 100%;
	border-collapse: collapse;
	background: #fff;
	margin-bottom: 1.25em;
}

.mhi-epc caption {
	caption-side: top;
	text-align: left;
	font-weight: bold;
	padding: 0.35em 0;
}

.mhi-epc th,
.mhi-epc td {
	border: 1px solid #ccc;
	padding: 0.6em;
	vertical-align: middle;
	text-align: left;
}

.mhi-epc thead th {
	background: #ddb92b;
	text-align: center;
}

.mhi-epc thead th .mhi-epc__subhead {
	display: block;
	font-weight: normal;
	font-size: 0.8em;
	margin-top: 0.25em;
}

.mhi-epc__group-label {
	background: #ddb92b;
	font-weight: bold;
	white-space: nowrap;
	text-align: center;
}

.mhi-epc__time-cell {
	text-align: center;
}

.mhi-epc__power-cell {
	text-align: center;
}

.mhi-epc input[type="text"],
.mhi-epc input[type="number"] {
	width: 6.5em;
}

.mhi-epc__time-cell input[type="text"] {
	width: 3em;
}

.mhi-epc__sun-row {
	text-align: center;
}

.mhi-epc__sun-row input[type="text"] {
	width: 4em;
}

.mhi-epc__help {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.6em;
	height: 1.6em;
	margin-right: 0.5em;
	border-radius: 50%;
	border: 1px solid #999;
	background: #fff;
	font-weight: bold;
	cursor: pointer;
	vertical-align: middle;
}

.mhi-epc__help:hover {
	background: #eee;
}

.mhi-epc__help-text {
	display: none;
	margin-top: 0.5em;
	padding: 0.6em 0.8em;
	background: #fffbe6;
	border: 1px solid #e6d68a;
	border-radius: 3px;
	font-size: 0.9em;
}

.mhi-epc__help-text.is-open {
	display: block;
}

.mhi-epc__reset-row {
	text-align: center;
	padding: 0.75em;
}

.mhi-epc__reset-row .button {
	margin-left: 0.5em;
}

@media (max-width: 600px) {
	.mhi-uc__row {
		flex-direction: column;
		align-items: center;
	}

	.mhi-epc th,
	.mhi-epc td {
		padding: 0.4em;
	}
}
