/* Lane x-cards: motion on listing cards, the county maps, and the index (x-cards.php says what and why). Every hidden
   state here comes from a class that x-cards.js adds, so a page without the script shows everything. */

/* The photo addresses for the card peek are data, never content. */
.gl-x-peek { display: none !important; }

/* ---------- 1. Status flags fade in ---------- */

/* The script adds the waiting state only to a flag whose card was out of view when it first looked, so a flag on the
   first screen never blinks out and back. */
@media (prefers-reduced-motion: no-preference) {
  .gl-js body .gl-card-flag.gl-x-flag-wait { opacity: 0; transform: translateX(-8px); }
  .gl-js body .gl-card-flag.gl-x-flag-in { transition: opacity 320ms cubic-bezier(.23, 1, .32, 1), transform 320ms cubic-bezier(.23, 1, .32, 1); }
}

/* ---------- 2. The county map's preview card ---------- */

/* It follows the pointer by transform only, never takes the pointer, and sits over the header's dropdowns' level. The
   inner box carries the fade and the small rise from 97%, so the outer box can move freely. */
.gl-x-tip { position: fixed; top: 0; left: 0; z-index: 1001; width: 264px; pointer-events: none; visibility: hidden; transition: visibility 0s linear 150ms; }
.gl-x-tip.is-on { visibility: visible; transition-delay: 0s; }
.gl-x-tip-in { display: grid; gap: 8px; padding: 12px; border: 1px solid var(--gl-navy); border-radius: var(--gl-radius); background: #fff; color: var(--gl-ink); box-shadow: 0 6px 18px rgba(16, 29, 69, .18); font-family: var(--gl-sans); text-align: left; opacity: 0; transform: scale(.97); transform-origin: var(--gl-x-origin, top left); transition: opacity 150ms cubic-bezier(.23, 1, .32, 1), transform 150ms cubic-bezier(.23, 1, .32, 1); }
.gl-x-tip.is-on .gl-x-tip-in { opacity: 1; transform: none; }
.gl-x-tip-county { margin: 0; font-size: 17px; font-weight: 600; line-height: 1.3; color: var(--gl-navy); }
.gl-x-tip-count { margin: -6px 0 0; font-size: 14px; line-height: 1.4; color: var(--gl-muted); }
.gl-x-tip-item { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 10px; align-items: start; padding-top: 8px; border-top: 1px solid var(--gl-navy); }
.gl-x-tip-img { display: block; width: 64px; height: 64px; max-width: none; border-radius: var(--gl-radius); background: var(--gl-wash); object-fit: cover; }
.gl-x-tip-text { display: grid; gap: 2px; min-width: 0; }
.gl-x-tip-label { font-size: 14px; line-height: 1.3; color: var(--gl-muted); }
.gl-x-tip-name { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--gl-ink); }
.gl-x-tip-price { font-size: 14px; line-height: 1.35; color: var(--gl-ink); font-variant-numeric: tabular-nums; }
.gl-x-tip-status { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--gl-navy); }
.gl-x-tip-status--sale-pending { color: var(--gl-pending); }
.gl-x-tip-status--sold { color: var(--gl-sold); }
@media (prefers-reduced-motion: reduce) {
  .gl-x-tip, .gl-x-tip-in { transition: none; }
  .gl-x-tip-in { transform: none; }
}

/* ---------- 3. The card photo peek ---------- */

/* The extra photos lie over the card's own, each fading in on top of the last. They scale with it on hover, so the
   crossfade never shows two sizes of photo. */
.gl-card-photo > img.gl-x-peek-img { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; max-width: none; margin: 0; object-fit: cover; opacity: 0; transition: opacity 300ms ease, transform 160ms cubic-bezier(.23, 1, .32, 1); }
.gl-card-photo > img.gl-x-peek-img.is-on { opacity: 1; }
.gl-x-dots { position: absolute; left: 0; right: 0; bottom: 8px; z-index: 1; display: flex; justify-content: center; gap: 6px; pointer-events: none; opacity: 0; transition: opacity 150ms ease; }
.gl-x-peeking .gl-x-dots { opacity: 1; }
/* White with a navy ring, so a dot shows on sky, snow, and dark soil alike. */
.gl-x-dot { width: 8px; height: 8px; border: 1px solid var(--gl-navy); border-radius: 50%; background: rgba(255, 255, 255, .6); transition: background-color 150ms ease; }
.gl-x-dot.is-on { background: #fff; box-shadow: 0 0 0 1px #fff; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  .gl-card:hover .gl-card-photo > img.gl-x-peek-img { transform: scale(1.03); }
}
