/*
 * The feed styles its own controls so it looks finished on any theme.
 * Themes can restyle the buttons through these custom properties.
 */
.shootcal-instagram-feed-shell,
.shootcal-instagram-feed-loader {
	--scif-button-font: 600 15px/1.2 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--scif-button-radius: 999px;
	--scif-follow-background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
	--scif-on-follow: #fff;
	--scif-outline: rgb(128 128 128 / 45%);
	--scif-tile-background: #eee;
	--scif-tile-border: 1px solid rgb(0 0 0 / 12%);
	--scif-tile-radius: 0;
}

.shootcal-instagram-feed-shell,
.shootcal-instagram-feed-loader {
	width: 100%;
}

.shootcal-instagram-feed {
	display: grid;
	grid-template-columns: repeat(var(--scif-columns, 3), minmax(0, 1fr));
	gap: clamp(4px, 0.75vw, 10px);
	width: 100%;
}

.shootcal-instagram-feed__item {
	position: relative;
	isolation: isolate;
	box-sizing: border-box;
	display: block;
	overflow: hidden;
	aspect-ratio: 1;
	border: var(--scif-tile-border);
	border-radius: var(--scif-tile-radius);
	background: var(--scif-tile-background);
	color: #fff;
	text-decoration: none;
}

/* Themes often set img { height: auto } at higher specificity; the photo must
   still fill the square tile so landscape posts sit centred, not at the top. */
.shootcal-instagram-feed__item > .shootcal-instagram-feed__image {
	transform: none !important;
	position: relative;
	/* Keep theme image-hover z-index rules below the media-type badge. */
	z-index: 0 !important;
	display: block;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	margin: 0;
	object-fit: contain;
	transition: opacity 180ms ease;
}

.shootcal-instagram-feed__item:hover .shootcal-instagram-feed__image,
.shootcal-instagram-feed__item:focus-visible .shootcal-instagram-feed__image {
	opacity: 0.92;
}

.shootcal-instagram-feed__item:focus-visible {
	outline: 3px solid #408bd1;
	outline-offset: 2px;
}

.shootcal-instagram-feed__type {
	position: absolute;
	z-index: 1;
	top: 8px;
	right: 8px;
	padding: 3px 6px;
	border-radius: 999px;
	background: rgb(0 0 0 / 68%);
	color: #fff;
	font: 600 12px/1.2 system-ui, sans-serif;
	letter-spacing: 0.02em;
}

.shootcal-instagram-feed__type--carousel,
.shootcal-instagram-feed__item:hover .shootcal-instagram-feed__type--carousel,
.shootcal-instagram-feed__item:focus-visible .shootcal-instagram-feed__type--carousel {
	display: inline-flex;
	padding: 0;
	background: none;
	color: rgb(25 25 25 / 62%);
	filter: drop-shadow(0 0 2px rgb(255 255 255 / 55%));
	transition: none;
}

.shootcal-instagram-feed__type--carousel svg {
	display: block;
	width: 16px;
	height: 16px;
}

.shootcal-instagram-feed__empty {
	margin: 0;
	padding: 0.75rem;
	border: 1px solid currentColor;
	font-size: 0.9375rem;
}

@media (max-width: 1024px) {
	.shootcal-instagram-feed {
		grid-template-columns: repeat(var(--scif-columns-tablet, 3), minmax(0, 1fr));
	}
}

@media (min-width: 641px) and (max-width: 1024px) {
	.shootcal-instagram-feed__type {
		font-size: 15px;
	}
}

