/* "Your house, before and after": three house sizes, one straight line to drag, a note that goes into the quote.
   Self-contained: this file, house.js and the <section class="house"> markup lift out together. */
.house .house-grid { display: grid; gap: 1.6rem; }
@media (min-width: 1000px) { .house .house-grid { grid-template-columns: 1.55fr 1fr; gap: 3.5rem; align-items: start; } }

.house-tabs { display: flex; gap: 0; border: 2px solid var(--ink); margin: 0 0 1rem; padding: 0; }
.house-tabs legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.house-tabs label { flex: 1; position: relative; }
.house-tabs label + label { border-left: 2px solid var(--ink); }
.house-tabs input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.house-tabs span {
  display: flex; align-items: center; justify-content: center; text-align: center; min-height: 48px; padding: .4rem .5rem;
  font: 700 .875rem/1.15 var(--sans); transition: background-color .25s, color .25s;
}
.house-tabs input:checked + span { background: var(--ink); color: var(--gold); }
.house-tabs input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.no-js .house-tabs { display: none; }

/* the comparison: the "after" picture underneath, the "before" laid over it and cut back to the line */
.compare { position: relative; margin: 0; --pos: 50%; background: var(--ink); touch-action: pan-y; user-select: none; }
.compare .frame { position: relative; aspect-ratio: 80 / 51; overflow: hidden; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.compare .before { clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare .line {
  position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--gold);
  box-shadow: 0 0 0 1px rgba(36, 35, 42, .35); pointer-events: none;
}
.compare .knob {
  position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; margin: -23px 0 0 -23px; background: var(--gold);
  display: grid; place-items: center; color: var(--ink); box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
}
.compare .knob svg { width: 26px; height: 26px; }
.compare .tag {
  position: absolute; top: .7rem; padding: .35rem .55rem; background: rgba(36, 35, 42, .82); color: var(--on-ink);
  font: 600 .625rem/1 var(--sans); letter-spacing: .2em; text-transform: uppercase; pointer-events: none;
}
.compare .tag.b { left: .7rem; }
.compare .tag.a { right: .7rem; background: var(--gold); color: var(--ink); }
.compare input[type="range"] {
  position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none;
}
.compare input[type="range"]:focus-visible ~ .line .knob { outline: 3px solid var(--ink); outline-offset: 3px; }
.compare figcaption { padding: .7rem .1rem 0; font-size: .85rem; color: var(--ink); background: var(--gold); }
.no-js .compare input[type="range"] { display: none; }

/* what sets the price, in their own words, and the note it makes */
.house .factors { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; padding: 0; margin: .5rem 0 .9rem; }
.house .factors li { border: 1px solid var(--ink); padding: .35rem .65rem; font: 600 .8125rem/1.2 var(--sans); }
.house .ask { border: 0; padding: 0; margin: 0 0 .8rem; }
.house .ask legend { font: 600 .6875rem/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; margin-bottom: .5rem; }
.house .ask .opts { display: flex; flex-wrap: wrap; gap: .4rem; }
.house .ask label { position: relative; }
.house .ask input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.house .ask span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .95rem; border: 2px solid var(--ink); font-weight: 600; font-size: .95rem; }
.house .ask input:checked + span { background: var(--ink); color: var(--gold); }
.house .ask input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 3px; }
.house .note {
  display: block; margin: .4rem 0 1rem; padding: .8rem .9rem; background: var(--ink); color: var(--on-ink); font-size: .98rem;
  border-left: 4px solid var(--on-ink);
}
.house .note b { display: block; font: 600 .625rem/1.4 var(--sans); letter-spacing: .2em; text-transform: uppercase; color: var(--gold); margin-bottom: .2rem; }

@media (max-width: 999px) { .house .band-head .cut { display: none; } .house .band-head .lede { margin: .6rem 0 0; } .house-tabs { margin-bottom: .7rem; } }
.house .factors-line { margin: .4rem 0 1rem; }
