#sb_instagram {
  min-height: 100vh; /* Ensures space is allocated at load */
  position: relative; /* Needed for absolute children */
  z-index: 10;
}

#sb_instagram.sbi_masonry #sbi_images .sbi_item,
#sb_instagram.sbi_highlight #sbi_images .sbi_item,
#sb_instagram #sbi_images .sbi_item
{
  float: none !important;
  position: absolute !important;
  box-sizing: border-box !important;
  display: block !important;
  justify-content: center;
  align-items: center;
  aspect-ratio: 9 / 16;
  width: 39.7vh !important;
  height: auto !important;
}
	
#sb_instagram .sbi_photo_wrap {
  aspect-ratio: 9 / 16;
  width: 100%;
  height: 100% !important;
  border-radius: inherit;
  overflow: hidden;
}
	
#sb_instagram .sbi_photo img, .sbi_item img {
	width: 100%;
	height: 75vh!important;
	object-fit: cover;
	display: block;
	border-radius: inherit;
	overflow: hidden;
	image-rendering: auto;
}
		
/* Custom animation layout */
.sbi_item {
  width: 39.7vh !important;
  height: auto !important;	
  will-change: transform;
  padding: 0.4em;
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  background-color: #ffffff !important;
  border-radius: 1.6vw;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  z-index: 10;
}
	
#sb_instagram .sbi_inner_wrap {
    padding: 0;
	height: -webkit-fill-available;
	border-radius: 1.4vw !important;
}

/* Medium laptops, large tablets – 1200 to 900px */
@media (max-width: 1200px) and (min-width: 901px) {
  #sb_instagram #sbi_images .sbi_item, .sbi_item  {
	   width: 28vh !important;
	   aspect-ratio: 9 / 16;
  }

  #sb_instagram .sbi_photo img {
    height: 140% !important;
  }
}

/* Tablets – 900px to 468px */
@media (max-width: 900px) and (min-width: 469px) {
  #sb_instagram #sbi_images .sbi_item, .sbi_item {
    width: 20vh !important;
	aspect-ratio: 9 / 16;
	}

  #sb_instagram .sbi_photo_wrap {
    aspect-ratio: 9 / 16;
    height: 100% !important;
  }

  #sb_instagram .sbi_photo img {
    height: 140% !important;
	object-fit: cover;
  }
}


/* Responsive tweak for tighter stacking */
@media (max-width: 467px) {
	
	#sb_instagram.sbi_masonry #sbi_images .sbi_item,
	#sb_instagram.sbi_highlight #sbi_images .sbi_item,
	#sb_instagram #sbi_images .sbi_item {
		position: relative !important;
		left: auto !important;
		top: auto !important;
		flex: 0 0 auto !important;
		scroll-snap-align: center;
		width: 70vw !important;
		height: 130vw !important;
	  }
	
	#sb_instagram .sbi_photo_wrap {
		  height: 127vw!important;
	}

	#sb_instagram #sbi_images {
		display: flex !important;
		flex-direction: row;
		overflow-x: auto !important;
		scroll-snap-type: x mandatory;
		gap: 1.2em;
		padding: 6em 1em;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none; /* Firefox */
		-ms-overflow-style: none;  /* IE 10+ */
	  }

	#sb_instagram .sbi_photo img{
		height: 127vw!important;
	}
	.sbi_item {
		width: 65% !important;
		height: 130vw !important;
		flex: 0 0 auto; 
		scroll-snap-align: center;
		position: relative !important; 
	  }
	
	.sbi-swipe-wrapper {
	  display: flex;
	  overflow-x: auto;
	  gap: 1.2em;
	  padding: 1em 0;
	  scroll-snap-type: x mandatory;
	  -webkit-overflow-scrolling: touch;
	}

	#sb_instagram #sbi_images::-webkit-scrollbar {
	  display: none; /* Safari and Chrome */
	}
	
}