/*
 * Instagram feed module (self-hosted).
 * Replaces the Smash Balloon #sbi_images grid. The surrounding
 * .instagram-feed / .instagram-feed-content styles still come from style.css.
 *
 * Grid: 2 x 2 on mobile, 4 across on tablet, --rmat-ig-cols across on desktop.
 */

.rmat-ig__grid {
	--rmat-ig-cols: 5;
	--rmat-ig-gap: 10px;

	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: var(--rmat-ig-gap);
	width: 100%;
	margin: 0 0 2rem;
	padding: 0;
	list-style: none;
}

.rmat-ig__item {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Beyond the fourth tile we'd break the 2 x 2 block, so hide the remainder
   until there's room for a single full row. */
.rmat-ig__item:nth-child(n+5) {
	display: none;
}

.rmat-ig__link {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: 5px;
	background-color: #f4f4f3;
	aspect-ratio: 1 / 1;
}

.rmat-ig__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 1;
	transition: opacity 0.3s ease-in-out;
}

.rmat-ig__link:hover .rmat-ig__image,
.rmat-ig__link:focus .rmat-ig__image {
	opacity: 0.5;
}

.rmat-ig__link:focus-visible {
	outline: 2px solid #4a4a49;
	outline-offset: 2px;
}

/* Video / album markers, so a reel still reads as a reel without a caption. */
.rmat-ig__badge {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 18px;
	height: 18px;
	background-repeat: no-repeat;
	background-position: center;
	background-size: contain;
	opacity: 0.9;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
	pointer-events: none;
}

.rmat-ig__badge--video {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23fff'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
}

.rmat-ig__badge--album {
	background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='2'%3E%3Crect x='8' y='3' width='13' height='13' rx='2'/%3E%3Cpath d='M16 20H5a2 2 0 0 1-2-2V7'/%3E%3C/svg%3E");
}

/* Follow link — carries over the pill styling the Smash Balloon button used. */
.rmat-ig__follow a {
	display: inline-block;
	font-family: 'Poppins', sans-serif;
	font-size: 1em;
	font-weight: 500;
	color: #4a4a49cc;
	background: none;
	border: 2px solid #4a4a49cc;
	border-radius: 50px;
	padding: 0.75em 1.5em;
	text-decoration: none;
	transition: var(--transition-1, all 0.3s ease-in-out);
}

.rmat-ig__follow a:hover,
.rmat-ig__follow a:focus {
	color: #93A8B3;
	text-decoration: underline;
	box-shadow: none;
}

.rmat-ig__notice {
	font-family: 'Poppins', sans-serif;
	font-size: 0.9em;
	text-align: center;
	color: #8a6d3b;
	background: #fcf8e3;
	border: 1px solid #faebcc;
	border-radius: 5px;
	padding: 0.75em 1em;
	margin-bottom: 2rem;
}

/* Tablet: one row of four. */
@media (min-width: 768px) {
	.rmat-ig__grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* Desktop: one row of everything the module is set to show. */
@media (min-width: 992px) {
	.rmat-ig__grid {
		grid-template-columns: repeat(var(--rmat-ig-cols), 1fr);
	}

	.rmat-ig__item:nth-child(n+5) {
		display: block;
	}
}
