/* Instagram Reel Grid — frontend styles */

.irg-grid {
	display: grid;
	grid-template-columns: repeat(var(--irg-cols-active, var(--irg-cols-desktop, 3)), 1fr);
	gap: var(--irg-gap, 20px);
	width: 100%;
	box-sizing: border-box;
}

.irg-grid *,
.irg-slider * {
	box-sizing: border-box;
}

.irg-item {
	min-width: 0;
	display: flex;
}


/* ---------- Slider / carousel ---------- */

.irg-slider {
	position: relative;
	width: 100%;
}

.irg-slider-track {
	display: flex;
	gap: var(--irg-gap, 20px);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-ms-overflow-style: none;
	scrollbar-width: none;
	width: 100%;
}

.irg-slider-track::-webkit-scrollbar {
	display: none;
}

.irg-slider-track .irg-item {
	flex: 0 0 calc((100% - (var(--irg-cols-active, 3) - 1) * var(--irg-gap, 20px)) / var(--irg-cols-active, 3));
	scroll-snap-align: start;
}

.irg-slider-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.9);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
	cursor: pointer;
	font-size: 14px;
	color: #262626;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
}

.irg-slider-arrow:hover {
	background: #fff;
}

.irg-slider-prev {
	left: -6px;
}

.irg-slider-next {
	right: -6px;
}

@media (max-width: 782px) {
	.irg-slider-arrow {
		display: none;
	}
}

.irg-card {
	background: #ffffff;
	border: 1px solid #dbdbdb;
	border-radius: 8px;
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	display: flex;
	flex-direction: column;
	width: 100%;
}

/* ---------- Header ---------- */

.irg-card-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
}

.irg-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	background: #f0f0f0;
}

.irg-header-text {
	display: flex;
	flex-direction: column;
	line-height: 1.25;
	min-width: 0;
	flex: 1;
}

.irg-username {
	font-size: 13px;
	font-weight: 600;
	color: #262626;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.irg-subtext {
	font-size: 12px;
	color: #8e8e8e;
}

.irg-profile-btn {
	flex-shrink: 0;
	background: #0095f6;
	color: #fff !important;
	font-size: 13px;
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 6px;
	text-decoration: none;
	white-space: nowrap;
}

.irg-profile-btn:hover {
	background: #1877c9;
	color: #fff;
}

/* ---------- Media ---------- */

.irg-media {
	position: relative;
	width: 100%;
	aspect-ratio: 9 / 14;
	background: #000;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.irg-video {
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #000;
	display: block;
}

.irg-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.irg-play-icon {
	display: none; /* native <video controls> already shows a play affordance */
}

/* ---------- Footer ---------- */

.irg-card-footer {
	padding: 10px 14px 14px;
	border-top: 1px solid #efefef;
}

.irg-view-more {
	display: block;
	font-size: 13px;
	color: #00376b;
	text-decoration: none;
	margin-bottom: 10px;
	font-weight: 400;
}

.irg-view-more:hover {
	text-decoration: underline;
}

.irg-icon-row {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 8px;
}

.irg-icon {
	width: 22px;
	height: 22px;
	display: inline-block;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	opacity: 0.85;
}

.irg-icon-right {
	margin-left: auto;
}

.irg-icon-heart {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='%23262626' stroke-width='1.8' d='M12 21s-7.5-4.6-10.1-9.1C.4 9 1.6 5.4 5 4.3c2.2-.7 4.4.2 5.7 2C12 4.5 14.2 3.6 16.4 4.3c3.4 1.1 4.6 4.7 3.1 7.6C16.9 16.4 12 21 12 21z'/></svg>");
}

.irg-icon-comment {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='%23262626' stroke-width='1.8' d='M12 3C6.5 3 2 6.6 2 11c0 2.4 1.3 4.6 3.5 6.1-.2 1.1-.8 2.6-1.7 3.6 1.8-.1 3.6-.8 4.9-1.7 1 .3 2.1.4 3.3.4 5.5 0 10-3.6 10-8.4S17.5 3 12 3z'/></svg>");
}

.irg-icon-share {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='%23262626' stroke-width='1.8' d='M22 3 2 10.5l8 3.5 3.5 8L22 3zM10 14l4.5-4.5'/></svg>");
}

.irg-icon-save {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='%23262626' stroke-width='1.8' d='M6 3h12v18l-6-4.5L6 21V3z'/></svg>");
}

.irg-icon-camera {
	background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'><path fill='none' stroke='%238e8e8e' stroke-width='1.8' d='M3 8h3l1.5-2h9L18 8h3v11H3V8z'/><circle cx='12' cy='13.5' r='3.2' fill='none' stroke='%238e8e8e' stroke-width='1.8'/></svg>");
}

.irg-likes {
	font-size: 13px;
	font-weight: 600;
	color: #262626;
	margin-bottom: 8px;
}

.irg-comment-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-top: 1px solid #efefef;
	padding-top: 10px;
}

.irg-comment-placeholder {
	font-size: 13px;
	color: #8e8e8e;
}

/* ---------- Admin-only notice shown on the front end ---------- */

.irg-admin-notice {
	padding: 14px 18px;
	background: #fff8e5;
	border: 1px solid #f0c36d;
	border-radius: 6px;
	font-size: 14px;
	color: #6b5300;
}

/* ---------- Manual Embed cells ---------- */

/* The card frame belongs to the cell, so the card exists from first paint. */
.irg-embed-cell {
	width: 100%;
	max-width: 540px;
	min-width: 0;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	background: #fff;
	border: 1px solid #dbdbdb;
	border-radius: 8px;
	overflow: hidden;
}

/* Instagram's embed is designed for >= 326px wide and its layout collapses below that
   (video area shrinks to a thin strip). So the iframe is ALWAYS rendered at >= 326px and,
   in narrower columns, scaled down with transform by irg-embed.js (see fitFrame). */
.irg-embed-frame {
	position: relative;
	width: 100%;
	overflow: hidden;
}

.irg-embed-cell.irg-pending .irg-embed-frame {
	display: flex;
	flex: 1 1 auto;
}

.irg-embed-cell.irg-pending .irg-embed-frame blockquote.instagram-media {
	flex: 1 1 auto;
}

.irg-embed-cell iframe.instagram-media,
.irg-embed-cell blockquote.instagram-media {
	min-width: 326px !important;
	width: 100% !important;
	max-width: 540px !important;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	box-sizing: border-box;
	transform-origin: 0 0;
}

/* "View this post on Instagram" placeholder (same text Instagram's own embed code shows) */
a.irg-embed-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 1 / 1.9;
	background: #fff;
	color: #3897f0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	box-shadow: none;
}

/* While the reel loads, reserve its space. Tune the ratio (height / width of the loaded
   iframe, read it in DevTools) so nothing jumps when the reel appears. */
.irg-embed-cell.irg-pending {
	aspect-ratio: 1 / 1.9;
}

/* Footer always takes its space (visibility, not display) so it never pops in. */
.irg-embed-footer {
	display: block;
	visibility: hidden;
	width: 100%;
	background: #fff;
	border: 0;
	border-top: 1px solid #efefef;
	border-radius: 0;
	padding: 10px 14px 14px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.irg-embed-cell.irg-loaded .irg-embed-footer {
	visibility: visible;
}

.irg-embed-footer a {
	text-decoration: none;
	box-shadow: none;
}

.irg-embed-footer .irg-comment-row {
	color: inherit;
}
