/* ==========================================================================
   Responsive — Ultra Modern Dark
   Mobile/tablet breakpoint refinements across all components.
   Source: ultra modern dark design guide.md, section 6
   ========================================================================== */

/* ==========================================================================
   TABLET — max-width: 991px
   ========================================================================== */

@media (max-width: 991px) {

  /* Section spacing rhythm — tablet */
  :root {
    --section-padding: 72px;
  }

  /* Header adjustments */
  .header-media {
    margin-bottom: 60px;
  }

  /* Hero search overlay */
  .hero-search-overlay__grid {
    flex-wrap: wrap;
  }

  .hero-search-overlay-wrapper {
    width: min(94%, 760px);
  }

  .hero-search-overlay {
    padding: 20px 22px;
  }

  .hero-search-overlay__field {
    flex: 1 1 45%;
  }

  .hero-search-overlay__action {
    flex-basis: 100%;
    justify-content: flex-start;
  }

  .hero-search-overlay__submit {
    width: 54px;
  }

  .hero-search-overlay__action .btn {
    width: 100%;
  }

  /* Gallery card title */
  .RWS2018-gallery-component .gallery-card__title,
  .rws-gallery-cards-block .gallery-card__title {
    font-size: 20px;
  }

  /* Blog cards */
  .rws-blog-card__title {
    font-size: 20px;
  }

  .rws-blog-card__body {
    padding: 20px;
  }

  /* Testimonial description */
  .testimonial-carousel .block-body .description {
    font-size: 14px;
    line-height: 24px;
  }

  /* IDX search layout — stack on tablet */
  #rws_search_form div.search_item {
    width: 48%;
    padding: 0 1% 2%;
  }

  /* List group padding */
  .list-group .list-group-item {
    padding: 10px 25px;
  }

  .list-group-item .list-group-item {
    margin-right: -25px;
  }

  /* Agents block */
  .agents-block {
    height: 180px;
  }
}

/* ==========================================================================
   LARGE TABLET — max-width: 1199px
   ========================================================================== */

@media (max-width: 1199px) {
  .hero-search-overlay__grid {
    gap: 14px;
  }
}

/* ==========================================================================
   MOBILE — max-width: 767px
   ========================================================================== */

@media (max-width: 767px) {

  /* Section spacing rhythm — mobile */
  :root {
    --section-padding: 56px;
  }

  /* Hero search overlay — normal document flow */
  .hero-search-overlay-wrapper {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto;
    transform: none;
    width: 92%;
    margin: -340px auto 40px auto;
    display: block !important;
    z-index: 30;
  }

  .hero-search-overlay {
    padding: 18px 20px;
    background: rgba(9, 9, 9, 0.88);
  }

  .hero-search-overlay__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    align-items: end;
  }

  .hero-search-overlay__field--wide {
    grid-column: span 2;
  }

  .hero-search-overlay__field--narrow {
    grid-column: span 1;
  }

  .hero-search-overlay__action {
    grid-column: span 2;
    display: flex;
    justify-content: center;
  }

  .hero-search-overlay__submit {
    width: 100%;
    max-width: 300px;
  }

  /* Gallery component */
  .RWS2018-gallery-component .gallery-component__container,
  .rws-gallery-cards-block .gallery-component__container {
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Blog cards */
  .rws-blog-two-col {
    margin-top: 40px;
  }

  .rws-blog-two-col__item {
    margin-bottom: 30px;
  }

  .rws-blog-card__meta {
    display: flex;
    flex-wrap: wrap;
  }

  .rws-blog-card__meta-item {
    margin-bottom: 6px;
  }

  /* Property listing list-view */
  .property-listing.list-view .property-item-v2 .item-body-bottom {
    padding: 0;
  }

  /* Houzez property-item list-view — stack on mobile */
  .property-listing.list-view .property-item {
    display: block;
  }

  .property-listing.list-view .property-item .table-cell {
    display: block;
  }

  .property-listing.list-view .property-item .figure-block {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
  }

  .property-listing.list-view .property-item .item-body {
    width: 100%;
    padding: 16px;
  }

  .property-listing.list-view .property-item .body-left {
    width: 100%;
    float: none;
    margin-bottom: 14px;
  }

  .property-listing.list-view .property-item .body-right {
    width: 100%;
    float: none;
    text-align: left;
    padding-left: 0;
    padding-top: 14px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  /* Taxonomy page title */
  .page-title.breadcrumb-top {
    padding: 16px 0;
    margin-bottom: 20px;
  }

  .page-title-right .view {
    flex-wrap: wrap;
    gap: 8px;
  }

  /* IDX search — full width on mobile */
  #rws_search_form div.search_item {
    width: 100%;
    padding: 0 0 2%;
  }

  /* Agents block */
  .agents-block {
    height: 80px;
  }

  /* Touch-friendly tap targets — min 48px */
  .btn,
  .btn-primary,
  .btn-secondary,
  .gform_button,
  input[type="submit"],
  button[type="submit"],
  .rws_search_button,
  .rws_button,
  .bootstrap-select .dropdown-toggle,
  .chosen-container-single .chosen-single {
    min-height: 48px;
  }

  /* Mobile nav */
  .mobile-nav .nav-dropdown {
    max-height: 80vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-nav .nav-dropdown a {
    padding: 12px 20px;
    min-height: 48px;
    display: flex;
    align-items: center;
  }
}

/* ==========================================================================
   SMALL MOBILE — max-width: 575px
   ========================================================================== */

@media (max-width: 575px) {
  .hero-search-overlay-wrapper {
    width: 96%;
    margin-top: -240px;
  }

  .hero-search-overlay {
    padding: 16px;
  }
}

/* ==========================================================================
   SMALL SCREEN TYPOGRAPHY — max-width: 560px
   ========================================================================== */

@media (max-width: 560px) {
  h2.lp-h2 {
    font-size: 32px;
    letter-spacing: 0.75px;
    line-height: 1.4;
  }
}

/* ==========================================================================
   jPList mobile overrides
   ========================================================================== */

@media only screen and (max-width: 800px) {
  .hero-search-overlay-wrapper {
    display: block !important;
    z-index: 30;
  }

  #results.jplist-list-view .list .block,
  #results.jplist-list-view .list .img {
    /* !important required — jPList inline styles */ 
    margin: 0 !important;
  }

  #results.jplist-list-view .list .img img {
    /* !important required — jPList inline styles */
    border-radius: 0 !important;
    border: 0;
  }

  #results.jplist-grid-view .list-item .img,
  #results.jplist-thumbs-view .list-item .img {
    margin: 0 !important;
    width: 100% !important;
  }

  #results.jplist-thumbs-view .list-item .block {
    margin: 0 !important;
    width: 100% !important;
    bottom: 10px;
  }
}

/* ==========================================================================
   DESKTOP+ — min-width: 992px
   ========================================================================== */

@media (min-width: 992px) and (max-width: 1199px) {
  .agents-block {
    height: 230px;
  }
}

@media (min-width: 1199px) {
  .agents-block {
    overflow: hidden;
    height: 260px;
    padding: 15px;
  }
}
