/*
 * Custom styling for the Smash Balloon Instagram Feed (free plugin) on the home page.
 * The free plugin ships almost no layout/design options, so this reshapes the existing
 * markup (#sb_instagram, .sbi_photo_wrap, .sbi_photo, #sbi_load, .sbi_follow_btn) rather
 * than replacing it. Pairs with js/sbi-custom.js, which injects .sbi_custom_overlay via
 * the plugin's documented sbi_custom_js() hook.
 */

/*
 * Single-row slider (4 cards/row desktop, 2 tablet, ~1 + peek mobile).
 * The free plugin has no carousel layout of its own (it ships a few vestigial
 * "carousel" JS hooks and arrow-position code, but never loads the Owl Carousel
 * library or exposes a layout option to switch it on) — this replaces the
 * plugin's CSS grid with a horizontal scroll-snap flex row instead. The nav
 * arrows are injected by js/sbi-custom.js, wrapping #sbi_images in
 * .sbi_slider_viewport so they can be positioned relative to just the image row.
 */
#sb_instagram .sbi_slider_viewport {
	position: relative;
}

#sb_instagram #sbi_images {
	display: flex !important;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	gap: 10px;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

#sb_instagram #sbi_images::-webkit-scrollbar {
	display: none;
}

#sb_instagram .sbi_item {
	opacity: 1;
	scroll-snap-align: start;
	flex: 0 0 calc((100% - 30px) / 4);
	max-width: calc((100% - 30px) / 4);
}

@media all and (max-width: 640px) {
	#sb_instagram .sbi_item {
		flex-basis: calc((100% - 10px) / 2);
		max-width: calc((100% - 10px) / 2);
	}
}

@media all and (max-width: 480px) {
	#sb_instagram .sbi_item {
		flex-basis: 88%;
		max-width: 88%;
	}
}

#sb_instagram .sbi_slider_arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	width: 38px;
	height: 38px;
	padding: 0;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background 0.2s ease, opacity 0.2s ease;
}

#sb_instagram .sbi_slider_arrow svg {
	width: 16px;
	height: 16px;
	fill: #333;
}

#sb_instagram .sbi_slider_arrow:hover,
#sb_instagram .sbi_slider_arrow:focus {
	background: #87ad83;
	outline: none;
}

#sb_instagram .sbi_slider_arrow:hover svg,
#sb_instagram .sbi_slider_arrow:focus svg {
	fill: #fff;
}

#sb_instagram .sbi_slider_arrow[disabled] {
	opacity: 0;
	pointer-events: none;
}

#sb_instagram .sbi_slider_prev {
	left: -6px;
}

#sb_instagram .sbi_slider_next {
	right: -6px;
}

@media all and (max-width: 640px) {
	#sb_instagram .sbi_slider_arrow {
		/* Close to the ~44px minimum recommended touch-target size. */
		width: 40px;
		height: 40px;
	}

	#sb_instagram .sbi_slider_arrow svg {
		width: 15px;
		height: 15px;
	}
}

#sb_instagram .sbi_photo_wrap {
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
	background: #111;
}

#sb_instagram .sbi_photo_wrap img {
	transition: transform 0.5s ease;
}

#sb_instagram .sbi_photo_wrap:hover img,
#sb_instagram .sbi_photo_wrap:focus-within img {
	transform: scale(1.08);
}

/* Overlay injected by sbi-custom.js on hover/focus */
#sb_instagram .sbi_custom_overlay {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 14px 12px;
	background: linear-gradient(180deg, rgba(17, 17, 17, 0) 45%, rgba(17, 17, 17, 0.85) 100%);
	opacity: 0;
	transition: opacity 0.3s ease;
	pointer-events: none;
}

#sb_instagram .sbi_photo_wrap:hover .sbi_custom_overlay,
#sb_instagram .sbi_photo_wrap:focus-within .sbi_custom_overlay {
	opacity: 1;
}

#sb_instagram .sbi_custom_icon {
	width: 20px;
	height: 20px;
	margin-bottom: 8px;
	fill: #fff;
}

#sb_instagram .sbi_custom_caption {
	margin: 0;
	color: #fff;
	font-family: Roboto, Helvetica, Arial, Verdana, sans-serif;
	font-size: 12.5px;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Load more + follow buttons, matched to the site's accent color */
#sb_instagram #sbi_load {
	margin-top: 22px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px;
}

#sb_instagram #sbi_load .sbi_load_btn,
#sb_instagram .sbi_follow_btn a {
	background: #87ad83 !important;
	border-radius: 30px;
	padding: 11px 28px;
	margin: 0;
	font-family: Roboto, Helvetica, Arial, Verdana, sans-serif;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	box-shadow: none;
}

#sb_instagram #sbi_load .sbi_load_btn:hover,
#sb_instagram #sbi_load .sbi_load_btn:focus,
#sb_instagram .sbi_follow_btn a:hover,
#sb_instagram .sbi_follow_btn a:focus {
	background: #729a6e !important;
	box-shadow: none;
	outline: none;
}

#sb_instagram .sbi_follow_btn {
	margin: 0;
}
