/**
 * Smart Home Demo — thermostat shortcode (house + phone thermo stacks).
 */

.sht-root {
	box-sizing: border-box;
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
	padding: clamp(1rem, 3vw, 2rem);
}

.sht-root *,
.sht-root *::before,
.sht-root *::after {
	box-sizing: border-box;
}

.sht-stage {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(200px, 0.4fr);
	align-items: center;
	gap: clamp(0.75rem, 2.2vw, 1.75rem);
}

@media (max-width: 700px) {
	.sht-stage {
		grid-template-columns: 1fr;
		justify-items: center;
	}
}

/* House 1248×832 */
.sht-house {
	position: relative;
	width: 100%;
	max-width: min(640px, 100%);
	justify-self: end;
	aspect-ratio: 1248 / 832;
}

@media (max-width: 700px) {
	.sht-house {
		justify-self: center;
	}
}

.sht-house__img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

.sht-house__layers {
	position: absolute;
	inset: 0;
	pointer-events: none;
	border-radius: 12px;
	overflow: hidden;
}

.sht-ho {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: fill;
	display: block;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.sht-root[data-sht-temp="1"] .sht-ho--plus-1,
.sht-root[data-sht-temp="2"] .sht-ho--plus-2,
.sht-root[data-sht-temp="3"] .sht-ho--plus-3,
.sht-root[data-sht-temp="-1"] .sht-ho--minus-1,
.sht-root[data-sht-temp="-2"] .sht-ho--minus-2,
.sht-root[data-sht-temp="-3"] .sht-ho--minus-3 {
	opacity: 1;
}

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

/* Phone 782×1558 — avoid filter on this wrapper: opacity changes on overlays would re-rasterize the whole subtree (blink). */
.sht-phone {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: clamp(200px, 26vw, 270px);
	justify-self: start;
}

@media (max-width: 700px) {
	.sht-phone {
		justify-self: center;
		max-width: min(270px, 78vw);
		margin-top: 0.75rem;
	}
}

.sht-phone__bezel {
	padding: 10px;
	border-radius: 36px;
	background: linear-gradient(145deg, #2a2a2e, #0e0e10);
	box-shadow:
		0 16px 32px rgba(0, 0, 0, 0.45),
		inset 0 1px 0 rgba(255, 255, 255, 0.06),
		inset 0 -1px 0 rgba(0, 0, 0, 0.5);
}

.sht-phone__screen {
	position: relative;
	border-radius: 28px;
	overflow: hidden;
	background: #000;
}

.sht-phone__stack {
	position: relative;
	width: 100%;
	aspect-ratio: 782 / 1558;
	transform: translateZ(0);
}

.sht-phone__base {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: fill;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}

.sht-phone__layers {
	position: absolute;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
	border-radius: inherit;
}

.sht-po {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: fill;
	display: block;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.12s ease;
}

.sht-root[data-sht-temp="1"] .sht-po--plus-1,
.sht-root[data-sht-temp="2"] .sht-po--plus-2,
.sht-root[data-sht-temp="3"] .sht-po--plus-3,
.sht-root[data-sht-temp="-1"] .sht-po--minus-1,
.sht-root[data-sht-temp="-2"] .sht-po--minus-2,
.sht-root[data-sht-temp="-3"] .sht-po--minus-3 {
	opacity: 1;
}

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

.sht-phone__hotspots {
	position: absolute;
	inset: 0;
	z-index: 3;
	pointer-events: none;
	border-radius: inherit;
	isolation: isolate;
}

.sht-phone__hotspots .sht-btn {
	pointer-events: auto;
}

.sht-btn {
	position: absolute;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	z-index: 10;
}

.sht-btn:focus {
	outline: none;
}

.sht-btn:focus-visible {
	outline: 3px solid #6cb3ff;
	outline-offset: 2px;
	border-radius: 8px;
	z-index: 20;
}

/* Minus / plus — adjust % to match phone_thermo_bgnd art */
.sht-btn--minus {
	top: 80%;
	left: 40%;
	width: 10%;
	height: 12%;
}

.sht-btn--plus {
	top: 80%;
	left: 55%;
	width: 10%;
	height: 12%;
}

.sht-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}
