/*********************
Layout pass (2026-11-03): phone hero, results, agents, talk, inner heroes
and archives. Loaded after every page stylesheet (includes/class.php, priority 20).
*********************/

/* agent names on the homepage mosaic (bottom fade keeps them readable) */
.agents--content ul li a {
  position: relative;
  display: block;
}

.agents--content ul li a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--border-radius15);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0) 45%);
  pointer-events: none;
}

.agents--name {
  position: absolute;
  left: 0.875rem;
  right: 0.875rem;
  bottom: 0.75rem;
  z-index: 1;
  color: var(--baseLight-color);
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.2;
}

/* inner heroes: shorter on desktop too (was 80vh) */
.heroInner {
  height: clamp(380px, 60vh, 600px);
}

@media screen and (max-width: 768px) {

  /*********************
  HOMEPAGE
  *********************/
  /* hero: as tall as its content, one-line search (filters are on the results page) */
  .hero {
    min-height: 0;
  }

  .hero--content {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 95%;
    margin-inline: auto;
    padding-block: 8rem 3rem;
  }

  .hero--content .title {
    font-size: clamp(2rem, 9vw, 2.5rem);
    line-height: 1.15;
  }

  .hero--content .text {
    font-size: var(--text-base);
    line-height: 1.5;
    margin-block-start: 0.75rem;
  }

  .hero--content .search-header {
    margin-block-start: 1.75rem;
  }

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

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

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

  .hero--content .search-header .search_address_input__field_wrapper {
    height: 48px;
  }

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

  .scrollTo {
    display: none;
  }

  /* results: shorter photo, the three counters on one line */
  .results {
    min-height: 0;
    padding-block: 2.5rem 4rem;
  }

  .results--img img {
    aspect-ratio: 4 / 3;
    height: auto;
    object-fit: cover;
    border-radius: var(--border-radius15);
  }

  .results--counter ul {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 0;
    margin-block-start: 2rem;
    padding-block: 1.25rem;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  }

  .results--counter ul li {
    width: auto;
    align-items: center;
    text-align: center;
    padding-inline: 0.25rem;
    margin: 0;
  }

  .results--counter ul li + li {
    border-left: 1px solid rgba(255, 255, 255, 0.15);
  }

  .results--counter ul li > h3,
  .results--counter ul li h3,
  .results--counter .mil-wrapper,
  .results--counter .mil-wrapper h3,
  .results--counter .percantage-wrapper,
  .results--counter .percantage-wrapper h3 {
    font-size: var(--text-2xl) !important;
    margin-block-end: 0.25rem;
    justify-content: center;
  }

  .results--counter ul li > p {
    font-size: 0.6875rem;
    line-height: 1.35;
    color: rgba(255, 255, 255, 0.65);
  }

  .results--text {
    width: 100%;
    margin-block-start: 2rem;
    font-size: var(--text-base);
    line-height: 1.65;
    text-align: left;
  }

  /* agents: one swipeable row of portrait cards with names (was a 3-4-3 mosaic of tiny tiles);
     the three group lists are flattened into the .agents--mosaic scroller */
  .agents .agents--content {
    display: flex;
    flex-direction: column;
    margin-block-start: 1.5rem;
  }

  .agents .agents--mosaic {
    display: flex;
    gap: 0.75rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 2.5vw;
    padding-inline: 2.5vw;
    padding-block-end: 0.5rem;
    scrollbar-width: none;
  }

  .agents .agents--mosaic::-webkit-scrollbar {
    display: none;
  }

  .agents .agents--mosaic > ul {
    display: contents;
  }

  .agents .agents--mosaic > ul > li {
    flex: 0 0 min(64%, 260px) !important;
    max-width: none !important;
    margin: 0 !important;
    scroll-snap-align: start;
  }

  .agents .agents--mosaic > ul > li img {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
    object-fit: cover;
    object-position: center 20%;
    border-radius: var(--border-radius15);
  }

  .agents--name {
    font-size: var(--text-lg);
  }

  .agents--content > a.btn {
    margin-block-start: 2rem;
    align-self: center;
  }

  /* talk: full-width form, short photo band instead of a 130vh fixed parallax */
  .talk--content {
    flex-direction: column;
  }

  .talk--form,
  .talk--img {
    width: 95%;
    margin-inline: auto;
  }

  .talk--form {
    padding-inline: 0;
    margin-block-start: 3rem;
  }

  .talk--form .title {
    font-size: var(--text-3xl);
  }

  .talk--form form {
    margin-block-start: 1.5rem;
  }

  .talk--form form input,
  .talk--form form textarea {
    margin-block: 0.25rem 1rem;
  }

  .talk--form form textarea {
    height: 110px;
  }

  .talk--img {
    margin-block: 0 3rem;
  }

  .talk--img .parallax {
    min-height: 0;
    aspect-ratio: 16 / 10;
    background-attachment: scroll;
    background-position: center;
    border-radius: var(--border-radius15);
  }

  /*********************
  INNER HEROES: as tall as the title
  *********************/
  .heroInner,
  .heroInner--agents,
  .heroInner.heroInner--neighborhoods__container {
    height: auto;
    min-height: 0;
  }

  .heroInner {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-block: 8rem 2.5rem;
  }

  .heroInner.heroInner--neighborhoods__container {
    margin-block-end: 2rem;
  }

  .heroInner h1,
  .heroInner .heroInner--neighborhoods {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    width: 95%;
    margin-inline: auto;
  }

  .heroInner h1 {
    font-size: clamp(1.875rem, 8.5vw, 2.5rem);
    line-height: 1.15;
  }

  .heroInner > .container {
    position: relative;
    z-index: 1;
    width: 100%;
  }

  .heroInner .heroInner--neighborhoods {
    gap: 1rem;
  }

  .heroInner .mini-des-neighbour.short-description {
    font-size: var(--text-sm);
    line-height: 1.55;
  }

  /*********************
  ARCHIVES
  *********************/
  /* agents archive: two per row on every phone (480px and down used to drop to one) */
  .rch-agents-rechat ul.rch-archive-agents {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 0.75rem;
  }

  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 {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  /* neighborhoods archive + related: two per row */
  body ul.rch-neighborhoods-archive {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.625rem;
    margin: 0;
  }

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

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

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

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

  body ul.rch-neighborhoods-archive li .content-container {
    left: 0.75rem !important;
    right: 0.75rem !important;
    bottom: 0.75rem !important;
    top: auto !important;
    transform: none !important;
    width: auto !important;
    text-align: left;
  }

  body ul.rch-neighborhoods-archive li .content-container h3 {
    margin: 0;
    font-size: var(--text-lg);
  }

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