/**
 * Hales HVAC calculators — wave 1 page styles.
 *
 * Scoped to .hales-calc-* (the calculators' virtual routes add
 * .hales-hvac-calculator-route to <body>). Colors ride the site's tokens with
 * the same oklch fallbacks the AC watts page uses, so the pages stay on the
 * Hales palette even where a token is undefined while deferred CSS loads.
 */

.hales-calc-page {
	background: var(--paper, oklch(96.5% .018 82));
	color: var(--text, oklch(20% .05 255));
}

/* --- hero ------------------------------------------------------------------ */

.hales-calc-hero {
	padding: clamp(4rem, 7vw, 7rem) 0 clamp(2.5rem, 5vw, 4rem);
	background: linear-gradient(135deg, var(--ink, oklch(18% .08 260)) 0%, oklch(21% .08 264) 100%);
	color: var(--text-on-dark, oklch(94% .015 89));
}

.hales-calc-crumbs {
	display: flex;
	gap: .5rem;
	flex-wrap: wrap;
	margin-bottom: 1.5rem;
	font-size: .9rem;
	color: oklch(94% .015 89 / .78);
}

.hales-calc-crumbs a {
	color: var(--gold-bright, oklch(84% .12 84));
	text-decoration: none;
}

.hales-calc-crumbs a:hover,
.hales-calc-crumbs a:focus-visible {
	text-decoration: underline;
}

.hales-calc-eyebrow {
	text-transform: uppercase;
	letter-spacing: .12em;
	font-weight: 700;
	color: var(--gold-bright, oklch(84% .12 84));
	font-size: .82rem;
	margin: 0 0 .75rem;
}

.hales-calc-title {
	max-width: 920px;
	color: inherit;
	margin: 0 0 1rem;
	font-size: clamp(2.1rem, 4.5vw, 4rem);
	line-height: 1.02;
}

.hales-calc-intro {
	max-width: 760px;
	color: oklch(94% .015 89 / .86);
	font-size: clamp(1.05rem, 2vw, 1.25rem);
	line-height: 1.65;
	margin: 0;
}

.hales-calc-actions {
	display: flex;
	gap: 1rem;
	flex-wrap: wrap;
	margin-top: 1.5rem;
}

/* --- layout ---------------------------------------------------------------- */

.hales-calc-section {
	padding: var(--section-y, clamp(3rem, 2rem + 5vw, 6rem)) 0;
}

.hales-calc-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(280px, .55fr);
	gap: clamp(1.5rem, 4vw, 3rem);
	align-items: start;
}

.hales-calc-h2 {
	font-size: clamp(1.5rem, 3vw, 2.25rem);
	margin: 2.5rem 0 1rem;
	color: var(--ink, oklch(18% .08 260));
}

.hales-calc-body > .hales-calc-h2:first-of-type {
	margin-top: 2rem;
}

.hales-calc-body p {
	line-height: 1.65;
}

.hales-calc-answer {
	background: var(--surface, oklch(100% 0 0));
	border-left: 4px solid var(--gold-bright, oklch(84% .12 84));
	border-radius: 0 8px 8px 0;
	padding: 1.25rem 1.5rem;
	margin-bottom: 2rem;
	box-shadow: 0 8px 24px oklch(18% .08 260 / .06);
}

.hales-calc-answer p {
	margin: 0;
	font-size: 1.08rem;
	line-height: 1.65;
	color: var(--text, oklch(20% .05 255));
}

/* --- form ------------------------------------------------------------------ */

.hales-calc-form {
	background: var(--surface, oklch(100% 0 0));
	border: 1px solid var(--paper-edge, oklch(84% .02 82));
	border-radius: 8px;
	padding: clamp(1.25rem, 3vw, 2rem);
	box-shadow: 0 16px 42px oklch(18% .08 260 / .08);
}

.hales-calc-fields {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1.1rem 1.5rem;
	margin-bottom: 1.5rem;
}

.hales-calc-field {
	display: flex;
	flex-direction: column;
	gap: .35rem;
	min-width: 0;
}

.hales-calc-field label {
	font-weight: 700;
	color: var(--ink, oklch(18% .08 260));
	font-size: .95rem;
	line-height: 1.35;
}

.hales-calc-optional {
	font-weight: 500;
	font-size: .85em;
	color: oklch(45% .04 255);
}

.hales-calc-field input,
.hales-calc-field select {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid var(--paper-edge, oklch(84% .02 82));
	border-radius: 8px;
	padding: .6rem .75rem;
	font: inherit;
	color: var(--text, oklch(20% .05 255));
	background: var(--surface, oklch(100% 0 0));
	min-height: 44px;
}

.hales-calc-field input:focus-visible,
.hales-calc-field select:focus-visible {
	outline: 2px solid var(--gold-bright, oklch(84% .12 84));
	outline-offset: 1px;
	border-color: var(--gold-bright, oklch(84% .12 84));
}

.hales-calc-field input[aria-invalid="true"],
.hales-calc-field select[aria-invalid="true"] {
	border-color: #b3261e;
}

.hales-calc-help {
	margin: 0;
	font-size: .82rem;
	line-height: 1.5;
	color: oklch(45% .04 255);
}

.hales-calc-error {
	margin: 0;
	font-size: .82rem;
	line-height: 1.5;
	font-weight: 700;
	color: #b3261e;
}

.hales-calc-error[hidden] {
	display: none;
}

/* --- result ---------------------------------------------------------------- */

