/* Millend Instagram Feed */
.mie-feed {
	--mie-cols: 4;
	--mie-cols-tablet: 3;
	--mie-cols-mobile: 2;
	--mie-gap: 0.5rem;
	--mie-ratio: 1 / 1;
	--mie-radius: 0.25rem;
	--mie-caption-size: 0.8125rem;
	--mie-follow-bg: #000;
	--mie-follow-fg: #fff;
	--mie-story-ring: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
	--mie-overlay: rgba(0, 0, 0, 0.6);
	display: flex;
	flex-direction: column;
	gap: var(--mie-gap);
	width: 100%;
}

.mie-feed--empty {
	padding: 2rem;
	text-align: center;
	border: 1px dashed currentColor;
	opacity: 0.7;
}

/* Stories bar */
.mie-stories {
	display: flex;
	gap: var(--mie-gap);
	overflow-x: auto;
	scroll-snap-type: x proximity;
	padding: 0.25rem 0 0.5rem;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}
.mie-stories::-webkit-scrollbar { height: 4px; }
.mie-stories::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.2); border-radius: 2px; }

.mie-story {
	flex: 0 0 auto;
	scroll-snap-align: start;
	text-decoration: none;
}
.mie-story__ring {
	display: block;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	padding: 3px;
	background: var(--mie-story-ring);
	box-sizing: border-box;
	transition: transform 150ms ease;
}
.mie-story:hover .mie-story__ring { transform: scale(1.05); }
.mie-story__ring img {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	object-fit: cover;
	border: 2px solid var(--mie-bg, #fff);
	box-sizing: border-box;
	background: #fff;
}

/* Grid */
.mie-grid {
	display: grid;
	grid-template-columns: repeat(var(--mie-cols), 1fr);
	gap: var(--mie-gap);
}
@media (max-width: 1024px) {
	.mie-grid { grid-template-columns: repeat(var(--mie-cols-tablet), 1fr); }
}
@media (max-width: 640px) {
	.mie-grid { grid-template-columns: repeat(var(--mie-cols-mobile), 1fr); }
}

.mie-item {
	position: relative;
	display: block;
	aspect-ratio: var(--mie-ratio);
	overflow: hidden;
	border-radius: var(--mie-radius);
	text-decoration: none;
	background: rgba(0,0,0,0.04);
}
.mie-item__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 400ms ease;
	display: block;
}
.mie-item:hover .mie-item__img {
	transform: scale(1.04);
}

/* Type badges */
.mie-badge {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	width: 28px;
	height: 28px;
	display: grid;
	place-items: center;
	color: #fff;
	pointer-events: none;
	filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4));
}
.mie-badge--video svg { width: 32px; height: 32px; }

/* Caption overlay — full-tile dark surface on hover */
.mie-item__caption {
	position: absolute;
	inset: 0;
	padding: 0.875rem 1rem;
	color: #fff;
	background: rgba(0, 0, 0, 0.78);
	font-size: var(--mie-caption-size);
	line-height: 1.45;
	opacity: 0;
	transition: opacity 180ms ease;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	text-align: center;
	overflow: hidden;
	backdrop-filter: saturate(1.1) blur(2px);
}
.mie-item__caption-inner {
	display: block;
	max-height: 100%;
	overflow: hidden;
	text-overflow: ellipsis;
}
.mie-item__caption--scroll {
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}
.mie-item__caption--scroll::-webkit-scrollbar { width: 4px; }
.mie-item__caption--scroll::-webkit-scrollbar-track { background: transparent; }
.mie-item__caption--scroll::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.35);
	border-radius: 2px;
}
.mie-item__caption--scroll::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.55);
}
.mie-item:hover .mie-item__caption,
.mie-item:focus-visible .mie-item__caption {
	opacity: 1;
}

/* Focus ring */
.mie-item:focus-visible,
.mie-story:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Follow button */
.mie-follow {
	display: flex;
	justify-content: center;
	margin-top: 0.75rem;
}
.mie-follow-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	padding: 0.75em 1.5em;
	background: var(--mie-follow-bg);
	color: var(--mie-follow-fg);
	border-radius: 999px;
	text-decoration: none;
	font-weight: 600;
	font-size: 0.9375rem;
	transition: transform 150ms ease, opacity 150ms ease;
}
.mie-follow-btn:hover {
	transform: translateY(-1px);
	opacity: 0.9;
	color: var(--mie-follow-fg);
}
.mie-follow-btn svg { flex-shrink: 0; }

