/* 	Resolve issue of images fluctuating on mobile on touch */
.e-gallery-item {
    display: inline-block !important;
}
.e-gallery--animated{
display: grid !important;
grid-template-columns: 1fr 1fr 1fr 1fr !important;
column-gap: 10px !important;
grid-row-gap: 10px !important;
padding: 0 !important;

}
.e-gallery--ltr.e-gallery-grid.e-gallery--animated .e-gallery-item{
position: relative;
width: unset;
top: unset;
left: unset
}
/* 	 */
/* Main photo grid - 4 columns: 2 columns for left (50%), 2 columns for right (50%) */
.common-gallery .e-gallery-grid, .e-gallery-grid:not(.e-gallery--animated) {
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
grid-auto-flow: row dense !important;
grid-auto-rows: auto !important;
}

/* Target: 1st, 6th, 9th, 14th, 17th, 22nd, 25th … */

.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(8n + 1) .e-gallery-image,
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(8n + 6) .e-gallery-image {
padding-bottom: 129.5% !important;
}
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(8n + 1),
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(8n + 6) {
grid-column: span 2 !important;
grid-row: span 2 !important;
}

/* Target: 3rd, 4th, 7th, 8th, 11th, 12th, 15th, 16th … */
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(4n + 3) .e-gallery-image,
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(4n + 4) .e-gallery-image {
padding-bottom: 130% !important;
}
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(4n + 3),
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(4n + 4) {
grid-column: span 1 !important;
}

/* Target: 2nd, 5th, 10th, 13th, 18th, 21st …*/
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(8n + 2) .e-gallery-image,
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(8n + 5) .e-gallery-image {
padding-bottom: 62.89% !important;
}
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(8n + 2),
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(8n + 5) {
grid-column: span 2 !important;
}


/* Responsive adjustments */
@media (max-width: 768px) {
 
 
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(8n + 1) .e-gallery-image,
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(8n + 6) .e-gallery-image {
padding-bottom: 96% !important;
}
 

 /* Target: 6th, 9th, 14th, 17th, 22nd, 25th … (skip 1st) to prevent image cutting from top*/
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(8n + 1):not(:nth-child(1)) .e-gallery-image,
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(8n + 6) .e-gallery-image {
background-position: top;
}

/* All images default to full width */
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(8n + 1),
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(8n + 6) {
grid-column: span 4 !important;
grid-row: auto !important;
}
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(8n + 2),
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(8n + 5)
{
  /* grid-column: auto !important; */
  grid-column: span 4 !important;
}
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(4n + 3),
.common-gallery .e-gallery-container > .elementor-gallery-item:nth-child(4n + 4)
{
grid-column: span 2 !important;
}

}