/*********************
Layout pass (2026-11-03): hero, four neighborhoods, phone menu panel,
inner heroes and the agents archive. Loaded after every page stylesheet
(includes/class.php, priority 20).
GOTCHA: never animate/transform .header--menu or .header--btn (stacking context
puts the phone panel under #overlay).
*********************/

/* the phone menu's contact button only shows inside the panel */
.navigation--cta {
  display: none;
}

/* hero: a little shorter (was 100vh with the title pushed down 343px) */
.hero--content {
  min-height: 88vh;
  min-height: 88svh;
}

.hero--content h1 {
  margin-block-start: 260px;
}

/* homepage neighborhoods: four across */
.neighborhoods--content ul {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.neighborhoods--content ul li img {
  height: 460px;
}

@media screen and (max-width: 992px) {
  .neighborhoods--content ul {
    display: grid !important; /* index.css turns it into a flex column on phones */
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .neighborhoods--content ul li {
    width: auto !important;
    min-width: 0;
    margin: 0 !important;
  }

  .neighborhoods--content ul li img {
    height: auto;
    aspect-ratio: 4 / 5;
  }

  /* phone menu: full-height panel from the left (the toggle sits on the left),
     big serif links with hairlines, contact button at the foot */
  .header--menu .navigation {
    left: -100%;
    right: auto;
    top: 0;
    bottom: 0;
    width: min(86vw, 380px);
    min-width: 0;
    height: 100vh;
    height: 100dvh;
    padding: 6.5rem 1.75rem 2rem;
    display: flex;
    flex-direction: column;
    background: var(--Gray-1);
    box-shadow: 12px 0 40px rgba(33, 37, 41, 0.18);
    transition-property: left, visibility;
  }

  .header--menu .navigation.active {
    left: 0;
    right: auto;
  }

  body.admin-bar .header--menu .navigation {
    padding-top: calc(6.5rem + 46px);
  }

  .header--menu .navigation > ul.navMenu {
    flex-direction: column;
    align-items: stretch;
    margin: 0;
    border-top: 1px solid var(--Gray-3);
  }

  .header--menu .navigation > ul.navMenu > li,
  .header--menu .navigation > ul.navMenu > li:not(:last-child) {
    margin: 0;
    border-bottom: 1px solid var(--Gray-3);
  }

  .header--menu .navigation > ul.navMenu > li > a {
    justify-content: space-between;
    padding-block: 0.95rem;
    font-family: var(--font-family-Playfair);
    font-size: var(--text-2xl);
    color: var(--Gray-9);
  }

  .header--menu .navigation > ul.navMenu > li > a::after {
    content: "";
    width: 8px;
    height: 8px;
    border-top: 1.5px solid var(--Gray-6);
    border-right: 1.5px solid var(--Gray-6);
    transform: rotate(45deg);
    flex: none;
  }

  .header--menu .navigation > ul.navMenu > li.current-menu-item > a {
    color: var(--Gray-6);
  }

  .navigation--cta {
    display: flex;
    justify-content: center;
    margin-block-start: auto;
    width: 100%;
    padding: 16px 24px;
  }

  /* the X stays dark and on top of the white panel */
  .nav-icon {
    position: relative;
    z-index: 1000;
  }

  .nav-icon.open:before,
  .nav-icon.open:after {
    background-color: var(--Gray-9);
  }

  /* inner heroes: as tall as the title (was ~600px with a 242px bottom margin) */
  .heroInner--content,
  .single-agents .heroInner .heroInner--content,
  .heroInner--search .heroInner--content {
    margin-block: 0;
    padding-block: 8rem 2.5rem;
    min-height: 0;
  }

  .heroInner {
    min-height: 0;
    height: auto;
  }

  .heroInner--content .breadcrumb--content {
    margin-block: 0 1rem;
  }

  .heroInner--content > h1 {
    margin-block-end: 0.75rem;
    font-size: clamp(1.875rem, 8.5vw, 2.5rem);
    line-height: 1.15;
  }

  .heroInner--content a.btn {
    margin-block-start: 1.25rem;
  }

  /* agents archive: two per row */
  ul.rch-archive-agents {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 1.5rem 0.75rem !important;
  }

  ul.rch-archive-agents li {
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    min-width: 0;
  }

  ul.rch-archive-agents li picture {
    height: auto !important;
  }

  ul.rch-archive-agents li picture img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
  }

  ul.rch-archive-agents li .rch-archive-name h3,
  ul.rch-archive-agents li .rch-archive-name a {
    font-size: var(--text-base);
  }

  ul.rch-archive-agents li .rch-archive-end-line {
    width: 100% !important;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
}

@media screen and (max-width: 768px) {
  /* hero: compact, one-line search (filters live on the results page) */
  .hero--content {
    min-height: 0;
    padding-block-end: 3rem;
  }

  .hero--content h1 {
    margin-block-start: 8rem;
  }

  .hero .rcw-filters,
  .hero--content .rcw-filters {
    display: none !important;
  }

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

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

  .hero .search_address_input__field_wrapper {
    height: 48px;
  }

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

  .neighborhoods--content ul {
    gap: 0.625rem;
  }

  .neighborhoods--content ul li div {
    left: 8px;
    right: 8px;
    bottom: 8px;
    padding: 0.5rem 0.625rem;
    font-size: var(--text-sm);
  }
}
