.epg-query-gallery {
	--epg-ink: #303b36;
	--epg-muted: #77827b;
	--epg-line: #e4e1dc;
	--epg-mount: #f1efec;
	--epg-frame: #ffffff;
	--epg-gap: clamp(16px, 2vw, 30px);
	--epg-edge: clamp(18px, 4.2vw, 52px);
	box-sizing: border-box;
	color: var(--epg-ink);
	margin-block: clamp(34px, 5vw, 72px);
	max-width: none;
	width: 100%;
}

.epg-query-gallery.alignfull {
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	max-width: none;
	width: 100vw;
}

.epg-query-gallery *,
.epg-query-gallery *::before,
.epg-query-gallery *::after {
	box-sizing: border-box;
}

.epg-query-gallery__header {
	margin-bottom: clamp(26px, 4vw, 48px) !important;
	padding-inline: var(--epg-edge);
}

.epg-query-gallery__header h2 {
	font-family: "Iowan Old Style", "Palatino Linotype", Palatino, Baskerville, Georgia, serif;
	font-size: clamp(27px, 2.6vw, 40px);
	font-weight: 400;
	letter-spacing: -0.045em;
	line-height: 1.08;
	margin: 0;
}

.epg-query-gallery__query {
	padding-inline: var(--epg-edge);
}

.epg-query-gallery__grid {
	display: grid !important;
	gap: clamp(30px, 4.2vw, 56px) var(--epg-gap) !important;
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	list-style: none;
	margin: 0 !important;
	padding: 0 !important;
}

.epg-query-gallery__grid > li {
	margin: 0;
	min-width: 0;
}

.epg-query-gallery__item--entering {
	animation: epg-fade-up 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
	animation-delay: var(--epg-item-delay, 0ms);
}

.epg-query-gallery__media {
	align-items: stretch;
	aspect-ratio: 1 / 1 !important;
	background: var(--epg-mount);
	display: grid;
	margin: 0 0 clamp(12px, 1.4vw, 17px) !important;
	overflow: hidden;
	padding: 6.7% 13.5%;
	width: 100%;
}

.epg-query-gallery__media a {
	display: block;
	height: 100%;
	width: 100%;
}

.epg-query-gallery__media img {
	border: clamp(3px, 0.42vw, 5px) solid var(--epg-frame);
	box-shadow: none;
	display: block;
	height: 100% !important;
	max-width: none;
	object-fit: cover !important;
	object-position: center center;
	width: 100% !important;
}

.epg-query-gallery__title,
.epg-query-gallery__excerpt {
	margin-block: 0 !important;
}

.epg-query-gallery__title a {
	color: inherit;
	text-decoration: none;
}

.epg-query-gallery__excerpt {
	color: var(--epg-muted);
	margin-top: 4px !important;
}

.epg-query-gallery__excerpt p {
	margin: 0;
}

/* Tiled is a denser wall; all presentation frames remain the same size. */
.epg-query-gallery__grid.is-style-epg-tiled {
	align-items: start;
	gap: var(--epg-gap) !important;
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.epg-query-gallery__pagination {
	margin: clamp(34px, 5vw, 62px) auto 0 !important;
}

.epg-query-gallery__pagination .wp-block-query-pagination-next {
	border: 1px solid var(--epg-line);
	border-radius: 999px;
	color: var(--epg-ink);
	display: inline-block;
	font-size: 14px;
	padding: 12px 25px;
	text-decoration: none;
}

.epg-query-gallery--enhanced .epg-query-gallery__pagination {
	display: none;
}

.epg-query-gallery__loader {
	min-height: 60px;
	padding-top: clamp(30px, 4vw, 52px);
	position: relative;
	text-align: center;
}

.epg-query-gallery__sentinel {
	display: block;
	height: 1px;
	position: absolute;
	top: 0;
	width: 100%;
}

.epg-query-gallery__status {
	color: var(--epg-muted);
	font-size: 14px;
	margin: 0;
	min-height: 22px;
}

.epg-query-gallery--loading .epg-query-gallery__status::before {
	animation: epg-pulse 850ms ease-in-out infinite alternate;
	background: var(--epg-ink);
	border-radius: 50%;
	content: "";
	display: inline-block;
	height: 6px;
	margin: 0 11px 2px 0;
	width: 6px;
}

@keyframes epg-pulse {
	from {
		opacity: 0.25;
		transform: scale(0.75);
	}

	to {
		opacity: 1;
		transform: scale(1);
	}
}

@keyframes epg-fade-up {
	from {
		opacity: 0;
		transform: translateY(22px);
	}

	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 900px) {
	.epg-query-gallery__grid,
	.epg-query-gallery__grid.is-style-epg-tiled {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 560px) {
	.epg-query-gallery {
		--epg-edge: clamp(16px, 5vw, 22px);
		--epg-gap: 14px;
	}

	.epg-query-gallery__grid {
		grid-template-columns: 1fr !important;
	}

	.epg-query-gallery__grid.is-style-epg-tiled {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}

	.epg-query-gallery__header {
		margin-bottom: 23px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.epg-query-gallery__item--entering {
		animation: none;
	}

	.epg-query-gallery--loading .epg-query-gallery__status::before {
		animation: none;
	}
}
