/* IDX widgets: hero search, showcase, neighborhood quick search, /search/ page. Load after palette.css. */

/* ---------- Search bar ---------- */
.idx-search {
  display: grid;
  grid-template-columns: 1.7fr 1fr 1fr 0.8fr auto;
  align-items: end;
  gap: 0;
  background: var(--white);
  border: 1px solid var(--stone);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(20,34,26, 0.08);
  padding: 0.4rem;
  margin-bottom: 1.25rem;
}
.idx-field {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.45rem 0.85rem;
  border-right: 1px solid var(--stone);
  min-width: 0;
}
.idx-field:nth-last-child(2) { border-right: 0; }
.idx-field label {
  font-size:.875rem;
  font-weight: 600;
  letter-spacing:.01em;
  text-transform:none;
  color: var(--bronze-deep);
}
.idx-field select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%235E584E' stroke-width='1.5'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E") no-repeat right center;
  padding: 0.15rem 1rem 0.15rem 0;
  font: 500 0.95rem var(--font-sans);
  color: var(--ink);
  width: 100%;
  cursor: pointer;
  text-overflow: ellipsis;
}
.idx-field select:focus { outline: none; }
.idx-field:focus-within { background: var(--ivory); border-radius: var(--radius-sm); }
.idx-search .idx-go {
  align-self: stretch;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--hunter);
  color: var(--white);
  font: 600 .875rem var(--font-sans);
  letter-spacing:.01em;
  text-transform:none;
  padding: 0 1.4rem;
  cursor: pointer;
  transition: var(--transition);
}
.idx-search .idx-go:hover { background: var(--hunter-deep); }
.idx-search .idx-go:focus-visible { outline: 2px solid var(--bronze); outline-offset: 2px; }
/* Home hero: let the bar run wider than the 960px headline column. */
@media (min-width: 901px) {
  .hero-content .idx-search { width: min(1160px, calc(100vw - 2 * clamp(1.25rem, 4vw, 2rem))); }
}

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.92rem;
}
.hero-links a {
  color: var(--ink);
  font-weight: 500;
  border-bottom: 1px solid var(--bronze);
  padding-bottom: 2px;
}
.hero-links a:hover { color: var(--leather); }

@media (max-width: 900px) {
  .idx-search { grid-template-columns: 1fr 1fr; }
  .idx-field { border-right: 0; border-bottom: 1px solid var(--stone); }
  .idx-field:first-child { grid-column: 1 / -1; }
  .idx-field:nth-child(odd):not(:first-child) { border-left: 1px solid var(--stone); }
  .idx-search .idx-go { grid-column: 1 / -1; justify-content: center; padding: 0.95rem; margin-top: 0.4rem; }
}

/* ---------- Showcase ---------- */
.idx-sub {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid var(--stone);
  padding-bottom: 0.75rem;
  margin-bottom: 1.75rem;
}
.idx-sub h3 {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  color: var(--ink);
}
.idx-sub a { font-size: 0.88rem; color: var(--bronze-deep); font-weight: 500; }
.idx-market { margin-top: 4rem; }
.idx-embed { min-height: 120px; }
.idx-embed[hidden] { display: none; }
.idx-slot { display: contents; }
.idx-note { font-size:.875rem; color: var(--taupe); margin-top: 1rem; }

