/* Square Post Grid — grid of square thumbnails, title only below each.
   Class names are namespaced under "spg-" so a theme can safely
   override any of this from its own stylesheet. */

.spg-grid {
	display: grid;
	grid-template-columns: repeat(var(--spg-cols-mobile, 1), 1fr);
	gap: 32px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 600px) {
	.spg-grid {
		grid-template-columns: repeat(var(--spg-cols-tablet, 2), 1fr);
	}
}

@media (min-width: 900px) {
	.spg-grid {
		grid-template-columns: repeat(var(--spg-cols-desktop, 3), 1fr);
	}
}

.spg-card {
	display: block;
	color: inherit;
	text-decoration: none;
}

.spg-media {
	position: relative;
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: #e7dac7;
}

.spg-media img {
	width: 100%;
	height: 100%;
	/* !important: themes commonly give inline-content images a vertical
	   margin (for images inserted directly into a paragraph); this grid
	   is often embedded inside that same content area, and a plain
	   `margin: 0` here can lose a same-specificity tie against a theme
	   rule that simply loads later in the page — pin it so it always wins. */
	margin: 0 !important;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.spg-card:hover .spg-media img {
	transform: scale(1.05);
}

.spg-media__placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #e7dac7, #e9e2d6);
}

.spg-title {
	margin: 16px 0 0;
	font-size: 22px;
	font-style: italic;
	font-weight: 500;
	line-height: 1.3;
	text-align: center;
}

.spg-pagination {
	margin-top: 40px;
}

.spg-pagination ul.page-numbers {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.spg-pagination .page-numbers li {
	display: block;
}

.spg-pagination a.page-numbers,
.spg-pagination span.page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25em;
	height: 2.25em;
	padding: 0 0.6em;
	border: 1px solid #e9e2d6;
	color: inherit;
	text-decoration: none;
	font-size: 14px;
}

.spg-pagination a.page-numbers:hover {
	border-color: currentColor;
}

.spg-pagination span.page-numbers.current {
	background: #2b2723;
	border-color: #2b2723;
	color: #fff;
}

.spg-pagination span.page-numbers.dots {
	border: none;
}
