/*--/------*/
/* --{{ FRAMED IMAGES (BorderIcon + BorderImg) }}-- */
/*--/------*/
/* Fixed square frame — beat Themify auto_fullwidth / tf_mw width:100% */
.BorderIcon .module-image,
.BorderImg .image-wrap {
  position: relative;
  display: flex !important;
  justify-content: center;
  align-items: center;
  width: 250px !important;
  max-width: 250px !important;
  height: 250px !important;
  aspect-ratio: 1 / 1;
  box-sizing: border-box;
  padding: 0 !important;
  margin-left: auto;
  margin-right: auto;

  &::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    background-color: var(--tb_pr_bg);
    -webkit-mask: var(--mask-frame) var(--mask-fit);
    mask: var(--mask-frame) var(--mask-fit);
  }

  img {
    position: absolute !important;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    width: auto !important;
    height: 75px !important;
    max-width: 70% !important;
    max-height: 70% !important;
    object-fit: contain !important;
    object-position: center !important;
    margin: 0 !important;
    float: none !important;
  }
}

.BorderImg {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  .image-wrap::after {
    background-color: var(--tb_pr_bg, var(--gray));
  }

  .image-content {
    margin-top: 15px;
  }

  .image-title {
    font: var(--text-h3) / 1em var(--font-heading);
    color: var(--blue);
    margin-bottom: 8px;
  }

  .image-caption {
    color: var(--black);
  }
}

/* Narrow viewports: allow the square to shrink with the column */
@media (max-width: 400px) {
  .BorderIcon .module-image,
  .BorderImg .image-wrap {
    width: 100% !important;
    max-width: 180px !important;
    height: auto !important;
  }
}
