/*
 * Tiles page (#289) module CSS, moved out of the Divi Builder "Custom CSS" fields.
 *
 * Page-scoped on purpose: the .bm-tile-gallery-module class also exists on the
 * Countertops page (#221), where Divi never emitted this CSS. Loading it
 * site-wide restyled that gallery (measured: its grid went from unstyled to a
 * 5-column 1/1.34 grid), so it is enqueued for the Tiles page only.
 */

/* ==========================================================================
   Tile gallery
   ========================================================================== */

/* First body section background position migrated from Divi section CSS. */
body.page-id-289 .et_pb_section_48 {
  background-position: center 75% !important;
}

.bm-tile-gallery-module {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  text-align: center !important;
}

.bm-tile-gallery-module .et_pb_gallery_items {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 34px !important;
  width: 100% !important;
  max-width: 100% !important;
}

.bm-tile-gallery-module .et_pb_gallery_item,
.bm-tile-gallery-module .et_pb_grid_item {
  width: 100% !important;
  margin: 0 !important;
  float: none !important;
  clear: none !important;
  text-align: center !important;
}

.bm-tile-gallery-module .et_pb_gallery_image {
  width: 100% !important;
  aspect-ratio: 1 / 1.34 !important;
  overflow: hidden !important;
  margin-bottom: 20px !important;
}

.bm-tile-gallery-module .et_pb_gallery_image a,
.bm-tile-gallery-module .et_pb_gallery_image img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
}

.bm-tile-gallery-module .et_pb_gallery_image img {
  object-fit: cover !important;
}

.bm-tile-gallery-module .et_overlay {
  display: none !important;
}

.bm-tile-gallery-module .et_pb_gallery_title,
.bm-tile-gallery-module .et_pb_gallery_caption {
  display: block !important;
  width: 100% !important;
  text-align: center !important;
}

.bm-tile-gallery-module .et_pb_gallery_title {
  margin: 0 0 14px !important;
  padding: 0 !important;
  font-size: 15px !important;
  line-height: 1.25 !important;
  font-weight: 500 !important;
  letter-spacing: 0.02em !important;
  text-transform: uppercase !important;
  color: #4f403c !important;
}

.bm-tile-gallery-module .et_pb_gallery_caption {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 15px !important;
  line-height: 1.15 !important;
  color: #4f403c !important;
}

@media (max-width: 980px) {
  .bm-tile-gallery-module .et_pb_gallery_items {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    align-items: flex-start !important;
    gap: 32px 24px !important;
  }

  .bm-tile-gallery-module .et_pb_gallery_item,
  .bm-tile-gallery-module .et_pb_grid_item {
    width: 30% !important;
    max-width: 260px !important;
    min-width: 0 !important;
  }
}

@media (max-width: 767px) {
  .bm-tile-gallery-module .et_pb_gallery_items {
    gap: 30px 22px !important;
  }

  .bm-tile-gallery-module .et_pb_gallery_item,
  .bm-tile-gallery-module .et_pb_grid_item {
    width: calc(50% - 11px) !important;
    max-width: 220px !important;
  }

  .bm-tile-gallery-module .et_pb_gallery_title,
  .bm-tile-gallery-module .et_pb_gallery_caption {
    font-size: 14px !important;
  }
}

/* ==========================================================================
   Material guide blurbs — from the .material-guide-row row
   ========================================================================== */

/* Маленькие ноутбуки и планшеты */
@media (max-width: 1300px) {
  /* Иконка сверху, текст под ней */
  .material-guide .et_pb_blurb_content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  .material-guide .et_pb_main_blurb_image {
    margin: 0 0 20px 0 !important;
  }

  .material-guide .et_pb_blurb_container {
    width: 100% !important;
    text-align: center !important;
  }

  .material-guide .et_pb_module_header,
  .material-guide h4 {
    text-align: center !important;

    /* Запрет переноса по буквам */
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
    white-space: normal !important;

    line-height: 1.1 !important;
  }

  .material-guide .et_pb_blurb_description,
  .material-guide p {
    text-align: center !important;

    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
  }
}

@media (max-width: 1500px) {
  .material-guide .et_pb_blurb {
    display: flex !important;
    justify-content: center !important;
  }

  .material-guide .et_pb_blurb_content {
    width: 320px !important;
    max-width: 100% !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  .material-guide .et_pb_main_blurb_image {
    width: 140px !important;
    display: flex !important;
    justify-content: center !important;
  }
}
