.elementor-widget-tart-instagram-feed {
	width: 100%;
}

.tart-instagram-feed.profile-instagram {
	width: 100%;
	padding: clamp(60px, 7vw, 105px) var(--rail, clamp(20px, 5vw, 72px));
	color: var(--ink, #14110d);
}

.tart-instagram-feed .instagram-head {
	display: flex;
	align-items: end;
	justify-content: space-between;
	gap: 40px;
	width: 100%;
	margin: 0 0 clamp(30px, 4vw, 52px);
}

.tart-instagram-feed .instagram-head h2 {
	margin: 0;
	color: var(--ink, #14110d);
	font: 400 96px/0.78 var(--display-font, "Bebas Neue", "Arial Narrow", Impact, sans-serif);
	letter-spacing: normal;
	text-transform: uppercase;
}

.tart-instagram-feed .instagram-head h2 em {
	display: block;
	color: var(--mark, #4e3a8a);
	font: 700 53px/0.9 var(--script, "Rajdhani", "Arial Narrow", sans-serif);
	letter-spacing: 0.015em;
	text-transform: uppercase;
}

.tart-instagram-feed .instagram-head>a {
	flex: none;
	padding-bottom: 8px;
	border-bottom: 1px solid currentColor;
	color: var(--ink, #14110d);
	font: 700 14px/1 var(--mono, "IBM Plex Mono", monospace);
	letter-spacing: 0.14em;
	text-decoration: none;
	text-transform: uppercase;
}

.tart-instagram-feed .instagram-feed-grid {
	display: grid;
	/* Desktop: at most five cards per row (one row with the default 5 posts). */
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: clamp(14px, 1.6vw, 24px);
	width: 100%;
}

/* Post card in the theme's chamfered shape (12px cut, as .blog-card).
   clip-path would cut a CSS border off the diagonals, so the border is a layer:
   the card itself is the border colour, ::before (inset 1px, same cut shape)
   is the card surface. The whole card is clickable (see .instagram-post__meta::after). */
.tart-instagram-feed .instagram-post {
	--ig-cut: 12px;
	--ig-cut-inner: 11.6px; /* 12px minus the 1px border on the 45deg edge */
	--ig-edge: rgb(20 17 13 / 16%);
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin: 0;
	padding: 1px;
	background: var(--ig-edge);
	clip-path: polygon(var(--ig-cut) 0, 100% 0, 100% calc(100% - var(--ig-cut)), calc(100% - var(--ig-cut)) 100%, 0 100%, 0 var(--ig-cut));
	transition: transform 220ms ease, background-color 220ms ease;
}

.tart-instagram-feed .instagram-post::before {
	content: "";
	position: absolute;
	inset: 1px;
	z-index: -1; /* stays inside the card: clip-path makes it a stacking context */
	background: #faf7f0;
	clip-path: polygon(var(--ig-cut-inner) 0, 100% 0, 100% calc(100% - var(--ig-cut-inner)), calc(100% - var(--ig-cut-inner)) 100%, 0 100%, 0 var(--ig-cut-inner));
	transition: background-color 220ms ease;
}

.tart-instagram-feed .instagram-post:hover,
.tart-instagram-feed .instagram-post:focus-within {
	--ig-edge: rgb(78 58 138 / 55%);
	transform: translateY(-3px);
}

.tart-instagram-feed .instagram-post:hover::before,
.tart-instagram-feed .instagram-post:focus-within::before {
	background: #fdfbf6;
}

/* Keyboard focus: a solid 2px purple edge (an outline would be clipped). */
.tart-instagram-feed .instagram-post:has(.instagram-post__meta:focus-visible) {
	--ig-edge: var(--mark, #4e3a8a);
	padding: 2px;
}

.tart-instagram-feed .instagram-post:has(.instagram-post__meta:focus-visible)::before {
	inset: 2px;
}

.tart-instagram-feed .instagram-post__media {
	position: relative;
	display: block;
	overflow: hidden;
	width: 100%;
	aspect-ratio: 4 / 5;
	background: var(--ink, #14110d);
	color: inherit;
	text-decoration: none;
	clip-path: polygon(var(--ig-cut-inner) 0, 100% 0, 100% 100%, 0 100%, 0 var(--ig-cut-inner));
}

.tart-instagram-feed .instagram-post img,
.tart-instagram-feed .instagram-post video,
.tart-instagram-feed .tart-instagram-feed__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background: var(--ink, #14110d);
	transition: transform 350ms ease;
}

.tart-instagram-feed .instagram-post:hover img,
.tart-instagram-feed .instagram-post:focus-within img {
	transform: scale(1.04);
}

.tart-instagram-feed .instagram-post__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 16px;
	padding: 16px 16px 14px;
}

.tart-instagram-feed .instagram-post__caption {
	display: -webkit-box;
	overflow: hidden;
	margin: 0;
	color: var(--ink-2, #332c24);
	font: 500 15px/1.5 var(--sans, "Space Grotesk", sans-serif);
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	overflow-wrap: anywhere;
}

/* Footer pinned to the bottom so every card in a row lines up. */
.tart-instagram-feed .instagram-post__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid rgb(20 17 13 / 12%);
	font: 700 11px/1.3 var(--mono, "IBM Plex Mono", monospace);
	letter-spacing: .1em;
	text-transform: uppercase;
}

.tart-instagram-feed .instagram-post__date {
	color: var(--mute, #6b6353);
}

.tart-instagram-feed .instagram-post__meta {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-left: auto;
	color: var(--mark, #4e3a8a);
	text-decoration: none;
}

.tart-instagram-feed .instagram-post__meta svg {
	width: 16px;
	height: 16px;
}

/* Stretched link: the footer link covers the whole card. */
.tart-instagram-feed .instagram-post__meta::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
}

.tart-instagram-feed .instagram-post__meta:focus-visible {
	outline: none;
}

.tart-instagram-feed .instagram-head>a:hover,
.tart-instagram-feed .instagram-head>a:focus-visible {
	color: var(--mark, #4e3a8a);
}

.tart-instagram-feed__video-icon {
	position: absolute;
	top: 12px;
	right: 12px;
	display: grid;
	width: 32px;
	height: 32px;
	place-items: center;
	border-radius: 50%;
	background: rgb(0 0 0 / 62%);
	color: #fff;
	font-size: 12px;
	line-height: 1;
}

.tart-instagram-feed__notice {
	padding: 16px;
	border: 1px dashed #a7aaad;
	background: #f6f7f7;
	color: #50575e;
	text-align: center;
}

@media (max-width: 1060px) {
	.tart-instagram-feed.profile-instagram {
		padding: 72px 32px;
	}

	/* Below desktop: a swipeable row with snap; the next card peeks in to signal more. */
	.tart-instagram-feed .instagram-feed-grid {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: min(31%, 340px);
		gap: 10px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		padding-bottom: 10px;
		scroll-snap-type: x mandatory;
		scrollbar-width: thin;
		-webkit-overflow-scrolling: touch;
	}

	.tart-instagram-feed .instagram-post {
		scroll-snap-align: start;
	}

	/* No lift on touch: it would be clipped by the scroll container. */
	.tart-instagram-feed .instagram-post:hover,
	.tart-instagram-feed .instagram-post:focus-within {
		transform: none;
	}
}

@media (max-width: 900px) {
	.tart-instagram-feed.profile-instagram {
		padding: 56px 24px;
	}

	.tart-instagram-feed .instagram-head {
		gap: 24px;
	}

	.tart-instagram-feed .instagram-feed-grid {
		grid-auto-columns: min(46%, 400px);
	}

}

@media (max-width: 767px) {
	.tart-instagram-feed.profile-instagram {
		padding: 0;
	}

	.tart-instagram-feed .instagram-head {
		display: grid;
		gap: 16px;
		margin-bottom: 24px;
	}

	.tart-instagram-feed .instagram-head h2 {
		font-size: var(--tart-display-mobile, 100px);
	}

	.tart-instagram-feed .instagram-head h2 em {
		font-size: 44px;
	}

	.tart-instagram-feed .instagram-head>a {
		justify-self: start;
		max-width: 100%;
		font-size: 12px;
		line-height: 1.35;
	}

	.tart-instagram-feed .instagram-feed-grid {
		grid-auto-columns: 88%;
	}

	.tart-instagram-feed .instagram-post__body {
		gap: 12px;
		padding: 12px 12px 12px;
	}

	.tart-instagram-feed .instagram-post__caption {
		font-size: 14px;
	}
}

/* An artist without posts: hide the whole container, so its padding leaves no empty band. */
.e-con:has(> .elementor-widget-tart-instagram-feed .tart-instagram-feed--empty):not(:has(> :not(.elementor-widget-tart-instagram-feed))),
.e-con:has(> .e-con-inner > .elementor-widget-tart-instagram-feed .tart-instagram-feed--empty):not(:has(> .e-con-inner > :not(.elementor-widget-tart-instagram-feed))) {
	display: none;
}
