/* Lane w-listing: the listing page's photo viewer, Compare slider, video slide, and the price in the phone's Call and
   Email bar (w-listing.js and w-listing.php). Motion uses transform and opacity only, and stops under reduced motion. */

/* ---------- The full-screen photo viewer ---------- */

/* It covers the page on the brochure map viewer's deep navy (g-docs.css): Compare, Zoom, and Close at the top, the
   photo, then its caption with Previous, the count, and Next, and the thumbnails at the foot. The page behind it
   doesn't scroll while it's open. */
html.gl-w-viewing, html.gl-w-viewing body { overflow: hidden; }
body .gl-w-viewer {
  position: fixed;
  inset: 0;
  z-index: 100001;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  overflow: hidden;
  overscroll-behavior: contain;
  background: var(--gl-navy-deep);
  color: #fff;
  font-family: var(--gl-sans);
}
body .gl-w-viewer[open] { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) auto auto; }
body .gl-w-viewer::backdrop { background: transparent; }
body .gl-w-viewer [hidden] { display: none !important; }
@media (prefers-reduced-motion: no-preference) {
  body .gl-w-viewer[open] { animation: gl-w-in 220ms cubic-bezier(.23, 1, .32, 1); }
  body .gl-w-viewer[open] .gl-w-v-stage { animation: gl-w-rise 240ms cubic-bezier(.23, 1, .32, 1); }
  body .gl-w-viewer.is-closing { opacity: 0; transition: opacity 160ms cubic-bezier(.23, 1, .32, 1); }
}
@keyframes gl-w-in { from { opacity: 0; } }
@keyframes gl-w-rise { from { opacity: 0; transform: scale(.97); } }

body .gl-w-v-top {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 8px max(8px, env(safe-area-inset-left));
}
body .gl-w-v-stage { position: relative; overflow: hidden; touch-action: none; user-select: none; -webkit-user-select: none; }
body .gl-w-v-rail { position: absolute; inset: 0; will-change: transform; }
body .gl-w-v-panel { position: absolute; inset: 0 16px; overflow: hidden; }
body .gl-w-viewer .gl-w-v-panel img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: contain;
  transform-origin: 50% 50%;
  cursor: zoom-in;
  -webkit-user-drag: none;
}
body .gl-w-viewer.is-zoomed .gl-w-v-panel img { cursor: grab; }
body .gl-w-viewer.is-zoomed .gl-w-v-panel img:active { cursor: grabbing; }

