.bsz-instagram-feed {
	--bsz-instagram-gap: 12px;
	--bsz-instagram-surface: #fff;
	--bsz-instagram-muted: #5d6673;
	--bsz-instagram-accent: #408bd1;
	display: block;
}

.bsz-instagram-feed__items {
	display: grid;
	gap: var(--bsz-instagram-gap);
}

/* Default: responsive auto-fit grid (theme template path). */
.bsz-instagram-feed--grid .bsz-instagram-feed__items {
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

/* Fixed column count when a columns attribute is supplied (shortcode path). */
.bsz-instagram-feed--grid[style*="--bsz-instagram-cols"] {
	--bsz-instagram-gap: 4px;
}

.bsz-instagram-feed--grid[style*="--bsz-instagram-cols"] .bsz-instagram-feed__items {
	grid-template-columns: repeat(var(--bsz-instagram-cols), minmax(0, 1fr));
}

@media (max-width: 781px) {

	.bsz-instagram-feed--grid[style*="--bsz-instagram-cols"] .bsz-instagram-feed__items {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 480px) {

	.bsz-instagram-feed--grid[style*="--bsz-instagram-cols"] .bsz-instagram-feed__items {
		grid-template-columns: 1fr;
	}
}

.bsz-instagram-feed--masonry .bsz-instagram-feed__items {
	column-count: 2;
	column-gap: var(--bsz-instagram-gap);
	display: block;
}

.bsz-instagram-feed--carousel .bsz-instagram-feed__items {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x proximity;
}

.bsz-instagram-tile {
	aspect-ratio: 1 / 1;
	background: var(--bsz-instagram-surface);
	margin: 0;
	overflow: hidden;
	position: relative;
}

.bsz-instagram-feed--carousel .bsz-instagram-tile {
	flex: 0 0 min(72vw, 220px);
	scroll-snap-align: start;
}

.bsz-instagram-feed--masonry .bsz-instagram-tile {
	break-inside: avoid;
	margin-block-end: var(--bsz-instagram-gap);
}

.bsz-instagram-tile__link {
	color: inherit;
	display: block;
	height: 100%;
	text-decoration: none;
}

.bsz-instagram-tile__image {
	display: block;
	height: 100%;
	object-fit: cover;
	transition: transform 0.45s ease, filter 0.3s ease;
	width: 100%;
}

.bsz-instagram-tile__link:hover .bsz-instagram-tile__image,
.bsz-instagram-tile__link:focus-visible .bsz-instagram-tile__image {
	filter: brightness(0.92);
	transform: scale(1.05);
}

/* Play overlay for video tiles. */
.bsz-instagram-tile__play {
	background: rgba(0, 0, 0, 0.45);
	border-radius: 50%;
	height: 44px;
	left: 50%;
	pointer-events: none;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 44px;
}

.bsz-instagram-tile__play::after {
	border-color: transparent transparent transparent #fff;
	border-style: solid;
	border-width: 9px 0 9px 15px;
	content: "";
	left: 54%;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
}

.bsz-instagram-tile__caption {
	background: color-mix(in srgb, var(--bsz-instagram-surface) 92%, transparent);
	bottom: 0;
	color: var(--bsz-instagram-muted);
	font-size: 0.875rem;
	left: 0;
	line-height: 1.35;
	margin: 0;
	padding: 8px;
	position: absolute;
	right: 0;
}

/* Follow button. */
.bsz-instagram-feed__follow {
	margin: 16px 0 0;
	text-align: center;
}

.bsz-instagram-feed__follow-btn {
	align-items: center;
	background: var(--bsz-instagram-accent);
	border-radius: 4px;
	color: #fff;
	display: inline-flex;
	font-size: 14px;
	font-weight: 600;
	gap: 8px;
	line-height: 1;
	padding: 11px 18px;
	text-decoration: none;
	transition: background 0.2s ease;
}

.bsz-instagram-feed__follow-btn:hover,
.bsz-instagram-feed__follow-btn:focus-visible {
	background: color-mix(in srgb, var(--bsz-instagram-accent) 88%, #000);
	color: #fff;
}

.bsz-instagram-feed__follow-icon {
	display: block;
	flex: 0 0 auto;
}

.bsz-instagram-feed--empty {
	border: 1px solid #c3c4c7;
	padding: 12px;
}

@media (min-width: 700px) {

	.bsz-instagram-feed--masonry .bsz-instagram-feed__items {
		column-count: 3;
	}
}

/* Lightbox. */
body.bsz-lightbox-open {
	overflow: hidden;
}

.bsz-lightbox {
	align-items: center;
	background: rgba(0, 0, 0, 0.82);
	bottom: 0;
	display: flex;
	justify-content: center;
	left: 0;
	padding: 24px;
	position: fixed;
	right: 0;
	top: 0;
	z-index: 100000;
}

.bsz-lightbox[hidden] {
	display: none;
}

.bsz-lightbox__dialog {
	max-width: min(680px, 92vw);
	position: relative;
	width: 100%;
}

.bsz-lightbox__figure {
	background: #fff;
	border-radius: 8px;
	margin: 0;
	overflow: hidden;
}

.bsz-lightbox__media {
	background: #000;
	display: flex;
	justify-content: center;
	position: relative;
}

.bsz-lightbox__image {
	display: block;
	height: auto;
	max-height: 72vh;
	max-width: 100%;
	width: auto;
}

.bsz-lightbox__play {
	background: rgba(0, 0, 0, 0.55);
	border-radius: 50%;
	height: 64px;
	left: 50%;
	pointer-events: none;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 64px;
}

.bsz-lightbox__play::after {
	border-color: transparent transparent transparent #fff;
	border-style: solid;
	border-width: 13px 0 13px 22px;
	content: "";
	left: 54%;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
}

.bsz-lightbox__caption {
	color: #1d1d1f;
	font-size: 14px;
	line-height: 1.45;
	margin: 0;
	max-height: 18vh;
	overflow: auto;
	padding: 14px 16px 4px;
}

.bsz-lightbox__cta {
	align-items: center;
	background: #408bd1;
	border-radius: 4px;
	color: #fff;
	display: inline-flex;
	font-size: 14px;
	font-weight: 600;
	margin: 10px 16px 16px;
	padding: 9px 16px;
	text-decoration: none;
}

.bsz-lightbox__cta:hover,
.bsz-lightbox__cta:focus {
	background: #357ab8;
	color: #fff;
}

.bsz-lightbox__close {
	background: rgba(255, 255, 255, 0.15);
	border: 0;
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	font-size: 24px;
	height: 36px;
	line-height: 1;
	position: absolute;
	right: 0;
	top: -44px;
	width: 36px;
}

.bsz-lightbox__nav {
	background: rgba(255, 255, 255, 0.15);
	border: 0;
	border-radius: 50%;
	color: #fff;
	cursor: pointer;
	font-size: 28px;
	height: 44px;
	line-height: 1;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
}

.bsz-lightbox__close:hover,
.bsz-lightbox__close:focus,
.bsz-lightbox__nav:hover,
.bsz-lightbox__nav:focus {
	background: rgba(255, 255, 255, 0.3);
}

.bsz-lightbox__nav--prev {
	left: -56px;
}

.bsz-lightbox__nav--next {
	right: -56px;
}

@media (max-width: 600px) {

	.bsz-lightbox__nav--prev {
		left: 4px;
	}

	.bsz-lightbox__nav--next {
		right: 4px;
	}

	.bsz-lightbox__close {
		right: 4px;
		top: 4px;
	}
}
