/*********************
Layout pass (2026-11-03): agents directory (search, cards, pager) and the
phone layouts of About, Contact, Blog, single post and Neighborhoods.
Loaded last on every page so it wins over the page stylesheets.
*********************/

/*********************
START: AGENTS DIRECTORY (/agents/)
*********************/
body.post-type-archive-agents .heroInner {
  padding-block-end: 2.5rem !important;
}

.agentsDir-body {
  padding-block: 1rem 6rem;
}

.agentsDir-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-block-end: 2.5rem;
  padding-block-end: 1.5rem;
  border-bottom: 1px solid rgba(21, 20, 16, 0.12);
}

.agentsDir-count {
  font-size: var(--text-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray-secondary);
}

/* search: one clear field, icon inside, 16px text (no iOS zoom), live results card */
.agentsDir .agentsSearch.rch-top-filter {
  margin: 0;
  width: min(100%, 480px);
}

.agentsDir .agentsSearch form#rch-agent-search-form {
  position: relative;
  width: 100%;
}

.agentsDir .agentsSearch .agentsSearch-icon {
  position: absolute;
  left: 1.125rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-secondary);
  pointer-events: none;
}

.agentsDir .agentsSearch form#rch-agent-search-form input {
  width: 100%;
  height: 52px;
  padding: 0 1.25rem 0 3rem;
  font-family: var(--font-family);
  font-size: 1rem;
  color: var(--gray-primary);
  background-color: var(--bg-light);
  border: 1px solid rgba(21, 20, 16, 0.14);
  border-radius: var(--border-radius-6);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.agentsDir .agentsSearch form#rch-agent-search-form input::placeholder {
  color: rgba(21, 20, 16, 0.45);
}

.agentsDir .agentsSearch form#rch-agent-search-form input:focus {
  border-color: var(--gray-primary);
  box-shadow: 0 0 0 3px rgba(198, 106, 60, 0.18);
}

.agentsDir .agentsSearch form#rch-agent-search-form div#rch-agent-search-results {
  top: calc(100% + 8px);
  left: 0;
  padding: 0.375rem;
  max-height: 360px;
  background: var(--bg-light);
  border: 1px solid rgba(21, 20, 16, 0.12);
  border-radius: var(--border-radius-6);
  box-shadow: 0 16px 40px rgba(21, 20, 16, 0.12);
}

.agentsDir .agentsSearch #rch-agent-search-results ul li:not(:last-child) {
  margin: 0;
}

.agentsDir .agentsSearch #rch-agent-search-results .rch-search-result-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.625rem;
  border-radius: var(--border-radius-4);
  color: var(--gray-primary);
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.agentsDir .agentsSearch #rch-agent-search-results .rch-search-result-item:hover,
.agentsDir .agentsSearch #rch-agent-search-results .rch-search-result-item:focus-visible {
  background-color: var(--bg-cream);
}

.agentsDir .agentsSearch #rch-agent-search-results .rch-search-result-item img {
  width: 40px;
  height: 40px;
  flex: none;
  object-fit: cover;
  border-radius: 50%;
  filter: grayscale(1);
  background-color: var(--bg-cream); /* agents without a photo: an even cream circle */
}

.agentsDir .agentsSearch #rch-agent-search-results .notfound {
  padding: 0.75rem;
  color: var(--gray-secondary);
  font-size: var(--text-sm);
}

/* cards */
.agentsGrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2.5rem 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.agentCard {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.agentCard-photo {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--bg-cream);
  border-radius: var(--border-radius-4);
}

.agentCard-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  filter: grayscale(1);
  transition: filter 0.5s ease, transform 0.8s ease;
}

.agentCard:hover .agentCard-photo img {
  filter: none;
  transform: scale(1.03);
}

.agentCard-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding-block-start: 1rem;
}

.agentCard-name {
  margin: 0;
  font-size: var(--text-xl);
  font-weight: 500;
  line-height: 1.25;
}

.agentCard-name a {
  color: var(--gray-primary);
  text-decoration: none;
}

.agentCard-role {
  margin-block-start: 0.375rem;
  font-size: var(--text-sm);
  color: var(--gray-secondary);
}

.agentCard-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-block-start: auto;
  padding-block-start: 1rem;
}

.agentCard-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--bg-orange-dark);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-block-end: 2px;
}

.agentCard-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(21, 20, 16, 0.2);
  color: var(--gray-primary);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.agentCard-call:hover {
  background-color: var(--gray-primary);
  color: var(--text-light);
}

.agentsDir-empty {
  padding-block: 3rem;
  text-align: center;
  color: var(--gray-secondary);
}

/* pager */
.agentsPager {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-block-start: 4rem;
}

.agentsPager .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 44px;
  height: 44px;
  padding-inline: 0.75rem;
  font-size: var(--text-base);
  color: var(--gray-primary);
  text-decoration: none;
  border: 1px solid rgba(21, 20, 16, 0.16);
  border-radius: var(--border-radius-6);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.agentsPager a.page-numbers:hover {
  border-color: var(--gray-primary);
}