body .gl-w-v-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
  min-height: 44px;
  padding: 10px max(16px, env(safe-area-inset-right)) 8px max(16px, env(safe-area-inset-left));
}
body .gl-w-viewer .gl-w-v-cap { flex: 1 1 300px; min-width: 0; margin: 0; color: #fff; font-size: 17px; font-weight: 600; line-height: 1.35; }
body .gl-w-v-nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
body .gl-w-viewer .gl-w-v-count {
  min-width: 4.5em;
  margin: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  font-variant-numeric: tabular-nums lining-nums;
  text-align: center;
}
body .gl-w-viewer .gl-w-v-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, .45);
  border-radius: var(--gl-radius);
  background: none;
  box-shadow: none;
  color: #fff;
  font-family: var(--gl-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: background-color var(--gl-fast);
}
body .gl-w-viewer .gl-w-v-top .gl-w-v-btn { border-color: transparent; }
body .gl-w-viewer .gl-w-v-top .gl-w-v-btn[aria-pressed="true"] { border-color: #fff; }
body .gl-w-viewer .gl-i { width: 20px; height: 20px; margin: 0; color: currentColor; }
body .gl-w-viewer :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* The thumbnails: one row that scrolls sideways, the current one framed in white. */
body .gl-w-v-thumbs {
  display: flex;
  gap: 6px;
  padding: 0 max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}
body .gl-w-v-thumbs::-webkit-scrollbar { display: none; }
body .gl-w-viewer .gl-w-v-thumb {
  position: relative;
  flex: none;
  width: 72px;
  height: 48px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: var(--gl-radius);
  overflow: hidden;
  background: rgba(255, 255, 255, .1);
  box-shadow: none;
  opacity: .72;
  cursor: pointer;
  transition: opacity var(--gl-fast);
}
body .gl-w-viewer .gl-w-v-thumb img { display: block; width: 100%; height: 100%; max-width: none; margin: 0; object-fit: cover; }
body .gl-w-viewer .gl-w-v-thumb::after { content: ""; position: absolute; inset: 0; border: 2px solid transparent; border-radius: var(--gl-radius); }
body .gl-w-viewer .gl-w-v-thumb.is-current { opacity: 1; }
body .gl-w-viewer .gl-w-v-thumb.is-current::after { border-color: #fff; }
@media (hover: hover) and (pointer: fine) {
  body .gl-w-viewer .gl-w-v-btn:hover { background: rgba(255, 255, 255, .12); }
  body .gl-w-viewer .gl-w-v-thumb:hover { opacity: 1; }
}
@media (max-width: 699px) {
  body .gl-w-v-nav { flex: 1 1 100%; justify-content: space-between; }
  body .gl-w-viewer .gl-w-v-cap { font-size: 16px; }
  body .gl-w-v-panel { inset: 0; }
}
/* A short window, such as a phone on its side, keeps the photo large: no thumbnails. */
@media (max-height: 500px) {
  body .gl-w-v-thumbs { display: none; }
  body .gl-w-v-foot { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
}
@media (max-width: 359px) {
  body .gl-w-v-nav { gap: 6px; }
  body .gl-w-viewer .gl-w-v-nav .gl-w-v-btn { gap: 4px; padding: 0 8px; }
  body .gl-w-viewer .gl-w-v-count { min-width: 0; }
  body .gl-w-viewer .gl-w-v-top .gl-w-v-btn { padding: 0 10px; }
}

/* ---------- Compare ---------- */

body .gl-w-cmp { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
body .gl-w-cmp-box { position: relative; overflow: hidden; border-radius: var(--gl-radius); touch-action: none; cursor: ew-resize; }
body .gl-w-viewer .gl-w-cmp-img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  object-fit: cover;
  pointer-events: none;
  -webkit-user-drag: none;
}
body .gl-w-cmp-line { position: absolute; top: 0; bottom: 0; left: -1px; width: 2px; background: #fff; pointer-events: none; }
body .gl-w-cmp-handle {
  position: absolute;
  top: 50%;
  left: -22px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 2px solid #fff;
  border-radius: var(--gl-radius);
  background: var(--gl-navy);
  color: #fff;
  cursor: ew-resize;
}
body .gl-w-viewer .gl-w-cmp-handle .gl-i { width: 22px; height: 22px; }
body .gl-w-cmp-label {
  position: absolute;
  top: 10px;
  padding: 4px 8px;
  border-radius: var(--gl-radius);
  background: var(--gl-navy-deep);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  pointer-events: none;
}
body .gl-w-cmp-label--a { left: 10px; }
body .gl-w-cmp-label--b { right: 10px; }

/* ---------- On the listing page ---------- */

/* "Compare" on the gallery's photo while it shows one of a pair, on the upper right, clear of the flag, the Pause
   button, and the count. */
body .gl-gal .gl-w-chip {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 1px solid var(--gl-navy);
  border-radius: var(--gl-radius);
  background: #fff;
  color: var(--gl-navy);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none;
  cursor: pointer;
  transition: background-color var(--gl-fast);
}
body .gl-gal .gl-w-chip .gl-i { width: 18px; height: 18px; margin: 0; }
@media (hover: hover) and (pointer: fine) { body .gl-gal .gl-w-chip:hover { background: var(--gl-wash); } }
body .gl-gal .gl-w-chip:focus-visible { outline: 3px solid #5b7bd5; outline-offset: 2px; }

/* The video slide: the video's picture, or the first photo, with a navy Play badge in the middle. */
body .gl-gal .gl-w-vslide { background: #000; cursor: auto; }
body .gl-gal .gl-w-vplay { position: absolute; inset: 0; display: block; color: #fff; text-decoration: none; }
/* Plan H: while the player shows, its link leaves the page, so Tab can't land on it under the player. */
body .gl-gal .gl-w-vplay[hidden] { display: none; }
body .gl-lp .gl-w-vplay img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; border-radius: 0; }
body .gl-gal .gl-w-vbadge {
  position: absolute;
  top: 50%;
  left: 50%;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 20px 0 16px;
  border-radius: var(--gl-radius);
  background: var(--gl-navy);
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  line-height: 1;
  transform: translate(-50%, -50%);
  transition: background-color var(--gl-fast);
}
body .gl-gal .gl-w-vbadge .gl-i, body .gl-gal .gl-w-vthumb-badge .gl-i { width: 22px; height: 22px; margin: 0; fill: currentColor; stroke: none; color: #fff; }
@media (hover: hover) and (pointer: fine) { body .gl-gal .gl-w-vplay:hover .gl-w-vbadge { background: var(--gl-navy-hover); } }
body .gl-gal .gl-w-vplay:focus-visible { outline: none; }
body .gl-gal .gl-w-vplay:focus-visible .gl-w-vbadge { outline: 3px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 6px #5b7bd5; }
body .gl-gal .gl-w-vframe { position: absolute; inset: 0; z-index: 2; background: #000; }
body .gl-gal .gl-w-vframe iframe { display: block; width: 100%; height: 100%; border: 0; }
body .gl-gal .gl-w-vclose {
  position: absolute;
  top: 8px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  margin: 0;
  padding: 0 12px;
  border: 0;
  border-radius: var(--gl-radius);
  background: #fff;
  color: var(--gl-navy);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  box-shadow: none;
  cursor: pointer;
}
body .gl-gal .gl-w-vclose .gl-i { width: 18px; height: 18px; margin: 0; }
body .gl-gal .gl-w-vthumb-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(16, 29, 69, .35);
}
body .gl-gal .gl-w-vthumb-badge .gl-i { width: 20px; height: 20px; }
/* While the video plays, the slideshow's Pause button and the count would cover the player's own controls. */
body .gl-gal.gl-w-playing :is(.gl-x-play, .gl-gal-count) { visibility: hidden; }

/* ---------- The phone's bottom bar (w-listing.js) ---------- */

@media (max-width: 899px) {
  body .gl-contact-bar.gl-w-priced { grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; }
  body .gl-contact-bar.gl-w-priced .gl-contact-btn { min-width: 96px; padding: 0 14px; }
  body .gl-contact-bar .gl-w-bar-price { display: flex; flex-direction: column; min-width: 0; margin: 0; line-height: 1.2; font-variant-numeric: tabular-nums lining-nums; }
  body .gl-contact-bar .gl-w-bar-amount { overflow: hidden; color: var(--gl-navy); font-size: 18px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
  body .gl-contact-bar .gl-w-bar-per { overflow: hidden; color: var(--gl-muted); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
  /* While the footer shows: off screen below, as when enhance.js moves the plain bar away. */
  body .gl-contact-bar.gl-w-hold { transform: translateY(calc(100% + 1px)); }

  /* Request a showing, then Call and Email as 48 px outline icon buttons, in one row down to 320 px. The bar stays put
     beside the agents' own buttons (enhance.js still marks it is-away there), since they don't offer a showing. Its
     edge is navy at 30%, not the pale rule, so it reads on Adam's screen. */
  body .gl-contact-bar.gl-w-show-bar,
  body .gl-contact-bar.gl-w-show-bar.gl-w-priced { grid-template-columns: minmax(0, 1fr) 48px 48px; align-items: center; gap: 8px; border-top-color: rgba(24, 42, 97, .3); }
  body .gl-contact-bar.gl-w-show-bar.is-away:not(.gl-w-hold) { transform: none; }
  body .gl-contact-bar.gl-w-show-bar .gl-w-bar-price { display: none; }
  body .gl-contact-bar.gl-w-show-bar .gl-contact-btn { min-width: 0; min-height: 48px; height: 48px; padding: 0 12px; }
  body .gl-contact-bar.gl-w-show-bar .gl-w-bar-show { justify-self: stretch; background: var(--gl-navy); color: #fff !important; white-space: nowrap; }
  body .gl-contact-bar.gl-w-show-bar .gl-w-bar-show .gl-i { flex: none; width: 20px; height: 20px; }
  body .gl-contact-bar.gl-w-show-bar .gl-w-bar-show span { overflow: hidden; text-overflow: ellipsis; }
  body .gl-contact-bar.gl-w-show-bar .gl-w-bar-icon { width: 48px; padding: 0; background: #fff; color: var(--gl-navy) !important; }
  body .gl-contact-bar.gl-w-show-bar .gl-w-bar-icon span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  body .gl-contact-bar.gl-w-show-bar .gl-w-bar-icon .gl-i { width: 22px; height: 22px; }
  @media (hover: hover) {
    body .gl-contact-bar.gl-w-show-bar .gl-w-bar-show:hover { background: var(--gl-navy-hover); }
    body .gl-contact-bar.gl-w-show-bar .gl-w-bar-icon:hover { background: var(--gl-wash); }
  }
  /* The bar is 65 px tall (48 px buttons in 8 px of padding, under a hairline), plus the phone's home-bar inset, which
     restyle.css already adds to its bottom padding. The page keeps that much room at its foot. */
  body.gl-has-bar.single-rem_property { padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px)); }
  body.gl-has-bar.single-rem_property #gl-preview-chip { bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important; }
}
/* Tablets and the Fold's inner screen: the price leads the bar again, and the showing button keeps its own width. */
@media (min-width: 560px) and (max-width: 899px) {
  body .gl-contact-bar.gl-w-show-bar.gl-w-priced { grid-template-columns: minmax(0, 1fr) auto 48px 48px; }
  body .gl-contact-bar.gl-w-show-bar.gl-w-priced .gl-w-bar-price { display: flex; }
  body .gl-contact-bar.gl-w-show-bar .gl-w-bar-show { padding: 0 22px; }
}
@media (max-width: 359px) {
  body .gl-contact-bar.gl-w-priced { gap: 6px; }
  body .gl-contact-bar.gl-w-priced .gl-contact-btn { min-width: 0; padding: 0 10px; }
  body .gl-contact-bar.gl-w-show-bar .gl-w-bar-show { gap: 6px; padding: 0 8px; font-size: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  body .gl-contact-bar { transition: none; }
}

/* ---------- Plan H: the bar with the plugin's data, the sold bar, and photo captions ---------- */

@media (max-width: 899px) {
  /* While the showing form or the full-screen viewer is open, the bar isn't there at all (w-listing.js). */
  body .gl-contact-bar.gl-w-cb.gl-w-cb-off { visibility: hidden; transform: translateY(calc(100% + 1px)); transition: none; }
  /* A sold listing: a filled Call as wide as its word, and See similar farms in the rest of the row, both 48 px. */
  body .gl-contact-bar.gl-w-sold-bar { grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 8px; border-top-color: rgba(24, 42, 97, .3); }
  body .gl-contact-bar.gl-w-sold-bar .gl-contact-btn { min-width: 0; min-height: 48px; padding: 0 18px; }
  body .gl-contact-bar.gl-w-sold-bar .gl-w-bar-similar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  @media (hover: hover) {
    body .gl-contact-bar.gl-w-sold-bar .gl-w-bar-similar:hover { background: var(--gl-wash); }
  }
}

/* A photo's caption, under the photo so it never covers the land, at 15 px. The line keeps its height while a photo
   with no caption shows, so the thumbnails under it don't move from photo to photo. */
body .gl-gal .gl-gal-cap { min-height: 1.45em; margin: 8px 0 0; color: var(--gl-ink); font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
body .gl-gal .gl-gal-cap[hidden] { display: block; visibility: hidden; }
@media (max-width: 699px) {
  body .gl-gal .gl-gal-cap { padding: 0 15px; }
}

@media print {
  body .gl-w-viewer, body .gl-gal .gl-w-chip, body .gl-gal .gl-w-vframe { display: none !important; }
  body .gl-gal .gl-w-vslide { display: none !important; }
  body .gl-gal .gl-w-vslide + .gl-gal-slide { position: static; display: block !important; height: auto; background: none; }
  body .gl-lp .gl-w-vslide + .gl-gal-slide img { width: auto; height: auto; max-height: 2in; }
}
