/* stylelint-disable selector-class-pattern */

/* =========================================================
   JSC COMPONENT CONTRACT
   File: jsc-idx-results-card.css
   Layer: IDX / Results Card
   Version: 2.0

   PURPOSE
   ----------------------------------------------------------------
   Owns:
   - Individual results card shell
   - Image treatment
   - Price overlay
   - Address and quick details
   - Footer meta / IDX compliance

   NOTES
   ----------------------------------------------------------------
   - Designed to feel consistent with the header + toolbar shell
   - Keeps a clean luxury / editorial real-estate tone
========================================================= */

:is(
  .jsc-idx-results-shell,
  body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
) .flexmls-listing{
  float: none !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  text-decoration: none;
  color: inherit;

  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(18, 20, 26, 0.08);
  border-radius: 26px;
  box-shadow: 0 10px 28px rgba(18, 20, 26, 0.05);

  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease;
}

:is(
  .jsc-idx-results-shell,
  body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
) .flexmls-listing:hover{
  transform: translateY(-4px);
  border-color: rgba(18, 20, 26, 0.14);
  box-shadow: 0 18px 40px rgba(18, 20, 26, 0.08);
}

/* =========================================================
   JSC IDX RESULT CARD BROKER ATTRIBUTION
   Injected by JS after FlexMLS card render
========================================================= */

.flexmls-listing .jsc-idx-card-broker {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(24, 24, 18, 0.1);
  font-size: 0.875rem;
  line-height: 1.35;
  color: rgba(24, 24, 18, 0.68);
}

.flexmls-listing .jsc-idx-card-broker__label {
  font-weight: 700;
  color: rgba(24, 24, 18, 0.92);
}

.flexmls-listing .jsc-idx-card-broker__name {
  font-weight: 500;
}

:is(
  .jsc-idx-results-shell,
  body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
) .flexmls-image-wrapper{
  position: relative;
  aspect-ratio: 1.22 / 1;
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-bottom: 1px solid rgba(18, 20, 26, 0.08);
}

:is(
  .jsc-idx-results-shell,
  body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
) .flexmls-image-wrapper::after{
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      to top,
      rgba(0, 0, 0, 0.52) 0%,
      rgba(0, 0, 0, 0.14) 42%,
      transparent 74%
    );
  pointer-events: none;
}