/* ---------- Neighborhood quick search ---------- */
.idx-nb { background: var(--parchment); border-top: 1px solid var(--stone); border-bottom: 1px solid var(--stone); }
.idx-nb-head { display: flex; justify-content: space-between; align-items: end; gap: 1.5rem; flex-wrap: wrap; margin-bottom: 1.75rem; }
.idx-nb-head p { color: var(--text-mid); max-width: 560px; margin-top: 0.5rem; }
.idx-chips { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.idx-chip {
  display: inline-block;
  padding: 0.6rem 1.1rem;
  border: 1px solid var(--stone);
  border-radius:0;
  background: var(--white);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 500;
  transition: var(--transition);
}
.idx-chip:hover, .idx-chip:focus-visible { border-color: var(--ink); }
.idx-chip.is-active { border-color: var(--hunter); background: var(--hunter); color: var(--white); }
.idx-chip[hidden] { display: none; }
.idx-nb .idx-embed, .idx-results .idx-embed { margin-top: 2rem; background: var(--white); border: 1px solid var(--stone); border-radius: var(--radius-md); padding: 1rem; }

/* Vendor widget rendered off screen; its listings are shown in .idx-card below. */
.idx-nb, .idx-results { position: relative; overflow: hidden; }
.idx-embed.idx-source { position: absolute; left: -10000px; top: 0; width: 1100px; min-height: 0; opacity: 0; pointer-events: none; margin: 0; }

/* Listing feed: carousel on guide pages, grid on /search/ */
.idx-feed { margin-top: 1.75rem; }
.idx-feed[hidden], .idx-feed [hidden] { display: none; }
.idx-feed-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1rem; min-height: 2.5rem; }
.idx-count { font-size:.875rem; font-weight: 500; letter-spacing: 0.04em; color: var(--taupe); }
.idx-arrows { display: flex; gap: 0.5rem; }
.idx-arrow {
  width: 2.5rem; height: 2.5rem;
  border: 1px solid var(--stone); border-radius:0;
  background: var(--white); color: var(--ink);
  font-size: 1.05rem; cursor: pointer; transition: var(--transition);
}
.idx-arrow:hover, .idx-arrow:focus-visible { background: var(--hunter-deep); border-color: var(--hunter-deep); color: var(--white); }
.idx-track { display: grid; gap: 1.25rem; }
.idx-track:focus-visible { outline: 2px solid var(--bronze); outline-offset: 4px; }
.idx-feed-carousel .idx-track {
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 2 * 1.25rem) / 3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  padding-bottom: 0.75rem;
}
.idx-feed-carousel .idx-card { scroll-snap-align: start; }
.idx-feed-grid .idx-track { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
@media (max-width: 900px) { .idx-feed-carousel .idx-track { grid-auto-columns: calc((100% - 1.25rem) / 2); } }
@media (max-width: 600px) { .idx-feed-carousel .idx-track { grid-auto-columns: 82%; } .idx-arrows { display: none; } }

.idx-card {
  display: flex; flex-direction: column;
  background: var(--white);
  border: 1px solid var(--stone);
  border-radius: var(--radius-md);
  overflow: hidden;
  color: var(--charcoal);
  transition: var(--transition);
}
a.idx-card:hover, a.idx-card:focus-visible { box-shadow: var(--shadow-lg); border-color: var(--bronze); }
.idx-card-img { position: relative; aspect-ratio: 4 / 3; background: var(--parchment); }
.idx-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.idx-card-tag {
  position: absolute; top: 0.75rem; left: 0.75rem;
  background: var(--hunter); color: var(--ivory);
  font-size:.875rem; font-weight: 600; letter-spacing:.01em; text-transform:none;
  padding: 0.3rem 0.6rem; border-radius: var(--radius-sm);
}
.idx-card-body { padding: 1rem 1.1rem 1.2rem; display: flex; flex-direction: column; gap: 0.3rem; }
.idx-card-price { font-family: var(--font-serif); font-size: 1.4rem; color: var(--ink); }
.idx-card-facts { font-size:.875rem; color: var(--taupe); }
.idx-card-addr { font-size: 0.9rem; color: var(--charcoal); line-height: 1.4; }
.idx-card-addr span { color: var(--taupe); font-size:.875rem; }
.idx-empty { background: var(--white); border: 1px solid var(--stone); border-radius: var(--radius-md); padding: 2rem; text-align: center; }
.idx-empty p { color: var(--text-mid); max-width: 520px; margin: 0 auto 1.25rem; }

/* Listings near the top of a long-form guide: split the article around it. */
.nll-wrap:has(+ .idx-nb-inline) { padding-bottom: clamp(2rem, 5vw, 3rem); }
.nll-wrap.nll-wrap-cont { padding-top: clamp(2.5rem, 6vw, 4rem); }

/* ---------- /search/ page ---------- */
.idx-page-hero { padding-bottom: 2.5rem; }
.idx-page-hero .idx-search { max-width: 980px; margin: 2rem auto 0; text-align: left; }
.idx-summary { color: var(--bronze-light); font-weight: 500; letter-spacing: 0.04em; }
.idx-areas-sec { background: var(--white); border-bottom: 1px solid var(--stone); padding: 2rem 0; }
.idx-areas-title { font-size:.875rem; font-weight: 600; letter-spacing:.01em; text-transform:none; color: var(--bronze-deep); margin-bottom: 1rem; }
.idx-areas { display: grid; grid-template-columns: auto 1fr 1.4fr; gap: 1.5rem 2.5rem; align-items: start; }
.idx-county h3 { font-family: var(--font-serif); font-size: 1.1rem; color: var(--ink); margin-bottom: 0.6rem; }
.idx-county > div { display: flex; flex-wrap: wrap; gap: 0.4rem 0.5rem; }
.idx-area {
  display: inline-block; padding: 0.4rem 0.8rem;
  border: 1px solid var(--stone); border-radius:0;
  font-size:.875rem; color: var(--ink); background: var(--ivory);
  transition: var(--transition);
}
.idx-area:hover, .idx-area:focus-visible { border-color: var(--ink); }
.idx-area.is-active { background: var(--hunter); border-color: var(--hunter); color: var(--white); }
.idx-county-all { padding-top: 2.1rem; }
@media (max-width: 900px) { .idx-areas { grid-template-columns: 1fr; } .idx-county-all { padding-top: 0; } }
.idx-results-links { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.idx-explore-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem 2rem; }
.idx-explore-links a { color: var(--ink); font-weight: 500; border-bottom: 1px solid var(--bronze); padding-bottom: 2px; }
.idx-explore-links a:hover { color: var(--leather); }
.idx-request { max-width: 640px; margin: 0 auto; }
.idx-request[hidden], [data-idx-map][hidden] { display: none; }
.idx-request .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.idx-request .btn { width: 100%; justify-content: center; }
.idx-request .idx-fine { font-size:.875rem; color: var(--taupe); margin-top: 0.75rem; text-align: center; }
@media (max-width: 600px) { .idx-request .form-row { grid-template-columns: 1fr; } }

/* Price/bedroom tiers: one IDX Broker carousel per button, swapped in place */
.idx-tier[hidden] { display: none; }
.idx-tier .idx-empty { border: 0; padding: 1.5rem 1rem; }
.idx-loading { margin: 0; padding: 3rem 1rem; text-align: center; color: var(--text-mid); font-size: 0.95rem; letter-spacing: 0.02em; }
.idx-map-sec .idx-embed { min-height: 520px; }