.agentsPager .page-numbers.current {
  background-color: var(--gray-primary);
  border-color: var(--gray-primary);
  color: var(--text-light);
}

.agentsPager .page-numbers.dots {
  min-width: 24px;
  padding: 0;
  border-color: transparent;
}

.agentsPager .page-numbers.prev,
.agentsPager .page-numbers.next {
  padding-inline: 1.125rem;
}

.agentsPager .page-numbers.prev {
  margin-inline-end: 0.5rem;
}

.agentsPager .page-numbers.next {
  margin-inline-start: 0.5rem;
}

.agentsPager-count {
  margin-block-start: 1rem;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--gray-secondary);
}

@media screen and (max-width: 1200px) {
  .agentsGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media screen and (max-width: 768px) {
  .agentsDir-bar {
    flex-direction: column-reverse;
    align-items: stretch;
    gap: 1rem;
  }

  .agentsDir .agentsSearch.rch-top-filter {
    width: 100%;
  }

  .agentsGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.75rem 0.75rem;
  }

  .agentCard-name {
    font-size: var(--text-base);
  }

  .agentCard-role {
    font-size: var(--text-xs);
  }

  .agentCard-actions {
    padding-block-start: 0.75rem;
  }

  .agentCard-call {
    width: 32px;
    height: 32px;
  }

  /* page numbers on one line, Previous / Next as a full-width pair under them */
  .agentsPager {
    margin-block-start: 3rem;
  }

  .agentsPager .page-numbers.prev,
  .agentsPager .page-numbers.next {
    order: 2;
    flex: 1 1 calc(50% - 0.25rem);
    margin: 0.5rem 0 0;
  }
}

/*********************
END: AGENTS DIRECTORY
*********************/

/*********************
START: PHONE LAYOUTS (About, Contact, Blog, Neighborhoods)
*********************/
@media screen and (max-width: 768px) {

  /* About: the four "approach" boxes two per row */
  .approach--list ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .approach--list ul li {
    padding: 1.25rem 1rem;
  }

  .approach--list ul li:not(:last-child) {
    margin: 0;
  }

  .approach--list ul li h3 {
    font-size: var(--text-lg);
    margin-block-end: 0.625rem;
  }

  .approach--list ul li p {
    font-size: var(--text-sm);
    line-height: 1.55;
  }

  /* Contact: one layer of padding instead of card padding + form padding */
  body .heroContact--form {
    padding: 1.25rem 1rem;
  }

  body .heroContact--form .rch-leads-form-block__form,
  body .heroContact--form form {
    padding: 0 !important;
    border: 0;
    background: transparent;
  }

  body .heroContact--form .form-group {
    margin-block-end: 1.25rem;
  }

  body .heroContact--form textarea {
    min-height: 120px;
    height: 120px;
  }

  body .heroContact--form button[type="submit"] {
    width: 100%;
  }

  /* Blog archive + "More blog posts": two per row */
  body .blog ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.5rem 0.75rem;
  }

  body .blog ul li {
    width: auto;
    flex-basis: auto;
    margin: 0;
    min-width: 0;
  }

  body .blog ul li picture {
    margin-block-end: 0.625rem;
  }

  body .blog ul li p {
    font-size: var(--text-sm);
    line-height: 1.4;
  }

  /* the hover "Learn more" overlay is hidden on phones; the card itself links (below) */
  body .blog ul li a.btn {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: none;
    width: 100%;
    max-width: none;
    height: 0;
    font-size: 0;
  }

  /* Neighborhoods archive + related: two per row, tight gutters */
  body.post-type-archive-neighborhoods .content-area {
    display: block;
    padding-inline: 2.5vw;
  }

  body.post-type-archive-neighborhoods .content-area > * {
    padding: 0 !important;
    margin: 0 !important;
  }

  body ul.rch-neighborhoods-archive {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.625rem;
    margin: 0;
  }

  body ul.rch-neighborhoods-archive .item {
    width: auto !important;
    padding: 0;
  }

  body ul.rch-neighborhoods-archive li .item-wrapper {
    display: block;
    position: relative;
    aspect-ratio: 4 / 5;
    border-radius: var(--border-radius-4);
  }

  body ul.rch-neighborhoods-archive li .image-holder,
  body ul.rch-neighborhoods-archive li .image-holder img {
    width: 100%;
    height: 100%;
  }

  body ul.rch-neighborhoods-archive li .image-holder img {
    object-fit: cover;
  }

  body ul.rch-neighborhoods-archive li .content-container h3 {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    font-size: var(--text-lg);
  }

  body ul.rch-neighborhoods-archive li.item .content-container .button-wrapper {
    display: none;
  }

  /* Single neighborhood: text edge to edge of the page gutter, comfortable size */
  body.single-neighborhoods .neighborhoodSinglePost {
    padding: 2rem 0 0 !important;
  }

  body.single-neighborhoods .neighborhoodSinglePost p {
    font-size: 1rem;
    line-height: 1.7;
  }
}

