/* Hotfixes for responsive layout glitches after Tilda export */

/* Project cards: ensure background images are centered on mobile/tablet */
#rec1140380691 .t-bgimg,
#rec1140380691 .t1073__bgimg,
#rec1140380691 .t1073__bgimg.t-bgimg {
  background-position: center center !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
}

/* Global: prevent background tiling when inline styles are malformed */
.t-bgimg {
  background-repeat: no-repeat !important;
}

/* If any card images use img tag instead of bg */
#rec1140380691 img.t-img {
  object-fit: cover;
  object-position: center;
}

/* Sliders / galleries (including popups): keep images centered on narrow screens */
.t-slds__bgimg {
  background-position: center center !important;
  background-size: cover !important;
}

.t-slds__wrapper {
  overflow: hidden;
}

img.t-slds__img,
.t-slds__img.t-img {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  display: block;
  object-fit: cover;
  object-position: center;
}

/* Reviews section (rec1140380636): mobile centering */
#rec1140380636 .t-cover__carrier {
  background-position: center center !important;
  background-size: cover !important;
}

@media screen and (max-width: 480px) {
  #rec1140380636 .t-slds__main.t-container {
    max-width: 100% !important;
    padding-left: 10px !important;
    padding-right: 10px !important;
    box-sizing: border-box;
  }
  #rec1140380636 .t659__content,
  #rec1140380636 .t-slds__container,
  #rec1140380636 .t-cover__wrapper {
    width: 100% !important;
    box-sizing: border-box;
  }
  #rec1140380636 .t-slds__wrapper {
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* Prevent accidental horizontal scroll caused by exported Tilda blocks */
html,
body,
#allrecords {
  overflow-x: hidden;
}

/* Hero cover (rec1140380681, T1120): right text block should fit on 1280x800 */
#rec1140380681 .t1120__col-right {
  box-sizing: border-box;
  min-width: 0;
  max-width: 360px;
}

#rec1140380681 .t1120__col-right .t1120__descr {
  word-break: break-word;
}

@media screen and (max-width: 1280px) {
  #rec1140380681 .t1120__col-right {
    max-width: 300px;
  }

  #rec1140380681 .t1120__col-right .t1120__descr,
  #rec1140380681 .t1120__col-right .t-descr {
    font-size: 16px !important;
    line-height: 1.35 !important;
  }
}

@media screen and (max-width: 980px) {
  /* On tablet/mobile T1120 typically stacks columns; just ensure full width */
  #rec1140380681 .t1120__col-right {
    max-width: 100%;
  }
}

/* Projects grid (rec1322134461, T959): prevent horizontal overflow on ~1280px widths
   Make the cards wrap and reduce columns when needed. */
#rec1322134461 .t959__row {
  display: flex;
  flex-wrap: wrap;
}

#rec1322134461 .t959__card {
  box-sizing: border-box;
  flex: 0 0 25%;
  max-width: 25%;
}

@media screen and (max-width: 1280px) {
  #rec1322134461 .t959__card {
    flex-basis: 33.3333%;
    max-width: 33.3333%;
  }
}

@media screen and (max-width: 960px) {
  #rec1322134461 .t959__card {
    flex-basis: 50%;
    max-width: 50%;
  }
}

@media screen and (max-width: 640px) {
  #rec1322134461 .t959__card {
    flex-basis: 100%;
    max-width: 100%;
  }
}

/* Popup galleries (T750 + t-slds): on some widths slides render as a 2x2 grid.
   Force each slide to take full width. */
.t-popup .t-slds__item {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
  display: block !important;
  float: none !important;
}

.t-popup .t-slds__items-wrapper {
  display: flex !important;
}