/* Deferred templates do not count as mounted posts. Keep four tiles balanced. */
@media (min-width: 641px) and (max-width: 1024px) {
	.shootcal-instagram-feed[data-tablet-columns="3"]:has(> .shootcal-instagram-feed__item:nth-child(4)):not(:has(> .shootcal-instagram-feed__item:nth-child(n+5))) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.shootcal-instagram-feed {
		grid-template-columns: repeat(var(--scif-columns-mobile, 2), minmax(0, 1fr));
	}

	.shootcal-instagram-feed__item--mobile-hidden {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.shootcal-instagram-feed__image {
		transition: none;
	}
}

.shootcal-instagram-feed__announcement { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Shared button base: resets theme button and link rules the feed doesn't want. */
.shootcal-instagram-feed-shell .shootcal-instagram-feed__more-button,
.shootcal-instagram-feed-shell .shootcal-instagram-feed__follow-link {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	margin: 0;
	padding: 0 24px;
	border-radius: var(--scif-button-radius);
	box-shadow: none;
	font: var(--scif-button-font);
	letter-spacing: 0.01em;
	text-align: center;
	text-decoration: none !important;
	text-transform: none;
	background-image: none !important;
	cursor: pointer;
	transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, transform 200ms ease;
}

.shootcal-instagram-feed-shell .shootcal-instagram-feed__more-button:active,
.shootcal-instagram-feed-shell .shootcal-instagram-feed__follow-link:active {
	transform: scale(0.97);
}

.shootcal-instagram-feed-shell .shootcal-instagram-feed__more-button:focus-visible,
.shootcal-instagram-feed-shell .shootcal-instagram-feed__follow-link:focus-visible {
	outline: 3px solid #408bd1;
	outline-offset: 3px;
}

/* View more and Follow share one centred row and wrap on narrow screens. */
.shootcal-instagram-feed__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 20px;
}

/* The wrapper adds no box, so a hidden View more leaves Follow centred. */
.shootcal-instagram-feed__more { display: contents; }

/* View more: quiet outline pill in the surrounding text colour, so it works on light and dark pages. */

.shootcal-instagram-feed-shell .shootcal-instagram-feed__more-button {
	border: 1px solid var(--scif-outline);
	background-color: transparent;
	color: inherit;
}

.shootcal-instagram-feed-shell .shootcal-instagram-feed__more-button:hover {
	border-color: currentColor;
	background-color: rgb(128 128 128 / 12%);
	color: inherit;
}

.shootcal-instagram-feed-shell .shootcal-instagram-feed__more-button[hidden] { display: none; }

/* Follow: Instagram-gradient pill with the Instagram glyph; readable on light and dark pages. */
.shootcal-instagram-feed__follow,
.shootcal-instagram-feed__actions > .shootcal-instagram-feed__follow {
	/* Beats theme paragraph margins, which would push Follow off the row's centre line. */
	margin: 0;
	text-align: center;
}

.shootcal-instagram-feed-shell .shootcal-instagram-feed__follow-link {
	border: 0;
	background-color: #dc2743;
	background-image: var(--scif-follow-background) !important;
	color: var(--scif-on-follow);
	transition: filter 200ms ease, transform 200ms ease;
}

.shootcal-instagram-feed-shell .shootcal-instagram-feed__follow-link::before {
	content: "";
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='5'/%3E%3Ccircle cx='12' cy='12' r='4.2'/%3E%3Ccircle cx='17.4' cy='6.6' r='1' fill='%23000' stroke='none'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2'%3E%3Crect x='3' y='3' width='18' height='18' rx='5'/%3E%3Ccircle cx='12' cy='12' r='4.2'/%3E%3Ccircle cx='17.4' cy='6.6' r='1' fill='%23000' stroke='none'/%3E%3C/svg%3E") center / contain no-repeat;
}

.shootcal-instagram-feed-shell .shootcal-instagram-feed__follow-link:hover,
.shootcal-instagram-feed-shell .shootcal-instagram-feed__follow-link:focus-visible,
.shootcal-instagram-feed-shell .shootcal-instagram-feed__follow-link:visited {
	color: var(--scif-on-follow);
}

.shootcal-instagram-feed-shell .shootcal-instagram-feed__follow-link:hover {
	filter: brightness(1.08) saturate(1.1);
}

@media (prefers-reduced-motion: reduce) {
	.shootcal-instagram-feed-shell .shootcal-instagram-feed__more-button,
	.shootcal-instagram-feed-shell .shootcal-instagram-feed__follow-link {
		transition: none;
	}
}
