.ibenlo-template-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(1rem, 2vw, 1.5rem);
}

.ibenlo-template-card {
	display: grid;
	grid-template-rows: auto 1fr;
	min-height: 100%;
	padding: 0;
	overflow: hidden;
}

.ibenlo-template-card__media {
	display: block;
	aspect-ratio: 16 / 10;
	overflow: hidden;
	border-bottom: 1px solid var(--ibenlo-stage-border);
	background: rgba(7, 11, 18, 0.22);
}

.ibenlo-template-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 420ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ibenlo-template-card:hover .ibenlo-template-card__image,
.ibenlo-template-card:focus-within .ibenlo-template-card__image {
	transform: scale(1.035);
}

.ibenlo-template-card__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.85rem;
	padding: clamp(1.1rem, 2.4vw, 1.55rem);
}

.ibenlo-template-card__title {
	margin: 0;
	color: var(--ibenlo-color-heading);
	font-size: clamp(1.45rem, 3vw, 2rem);
	font-weight: 800;
	line-height: 1.02;
	text-transform: uppercase;
}

.ibenlo-template-card__title a {
	color: inherit;
	text-decoration: none;
}

.ibenlo-template-card__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem 0.75rem;
	color: var(--ibenlo-color-text-muted);
	font-size: var(--ibenlo-type-ui);
	font-weight: 700;
}

.ibenlo-template-card__excerpt {
	max-width: none;
	margin: 0;
	color: var(--ibenlo-color-text);
	font-size: var(--ibenlo-type-paragraph);
	line-height: var(--ibenlo-type-paragraph-line-height);
}

.ibenlo-template-card__excerpt p {
	margin: 0;
}

.ibenlo-template-card__link {
	margin-top: auto;
}

.ibenlo-template-pagination {
	margin-top: clamp(1.6rem, 4vw, 2.6rem);
	text-align: center;
}

.ibenlo-template-pagination .nav-links {
	display: inline-flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.45rem;
	padding: 0.35rem;
	border: 1px solid var(--ibenlo-stage-border);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.06);
}

.ibenlo-template-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.45rem;
	min-height: 2.45rem;
	padding: 0.35rem 0.75rem;
	border-radius: 999px;
	color: var(--ibenlo-stage-paper);
	font-size: var(--ibenlo-type-ui);
	font-weight: 800;
	text-decoration: none;
}

.ibenlo-template-pagination .page-numbers.current,
.ibenlo-template-pagination a.page-numbers:hover,
.ibenlo-template-pagination a.page-numbers:focus-visible {
	background: var(--ibenlo-stage-lime);
	color: var(--color-text-on-accent);
}

.ibenlo-template-search-form {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.8rem;
	margin-top: 1.4rem;
}

.ibenlo-template-search-form__field {
	position: relative;
	min-width: 0;
}

.ibenlo-template-search-form__field svg {
	position: absolute;
	top: 50%;
	left: 1rem;
	width: 1.25rem;
	height: 1.25rem;
	color: var(--ibenlo-color-text-muted);
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transform: translateY(-50%);
	pointer-events: none;
}

.ibenlo-template-search-form input[type="search"] {
	width: 100%;
	min-height: var(--ibenlo-field-min-height);
	padding: 0.85rem 1rem 0.85rem 3rem;
	border: 1px solid var(--ibenlo-stage-border);
	border-radius: var(--ibenlo-button-radius);
	background: rgba(7, 11, 18, 0.34);
	color: var(--ibenlo-stage-paper);
	font: inherit;
	font-size: var(--ibenlo-type-ui);
	font-weight: 700;
	outline: none;
	transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.ibenlo-template-search-form input[type="search"]:focus {
	border-color: rgba(63, 234, 217, 0.52);
	background: rgba(7, 11, 18, 0.48);
	box-shadow: 0 0 0 3px rgba(63, 234, 217, 0.12);
}

.ibenlo-content-none {
	max-width: 54rem;
	margin-inline: auto;
	padding: clamp(1.4rem, 4vw, 2.35rem);
	text-align: center;
}

.ibenlo-content-none > p:not(.ibenlo-stage-kicker) {
	max-width: 42rem;
	margin: 0 auto 1.25rem;
	color: var(--ibenlo-color-text);
	font-size: var(--ibenlo-type-paragraph);
	line-height: var(--ibenlo-type-paragraph-line-height);
}

.ibenlo-content-none__actions {
	justify-content: center;
}

.ibenlo-template-attachment__card {
	max-width: 62rem;
	margin-inline: auto;
	padding: clamp(1.35rem, 4vw, 2.5rem);
}

.ibenlo-template-attachment__media {
	margin: 1.5rem 0;
}

.ibenlo-template-attachment__media img {
	width: 100%;
	height: auto;
	display: block;
}

.ibenlo-template-preview__stack {
	display: grid;
	gap: 1.5rem;
}

body.ibenlo-stage-theme.ibenlo-light-mode .ibenlo-template-card__media {
	border-color: rgba(23, 33, 49, 0.1);
	background: rgba(44, 38, 70, 0.04);
}

body.ibenlo-stage-theme.ibenlo-light-mode .ibenlo-template-card__meta,
body.ibenlo-stage-theme.ibenlo-light-mode .ibenlo-template-search-form__field svg {
	color: color-mix(in srgb, var(--ibenlo-stage-plum) 52%, rgba(23, 33, 49, 0.56));
}

body.ibenlo-stage-theme.ibenlo-light-mode .ibenlo-template-pagination .nav-links {
	border-color: rgba(23, 33, 49, 0.1);
	background: rgba(255, 255, 255, 0.72);
	box-shadow: 0 12px 28px rgba(30, 56, 89, 0.08);
}

body.ibenlo-stage-theme.ibenlo-light-mode .ibenlo-template-pagination .page-numbers {
	color: var(--ibenlo-stage-plum);
}

body.ibenlo-stage-theme.ibenlo-light-mode .ibenlo-template-pagination .page-numbers.current,
body.ibenlo-stage-theme.ibenlo-light-mode .ibenlo-template-pagination a.page-numbers:hover,
body.ibenlo-stage-theme.ibenlo-light-mode .ibenlo-template-pagination a.page-numbers:focus-visible {
	background: var(--ibenlo-stage-plum);
	color: var(--ibenlo-stage-paper);
}

body.ibenlo-stage-theme.ibenlo-light-mode .ibenlo-template-search-form input[type="search"] {
	border-color: rgba(23, 33, 49, 0.16);
	background: rgba(255, 255, 255, 0.72);
	color: var(--ibenlo-color-heading);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, 0.8),
		0 8px 20px rgba(30, 56, 89, 0.06);
}

body.ibenlo-stage-theme.ibenlo-light-mode .ibenlo-template-search-form input[type="search"]:focus {
	border-color: color-mix(in srgb, var(--ibenlo-stage-plum) 42%, rgba(23, 33, 49, 0.14));
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--ibenlo-stage-plum) 14%, transparent);
}

@media (max-width: 980px) {
	.ibenlo-template-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.ibenlo-template-grid,
	.ibenlo-template-search-form {
		grid-template-columns: 1fr;
	}

	.ibenlo-template-search-form {
		gap: var(--ibenlo-stacked-search-gap, 24px);
	}

	.ibenlo-template-search-form .ibenlo-card-link {
		padding-inline: var(--ibenlo-stacked-search-button-padding-inline, calc(var(--ibenlo-button-padding-x, 1.35rem) + var(--ibenlo-button-padding-x, 1.35rem)));
		width: 100%;
	}
}
