/**
 * Explore & Learn Posts
 * Colors come from Settings. Fonts are set below; the font files themselves must be
 * loaded by the site (Adobe Fonts kit / theme / Elementor).
 */

.elp {
	--elp-text: #1a1a1a;
	--elp-body: #3d4249;
	--elp-muted: #5f646b;
	--elp-accent: #000;
	--elp-accent-text: #fff;
	--elp-card: #fff;
	--elp-border: #d4d7dc;
	--elp-placeholder: #cfd3da;
	--elp-gap: 28px;
	--elp-cols: 3;
	--elp-cols-tablet: 2;
	--elp-cols-mobile: 1;

	/* Typography */
	--elp-font-heading: "Big Caslon FB", serif, sans-serif;
	--elp-font-text: adobe-caslon-pro, "Big Caslon FB", serif, sans-serif;
	--elp-font-button: "Proxima Nova", proxima-nova, sans-serif;

	width: 100%;
	max-width: 100%;
	color: var(--elp-text);
	font-family: var(--elp-font-text);
}

.elp *,
.elp *::before,
.elp *::after {
	box-sizing: border-box;
}

/* Header: heading left, topic buttons right ------------------------------ */

.elp .elp__header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 32px;
	margin: 0 0 28px;
}

.elp .elp__heading {
	margin: 0;
	font-family: var(--elp-font-heading);
	color: var(--elp-text);
	font-size: clamp(1.875rem, 1.4rem + 1.4vw, 2.375rem);
	font-weight: 400;
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.elp .elp__heading:focus {
	outline: none;
}

.elp .elp__topics {
	max-width: 100%;
}

.elp .elp__topic-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.elp .elp__topic-list > li {
	margin: 0;
	padding: 0;
}

.elp .elp__topic {
	display: inline-flex;
	align-items: center;
	min-height: 39px;
	padding: 8px 16px;
	border: 1px solid var(--elp-border);
	border-radius: 0;
	background: var(--elp-card);
	color: var(--elp-text);
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
	font-family: var(--elp-font-button);
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.elp .elp__topic:hover {
	border-color: var(--elp-accent);
	color: var(--elp-text);
}

.elp .elp__topic.is-active,
.elp .elp__topic.is-active:hover {
	border-color: var(--elp-accent);
	background: var(--elp-accent);
	color: var(--elp-accent-text);
	font-weight: 500;
}

/* Grid ----------------------------------------------------------------- */

.elp .elp__results {
	transition: opacity 0.2s ease;
}

.elp.is-loading .elp__results {
	opacity: 0.45;
	pointer-events: none;
}

.elp .elp__grid {
	display: grid;
	grid-template-columns: repeat(var(--elp-cols), minmax(0, 1fr));
	gap: var(--elp-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.elp .elp__item {
	display: flex;
	margin: 0;
	padding: 0;
}

/* Card ----------------------------------------------------------------- */

.elp .elp-card {
	display: flex;
	flex-direction: column;
	width: 100%;
	background: var(--elp-card);
	box-shadow: 0 1px 2px rgba(20, 24, 31, 0.05), 0 4px 16px rgba(20, 24, 31, 0.06);
	transition: box-shadow 0.2s ease;
}

.elp .elp-card:hover {
	box-shadow: 0 2px 4px rgba(20, 24, 31, 0.06), 0 10px 28px rgba(20, 24, 31, 0.1);
}

.elp .elp-card__media {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--elp-placeholder);
}

.elp .elp-card__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	border-radius: 0;
}

.elp .elp-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	padding: 24px 22px;
}

.elp .elp-card__topic {
	margin: 0 0 8px;
	font-family: var(--elp-font-text);
	color: var(--elp-muted);
	font-size: 0.75rem;
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.elp .elp-card__title {
	margin: 0 0 14px;
	font-family: var(--elp-font-heading);
	color: var(--elp-text);
	font-size: clamp(1.375rem, 1.2rem + 0.5vw, 1.625rem);
	font-weight: 400;
	line-height: 1.2;
}

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

.elp .elp-card__title a:hover {
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 4px;
}

.elp .elp-card__excerpt {
	display: -webkit-box;
	margin: 0 0 20px;
	overflow: hidden;
	color: var(--elp-body);
	font-family: var(--elp-font-text);
	font-size: 1rem;
	line-height: 1.6;
	-webkit-line-clamp: 5;
	-webkit-box-orient: vertical;
}

/* Footer sits at the bottom so reading time and links line up across a row. */
.elp .elp-card__footer {
	margin-top: auto;
}

.elp .elp-card__meta {
	margin: 0 0 6px;
	font-family: var(--elp-font-text);
	color: var(--elp-muted);
	font-size: 0.8125rem;
	line-height: 1.4;
}

.elp .elp-card__cta {
	color: var(--elp-text);
	font-family: var(--elp-font-button);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.4;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.elp .elp-card__cta:hover {
	color: var(--elp-text);
	text-decoration-thickness: 2px;
}

/* Pagination ----------------------------------------------------------- */

.elp .elp__pagination {
	margin-top: 44px;
}

.elp .elp__pagination ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.elp .elp__pagination li {
	margin: 0;
	padding: 0;
}

.elp .elp__page {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--elp-border);
	background: var(--elp-card);
	color: var(--elp-text);
	font-family: var(--elp-font-button);
	font-size: 0.875rem;
	line-height: 1;
	text-decoration: none;
}

.elp a.elp__page:hover {
	border-color: var(--elp-accent);
	color: var(--elp-text);
}

.elp .elp__page.is-current {
	border-color: var(--elp-accent);
	background: var(--elp-accent);
	color: var(--elp-accent-text);
}

.elp .elp__page--gap {
	min-width: 24px;
	padding: 0;
	border-color: transparent;
	background: transparent;
}

/* Empty state ---------------------------------------------------------- */

.elp .elp__empty {
	margin: 8px 0 0;
	font-family: var(--elp-font-text);
	color: var(--elp-body);
	font-size: 1.0625rem;
	line-height: 1.6;
}

.elp .elp__empty a {
	color: var(--elp-text);
	text-decoration: underline;
}

/* Focus ---------------------------------------------------------------- */

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

.elp .elp__topic:focus-visible,
.elp .elp__page:focus-visible {
	outline-offset: 2px;
}

.elp-sr-only {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	margin: -1px !important;
	padding: 0 !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

/* Tablet --------------------------------------------------------------- */

@media (max-width: 1024px) {
	.elp {
		--elp-gap: 24px;
	}

	.elp .elp__grid {
		grid-template-columns: repeat(var(--elp-cols-tablet), minmax(0, 1fr));
	}

	.elp .elp__header {
		flex-direction: column;
		align-items: flex-start;
	}
}

/* Phone: topic buttons scroll sideways instead of wrapping ------------- */

@media (max-width: 767px) {
	.elp {
		--elp-gap: 20px;
	}

	.elp .elp__grid {
		grid-template-columns: repeat(var(--elp-cols-mobile), minmax(0, 1fr));
	}

	.elp .elp__header {
		margin-bottom: 20px;
	}

	.elp .elp__topics {
		width: 100%;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.elp .elp__topics::-webkit-scrollbar {
		display: none;
	}

	.elp .elp__topic-list {
		flex-wrap: nowrap;
		padding: 2px; /* room for the focus outline */
	}

	.elp .elp-card__body {
		padding: 20px 18px 22px;
	}

	.elp .elp__pagination {
		margin-top: 32px;
	}

	.elp .elp__page--prev,
	.elp .elp__page--next {
		padding: 0 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.elp *,
	.elp *::before,
	.elp *::after {
		transition: none !important;
	}
}
