/* TML Motion
   The still hero and the page copy stay put. These rules only reserve
   scroll room and stack the Fox Meadow pair. They do nothing until the
   boot script marks the document, and nothing at all in the editor. */

html.tml-js {
  scroll-behavior: auto;
}

html.tml-js .tml-hero-laptop__still {
  animation: none;
  opacity: 1;
  transform: none;
}

.tml-hero-laptop {
  position: relative;
}

.tml-hero-seq {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.tml-hero-laptop.is-live .tml-hero-seq {
  opacity: 1;
  transition: opacity 0.35s linear;
}

.tml-hero-laptop.is-live .tml-hero-laptop__still {
  opacity: 0;
  transition: opacity 0.35s linear;
}

@media (min-width: 768px) and (min-height: 501px) and (prefers-reduced-motion: no-preference) {
  html.tml-js body.tml-laptop-on #hero:has(.tml-hero-laptop) {
    --padding-bottom: 100vh;
    --overflow: visible;
    overflow: visible;
    padding-block-end: 100vh;
  }

  html.tml-js body.tml-laptop-on .tml-laptop-stage {
    padding-bottom: 100vh;
  }

  html.tml-js body.tml-laptop-on #hero .tml-laptop-stage {
    padding-bottom: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tml-hero-seq {
    display: none;
  }
}

.tml-media-clip {
  overflow: hidden;
}

.tml-media-clip img {
  transform-origin: center center;
  will-change: transform;
}

/* Before / after. The explicit figure always stacks. The Fox Meadow pair
   stacks only while the compare setting is on, and it stacks before paint. */
.tml-compare,
body.tml-compare-on .e-con:has(> .elementor-widget-image img[data-src*="fox-before"]):has(> .elementor-widget-image img[data-src*="fox-after"]),
body.tml-compare-on .e-con:has(> .elementor-widget-image img[src*="fox-before"]):has(> .elementor-widget-image img[src*="fox-after"]) {
  --tml-wipe: 50%;
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
  width: 100%;
  max-width: 100%;
  gap: 0;
  --gap: 0px;
  margin: 0;
}

.tml-compare > img,
body.tml-compare-on .e-con:has(> .elementor-widget-image img[data-src*="fox-before"]):has(> .elementor-widget-image img[data-src*="fox-after"]) > .elementor-widget-image,
body.tml-compare-on .e-con:has(> .elementor-widget-image img[src*="fox-before"]):has(> .elementor-widget-image img[src*="fox-after"]) > .elementor-widget-image {
  grid-area: 1 / 1;
  width: 100%;
  max-width: 100%;
  margin: 0;
}

.tml-compare img,
body.tml-compare-on .e-con:has(> .elementor-widget-image img[data-src*="fox-before"]):has(> .elementor-widget-image img[data-src*="fox-after"]) img,
body.tml-compare-on .e-con:has(> .elementor-widget-image img[src*="fox-before"]):has(> .elementor-widget-image img[src*="fox-after"]) img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
}

.tml-compare__after,
body.tml-compare-on .e-con:has(> .elementor-widget-image img[data-src*="fox-after"]) > .elementor-widget-image:has(img[data-src*="fox-after"], img[src*="fox-after"]),
body.tml-compare-on .e-con:has(> .elementor-widget-image img[src*="fox-after"]) > .elementor-widget-image:has(img[data-src*="fox-after"], img[src*="fox-after"]) {
  clip-path: inset(0 0 0 var(--tml-wipe));
  z-index: 2;
}

.tml-compare__label {
  position: absolute;
  bottom: 14px;
  z-index: 3;
  margin: 0;
  font-family: Inter, "Inter Tight", system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0b1530;
  background: rgba(250, 250, 247, 0.9);
  padding: 3px 8px;
  pointer-events: none;
}

.tml-compare__label--before {
  left: 14px;
}

.tml-compare__label--after {
  right: 14px;
}

.tml-compare::after,
body.tml-compare-on .e-con:has(> .elementor-widget-image img[data-src*="fox-before"]):has(> .elementor-widget-image img[data-src*="fox-after"])::after,
body.tml-compare-on .e-con:has(> .elementor-widget-image img[src*="fox-before"]):has(> .elementor-widget-image img[src*="fox-after"])::after,
.tml-compare__line {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--tml-wipe);
  width: 1px;
  margin-left: -0.5px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(11, 21, 48, 0.2);
  z-index: 3;
  pointer-events: none;
}

body.tml-compare-on .tml-compare-live::after,
.tml-compare.tml-compare-live::after {
  content: none !important;
}

.tml-compare__knob {
  position: absolute;
  top: 50%;
  left: var(--tml-wipe);
  z-index: 4;
  width: 36px;
  height: 36px;
  margin: -18px 0 0 -18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(11, 21, 48, 0.22);
  pointer-events: none;
}

.tml-compare__knob::before,
.tml-compare__knob::after {
  content: "";
  position: absolute;
  top: 50%;
  margin-top: -4px;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
}

.tml-compare__knob::before {
  left: 10px;
  border-right: 5px solid #0b1530;
}

.tml-compare__knob::after {
  right: 10px;
  border-left: 5px solid #0b1530;
}

/* The image itself takes the mouse (the divider follows it) and horizontal
   swipes; vertical swipes still scroll the page. */
.tml-compare-live {
  cursor: ew-resize;
  touch-action: pan-y;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.tml-compare-live img {
  -webkit-user-drag: none;
}

/* Keyboard and screen readers only: it stays focusable (arrow keys) but never
   catches clicks or touches. */
.tml-compare__range {
  position: absolute;
  inset: 0;
  z-index: 5;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  appearance: none;
}

.tml-compare:focus-within .tml-compare__knob,
.tml-compare-live:focus-within .tml-compare__knob {
  box-shadow: 0 0 0 2px #1239c6, 0 1px 4px rgba(11, 21, 48, 0.22);
}

@media (prefers-reduced-motion: reduce) {
  .tml-hero-laptop.is-live .tml-hero-seq,
  .tml-hero-laptop.is-live .tml-hero-laptop__still {
    transition: none;
  }
}
