/* RL Post Grid
   ------------------------------------------------------------------ */

.rlpg {
	--rlpg-cols: 3;
	--rlpg-cols-t: 2;
	--rlpg-cols-m: 1;
	--rlpg-gap-x: 30px;
	--rlpg-gap-y: 40px;
	--rlpg-ratio: 4/3;
	--rlpg-radius: 0px;
	--rlpg-badge-bg: #E7623D;
	--rlpg-badge-color: #fff;
	--rlpg-title: #111;
	--rlpg-title-hover: #E7623D;
	--rlpg-meta: #8a8a8a;
	--rlpg-excerpt: #5a5a5a;
	--rlpg-accent: #E7623D;
	--rlpg-title-lines: 2;
	box-sizing: border-box;
}

.rlpg *,
.rlpg *::before,
.rlpg *::after {
	box-sizing: inherit;
}

.rlpg__grid {
	display: grid;
	grid-template-columns: repeat(var(--rlpg-cols), minmax(0, 1fr));
	column-gap: var(--rlpg-gap-x);
	row-gap: var(--rlpg-gap-y);
}

/* ------------------------------------------------------------ card */

.rlpg-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.rlpg-card__media {
	position: relative;
	overflow: hidden;
	border-radius: var(--rlpg-radius);
	background: #ececec;
	aspect-ratio: var(--rlpg-ratio);
}

.rlpg-card__imglink {
	display: block;
	width: 100%;
	height: 100%;
}

.rlpg-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.3, 1);
}

.rlpg-img--placeholder {
	background: linear-gradient(135deg, #e4e4e4 0%, #cfcfcf 100%);
}

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

/* ----------------------------------------------------------- badge */

.rlpg-badge {
	position: absolute;
	z-index: 2;
	display: inline-block;
	padding: 6px 13px;
	background: var(--rlpg-badge-bg);
	color: var(--rlpg-badge-color);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.2;
	text-decoration: none;
	text-transform: uppercase;
	transition: filter 0.2s ease;
}

.rlpg-badge:hover,
.rlpg-badge:focus {
	color: var(--rlpg-badge-color);
	filter: brightness(0.92);
	text-decoration: none;
}

.rlpg--badge-bottom_left .rlpg-badge {
	bottom: 14px;
	left: 0;
}

.rlpg--badge-top_left .rlpg-badge {
	top: 14px;
	left: 0;
}

.rlpg--badge-top_right .rlpg-badge {
	top: 14px;
	right: 0;
}

/* Badge sitting above the title instead of on the image. */
.rlpg--badge-above_title .rlpg-badge {
	position: static;
	align-self: flex-start;
	margin-bottom: 10px;
}

/* ------------------------------------------------------------ body */

.rlpg-card__body {
	display: flex;
	flex-direction: column;
	padding-top: 18px;
}

.rlpg-card__title {
	margin: 0;
	color: var(--rlpg-title);
	font-size: 19px;
	font-weight: 700;
	line-height: 1.35;
}

.rlpg-card__title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.rlpg-card__title a:hover,
.rlpg-card__title a:focus {
	color: var(--rlpg-title-hover);
	text-decoration: none;
}

.rlpg--clamp .rlpg-card__title a {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--rlpg-title-lines);
	line-clamp: var(--rlpg-title-lines);
}

.rlpg-meta {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 9px;
	color: var(--rlpg-meta);
	font-size: 13px;
}

.rlpg-meta__sep {
	opacity: 0.6;
}

.rlpg-card__excerpt {
	margin: 11px 0 0;
	color: var(--rlpg-excerpt);
	font-size: 15px;
	line-height: 1.65;
}

.rlpg-more {
	align-self: flex-start;
	margin-top: 14px;
	color: var(--rlpg-accent);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-decoration: none;
	text-transform: uppercase;
}

.rlpg-more:hover,
.rlpg-more:focus {
	color: var(--rlpg-accent);
	text-decoration: underline;
}

/* ------------------------------------------------------- load more */

.rlpg__actions {
	display: flex;
	justify-content: center;
	margin-top: 42px;
}

.rlpg-load {
	padding: 14px 34px;
	border: 1px solid var(--rlpg-accent);
	background: transparent;
	color: var(--rlpg-accent);
	cursor: pointer;
	font-family: inherit;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.11em;
	line-height: 1;
	text-transform: uppercase;
	transition: background-color 0.25s ease, color 0.25s ease;
}

.rlpg-load:hover:not(:disabled) {
	background: var(--rlpg-accent);
	color: #fff;
}

.rlpg-load:disabled {
	cursor: default;
	opacity: 0.55;
}

.rlpg-card--in {
	animation: rlpg-in 0.45s ease both;
}

@keyframes rlpg-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* ----------------------------------------------------------- empty */


/* ------------------------------------------------------ a11y focus */

.rlpg a:focus-visible,
.rlpg button:focus-visible {
	outline: 2px solid var(--rlpg-accent);
	outline-offset: 3px;
}

