/* "Your block": choose how much the land falls; a model of the block tilts to match and one of their real homes
   built on ground like it sits beside it. Works with no script (radio buttons and :has); block.js adds a slider
   that tilts the land smoothly and a note for the enquiry form. Lift out: this file, block.js, the section. */

.bt { --bt-ease: cubic-bezier(.2, .7, .2, 1); }
.bt-pick { position: relative; border: 0; padding: 0; margin: 0 0 1.4rem; display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; }
.bt-pick input { position: absolute; left: 0; top: 0; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.bt-pick label { display: grid; gap: .45rem; justify-items: center; padding: .7rem .3rem .65rem; border: 1px solid var(--line, #e4e0d7); border-radius: 12px; font-size: .8125rem; font-weight: 600; line-height: 1.15; text-align: center; cursor: pointer; transition: background-color .25s, color .25s, border-color .25s; }
.bt-pick label svg { width: 40px; height: 18px; }
.bt-pick label svg path { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.bt-pick input:checked + label { background: var(--ink, #191b18); color: #fff; border-color: var(--ink, #191b18); }
.bt-pick input:focus-visible + label { outline: 2px solid var(--mint-deep, #2b6b53); outline-offset: 2px; }

.bt-stage { position: relative; }
/* on a phone their photo sits over the corner of the model, so both fit one screen */
@media (max-width: 959px) {
  .bt-stage { gap: 0; }
  .bt-left { display: contents; }
  .bt-right { display: contents; }
  .bt-model { order: 1; }
  .bt-stage .bt-built { order: 2; width: 54%; margin: -20% 0 0 auto; position: relative; z-index: 2; }
  .bt-slide { order: 3; }
  .bt-read { order: 4; }
  .bt-built .bt-pics { clip-path: none; box-shadow: 0 0 0 4px var(--paper, #fff), 0 12px 30px rgba(25, 27, 24, .16); }
  .bt-built .bt-cap { text-align: right; margin-top: .5rem; }
  .bt-built .bt-tag { left: .45rem; bottom: .45rem; font-size: .5625rem; padding: .35rem .4rem; }
}
.bt-fig { margin: 0; }
.bt-pics { position: relative; overflow: hidden; background: var(--paper-2, #f6f4ef); }
.bt-model .bt-pics { aspect-ratio: 4 / 3; }
.bt-built .bt-pics { aspect-ratio: 3 / 2; clip-path: polygon(0 var(--fall, 7%), 100% 0, 100% 100%, 0 100%); }
.bt-pics img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s var(--bt-ease); }
.bt-built .bt-cap { display: none; }
.bt-tag { position: absolute; left: .7rem; top: .7rem; z-index: 2; font: 600 .625rem/1 var(--sans, system-ui); letter-spacing: .2em; text-transform: uppercase; background: rgba(255, 255, 255, .85); color: var(--ink-2, #4a4d47); padding: .45rem .55rem; border-radius: 3px; }
.bt-built .bt-tag { top: auto; bottom: .7rem; }

/* which view shows: the checked radio decides */
.bt:has(#fall-flat:checked) [data-k="flat"],
.bt:has(#fall-gentle:checked) [data-k="gentle"],
.bt:has(#fall-moderate:checked) [data-k="moderate"],
.bt:has(#fall-steep:checked) [data-k="steep"] { opacity: 1; }
.bt-read [data-k], .bt-built .bt-cap[data-k] { display: none; }
.bt:has(#fall-flat:checked) .bt-read [data-k="flat"],
.bt:has(#fall-gentle:checked) .bt-read [data-k="gentle"],
.bt:has(#fall-moderate:checked) .bt-read [data-k="moderate"],
.bt:has(#fall-steep:checked) .bt-read [data-k="steep"],
.bt:has(#fall-flat:checked) .bt-cap[data-k="flat"],
.bt:has(#fall-gentle:checked) .bt-cap[data-k="gentle"],
.bt:has(#fall-moderate:checked) .bt-cap[data-k="moderate"],
.bt:has(#fall-steep:checked) .bt-cap[data-k="steep"] { display: block; }
/* while the slider is being dragged, the script sets each picture's opacity itself */
.bt.is-scrub .bt-pics img { transition: none; }

/* the slider: a line that tilts with the land */
.bt-slide { display: none; margin: 1.1rem 0 .4rem; }
.bt.has-js .bt-slide { display: block; }
.bt-slide label { display: flex; justify-content: space-between; font: 600 .6875rem/1.3 var(--sans, system-ui); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3, #6b6e66); margin-bottom: .5rem; }
.bt-range { -webkit-appearance: none; appearance: none; width: 100%; height: 44px; background: transparent; margin: 0; cursor: grab; touch-action: pan-y; }
.bt-range:active { cursor: grabbing; }
.bt-range::-webkit-slider-runnable-track { height: 2px; background: linear-gradient(90deg, var(--mint-deep, #2b6b53) var(--p, 100%), var(--line, #e4e0d7) var(--p, 100%)); }
.bt-range::-moz-range-track { height: 2px; background: var(--line, #e4e0d7); }
.bt-range::-moz-range-progress { height: 2px; background: var(--mint-deep, #2b6b53); }
.bt-range::-webkit-slider-thumb { -webkit-appearance: none; width: 30px; height: 30px; margin-top: -14px; border-radius: 50%; background: var(--paper, #fff); border: 2px solid var(--ink, #191b18); box-shadow: 0 3px 10px rgba(0, 0, 0, .12); transform: rotate(var(--tilt, 0deg)); }
.bt-range::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--paper, #fff); border: 2px solid var(--ink, #191b18); }
.bt-range:focus-visible { outline: none; }
.bt-range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--mint-deep, #2b6b53); outline-offset: 3px; }

.bt-read { margin-top: .6rem; }
.bt-read h3 { font-size: clamp(1.7rem, 5vw, 2.5rem); margin: 0 0 .5rem; }
.bt-read p { color: var(--ink-2, #4a4d47); max-width: 34em; }
.bt-note { display: inline-flex; align-items: center; gap: .55rem; min-height: 46px; padding: .65rem 1.1rem; border-radius: 999px; border: 1px solid var(--ink, #191b18); background: transparent; font-weight: 600; font-size: .95rem; cursor: pointer; transition: background-color .25s, color .25s; }
.bt-note:hover { background: var(--ink, #191b18); color: #fff; }
.bt-note svg { width: 1em; height: 1em; }
.bt-note[aria-pressed="true"] { background: var(--mint-wash, #e9f3ee); border-color: var(--mint-deep, #2b6b53); color: var(--mint-deeper, #1f5340); }
.bt-fine { font-size: .8125rem; color: var(--ink-3, #6b6e66); margin-top: 1.2rem; max-width: 38em; }

@media (min-width: 960px) {
  .bt-pick { grid-template-columns: repeat(4, auto); justify-content: start; gap: .5rem; }
  .bt-pick label { grid-auto-flow: column; padding: .7rem 1.1rem; border-radius: 999px; font-size: .9rem; }
  .bt-right { display: flex; flex-direction: column; justify-content: flex-end; }
  .bt-read { margin-top: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) { .bt-pics img { transition: none; } }
