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

/* =========================================================
   JSC COMPONENT CONTRACT
   File: jsc-idx.css
   Layer: IDX / Shared Foundation
   Version: 1.0

   PURPOSE
   ----------------------------------------------------------------
   Owns:
   - Local IDX tokens
   - Fixed IDX shell and dynamic stack offset
   - Results offset logic
   - Universal IDX safeguards

   Does NOT own:
   - Compact header search rail
   - Expanded search panel UI
   - IDX support intro and location quick links
========================================================= */

/* =========================================================
   1) LOCAL IDX TOKENS
========================================================= */

/* #region Local IDX Tokens */
:root{
  /* IDX shell + stack */
  --jsc-idx-shell-top: var(--jsc-header-offset-desktop);

  --jsc-idx-fixed-stack: 420px;

  --jsc-idx-shell-z: 30;

  /* shared widths */
  --jsc-idx-shell-max: 1320px;

  --jsc-idx-section-max: 1320px;

  /* shared section padding */
  --jsc-idx-section-pad-inline: clamp(20px,4vw,48px);

  --jsc-idx-shell-pad-inline: clamp(20px,4vw,48px);

  /* shared vertical rhythm */
  --jsc-idx-inner-pad-top: 5px;

  --jsc-idx-inner-pad-bottom: 44px;

  /* shared motion */
  --jsc-idx-fast: var(--jsc-fast);

  --jsc-idx-med: 280ms;

  --jsc-idx-ease: var(--jsc-ease);
}

/* #endregion Local IDX Tokens */

/* =========================================================
   2) UNIVERSAL SAFEGUARDS
========================================================= */

/* #region Universal Safeguards */
.jsc-idx-fixed-shell,
.jsc-idx-fixed-shell__inner,
.jsc-idx-searchbar,
.jsc-idx-searchbar__inner,
.jsc-idx-searchbar__main,
.jsc-idx-searchbar__field,
.jsc-idx-searchbar__actions,
.jsc-idx-search-panel,
.jsc-idx-search-panel__inner,
.jsc-idx-search-panel__card,
.jsc-idx-support,
.jsc-idx-support__inner{
  box-sizing: border-box;
  min-width: 0;
}

/* #endregion Universal Safeguards */

/* =========================================================
   3) FIXED SHELL + RESULTS OFFSET
========================================================= */

/* #region Fixed Shell + Results Offset */
.jsc-idx-fixed-shell{
  position: static !important;
  left: 0;
  right: 0;
  z-index: calc(var(--jsc-z-header) - 1);
  display: flex;
  flex-direction: column;
  background: var(--jsc-surface-light);
  box-shadow: 0 1px 0 rgb(var(--jsc-rgb-mirage) / var(--jsc-o-06));
  pointer-events: none;
}

.jsc-idx-fixed-shell::after{
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 12px;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgb(var(--jsc-rgb-black) / var(--jsc-o-04)),
    transparent
  );
}

.jsc-idx-fixed-shell__inner{
  display: flex;
  flex-direction: column;
  width: 100%;
  min-width: 0;
}

.jsc-idx-fixed-shell > header.jsc-header{
  position: relative;
  inset: auto;
  box-shadow: none;
}

body.flexmls_connect__search_results_page .flexmls_connect__search_results_v2.flexmls-v2-widget{
  box-sizing: border-box;
  padding-top: var(--jsc-idx-fixed-stack);
}

.jsc-idx-results-shell,
.jsc-idx-results-shell .elementor-widget-fmc-widget-fmcsearchresults,
.jsc-idx-results-shell .flexmls_connect__search_results_v2,
.jsc-idx-results-shell .flexmls-v2-widget{
  position: relative;
  z-index: 1;
}

.jsc-idx-search-panel,
.jsc-idx-search-panel__card{
  position: relative;
  z-index: 5;
}

.page-id-403 .jsc-idx-results-shell{
  position: relative;
  z-index: 1;
  margin-top: var(--jsc-idx-fixed-stack);
}

/* =========================================================
   3A) IDX PAGE MODE ROUTING
========================================================= */

.jsc-idx-searchbar,
.jsc-idx-searchbar *,
.jsc-idx-search-panel,
.jsc-idx-search-panel *,
.jsc-idx-support,
.jsc-idx-support *{
  pointer-events: auto;
}

.jsc-idx-search-panel{
  position: relative;
  z-index: 2;
}

body.flexmls_connect__listing_details_page .jsc-idx-searchbar,
body.flexmls_connect__listing_details_page .jsc-idx-search-panel,
body.flexmls_connect__listing_details_page .jsc-idx-support{
  display: none !important;
}

body.flexmls_connect__listing_details_page{
  --jsc-idx-fixed-stack: var(--jsc-header-current-height);
}

body.flexmls_connect__listing_details_page .flexmls-listing-details.flexmls-v2-widget{
  padding-top: var(--jsc-header-current-height);
}

/* #endregion Fixed Shell + Results Offset */

/* =========================================================
   3B) INTERACTION + VISIBILITY HARDENING
========================================================= */

.jsc-idx-search-panel[hidden]{
  display: none !important;
}

.jsc-idx-search-panel__card{
  position: relative;
  z-index: 3;
}

.page-id-403 .jsc-idx-results-shell,
.page-id-403 .jsc-idx-results-shell .elementor-widget-fmc-widget-fmcsearchresults,
.page-id-403 .jsc-idx-results-shell .flexmls_connect__search_results_v2.flexmls-v2-widget{
  position: relative;
  z-index: 1;
}



/* =========================================================
   4) IDX INIT GUARD
========================================================= */

/* #region IDX Init Guard */
html.jsc-is-resizing .jsc-idx-results-shell,
html.jsc-is-resizing .jsc-idx-results-grid,
html.jsc-is-resizing .jsc-idx-support,
html.jsc-is-resizing .jsc-idx-search-panel,
html.jsc-is-resizing .jsc-idx-searchbar,
html.jsc-is-resizing .jsc-idx-fixed-shell,
html.jsc-is-resizing .flexmls_connect__search_results_v2.flexmls-v2-widget{
  transition: none !important;
  animation: none !important;
}

.page-id-403 .jsc-idx-results-shell .elementor-widget-fmc-widget-fmcsearchresults,
.page-id-403 .jsc-idx-results-shell .flexmls_connect__search_results_v2.flexmls-v2-widget{
  margin-top: 0;
  padding-top: 0;
}

/* #endregion IDX Init Guard */
/* =========================================================
   IDX SEARCH PAGE: HEADER SCROLLS WITH PAGE
   Applies to Adirondack Real Estate / search-results pages only.
========================================================= */

html.jsc-idx-search-mode header.elementor-location-header {
  position: static !important;
}




/* =========================================================
   5) SHARED RESPONSIVE TOKENS
========================================================= */

/* #region Shared Responsive Tokens */
@media (max-width: 1024px){
  :root{
    --jsc-idx-inner-pad-top: 12px;

    --jsc-idx-inner-pad-bottom: 36px;
  }
}

@media (max-width: 767.98px){
  :root{
    --jsc-idx-section-pad-inline: 16px;

    --jsc-idx-shell-pad-inline: 16px;

    --jsc-idx-inner-pad-top: 8px;

    --jsc-idx-inner-pad-bottom: 28px;
  }
}

@media (max-width: 479.98px){
  :root{
    --jsc-idx-section-pad-inline: 12px;

    --jsc-idx-shell-pad-inline: 12px;
  }
}

/* #endregion Shared Responsive Tokens */

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