.hales-calc-result {
	background: oklch(97% .01 82);
	border: 1px solid var(--paper-edge, oklch(84% .02 82));
	border-left: 4px solid var(--gold-bright, oklch(84% .12 84));
	border-radius: 0 8px 8px 0;
	padding: 1.1rem 1.35rem;
	margin-bottom: 1.25rem;
}

.hales-calc-result__primary {
	margin: 0 0 .4rem;
	font-size: clamp(1.25rem, 2.4vw, 1.6rem);
	font-weight: 800;
	color: var(--ink, oklch(18% .08 260));
	line-height: 1.25;
}

.hales-calc-result__secondary {
	margin: 0 0 .6rem;
	color: var(--text, oklch(20% .05 255));
	line-height: 1.5;
}

.hales-calc-result__list {
	margin: 0;
	padding-left: 1.15rem;
}

.hales-calc-result__list li + li {
	margin-top: .4rem;
}

.hales-calc-result__list li {
	line-height: 1.55;
}

.hales-calc-result__noscript {
	margin: .75rem 0 0;
	font-size: .85rem;
	color: oklch(45% .04 255);
}

.hales-calc-submit {
	margin-top: .25rem;
}

.hales-calc-rate-note {
	font-size: .9rem;
	color: oklch(45% .04 255);
	background: oklch(97% .01 82);
	border: 1px dashed var(--paper-edge, oklch(84% .02 82));
	border-radius: 8px;
	padding: .85rem 1rem;
}

/* --- side card ------------------------------------------------------------- */

.hales-calc-side {
	background: var(--ink, oklch(18% .08 260));
	color: var(--text-on-dark, oklch(94% .015 89));
	border-radius: 8px;
	padding: clamp(1.25rem, 3vw, 1.75rem);
	position: sticky;
	top: 1.5rem;
}

.hales-calc-side h2 {
	color: inherit;
	margin: 0 0 .75rem;
	font-size: 1.25rem;
}

.hales-calc-side p {
	line-height: 1.6;
	margin: 0 0 1rem;
}

.hales-calc-side__cta {
	display: inline-block;
}

.hales-calc-side__updated {
	font-size: .8rem;
	color: oklch(94% .015 89 / .7);
	margin: 1rem 0 0;
}

/* --- faq / links ------------------------------------------------------------ */

.hales-calc-faq details {
	background: var(--surface, oklch(100% 0 0));
	border: 1px solid var(--paper-edge, oklch(84% .02 82));
	border-radius: 8px;
	padding: 1rem 1.25rem;
}

.hales-calc-faq details + details {
	margin-top: .8rem;
}

.hales-calc-faq summary {
	cursor: pointer;
	font-weight: 800;
	color: var(--ink, oklch(18% .08 260));
	line-height: 1.45;
}

.hales-calc-faq details p {
	margin: .7rem 0 0;
	line-height: 1.65;
}

.hales-calc-links {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1rem;
}

.hales-calc-link {
	display: block;
	background: var(--surface, oklch(100% 0 0));
	border: 1px solid var(--paper-edge, oklch(84% .02 82));
	border-radius: 8px;
	padding: 1rem;
	color: var(--ink, oklch(18% .08 260));
	font-weight: 700;
	text-decoration: none;
	line-height: 1.4;
}

.hales-calc-link:hover,
.hales-calc-link:focus-visible {
	border-color: var(--gold-bright, oklch(84% .12 84));
}

/* --- info bridge spacing on these routes ------------------------------------ */

.hales-calc-page .hales-info-bridge {
	max-width: 1200px;
	margin: 0 auto clamp(2rem, 4vw, 3rem);
	padding: 0 20px;
}

/* --- hub -------------------------------------------------------------------- */

.hales-calc-hub-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 1.25rem;
}

.hales-calc-hub-card {
	display: flex;
	flex-direction: column;
	gap: .6rem;
	padding: 1.5rem;
	background: var(--surface, oklch(100% 0 0));
	border: 1px solid var(--paper-edge, oklch(84% .02 82));
	border-radius: 8px;
	color: var(--ink, oklch(18% .08 260));
	text-decoration: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.hales-calc-hub-card:hover,
.hales-calc-hub-card:focus-visible {
	border-color: var(--gold-bright, oklch(84% .12 84));
	box-shadow: 0 6px 18px oklch(20% .05 255 / .08);
}

.hales-calc-hub-card h3 {
	margin: 0;
	font-size: 1.25rem;
	line-height: 1.3;
	color: var(--ink, oklch(18% .08 260));
}

.hales-calc-hub-card p {
	margin: 0;
	line-height: 1.6;
	color: var(--text-muted, oklch(35% .03 255));
}

.hales-calc-hub-card__open {
	margin-top: auto;
	padding-top: .4rem;
	font-weight: 800;
	/* Text-on-light token: --gold itself fails contrast on light grounds. */
	color: var(--gold-text-on-light, #7a4f00);
}

/* --- responsive -------------------------------------------------------------- */

@media (max-width: 900px) {
	.hales-calc-grid {
		grid-template-columns: 1fr;
	}

	.hales-calc-side {
		position: static;
	}

	.hales-calc-links {
		grid-template-columns: 1fr;
	}

	.hales-calc-fields {
		grid-template-columns: 1fr;
	}

	.hales-calc-hub-grid {
		grid-template-columns: 1fr;
	}

	.hales-calc-actions .btn {
		width: 100%;
	}
}