:is(
  .jsc-idx-results-shell,
  body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
) .new-listing-tag{
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  background: #0b76d1;
  color: #fff;
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

:is(
  .jsc-idx-results-shell,
  body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
) .flexmls-price{
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 2;

  font-size: clamp(24px, 2vw, 38px);
  line-height: 1;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
}

:is(
  .jsc-idx-results-shell,
  body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
) .flexmls-portal-links{
  position: absolute;
  inset: auto 16px 16px auto;
  z-index: 3;
}

:is(
  .jsc-idx-results-shell,
  body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
) .flexmls-content-wrapper{
  display: grid;
  gap: 14px;
  padding: 20px 20px 22px;
  flex: 1 1 auto;
}

:is(
  .jsc-idx-results-shell,
  body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
) .flexmls-address{
  color: var(--jsc-ink, #12141a);
  font-size: 20px;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: -0.01em;
}

:is(
  .jsc-idx-results-shell,
  body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
) .flexmls-quick-details{
  display: flex;
  flex-wrap: wrap;
  gap: 10px 10px;
  align-items: center;
}

:is(
  .jsc-idx-results-shell,
  body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
) .flexmls-status{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(45, 125, 53, 0.09);
  font-size: 12px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

:is(
  .jsc-idx-results-shell,
  body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
) .flexmls-status-active{
  color: #2d7d35;
}

:is(
  .jsc-idx-results-shell,
  body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
) .flexmls-details{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

:is(
  .jsc-idx-results-shell,
  body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
) .flexmls-detail{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(18, 20, 26, 0.05);
  color: var(--jsc-ink-2, #5f6472);
  font-size: 13px;
  line-height: 1;
  font-weight: 600;
  letter-spacing: 0.02em;
}

:is(
  .jsc-idx-results-shell,
  body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
) .flexmls-last-modified-and-idx-wrapper{
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(18, 20, 26, 0.08);
  color: var(--jsc-ink-2, #5f6472);
  font-size: 13px;
  line-height: 1.4;
}

:is(
  .jsc-idx-results-shell,
  body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
) .flexmls-last-modified-and-label-wrapper{
  min-width: 0;
}

:is(
  .jsc-idx-results-shell,
  body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
) .flexmls-bold-label{
  color: var(--jsc-ink, #12141a);
  font-weight: 600;
}

:is(
  .jsc-idx-results-shell,
  body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
) .flexmls-idx-compliance-label{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 46px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(47, 51, 32, 0.08);
  color: var(--jsc-ink-2, #5f6472);
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  flex: 0 0 auto;
}

/* =========================================================
   JSC IDX RESULT CARD COMPLIANCE
   Normal-flow version to avoid overlap with details/pills.
========================================================= */

.flexmls-listing .flexmls-content-wrapper {
  position: relative;
  padding-bottom: 0 !important;
}

/* Restore footer to normal flow */
.flexmls-listing .flexmls-last-modified-and-idx-wrapper {
  position: static !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  margin-top: 14px !important;
  padding-bottom: 10px !important;
}

/* Injected MLS / office block */
.flexmls-listing .jsc-idx-card-compliance {
  position: static !important;
  margin: 14px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(24, 24, 18, 0.1);

  display: grid;
  gap: 10px;
  min-height: 76px;

  font-size: 0.875rem;
  line-height: 1.35;
  color: rgba(24, 24, 18, 0.68);
}

.flexmls-listing .jsc-idx-card-compliance > div {
  display: grid;
  gap: 3px;
}

.flexmls-listing .jsc-idx-card-compliance__label {
  display: block;
  font-weight: 700;
  color: rgba(24, 24, 18, 0.92);
}

.flexmls-listing .jsc-idx-card-compliance__value {
  display: block;
  font-weight: 500;
}

.flexmls-listing .jsc-idx-card-office__value {
  min-height: 1.35em;
  opacity: 0.78;
  transition: opacity 180ms ease;
}

.flexmls-listing[data-jsc-office-fetch-complete="true"] .jsc-idx-card-office__value {
  opacity: 1;
}

/* =========================================================
   IDX RESULTS LOAD STABILITY
   Prevents results grid from painting before header/search
   layout is finalized.
========================================================= */

html.jsc-ui-init body.page-id-403 .flexmls_connect__search_results_v2,
html.jsc-ui-init body.page-id-2147 .flexmls_connect__search_results_v2,
html:not(.jsc-idx-widget-ready) body.page-id-403 .flexmls_connect__search_results_v2,
html:not(.jsc-idx-widget-ready) body.page-id-2147 .flexmls_connect__search_results_v2 {
  opacity: 0;
  visibility: hidden;
}

html.jsc-idx-widget-ready body.page-id-403 .flexmls_connect__search_results_v2,
html.jsc-idx-widget-ready body.page-id-2147 .flexmls_connect__search_results_v2 {
  opacity: 1;
  visibility: visible;
  transition: opacity 180ms ease;
}


@media (max-width: 1199.98px){
  :is(
    .jsc-idx-results-shell,
    body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
  ) .flexmls-address{
    font-size: 18px;
  }

  :is(
    .jsc-idx-results-shell,
    body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
  ) .flexmls-content-wrapper{
    padding: 18px 18px 20px;
  }
}

@media (max-width: 767.98px){
  :is(
    .jsc-idx-results-shell,
    body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
  ) .flexmls-image-wrapper{
    aspect-ratio: 4 / 3;
  }

  :is(
    .jsc-idx-results-shell,
    body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
  ) .flexmls-price{
    font-size: clamp(22px, 7vw, 32px);
  }

  :is(
    .jsc-idx-results-shell,
    body.page-id-2147 .flexmls_connect__search_results_v2.flexmls-v2-widget
  ) .flexmls-last-modified-and-idx-wrapper{
    flex-direction: column;
    align-items: flex-start;
  }
}

/* stylelint-enable selector-class-pattern */