/* ==========================================================================
   Urban Shell — hero.css
   Hero section + tabbed search bar
   ========================================================================== */

.urban-hero {
  position: relative;
  min-height: 790px;
  background-image: var(--urban-hero-bg, none);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  align-items: stretch;
  color: #fff;
  padding-top: 60px;
  padding-bottom: 0;
  font-family: 'Poppins', sans-serif;
  overflow: hidden; /* Contain Ken Burns zoom inside hero bounds */
}

/* Dark overlay over bg image */
.urban-hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(rgba(20,30,45,0.5), rgba(20,30,45,0.6));
  z-index: 1;
  pointer-events: none;
}

/* ==========================================================================
   v2.2.0 Issue #7 — Hero background slideshow (5 images max).
   Pure-CSS animation: Ken Burns zoom + cross-fade. No JS.

   Total cycle: 45s for 5 images (9s per image).
   Each image is fully visible for ~7.5s with 1.5s cross-fade transitions.
   Ken Burns: subtle 1.0 → 1.08 scale over its visible window.

   The animation-delay staggers each slide by 9s so they hand off cleanly.
   Adapts gracefully if there are 1-4 images (animation still loops at same
   pace, with some "off" slots remaining transparent — visually identical
   to a single static image when only 1 slide).
   ========================================================================== */

.urban-hero--slideshow {
  background-image: none; /* Slideshow layers replace the single bg */
}

.urban-hero__slideshow {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
}

.urban-hero__slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  /* Hint to browser: this property will animate (perf optimization) */
  will-change: opacity, transform;
}

/* 5-image cycle (45s total) — each slide gets a 9s window */
.urban-hero--slideshow-5 .urban-hero__slide {
  animation: urbanHeroSlide5 45s infinite;
}
.urban-hero--slideshow-5 .urban-hero__slide--1 { animation-delay: 0s; }
.urban-hero--slideshow-5 .urban-hero__slide--2 { animation-delay: 9s; }
.urban-hero--slideshow-5 .urban-hero__slide--3 { animation-delay: 18s; }
.urban-hero--slideshow-5 .urban-hero__slide--4 { animation-delay: 27s; }
.urban-hero--slideshow-5 .urban-hero__slide--5 { animation-delay: 36s; }

@keyframes urbanHeroSlide5 {
  /* 0–3% fade in */
  0%   { opacity: 0; transform: scale(1); }
  3%   { opacity: 1; transform: scale(1); }
  /* 3–20% fully visible, Ken Burns zoom */
  20%  { opacity: 1; transform: scale(1.08); }
  /* 20–23% fade out */
  23%  { opacity: 0; transform: scale(1.08); }
  /* 23–100% invisible while others cycle */
  100% { opacity: 0; transform: scale(1); }
}

/* 4-image cycle (36s total) */
.urban-hero--slideshow-4 .urban-hero__slide {
  animation: urbanHeroSlide4 36s infinite;
}
.urban-hero--slideshow-4 .urban-hero__slide--1 { animation-delay: 0s; }
.urban-hero--slideshow-4 .urban-hero__slide--2 { animation-delay: 9s; }
.urban-hero--slideshow-4 .urban-hero__slide--3 { animation-delay: 18s; }
.urban-hero--slideshow-4 .urban-hero__slide--4 { animation-delay: 27s; }

@keyframes urbanHeroSlide4 {
  0%   { opacity: 0; transform: scale(1); }
  4%   { opacity: 1; transform: scale(1); }
  25%  { opacity: 1; transform: scale(1.08); }
  29%  { opacity: 0; transform: scale(1.08); }
  100% { opacity: 0; transform: scale(1); }
}

/* 3-image cycle (27s total) */
.urban-hero--slideshow-3 .urban-hero__slide {
  animation: urbanHeroSlide3 27s infinite;
}
.urban-hero--slideshow-3 .urban-hero__slide--1 { animation-delay: 0s; }
.urban-hero--slideshow-3 .urban-hero__slide--2 { animation-delay: 9s; }
.urban-hero--slideshow-3 .urban-hero__slide--3 { animation-delay: 18s; }

@keyframes urbanHeroSlide3 {
  0%   { opacity: 0; transform: scale(1); }
  5%   { opacity: 1; transform: scale(1); }
  33%  { opacity: 1; transform: scale(1.08); }
  38%  { opacity: 0; transform: scale(1.08); }
  100% { opacity: 0; transform: scale(1); }
}

/* 2-image cycle (18s total) */
.urban-hero--slideshow-2 .urban-hero__slide {
  animation: urbanHeroSlide2 18s infinite;
}
.urban-hero--slideshow-2 .urban-hero__slide--1 { animation-delay: 0s; }
.urban-hero--slideshow-2 .urban-hero__slide--2 { animation-delay: 9s; }

@keyframes urbanHeroSlide2 {
  0%   { opacity: 0; transform: scale(1); }
  8%   { opacity: 1; transform: scale(1); }
  50%  { opacity: 1; transform: scale(1.08); }
  58%  { opacity: 0; transform: scale(1.08); }
  100% { opacity: 0; transform: scale(1); }
}

/* Single image — just Ken Burns zoom, no fade */
.urban-hero--slideshow-1 .urban-hero__slide {
  opacity: 1;
  animation: urbanHeroSingleKenBurns 30s infinite alternate ease-in-out;
}

@keyframes urbanHeroSingleKenBurns {
  from { transform: scale(1); }
  to   { transform: scale(1.08); }
}

