/* Instagram JSON Feed – Light theme (Instagram profile style) */

.insta-feed {
	--insta-bg: #fff;
	--insta-text: #262626;
	--insta-text-muted: #737373;
	--insta-border: #dbdbdb;
	--insta-accent: #0095f6;
	--insta-max-width: 1290px;
	--insta-grid-gap: 2px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	background: var(--insta-bg);
	color: var(--insta-text);
	width: 100%;
	max-width: var(--insta-max-width);
	margin: 0 auto;
	padding: 24px 16px 32px;
	box-sizing: border-box;
	line-height: 1.4;
	-webkit-font-smoothing: antialiased;
}

.insta-feed *,
.insta-feed *::before,
.insta-feed *::after {
	box-sizing: border-box;
}

.insta-feed__grid img,
.insta-feed-modal__media img {
	border: none;
	border-radius: 0;
	box-shadow: none;
	vertical-align: top;
}

.insta-feed a {
	text-decoration: none;
	outline: none;
	color: inherit;
}

.insta-feed button.insta-feed-modal__close,
.insta-feed button.insta-feed-modal__nav {
	font-family: inherit;
	border: none;
	background: none;
	padding: 0;
	cursor: pointer;
	color: inherit;
}

/* ── Header (Instagram profile layout) ── */
.insta-feed__header {
	display: flex;
	align-items: center;
	gap: 28px;
	padding: 0 0 28px;
	margin: 0;
}

.insta-feed__avatar-ring {
	flex-shrink: 0;
	width: 156px;
	height: 156px;
	padding: 2px;
	border-radius: 50%;
	background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
}

.insta-feed__avatar-wrap {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	overflow: hidden;
	background: #fff;
	border: 2px solid #fff;
	padding: 0;
	margin: 0;
	line-height: 0;
	font-size: 0;
	box-sizing: border-box;
}

.insta-feed__avatar {
	width: 100%;
	height: 100%;
	border-radius: 0;
	object-fit: cover;
	object-position: center;
	display: block;
	max-width: none;
	margin: 0;
	padding: 0;
	vertical-align: top;
}

.insta-feed__avatar--placeholder {
	width: 100%;
	height: 100%;
	background: #efefef;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #999;
	border-radius: 50%;
}

.insta-feed__header-info {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.insta-feed__top-row {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.insta-feed__username {
	font-size: 20px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--insta-text);
}

.insta-feed__verified {
	display: inline-flex;
	flex-shrink: 0;
	line-height: 0;
}

.insta-feed__follow-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	background: #0095f6;
	color: #fff !important;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	padding: 7px 16px;
	border-radius: 8px;
	margin-left: 12px;
	text-decoration: none !important;
	transition: background 0.15s ease;
}

.insta-feed__follow-btn:hover,
.insta-feed__follow-btn:focus {
	background: #1877f2;
	color: #fff !important;
}

.insta-feed__menu {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-left: auto;
	color: var(--insta-text);
	opacity: 0.85;
	padding: 4px;
}

.insta-feed__menu:hover {
	opacity: 1;
}

.insta-feed__display-name {
	font-size: 14px;
	font-weight: 400;
	line-height: 1.4;
	color: var(--insta-text);
}

.insta-feed__stats-row {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	font-size: 14px;
	color: var(--insta-text);
	line-height: 1.3;
}

.insta-feed__stat-line {
	white-space: nowrap;
}

/* ── Grid ── */
.insta-feed__grid {
	display: grid;
	gap: var(--insta-grid-gap);
	width: 100%;
	margin: 0;
	padding: 0;
	background: var(--insta-bg);
}

.insta-feed--cols-2 .insta-feed__grid { grid-template-columns: repeat(2, 1fr); }
.insta-feed--cols-3 .insta-feed__grid { grid-template-columns: repeat(3, 1fr); }
.insta-feed--cols-4 .insta-feed__grid { grid-template-columns: repeat(4, 1fr); }
.insta-feed--cols-5 .insta-feed__grid { grid-template-columns: repeat(5, 1fr); }
.insta-feed--cols-6 .insta-feed__grid { grid-template-columns: repeat(6, 1fr); }

.insta-feed__item {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 3 / 4;
	overflow: hidden;
	background: #efefef;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	opacity: 1;
}

.insta-feed__item img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	display: block;
	margin: 0;
	padding: 0;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.insta-feed__item--loaded img {
	opacity: 1;
}

.insta-feed__item--broken {
	background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
}

.insta-feed__item--broken::before {
	content: '';
	position: absolute;
	inset: 0;
	margin: auto;
	width: 36px;
	height: 36px;
	background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23b0b0b0'%3E%3Cpath d='M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2zM8.5 13.5l2.5 3.01L14.5 12l4.5 6H5l3.5-4.5z'/%3E%3C/svg%3E");
	opacity: 0.85;
	pointer-events: none;
}

.insta-feed__item--loaded:focus-visible {
	outline: 2px solid var(--insta-accent);
	outline-offset: -2px;
}

.insta-feed__item:hover img {
	opacity: 0.9;
}

.insta-feed__item-icon {
	position: absolute;
	top: 8px;
	right: 8px;
	color: #fff;
	line-height: 0;
	filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
	pointer-events: none;
	z-index: 2;
}

.insta-feed-empty {
	text-align: center;
	padding: 40px 20px;
	color: var(--insta-text-muted);
}

.insta-feed__load-wrap {
	display: flex;
	justify-content: center;
	padding: 24px 0 8px;
}

