/* zillow-like sale layout, white + #6D28D9 */
:root {
  --purple: #6D28D9;
  --purple-bright: #8B5CF6;
  --lilac: #C084FC;
  --lilac-soft: #F3E8FF;
  --bg: #ffffff;
  --soft: #FAF7FF;
  --ink: #211438;
  --muted: #5c5470;
  --line: #ece7f4;
  --shadow: 0 10px 28px rgba(33, 20, 56, 0.12);
  --header: 4.25rem;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.2rem;
}

body {
  margin: 0;
  font-family: "Vazirmatn", Tahoma, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
  font-size: 1rem;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,
h2,
h3,
p,
ul,
ol,
figure {
  margin-top: 0;
}

::selection {
  background: #E9D5FF;
  color: var(--ink);
}

.skip {
  position: absolute;
  inset-inline-start: 1rem;
  top: -4rem;
  z-index: 50;
  background: var(--bg);
  color: var(--purple);
  padding: 0.55rem 0.9rem;
  border-radius: 999px;
}

.skip:focus {
  top: 0.7rem;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.header-inner,
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.15rem;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 0.7rem;
  color: var(--purple);
  background: var(--lilac-soft);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.site-nav a {
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.95rem;
}

.site-nav a:hover,
.site-nav a.is-current {
  color: var(--purple);
  background: var(--lilac-soft);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-weight: 700;
}

.hero {
  position: relative;
  min-height: 34rem;
  display: grid;
  align-items: center;
  overflow: hidden;
  color: #fff;
}

.hero-photo {
  position: absolute;
  inset: 0;
}

.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 70%;
}

.hero-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(33, 20, 56, 0.28), rgba(33, 20, 56, 0.62)),
    radial-gradient(circle at 80% 20%, rgba(192, 132, 252, 0.35), transparent 42%);
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 4.5rem 0 3.5rem;
  text-align: center;
}

.eyebrow {
  margin-bottom: 0.4rem;
  color: #f3e8ff;
  font-weight: 700;
  letter-spacing: 0;
}

.hero h1 {
  margin-bottom: 0.4rem;
  font-size: clamp(1.8rem, 4vw, 3.1rem);
  line-height: 1.35;
  font-weight: 800;
}

.hero .lead {
  max-width: 36rem;
  margin: 0 auto 1.4rem;
  color: rgba(255, 255, 255, 0.92);
}

.search-panel {
  width: min(760px, 100%);
  margin-inline: auto;
  padding: 0.85rem;
  background: #fff;
  color: var(--ink);
  border-radius: 1.4rem;
  box-shadow: 0 18px 50px rgba(33, 20, 56, 0.22);
}

.search-row {
  display: flex;
  gap: 0.55rem;
}

.search-main {
  flex: 1;
}

.search-main input,
.field input,
.field select {
  width: 100%;
  border: 1px solid #e4dcf2;
  background: #fff;
  border-radius: 999px;
  padding: 0.85rem 1.1rem;
  outline: none;
}

.search-main input:focus,
.field input:focus,
.field select:focus,
.btn:focus-visible,
.text-button:focus-visible,
.nav-toggle:focus-visible,
.site-nav a:focus-visible,
.dialog-close:focus-visible {
  outline: 3px solid rgba(139, 92, 246, 0.45);
  outline-offset: 2px;
}

.search-submit {
  flex: 0 0 auto;
  min-width: 7.2rem;
}

.search-filters {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr auto;
  gap: 0.6rem;
  align-items: end;
  margin-top: 0.7rem;
}

.field {
  display: grid;
  gap: 0.25rem;
  text-align: right;
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}

.field input,
.field select {
  border-radius: 0.8rem;
  padding: 0.65rem 0.8rem;
  color: var(--ink);
  font-weight: 500;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--purple);
  font-weight: 700;
  padding: 0.7rem 0.4rem;
  cursor: pointer;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.8rem 1.2rem;
  background-image: linear-gradient(180deg, #C4B5FD 0%, #8B5CF6 38%, #6D28D9 100%);
  box-shadow: 0 8px 18px rgba(109, 40, 217, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.btn-ghost {
  color: var(--purple);
  background: #fff;
  background-image: none;
  box-shadow: none;
  border: 1px solid rgba(109, 40, 217, 0.35);
}

.section {
  padding: 3.2rem 0;
}

.section-soft {
  background: var(--soft);
}

.section-head {
  margin-bottom: 1.3rem;
}

.section-head h2,
.advisor h2,
.tip-grid h3,
.advisor-card h3 {
  margin-bottom: 0.35rem;
  line-height: 1.4;
}

.section-head h2,
.advisor h2 {
  font-size: clamp(1.45rem, 2vw, 1.9rem);
}

.section-lead,
.prose,
.location,
.fine,
.facts,
.advisor-card li,
.tip-grid p,
.contact-card p,
.empty p {
  color: var(--muted);
}

.section-soft .eyebrow {
  color: var(--purple);
}

.title-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.listings-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.35rem;
}

.listing-card,
.tip-grid li,
.advisor-card,
.contact-card,
.empty {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  overflow: hidden;
}

.listing-card {
  display: flex;
  flex: 1 1 300px;
  flex-direction: column;
  width: min(100%, 380px);
  max-width: 380px;
  border-radius: 1.5rem;
  box-shadow: 0 14px 34px rgba(109, 40, 217, 0.08);
}

.card-media {
  position: relative;
  aspect-ratio: 4 / 3;
  margin: 0.7rem 0.7rem 0;
  border-radius: 1.15rem;
  background: var(--lilac-soft);
  overflow: hidden;
}

.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-media span {
  display: grid;
  place-items: center;
  height: 100%;
  color: var(--purple);
  font-weight: 700;
}

.card-body,
.empty,
.advisor-card,
.contact-card,
.tip-grid li {
  padding: 1rem 1rem 1.1rem;
}

.price {
  margin-bottom: 0.15rem;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--purple);
}