/* Respect user accessibility preferences */
@media (prefers-reduced-motion: reduce) {
  .urban-hero__slide {
    animation: none !important;
    transform: none !important;
  }
  /* Only show the first slide if motion is reduced */
  .urban-hero__slide:not(.urban-hero__slide--1) {
    opacity: 0 !important;
  }
  .urban-hero__slide--1 {
    opacity: 1 !important;
  }
}


.urban-hero__inner {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-bottom: 0;
}

/* Subtitle (above headline) */
.urban-hero__subtitle {
  color: var(--urban-orange);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  margin: 0 0 6px;
}

/* Main headline */
.urban-hero__headline {
  font-size: clamp(34px, 4.8vw, 56px);
  font-weight: 700;
  text-align: center;
  line-height: 1.1;
  margin: 0 0 14px;
  letter-spacing: -0.5px;
  color: #fff;
}

/* Tagline below headline */
.urban-hero__tagline {
  color: var(--urban-orange);
  font-size: 15px;
  text-align: center;
  margin: 0 0 32px;
  font-weight: 500;
}

.urban-hero__tagline-dot {
  margin: 0 8px;
  opacity: 0.6;
  display: inline-block;
}

/* ==========================================================================
   SEARCH BAR
   ========================================================================== */

.urban-search {
  width: 100%;
  max-width: 1240px;
  background: #fff;
  border-radius: var(--urban-radius-lg);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  color: var(--urban-charcoal);
  margin: 0 auto 0;
}

/* Tabs */
.urban-search__tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.urban-search__tab {
  padding: 18px;
  text-align: center;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  background: var(--urban-charcoal);
  color: #fff;
  border: none;
  font-family: inherit;
  transition: var(--urban-transition);
  line-height: 1.2;
}

.urban-search__tab:hover {
  background: var(--urban-charcoal-soft);
}

.urban-search__tab.is-active {
  background: var(--urban-orange);
}

/* Form fields container */
.urban-search__fields {
  padding: 28px 32px;
  margin: 0;
}

/* Field rows */
.urban-search__row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

.urban-search__row--2 {
  grid-template-columns: 1fr 1fr 2fr;
}

/* Field wrapper */
.urban-search__field {
  display: flex;
  flex-direction: column;
}

.urban-search__field label {
  font-size: 13px;
  color: var(--urban-charcoal);
  font-weight: 600;
  margin-bottom: 8px;
}

.urban-search__field select,
.urban-search__field input[type="text"],
.urban-search__field input[type="number"] {
  padding: 13px 14px;
  border: 1px solid var(--urban-border);
  border-radius: var(--urban-radius-md);
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  color: var(--urban-charcoal);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.urban-search__field select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.urban-search__field select:focus,
.urban-search__field input:focus {
  outline: none;
  border-color: var(--urban-orange);
  box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.1);
}

/* Submit button */
.urban-search__field--submit {
  justify-content: flex-end;
}

.urban-search__btn {
  background: var(--urban-orange);
  color: #fff;
  border: none;
  padding: 13px 18px;
  border-radius: var(--urban-radius-md);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--urban-transition);
  width: 100%;
  line-height: 1.2;
}

.urban-search__btn:hover {
  background: var(--urban-orange-dark);
  transform: translateY(-1px);
}

.urban-search__btn:active {
  transform: translateY(0);
}

/* Price slider section */
.urban-search__price {
  padding-top: 8px;
  border-top: 1px solid #f0f0f0;
  margin-top: 8px;
}

.urban-search__price-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--urban-charcoal);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.urban-search__price-range {
  color: var(--urban-orange);
  font-weight: 600;
}

.urban-search__price-slider {
  height: 6px;
  background: linear-gradient(to right, #f0f0f0 0%, var(--urban-orange) 5%, var(--urban-orange) 95%, #f0f0f0 100%);
  border-radius: 3px;
  position: relative;
}

.urban-search__price-slider::before,
.urban-search__price-slider::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  background: #fff;
  border: 3px solid var(--urban-orange);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.urban-search__price-slider::before {
  left: 5%;
}

.urban-search__price-slider::after {
  right: 5%;
}

/* Hide fields based on tab (Phase H will refine — for Stage 2 just visual) */
.urban-search__fields[data-active-tab="commercial"] [data-show-for]:not([data-show-for*="commercial"]) {
  display: none;
}
.urban-search__fields[data-active-tab="land"] [data-show-for]:not([data-show-for*="land"]) {
  display: none;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 960px) {
  .urban-hero {
    min-height: 0;
    padding-top: 36px;
    padding-bottom: 28px;
  }

  .urban-hero__inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .urban-hero__headline {
    font-size: clamp(26px, 7vw, 36px);
  }

  .urban-hero__tagline {
    margin-bottom: 22px;
    font-size: 13px;
  }

  .urban-search__tab {
    padding: 13px 8px;
    font-size: 13px;
  }

  .urban-search__fields {
    padding: 18px;
  }

  .urban-search__row,
  .urban-search__row--2 {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
  }

  .urban-search__field label {
    font-size: 12px;
    margin-bottom: 6px;
  }

  .urban-search__field select,
  .urban-search__field input {
    padding: 11px 12px;
    font-size: 13px;
  }

  .urban-search__btn {
    padding: 13px;
    font-size: 14px;
  }
}

@media (max-width: 600px) {
  .urban-hero__subtitle {
    font-size: 12px;
  }
  .urban-hero__tagline-dot {
    margin: 0 5px;
  }
}
