/* THE LOWRY GROUP — Grand Tour gallery styles (extracted for v3 listing pages) */
:root{--gold:#c9a45c;--gold-dim:#a8843f;--charcoal:#14171a;--hairline:rgba(255,255,255,.14);
  --text-on-black:#f4efe6;--text-on-black-muted:rgba(244,239,230,.72);
  --font-body:"Jost",-apple-system,"Segoe UI",sans-serif;--font-display:"Playfair Display",Georgia,serif;
  --space-xs:8px;--space-sm:14px;--space-md:24px;--container-pad:clamp(20px,5vw,64px);
  --speed-fast:.2s;--speed-med:.4s;--speed-slow:.7s;--ease:cubic-bezier(.4,0,.2,1)}
.tour-tabs {
  display: flex;
  gap: var(--space-md);
  padding: 0 var(--container-pad);
  margin-bottom: var(--space-md);
  overflow-x: auto;
  scrollbar-width: none;
  /* Fades the right edge so a horizontally-scrollable tab row (e.g. the
     Grand Tour gallery categories) reads as scrollable at a glance, rather
     than looking like it simply ends off-screen with no other hint. */
  mask-image: linear-gradient(to right, black calc(100% - 28px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, black calc(100% - 28px), transparent 100%);
}
.tour-tabs::-webkit-scrollbar { display: none; }
.tour-tab {
  background: none;
  border: none;
  white-space: nowrap;
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-on-black-muted);
  padding: 0.4em 0 0.6em;
  position: relative;
  cursor: pointer;
  transition: color var(--speed-fast) var(--ease);
}
.tour-tab::after {
  content: '';
  position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: var(--gold);
  transition: right var(--speed-med) var(--ease);
}
.tour-tab:hover { color: var(--text-on-black); }
.tour-tab.is-active { color: var(--gold); }
.tour-tab.is-active::after { right: 0; }

/* The Media page only ever has a small handful of tabs, but their labels
   are long ("Lakewood Ranch & Sarasota Lifestyle") — on a phone that meant
   horizontal scrolling with no visible cue that there was anything to
   scroll to. Since there are so few of them, wrapping to a second line is
   simpler and more discoverable than scrolling. (The Grand Tour gallery's
   tabs, which can run to 6-8 short single-word categories, keep the
   horizontal scroll behavior above — wrapping that many would look busy.) */
@media (max-width: 640px) {
  #mediaTabs {
    flex-wrap: wrap;
    overflow-x: visible;
    justify-content: center;
    row-gap: 0.6em;
    mask-image: none;
    -webkit-mask-image: none;
  }
  #mediaTabs .tour-tab { white-space: normal; text-align: center; }
}

/* ---- Filmstrip ---- */
.tour-wrap { position: relative; }

.tour-viewport { position: relative; }

.tour-track {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 0 var(--container-pad);
  cursor: grab;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.tour-track::-webkit-scrollbar { display: none; }
.tour-track.is-dragging { cursor: grabbing; scroll-snap-type: none; user-select: none; }

.tour-slide {
  flex: 0 0 auto;
  width: min(78vw, 920px);
  height: 74vh;
  scroll-snap-align: center;
  overflow: hidden;
  position: relative;
  background: var(--charcoal);
}
.tour-slide img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--speed-slow) var(--ease);
}
.tour-slide:hover img { transform: scale(1.03); }

.tour-slide-cat {
  position: absolute; left: var(--space-sm); bottom: var(--space-sm);
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-on-black);
  background: rgba(10, 10, 10, 0.55);
  padding: 0.5em 0.9em;
  border: 1px solid var(--gold-dim);
}

.tour-counter {
  position: absolute;
  top: var(--space-sm);
  right: calc(var(--container-pad) + 0.5em);
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  background: rgba(10, 10, 10, 0.5);
  padding: 0.3em 0.8em;
  pointer-events: none;
  z-index: 2;
}

.tour-progress {
  height: 1px;
  background: var(--hairline);
  margin: var(--space-sm) var(--container-pad) 0;
  position: relative;
}
.tour-progress span {
  position: absolute; left: 0; top: 0; height: 100%;
  background: var(--gold);
  width: 0%;
}

.tour-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px; height: 48px;
  border: none; background: none;
  color: var(--text-on-black);
  font-size: 1.7rem;
  opacity: 0;
  transition: opacity var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease);
  z-index: 2;
}
.tour-viewport:hover .tour-arrow { opacity: 0.7; }
.tour-arrow:hover { opacity: 1 !important; color: var(--gold); }
.tour-arrow-prev { left: calc(var(--container-pad) - 1.4em); }
.tour-arrow-next { right: calc(var(--container-pad) - 1.4em); }

@media (max-width: 720px) {
  .tour-slide { width: 88vw; height: 56vh; }
  .tour-arrow { display: none; }
  .tour-counter { top: var(--space-xs); right: calc(var(--container-pad) + 0.2em); }
}

/* ---- Full-screen crossfade viewer ---- */
.tour-viewer {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(6, 6, 6, 0.97);
  display: none;
  align-items: center;
  justify-content: center;
}
.tour-viewer.is-open { display: flex; }

/* Soft blurred fill behind the photo so non-widescreen shots (older MLS/3:2
   photography mixed with newer 16:9 shoots) never show hard black bars —
   same idea as Spotify/Apple Music's blurred album-art backdrop. */
.tour-viewer-backdrop {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(50px) brightness(0.4) saturate(1.15);
  transform: scale(1.15);
  z-index: 0;
}

.tour-viewer-stage {
  position: relative;
  z-index: 1;
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.tour-viewer-img {
  position: absolute;
  max-height: 88vh; max-width: 90vw;
  object-fit: contain;
  opacity: 0;
  transition: opacity var(--speed-med) var(--ease);
}
.tour-viewer-img.is-active { opacity: 1; }

.tour-viewer-close {
  position: absolute; top: var(--space-md); right: var(--container-pad);
  background: none; border: none;
  color: var(--text-on-black);
  font-size: 1.7rem;
  z-index: 2;
  transition: color var(--speed-fast) var(--ease);
}
.tour-viewer-close:hover { color: var(--gold); }

.tour-viewer-counter {
  position: absolute; top: var(--space-md); left: var(--container-pad);
  font-family: var(--font-display);
  letter-spacing: 0.08em;
  color: var(--gold);
  font-size: 0.9rem;
  z-index: 2;
}

.tour-viewer-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: none; border: none;
  color: var(--text-on-black);
  font-size: 2.2rem;
  opacity: 0.5;
  transition: opacity var(--speed-fast) var(--ease), color var(--speed-fast) var(--ease);
  z-index: 2;
  padding: var(--space-sm);
}
.tour-viewer-arrow:hover { opacity: 1; color: var(--gold); }
.tour-viewer-prev { left: var(--space-sm); }
.tour-viewer-next { right: var(--space-sm); }

.tour-viewer-progress {
  position: absolute; bottom: 0; left: 0; right: 0; height: 1px;
  background: var(--hairline);
}
.tour-viewer-progress span {
  position: absolute; left: 0; top: 0; height: 100%;
  background: var(--gold);
  width: 0%;
}