.price.is-empty {
  color: var(--muted);
  font-size: 1rem;
  font-weight: 700;
}

.facts {
  margin-bottom: 0.35rem;
  font-size: 0.92rem;
}

.card-body h3 {
  margin-bottom: 0.15rem;
  font-size: 1.05rem;
}

.location,
.description {
  margin-bottom: 0.45rem;
}

.card-details {
  margin-top: auto;
  align-self: flex-start;
}

.empty {
  grid-column: 1 / -1;
  padding: 1.4rem;
}

.advisor {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr;
  gap: 1.4rem;
  align-items: start;
}

.prose p + p {
  margin-top: 0.7rem;
}

.advisor-card ul {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
}

.advisor-card li {
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--line);
}

.advisor-card li:last-child {
  border-bottom: 0;
}

.tip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tip-num {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.7rem;
  border-radius: 999px;
  background: var(--lilac-soft);
  color: var(--purple);
  font-weight: 800;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.contact-card h3 {
  margin-bottom: 0.25rem;
  font-size: 0.95rem;
}

.contact-card a {
  color: var(--purple);
  font-weight: 700;
  overflow-wrap: anywhere;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.6rem 0 2rem;
}

.footer-inner {
  display: grid;
  gap: 0.7rem;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1.1rem;
}

.footer-nav a:hover {
  color: var(--purple);
}

.brand-name {
  font-weight: 800;
  margin-bottom: 0.1rem;
}

.fine {
  margin: 0;
  font-size: 0.9rem;
}

.listing-dialog {
  position: relative;
  width: min(720px, calc(100% - 1.5rem));
  border: 0;
  border-radius: 1.2rem;
  padding: 0;
  color: var(--ink);
}

.listing-dialog::backdrop {
  background: rgba(33, 20, 56, 0.46);
}

.dialog-close {
  position: absolute;
  top: 0.7rem;
  inset-inline-start: 0.7rem;
  z-index: 2;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--purple);
  font-weight: 700;
  padding: 0.35rem 0.75rem;
  cursor: pointer;
}

#listing-dialog-body {
  display: grid;
}

.dialog-media {
  aspect-ratio: 3 / 4;
  border-radius: 1.2rem 1.2rem 0 0;
}

.dialog-copy {
  padding: 1.1rem 1.15rem 1.3rem;
}

.dialog-description {
  white-space: pre-wrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.chip {
  background: var(--lilac-soft);
  color: var(--purple);
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.82rem;
  font-weight: 700;
}

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .listing-card,
  .card-media img,
  .btn,
  .tip-grid li,
  .contact-card {
    transition: transform 0.22s ease, box-shadow 0.22s ease;
  }

  .listing-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
  }

  .listing-card:hover .card-media img {
    transform: scale(1.05);
  }

  .btn:hover {
    transform: translateY(-2px);
    filter: brightness(1.06);
  }

  .tip-grid li:hover,
  .contact-card:hover {
    transform: translateY(-3px);
  }
}

@media (max-width: 1100px) {
  .listing-card {
    flex-basis: 280px;
  }
}

@media (max-width: 980px) {
  .tip-grid,
  .contact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .advisor {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    inset-inline: 0;
    top: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 0.6rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
  }

  .site-nav.is-open {
    display: flex;
  }

  .hero {
    min-height: 0;
  }

  .hero-content {
    padding: 2.4rem 0 2rem;
  }

  .search-row,
  .search-filters {
    grid-template-columns: 1fr;
    display: grid;
  }

  .search-submit,
  .btn,
  .card-details {
    width: 100%;
  }

  .listing-card {
    flex-basis: 100%;
    width: min(100%, 440px);
    max-width: 440px;
  }

  .tip-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
}

.sold-flag {
  display: inline-flex;
  margin-bottom: 0.45rem;
  background: #f3e8ff;
  color: var(--purple);
  border-radius: 999px;
  padding: 0.15rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 800;
}

.code-line {
  margin-bottom: 0.35rem;
  color: var(--purple);
  font-size: 1.15rem;
  font-weight: 800;
}

.measure-line {
  margin-bottom: 0.55rem;
  font-weight: 700;
}

.detail-copy {
  white-space: pre-wrap;
  margin-bottom: 0.7rem;
}

.excerpt,
.dialog-description {
  white-space: pre-wrap;
}

.excerpt {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 0.7rem;
}

.gallery {
  position: absolute;
  inset: 0;
}

.gallery-scroller {
  display: flex;
  direction: rtl;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  cursor: grab;
}

.gallery-scroller::-webkit-scrollbar {
  display: none;
}

.gallery-scroller.is-dragging {
  scroll-snap-type: none;
  cursor: grabbing;
}

.gallery-slide {
  flex: 0 0 100%;
  height: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.gallery-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.55rem;
  display: flex;
  justify-content: center;
  gap: 0.32rem;
  pointer-events: none;
}

.gallery-dots span {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
}

.gallery-dots span.is-on {
  width: 0.95rem;
  background: #fff;
}

.call-row {
  display: grid;
  gap: 0.45rem;
  margin: 0.7rem 0 0.2rem;
}

.call-advisor {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.8rem;
  border-radius: 999px;
  background: var(--purple);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
}

.call-advisor:hover {
  background: var(--purple-bright);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}
