/* ------------------------------------------
Elementor Posts Pirch Overlay Skin styles
-----------------------------------------------*/

.elementor-widget-posts-pirch__overlay-img {
  max-height: 100%;
  object-fit: contain;
}

.elementor-widget-posts-pirch__overlay-logo {
  align-items: flex-end;
  display: flex;
  height: 100%;
  justify-content: center;
}

.elementor-widget-posts-pirch__overlay-wrapper {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  height: 30%;
  width: 100%;
  transform: translateX(-50%);
  z-index: 1;
}

.elementor-widget-posts-pirch__overlay-wrapper .elementor-post__text {
  position: absolute;
  bottom: 0;
  padding: 0 2rem !important;
}

.elementor-posts.elementor-posts--skin-cards-overlay-pirch.elementor-posts
  .elementor-post__card
  .elementor-post__text {
  margin-top: 0;
}
.elementor-posts.elementor-posts--skin-cards-overlay-pirch
  .elementor-post__thumbnail
  img {
  position: absolute;
  object-fit: cover;
  width: 100%;
  height: 100%;
}

.elementor-posts.elementor-posts--skin-cards-overlay-pirch .elementor-background-overlay {
  opacity: 0.7;
  transition: all 0.3s;
}

.elementor-posts.elementor-posts--skin-cards-overlay-pirch .elementor-post:hover .elementor-background-overlay {
  background-color: var( --e-global-color-primary );
}

/* Modify Elementor grid */

.elementor-posts--skin-cards-overlay-pirch.elementor-grid .elementor-grid-item {
  width: 100%;
}

@media only screen and (min-width:768px) and (max-width: 1270px) {
  .elementor-grid-4 .elementor-posts--skin-cards-overlay-pirch.elementor-grid,
  .elementor-grid-5 .elementor-posts--skin-cards-overlay-pirch.elementor-grid {
    display: flex;
    flex-wrap: wrap;
  }

  /* 5 elements, two last wraps on breakpoint */
  .elementor-grid-5 .elementor-posts--skin-cards-overlay-pirch.elementor-grid .elementor-grid-item {
    max-width: 33.3333%;
  }

  .elementor-grid-5 .elementor-posts--skin-cards-overlay-pirch.elementor-grid .elementor-grid-item:nth-child(3n + 1):nth-last-of-type(2),
  .elementor-grid-5 .elementor-posts--skin-cards-overlay-pirch.elementor-grid .elementor-grid-item:nth-child(4n + 1):nth-last-of-type(1) {
    max-width: 50%;
  }

  .elementor-grid-5 .elementor-posts--skin-cards-overlay-pirch.elementor-grid .elementor-grid-item:nth-child(3n + 1):nth-last-of-type(2) .elementor-post__card,
  .elementor-grid-5 .elementor-posts--skin-cards-overlay-pirch.elementor-grid .elementor-grid-item:nth-child(4n + 1):nth-last-of-type(1) .elementor-post__card{
    min-height: 67%;
  }

  .elementor-grid-5 .elementor-posts--skin-cards-overlay-pirch.elementor-grid .elementor-grid-item:nth-child(3n + 1):nth-last-of-type(2) .elementor-post__thumbnail,
  .elementor-grid-5 .elementor-posts--skin-cards-overlay-pirch.elementor-grid .elementor-grid-item:nth-child(4n + 1):nth-last-of-type(1) .elementor-post__thumbnail {
    padding-bottom: calc( 1 * 67% );
  }

  /* 4 elements, keep 4 in line */
  .elementor-grid-4 .elementor-posts--skin-cards-overlay-pirch.elementor-grid .elementor-grid-item {
    max-width: 25%;
  }

}

@media only screen and (min-width:768px) and (max-width: 1024px) {

  /* 4 elements, two last wraps on breakpoint */
  .elementor-grid-4 .elementor-posts--skin-cards-overlay-pirch.elementor-grid .elementor-grid-item {
    max-width: 50%;
  }

}