/* Skawen Residential airflow animation, see inc/skawen-residential-flow.php */
.skw-rf {
	--rf-air-in: #ff8a1f; --rf-air-out: #2ec4b6; --rf-brine: #ffb703; --rf-brine-ret: #48cae4;
	--rf-ref: #b15cff; --rf-heat: #e63946; --rf-ret: #3a86ff; --rf-bypass: #f1f5f7;
	position: relative; color: var(--skw-navy, #252d44); margin: 0;
}
.skw-rf .screen-reader-text { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skw-rf *, .skw-rf *::before, .skw-rf *::after { box-sizing: border-box; }

/* picture + drawing: the svg uses the coordinates of the 5504 x 3072 picture */
.skw-rf__view { position: relative; width: 100%; aspect-ratio: 5504 / 3072; overflow: hidden; background: var(--skw-surface-blue, #eef1f6); }
.skw-rf__stage { position: absolute; left: 0; top: 0; width: 100%; height: 100%; }
.skw-rf__stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; max-width: none; }
.skw-rf__stage svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }

.skw-rf .base { fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: .28; }
.skw-rf .flow { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 46 64; animation: skw-rf-dash 1.6s linear infinite; filter: url(#skw-rf-glow); }
.skw-rf .inside { stroke-dasharray: 22 40; opacity: .9; }
.skw-rf .slow { animation-duration: 2.4s; }
.skw-rf .main { stroke-dasharray: 72 38; }
.skw-rf .air { stroke-dasharray: 90 70; animation-duration: 1.3s; }
.skw-rf .pipe-arrow { fill: #fff; opacity: .95; filter: url(#skw-rf-glow); }
.skw-rf .ref-dot { filter: url(#skw-rf-glow); }
.skw-rf [data-flow="heat"] .base, .skw-rf [data-flow="ret"] .base { opacity: .45; }
.skw-rf .coil { fill: none; stroke-width: 12; opacity: 0; stroke: var(--rf-air-in); animation: skw-rf-pulse 2.4s ease-in-out infinite; }
@keyframes skw-rf-dash { to { stroke-dashoffset: -110; } }
@keyframes skw-rf-pulse { 0%, 100% { opacity: 0; } 50% { opacity: .7; } }

.skw-rf svg [data-flow] { transition: opacity .35s; }
.skw-rf svg [data-flow="bypass"] { opacity: 0; }
.skw-rf.is-bypass svg [data-flow="bypass"] { opacity: 1; }
.skw-rf.is-bypass [data-rec] { opacity: .08; }
.skw-rf.is-bypass .coil { animation: none; opacity: 0; }
.skw-rf.is-focus svg [data-flow] { opacity: .12; }
.skw-rf.is-focus svg [data-flow].is-on { opacity: 1; }

/* numbered markers, same colours as the theme hotspot markers */
.skw-rf__hs { position: absolute; transform: translate(-50%, -50%); width: 32px; height: 32px; margin: 0; padding: 0; border: 0; border-radius: 50%;
	background: var(--skw-accent-soft, #badef8); color: var(--skw-navy, #252d44); font: 600 14px/32px var(--skw-font-sans, sans-serif); text-align: center; cursor: pointer;
	box-shadow: 0 0 0 5px rgba(186, 222, 248, .35), 0 2px 8px rgba(0, 0, 0, .25); transition: background-color .15s ease, color .15s ease; }
.skw-rf__hs:hover, .skw-rf__hs[aria-expanded="true"] { background: var(--skw-navy, #252d44); color: #fff; }
.skw-rf__hs:focus-visible { outline: 2px solid var(--skw-accent, #90caf9); outline-offset: 3px; }

/* explanation: a tooltip over the picture on wide screens, a panel under it on phones */
.skw-rf__tip { position: absolute; z-index: 3; width: 280px; max-width: calc(100% - 16px); background: var(--skw-navy-deep, #1a2338); color: var(--skw-on-dark-body, #e6e9ef);
	padding: 14px 16px; font-size: 14px; line-height: 1.5; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); pointer-events: none; opacity: 0; transition: opacity .2s; }
.skw-rf__tip.is-show { opacity: 1; }
.skw-rf__tip b { display: block; margin-bottom: 4px; font-weight: 600; color: #fff; }
.skw-rf__tip span { display: block; }
.skw-rf__tip span + span { margin-top: 8px; }
.skw-rf__tip.is-long { width: 400px; }

/* controls */
.skw-rf__controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; margin-top: 24px; }
.skw-rf__mode { display: inline-flex; border: 1px solid var(--skw-navy, #252d44); }
.skw-rf__mode button { min-width: 0; height: 44px; text-transform: none; white-space: nowrap; margin: 0; border: 0; border-radius: 0; background: transparent; padding: 0 18px; font: inherit; font-size: 14px; letter-spacing: 0; color: var(--skw-navy, #252d44); cursor: pointer; transition: background-color .15s ease, color .15s ease; }
.skw-rf__mode button[aria-pressed="true"] { background: var(--skw-navy, #252d44); color: #fff; }
.skw-rf__mode button:focus-visible { outline: 2px solid var(--skw-accent, #90caf9); outline-offset: 2px; }
.skw-rf__legend { display: flex; flex-wrap: wrap; gap: 4px 22px; margin: 0; padding: 0; list-style: none; }
.skw-rf__legend li { margin: 0; padding: 0; list-style: none; }
.skw-rf__legend li::before { content: none; display: none; }
.skw-rf__legend button { text-transform: none; letter-spacing: 0; display: flex; align-items: center; gap: 8px; min-height: 32px; margin: 0; padding: 0; border: 0; background: none; font: inherit; font-size: 14px; line-height: 1.3; color: var(--skw-navy, #252d44); cursor: pointer; }
.skw-rf__legend button[aria-pressed="true"] { font-weight: 600; text-decoration: underline; text-underline-offset: 4px; }
.skw-rf__legend button:focus-visible { outline: 2px solid var(--skw-accent, #90caf9); outline-offset: 2px; }
.skw-rf__legend i { display: inline-block; width: 26px; height: 4px; flex: none; }
.skw-rf__legend i.is-bypass { background: repeating-linear-gradient(90deg, #9aa9b2 0 6px, transparent 6px 10px); }

/* phones: crop to the unit (x 100-4300, y 560-3072 of the picture) so the markers stay big enough */
@media (max-width: 767px) {
	.skw-rf__view { aspect-ratio: 4200 / 2512; }
	.skw-rf__stage { left: -2.381%; top: -22.293%; width: 131.048%; height: 122.293%; }
	.skw-rf__hs { width: 26px; height: 26px; font-size: 12px; line-height: 26px; box-shadow: 0 0 0 3px rgba(186, 222, 248, .35), 0 2px 6px rgba(0, 0, 0, .25); }
	.skw-rf__tip, .skw-rf__tip.is-long { position: static; width: auto; max-width: none; box-shadow: none; display: none; }
	.skw-rf__tip.is-show { display: block; margin-top: 12px; }
	.skw-rf__controls { margin-top: 16px; }
	.skw-rf__mode { display: grid; grid-template-columns: minmax(max-content, 1fr) 1fr; width: 100%; }
	.skw-rf__mode button { height: auto; min-height: 44px; padding: 8px 10px; white-space: normal; line-height: 1.2; }
	.skw-rf__legend { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 16px; }
	.skw-rf__legend button { font-size: 13px; text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
	.skw-rf .flow { animation: none; stroke-dasharray: none; opacity: .85; }
	.skw-rf .coil { animation: none; }
	.skw-rf .ref-dot, .skw-rf .pipe-arrow { display: none; }
}