/* PhotoSwipe video sizing — custom HTML slides need contain + centering.
   Image slides are handled natively by PhotoSwipe's zoom/pan system and
   must NOT be constrained (PhotoSwipe sets explicit inline px dimensions). */
.pswp__content .pswp__mie-video {
	object-fit: contain;
	max-width: 100%;
	max-height: 100%;
}

/* Bricks Builder ships its own PhotoSwipe CSS that hides SVG icons in non-Bricks
   lightbox instances:  .pswp:not(.brx) .pswp__button svg { display: none }
   Override with higher specificity so our arrows + close button stay visible. */
.pswp:not(.brx) .pswp__button svg.pswp__icn {
	display: block;
}

/* ── Caption panel — right sidebar on desktop, bottom sheet on mobile ── */
.pswp__mie-panel {
	position: absolute;
	z-index: 1050;
	background: rgba(0, 0, 0, 0.82);
	color: #fff;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	transition: transform 300ms ease, opacity 200ms ease;
	pointer-events: auto;
	display: flex;
	flex-direction: column;
	/* Desktop: right sidebar */
	top: 0;
	right: 0;
	bottom: 0;
	width: 320px;
	max-width: 35vw;
	border-left: 1px solid rgba(255, 255, 255, 0.08);
}
.pswp__mie-panel--hidden {
	transform: translateX(100%);
	opacity: 0;
	pointer-events: none;
}
.pswp__mie-panel--no-content {
	display: none !important;
}

/* Panel header — close button right-aligned */
.pswp__mie-panel-header {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 0.75rem 0.75rem 0.5rem;
	flex-shrink: 0;
}
.pswp__mie-panel-close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: none;
	background: rgba(255, 255, 255, 0.1);
	color: #fff;
	border-radius: 50%;
	cursor: pointer;
	transition: background 150ms ease;
	flex-shrink: 0;
}
.pswp__mie-panel-close:hover {
	background: rgba(255, 255, 255, 0.22);
}

/* Panel body — scrollable caption text */
.pswp__mie-panel-body {
	flex: 1;
	overflow-y: auto;
	padding: 0 1rem 1rem;
	line-height: 1.55;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}
.pswp__mie-panel-body::-webkit-scrollbar { width: 4px; }
.pswp__mie-panel-body::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.3);
	border-radius: 2px;
}
.pswp__mie-panel-body a {
	color: #9ecbff;
	text-decoration: underline;
}

/* Toggle button active state (info icon in the toolbar) */
.pswp__mie-toggle--active {
	opacity: 1 !important;
}

/* Mobile: bottom sheet instead of sidebar */
@media (max-width: 767px) {
	.pswp__mie-panel {
		top: auto;
		right: 0;
		bottom: 0;
		left: 0;
		width: 100%;
		max-width: 100%;
		max-height: 40vh;
		border-left: none;
		border-top: 1px solid rgba(255, 255, 255, 0.1);
		border-radius: 0.75rem 0.75rem 0 0;
	}
	.pswp__mie-panel--hidden {
		transform: translateY(100%);
	}
}
.pswp__mie-permalink {
	position: absolute;
	bottom: 1rem;
	left: 1rem;
	padding: 0.5rem 0.875rem;
	background: rgba(255,255,255,0.12);
	color: #fff;
	border-radius: 999px;
	text-decoration: none;
	font-size: var(--text-s, 0.8125rem);
	font-weight: 500;
	backdrop-filter: blur(8px);
	display: inline-flex;
	align-items: center;
	gap: 0.375rem;
	transition: background 150ms ease;
	z-index: 1050;
}
.pswp__mie-permalink:hover {
	background: rgba(255,255,255,0.22);
	color: #fff;
}
/* Video slide wrapper */
.pswp__mie-video-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 1rem;
	box-sizing: border-box;
}
.pswp__mie-video {
	max-width: min(90vw, 1200px);
	max-height: 90vh;
	display: block;
	margin: 0 auto;
	background: #000;
	border-radius: 0.25rem;
	object-fit: contain;
}