.insta-feed__load-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	color: var(--insta-text);
	font-size: 14px;
	font-weight: 600;
	padding: 8px 24px;
	border-radius: 8px;
	border: 1px solid var(--insta-border);
	cursor: pointer;
	transition: background 0.2s ease;
}

.insta-feed__load-more:hover,
.insta-feed__load-more:focus {
	background: #fafafa;
}

.insta-feed__load-more[hidden] {
	display: none !important;
}

/* ── Modal (unchanged dark overlay) ── */
body.insta-feed-modal-open {
	overflow: hidden;
}

.insta-feed-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.insta-feed-modal[hidden] {
	display: none !important;
}

.insta-feed-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
}

.insta-feed-modal__dialog {
	position: relative;
	display: flex;
	width: 100%;
	max-width: 1100px;
	max-height: 90vh;
	background: #000;
	border-radius: 4px;
	overflow: hidden;
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
	z-index: 1;
}

.insta-feed-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 5;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	padding: 0;
}

.insta-feed-modal__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 4;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.5);
	color: #fff;
	border: none;
	border-radius: 50%;
	cursor: pointer;
	padding: 0;
}

.insta-feed-modal__nav--prev { left: 12px; }
.insta-feed-modal__nav--next { right: 12px; }
.insta-feed-modal__nav[hidden] { display: none !important; }

.insta-feed-modal__content {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	background: #000;
	min-width: 0;
	min-height: 400px;
	max-height: 90vh;
}

.insta-feed-modal__media {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	min-height: 300px;
	max-height: calc(90vh - 40px);
}

.insta-feed-modal__media img,
.insta-feed-modal__media video {
	max-width: 100%;
	max-height: calc(90vh - 60px);
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

.insta-feed-modal__media iframe,
.insta-feed-modal__iframe {
	width: 100%;
	min-width: 326px;
	max-width: 540px;
	height: min(680px, calc(90vh - 40px));
	border: 0;
	background: #000;
}

.insta-feed-modal__video-fallback {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 16px;
	padding: 24px;
	color: #fff;
	text-align: center;
}

.insta-feed-modal__video-btn {
	background: #0095f6;
	color: #fff !important;
	padding: 10px 20px;
	border-radius: 8px;
	text-decoration: none !important;
	font-weight: 600;
}

.insta-feed-modal__dots {
	display: flex;
	gap: 6px;
	padding: 12px 0 16px;
}

.insta-feed-modal__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.4);
}

.insta-feed-modal__dot.is-active {
	background: #0095f6;
}

.insta-feed-modal__sidebar {
	flex: 0 0 340px;
	display: flex;
	flex-direction: column;
	border-left: 1px solid #262626;
	background: #000;
	max-height: 90vh;
	overflow: hidden;
}

.insta-feed-modal__sidebar-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px;
	border-bottom: 1px solid #262626;
}

.insta-feed-modal__sidebar-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
}

.insta-feed-modal__sidebar-user {
	font-size: 14px;
	font-weight: 600;
	color: #fff;
}

.insta-feed-modal__caption {
	flex: 1 1 auto;
	padding: 16px;
	font-size: 14px;
	color: #fff;
	overflow-y: auto;
	white-space: pre-wrap;
	word-break: break-word;
}

.insta-feed-modal__caption[hidden],
.insta-feed-modal__likes[hidden],
.insta-feed-modal__ig-link[hidden],
.insta-feed-modal__dots[hidden] {
	display: none !important;
}

.insta-feed-modal__likes {
	padding: 0 16px 8px;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
}

.insta-feed-modal__ig-link {
	display: block;
	padding: 16px;
	font-size: 14px;
	font-weight: 600;
	color: #0095f6 !important;
	border-top: 1px solid #262626;
}

/* ── Elementor ── */
.elementor-widget-shortcode .elementor-widget-container,
.elementor-widget-shortcode .elementor-shortcode {
	overflow: visible;
	max-width: 100%;
}

.elementor-widget-shortcode .insta-feed {
	width: 100%;
	max-width: 1290px;
	margin-left: auto;
	margin-right: auto;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
	.insta-feed--cols-5 .insta-feed__grid,
	.insta-feed--cols-6 .insta-feed__grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

@media (max-width: 768px) {
	.insta-feed {
		padding: 16px 12px 24px;
	}

	.insta-feed__header {
		gap: 16px;
		padding-bottom: 20px;
	}

	.insta-feed__avatar-ring {
		width: 85px;
		height: 85px;
	}

	.insta-feed__follow-btn {
		margin-left: 8px;
		padding: 6px 12px;
		font-size: 13px;
	}

	.insta-feed__username {
		font-size: 16px;
	}

	.insta-feed__display-name,
	.insta-feed__stats-row {
		font-size: 13px;
	}

	.insta-feed__stats-row {
		gap: 12px;
	}

	.insta-feed--cols-3 .insta-feed__grid,
	.insta-feed--cols-4 .insta-feed__grid,
	.insta-feed--cols-5 .insta-feed__grid,
	.insta-feed--cols-6 .insta-feed__grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.insta-feed-modal__dialog {
		flex-direction: column;
		max-width: 100%;
		max-height: 100vh;
		height: 100%;
		border-radius: 0;
	}

	.insta-feed-modal {
		padding: 0;
	}

	.insta-feed-modal__sidebar {
		border-left: none;
		border-top: 1px solid #262626;
		max-height: 40vh;
	}
}

@media (max-width: 480px) {
	.insta-feed--cols-3 .insta-feed__grid,
	.insta-feed--cols-4 .insta-feed__grid,
	.insta-feed--cols-5 .insta-feed__grid,
	.insta-feed--cols-6 .insta-feed__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}