/* ------------------------------------------------------ responsive */

@media (max-width: 980px) {
	.rlpg__grid {
		grid-template-columns: repeat(var(--rlpg-cols-t), minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.rlpg__grid {
		grid-template-columns: repeat(var(--rlpg-cols-m), minmax(0, 1fr));
	}

	.rlpg-card__title {
		font-size: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rlpg-img,
	.rlpg-card--in {
		animation: none !important;
		transition: none !important;
	}
}

/* --------------------------------------------------------- pagination */

.rlpg__pager {
	margin-top: 42px;
}

.rlpg__pages {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rlpg__pages li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.rlpg__pages .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 13px;
	border: 1px solid rgba(0, 0, 0, 0.12);
	color: var(--rlpg-title);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.rlpg__pages a.page-numbers:hover,
.rlpg__pages a.page-numbers:focus {
	border-color: var(--rlpg-accent);
	color: var(--rlpg-accent);
	text-decoration: none;
}

.rlpg__pages .page-numbers.current {
	background: var(--rlpg-accent);
	border-color: var(--rlpg-accent);
	color: #fff;
}

.rlpg__pages .page-numbers.dots {
	border-color: transparent;
	opacity: 0.6;
}

.rlpg__pages .prev,
.rlpg__pages .next {
	font-weight: 700;
	letter-spacing: 0.04em;
}

/* Previous / Next only */

.rlpg__pager-ends {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.rlpg__pager-ends .page-numbers {
	display: inline-flex;
	align-items: center;
	padding: 12px 22px;
	border: 1px solid var(--rlpg-accent);
	color: var(--rlpg-accent);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.09em;
	line-height: 1;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.rlpg__pager-ends .page-numbers:hover,
.rlpg__pager-ends .page-numbers:focus {
	background: var(--rlpg-accent);
	color: #fff;
	text-decoration: none;
}

/* Keeps the count centred when only one of the two arrows exists. */
.rlpg__pager-ends .rlpg__pager-count {
	margin: 0 auto;
}

.rlpg__pager-count {
	margin: 14px 0 0;
	color: var(--rlpg-meta);
	font-size: 13px;
	text-align: center;
}

.rlpg--empty-page {
	text-align: center;
}

@media (max-width: 480px) {
	.rlpg__pages .page-numbers {
		min-width: 36px;
		height: 36px;
		padding: 0 9px;
		font-size: 13px;
	}

	.rlpg__pager-ends {
		flex-direction: column;
	}
}

/* -------------------------------------------------------- empty state */

.rlpg-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: 480px;
	margin: 0 auto;
	padding: 56px 28px 60px;
	text-align: center;
}

.rlpg-empty__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 76px;
	height: 76px;
	margin-bottom: 22px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--rlpg-accent) 12%, transparent);
	color: var(--rlpg-accent);
}

/* color-mix is recent, so give older browsers a plain tint. */
@supports not (background: color-mix(in srgb, red 10%, transparent)) {
	.rlpg-empty__icon {
		background: rgba(0, 0, 0, 0.05);
	}
}

.rlpg-empty__icon svg {
	width: 34px;
	height: 34px;
}

.rlpg-empty__title {
	margin: 0 0 10px;
	color: var(--rlpg-title);
	font-size: 23px;
	font-weight: 700;
	line-height: 1.3;
}

.rlpg-empty__text {
	margin: 0;
	color: var(--rlpg-meta);
	font-size: 15.5px;
	line-height: 1.65;
}

.rlpg-empty__search {
	width: 100%;
	max-width: 340px;
	margin-top: 24px;
}

.rlpg-empty__search input[type="search"],
.rlpg-empty__search input[type="text"] {
	width: 100%;
	padding: 12px 15px;
	border: 1px solid rgba(0, 0, 0, 0.14);
	border-radius: 3px;
	font-family: inherit;
	font-size: 15px;
}

.rlpg-empty__search input:focus {
	border-color: var(--rlpg-accent);
	outline: none;
}

.rlpg-empty__btn {
	display: inline-block;
	margin-top: 26px;
	padding: 13px 30px;
	border: 1px solid var(--rlpg-accent);
	background: var(--rlpg-accent);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.1em;
	line-height: 1;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color 0.22s ease, color 0.22s ease;
}

.rlpg-empty__btn:hover,
.rlpg-empty__btn:focus {
	background: transparent;
	color: var(--rlpg-accent);
	text-decoration: none;
}

/* Editor-only hint, deliberately unobtrusive. */
.rlpg-empty__note {
	max-width: 44em;
	margin: 30px 0 0;
	padding: 11px 15px;
	border: 1px dashed rgba(0, 0, 0, 0.18);
	background: rgba(0, 0, 0, 0.02);
	color: #777;
	font-size: 12.5px;
	line-height: 1.55;
}

@media (max-width: 480px) {
	.rlpg-empty {
		padding: 40px 18px 44px;
	}

	.rlpg-empty__title {
		font-size: 20px;
	}
}
