/*
 * Mobile/tablet adaptation for the untouched Wix capture.
 * All layout changes are gated below 981px; the desktop canvas is preserved.
 */
@media (max-width: 980px) {
  :root {
    --site-width: 100% !important;
  }

  html,
  body {
    width: 100% !important;
    min-width: 320px !important;
    max-width: 100% !important;
    -webkit-text-size-adjust: 100%;
  }

  #SITE_CONTAINER,
  #site-root,
  #masterPage,
  #main_MF,
  #SITE_BACKGROUND,
  #BACKGROUND_GROUP,
  [id^="backgroundGroup_"],
  [id^="pageBackground_"],
  #SITE_PAGES > div,
  #SITE_CONTAINER > *,
  #SITE_PAGES,
  #SITE_PAGES > *,
  #SITE_PAGES > * > *,
  #SITE_HEADER,
  #SITE_FOOTER,
  #SITE_HEADER > *,
  #SITE_FOOTER > *,
  [data-mesh-id$="inlineContent"],
  .mesh-layout,
  .mesh-container-content {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  body:not(.responsive) #site-root {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: visible !important;
  }

  #masterPage,
  #SITE_PAGES,
  #SITE_HEADER,
  #SITE_FOOTER,
  #SITE_BACKGROUND,
  #BACKGROUND_GROUP,
  [id^="backgroundGroup_"],
  [id^="pageBackground_"] {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  #masterPage {
    height: auto !important;
    min-height: 0 !important;
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #masterPage.mesh-layout {
    height: auto !important;
    min-height: 0 !important;
  }

  /* The captured Wix editor is a coordinate-based CSS grid, not an absolute
     layout. At narrow widths its grid coordinates and desktop margins must be
     discarded so children participate in normal vertical flow. */
  [data-mesh-id$="-gridContainer"] {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-template-rows: none !important;
    grid-auto-flow: row !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    gap: 16px !important;
  }

  [data-mesh-id$="-gridContainer"] > * {
    position: relative !important;
    inset: auto !important;
    transform: none !important;
    grid-area: auto !important;
    grid-column: auto !important;
    grid-row: auto !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    flex: 0 0 auto !important;
  }

  .mesh-layout,
  .mesh-container-content,
  [data-mesh-id$="inlineContent"] {
    height: auto !important;
    min-height: 0 !important;
  }

  #SITE_PAGES * {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
  }

  #SITE_PAGES {
    height: auto !important;
    min-height: 0 !important;
  }

  #SITE_PAGES > *,
  #SITE_PAGES > * > *,
  #main_MF,
  [data-block-level-container="ClassicSection"] {
    height: auto !important;
    min-height: 0 !important;
  }

  /* Captured Wix columns become naturally wrapping rows; the runtime script
     restores their children to document flow without changing source content. */
  .wixui-column-strip {
    display: flex !important;
    flex-flow: row wrap !important;
    align-items: flex-start !important;
    gap: 0 !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .wixui-column-strip__column {
    box-sizing: border-box !important;
    flex: 1 1 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    height: auto !important;
    min-height: 0 !important;
  }

  /* Preserve common two-up tablet groupings when there is room, while all
     phone layouts stack. */
  .wixui-repeater,
  .gallery-items-container,
  .gallery-items,
  .gallery-items-wrapper,
  [data-testid="gallery-items-container"] {
    box-sizing: border-box !important;
    max-width: 100% !important;
  }

  .gallery-item,
  .wixui-repeater__item,
  .gallery-item-container,
  .gallery-item-wrapper {
    box-sizing: border-box !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  .wixui-image,
  .wixui-image img,
  .gallery-item img,
  .gallery-item picture,
  .blog-post-list-item img,
  iframe,
  video,
  svg {
    max-width: 100% !important;
  }

  .wixui-image img,
  .gallery-item img,
  .blog-post-list-item img {
    height: auto !important;
    object-fit: contain;
  }

  .wixui-rich-text,
  .wixui-rich-text *,
  .blog-post-description-font,
  .blog-post-post-list-description-font {
    box-sizing: border-box !important;
    max-width: 100% !important;
    overflow-wrap: anywhere;
  }

  .wixui-rich-text,
  .wixui-rich-text > *,
  [data-mesh-id$="inlineContent"] > * {
    width: auto !important;
    min-width: 0 !important;
  }

  .wixui-rich-text p,
  .wixui-rich-text li {
    white-space: normal !important;
  }

  input,
  select,
  textarea,
  button {
    max-width: 100%;
    font: inherit;
  }

  input,
  select,
  textarea {
    box-sizing: border-box;
  }

  iframe,
  .wixui-map,
  [data-testid*="map"] {
    width: 100% !important;
    max-width: 100% !important;
  }

  #POPUPS_ROOT,
  #POPUPS_ROOT * {
    box-sizing: border-box;
  }

  /* Background-only banners have no in-flow content to establish a height. */
  [data-block-level-container="ClassicSection"].static-background-banner {
    min-height: clamp(280px, 70vw, 520px) !important;
  }
  .wixui-column-strip__column.static-background-banner {
    min-height: 300px !important;
  }
  [data-block-level-container="ClassicSection"] [data-hook="bgLayers"] wow-image.bgImage {
    position: absolute !important;
    inset: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    top: 0 !important;
  }
  [data-block-level-container="ClassicSection"] [data-motion-part^="BG_MEDIA"],
  .wixui-column-strip__column [data-motion-part^="BG_MEDIA"] {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    margin: 0 !important;
  }

  .wixui-rich-text {
    padding: 12px 16px;
  }
  .static-mobile-prose :is(p, li, span) {
    font-size: 17px !important;
    line-height: 1.7 !important;
  }
  .static-mobile-prose p {
    text-align: start !important;
  }
  .wixui-rich-text :is(h1, h2, h3),
  .wixui-rich-text :is(h1, h2, h3) span {
    font-size: clamp(24px, 5vw, 32px) !important;
    line-height: 1.4 !important;
  }
  .wixui-rich-text p:empty {
    display: none;
  }
  #SITE_HEADER .wixui-rich-text {
    padding: 0 16px;
  }
  #SITE_HEADER #comp-lm7frqiu :is(h1, h2, h3, span) {
    font-size: 15px !important;
    line-height: 1.5 !important;
  }
  #SITE_FOOTER {
    background: #173f5b;
    padding: 24px 16px;
  }
  #SITE_FOOTER .wixui-rich-text {
    padding: 0;
  }
  .wixui-button,
  .wixui-button > *,
  button,
  input,
  select {
    min-height: 44px;
  }
  input,
  textarea,
  select {
    font-size: 16px !important;
  }
  .wixui-map iframe {
    min-height: 300px;
  }
}

@media (min-width: 600px) and (max-width: 980px) {
  .wixui-column-strip__column[data-responsive-columns="2"] {
    flex-basis: 50% !important;
  }
}

@media (max-width: 599px) {
  .wixui-column-strip__column {
    flex-basis: 100% !important;
  }

  .gallery-item,
  .wixui-repeater__item,
  .gallery-item-container,
  .gallery-item-wrapper {
    width: 100% !important;
  }

  .gallery-item img {
    height: auto !important;
    max-height: none !important;
  }
}