/* single post "More blog post": 4 related posts, one row on desktop */
@media screen and (min-width: 769px) {
  body.single-post .blog ul {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
  }

  body.single-post .blog ul li {
    width: auto;
    flex-basis: auto;
    margin: 0;
    min-width: 0;
  }
}

/* single neighborhood "Explore similar": four across on desktop */
@media screen and (min-width: 769px) {
  body ul.rch-neighborhoods-archive.nhRelated {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 0;
  }

  body ul.rch-neighborhoods-archive.nhRelated .item {
    width: auto !important;
    padding: 0;
  }

  body ul.rch-neighborhoods-archive.nhRelated li .item-wrapper {
    display: block;
    position: relative;
    aspect-ratio: 4 / 5;
  }

  body ul.rch-neighborhoods-archive.nhRelated li .image-holder,
  body ul.rch-neighborhoods-archive.nhRelated li .image-holder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

/*********************
END: PHONE LAYOUTS
*********************/

/*********************
START: DESKTOP HERO
*********************/
/* one screen tall (was 120vh) so the search bar pinned to its bottom is visible on arrival */
@media screen and (min-width: 769px) {
  .hero,
  .hero--content {
    height: 100vh;
    height: 100svh;
    min-height: 640px;
  }

  /* sits above the demo version switcher (fixed, 24px from the bottom, ~52px tall) */
  .hero--listing__search {
    bottom: 4rem;
  }
}

/*********************
END: DESKTOP HERO
*********************/

/*********************
START: HOMEPAGE NEIGHBORHOODS (four cards) + PHONE HERO
*********************/
/* desktop: two rows of offset widths (7+5, then 5+7) so four neighborhoods fill the block */
.neighborhood .neighborhood--row {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: 24rem;
}

.neighborhood .neighborhood--row .neighborhood--item,
.neighborhood .neighborhood--row .neighborhood--item:nth-child(n) {
  grid-column: span 6;
  min-height: 0;
}

.neighborhood .neighborhood--row .neighborhood--item:nth-child(4n + 1),
.neighborhood .neighborhood--row .neighborhood--item:nth-child(4n + 4) {
  grid-column: span 7;
}

.neighborhood .neighborhood--row .neighborhood--item:nth-child(4n + 2),
.neighborhood .neighborhood--row .neighborhood--item:nth-child(4n + 3) {
  grid-column: span 5;
}

.neighborhood .neighborhood--item__img {
  aspect-ratio: auto;
  height: 100%;
}

@media screen and (max-width: 768px) {
  /* phones: 2 x 2 portrait cards, the whole card opens the neighborhood */
  .neighborhood .neighborhood--row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 0.625rem;
  }

  .neighborhood .neighborhood--row .neighborhood--item:nth-child(n) {
    grid-column: auto;
    aspect-ratio: 4 / 5;
  }

  .neighborhood .neighborhood--item__label {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    font-size: var(--text-lg);
  }

  .neighborhood .neighborhood--item:hover .neighborhood--item__label {
    bottom: 0.75rem;
  }

  .neighborhood .neighborhood--item a.btn {
    inset: 0;
    top: 0;
    left: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    opacity: 0;
    transform: none;
    font-size: 0;
    z-index: 2;
  }

  /* phone hero: natural height, compact title + one-row stats, one-line search */
  .hero,
  .hero--content {
    height: auto;
  }

  .hero--content {
    padding-block: 7.5rem 2.5rem;
    row-gap: 2rem;
  }

  .hero--content__title {
    height: auto;
    row-gap: 1.75rem;
  }

  .hero--content__title h1,
  .hero--content h1 {
    font-size: clamp(2.5rem, 12vw, 3.25rem);
    line-height: 1;
  }

  .hero--content__title ul {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 0;
    padding-block: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
  }

  .hero--content__title ul li {
    align-items: center;
    text-align: center;
    padding-inline: 0.25rem;
  }

  .hero--content__title ul li + li {
    border-left: 1px solid rgba(255, 255, 255, 0.2);
  }

  .hero--content__title ul li span {
    font-size: var(--text-xl);
  }

  .hero--content__title ul li p {
    font-size: 0.75rem;
    line-height: 1.3;
    margin-block-start: 0.25rem;
  }

  .hero--listing__search {
    position: relative;
    bottom: auto;
  }

  /* price / beds / baths are on the results page; the hero keeps address + Search on one line */
  /* .hero--listing__search .rcw-filters {
    display: none !important;
  } */

  .hero--listing__search .rcw-search-bar {
    display: flex !important;
    flex-direction: row !important;
    align-items: stretch;
    gap: 0.5rem;
  }

  .hero--listing__search .rcw-search-bar > .rcw-search {
    flex: 1 1 0 !important;
    min-width: 0;
  }

  .hero--listing__search .rcw-search-bar .search_address_input__field_wrapper {
    height: 48px;
  }

  .hero--listing__search .rcw-search-bar .rcw-search-btn {
    flex: 0 0 auto;
    width: auto !important;
    height: 48px;
    padding-inline: 1rem;
  }
}

/*********************
END: HOMEPAGE NEIGHBORHOODS + PHONE HERO
*********************/
