/**
 * Ghost Posts for Elementor
 *
 * Deliberately quiet: the grid inherits the theme's fonts and colours, and every
 * value that a site owner is likely to want to change is a custom property.
 */

.gpe-wrap {
	--gpe-columns: 3;
	--gpe-gap: 32px;
	--gpe-card-bg: transparent;
	--gpe-card-border: rgba(0, 0, 0, 0.12);
	--gpe-card-radius: 10px;
	--gpe-card-padding: 20px;
	--gpe-media-ratio: 0.62;
	--gpe-accent: currentColor;
	--gpe-muted: rgba(0, 0, 0, 0.6);
}

.gpe-cols-1 { --gpe-columns: 1; }
.gpe-cols-2 { --gpe-columns: 2; }
.gpe-cols-3 { --gpe-columns: 3; }
.gpe-cols-4 { --gpe-columns: 4; }

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

.gpe-grid {
	display: grid;
	grid-template-columns: repeat(var(--gpe-columns), minmax(0, 1fr));
	gap: var(--gpe-gap);
}

.gpe-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--gpe-card-bg);
	border: 1px solid var(--gpe-card-border);
	border-radius: var(--gpe-card-radius);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.gpe-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.gpe-card__media {
	display: block;
	overflow: hidden;
	line-height: 0;
}

.gpe-card__media img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 1 / var(--gpe-media-ratio);
	object-fit: cover;
	transition: transform 0.35s ease;
}

.gpe-card:hover .gpe-card__media img {
	transform: scale(1.03);
}

.gpe-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	padding: var(--gpe-card-padding);
}

.gpe-card__tags {
	margin: 0;
	font-size: 0.75em;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--gpe-muted);
}

.gpe-card__tag-sep,
.gpe-card__meta-sep {
	margin: 0 0.4em;
	opacity: 0.6;
}

.gpe-card__title {
	margin: 0;
	font-size: 1.25em;
	line-height: 1.3;
}

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

.gpe-card__title a:hover,
.gpe-card__title a:focus-visible {
	text-decoration: underline;
}

.gpe-card__excerpt {
	margin: 0;
	color: var(--gpe-muted);
	line-height: 1.6;
}

.gpe-card__meta {
	margin: 0;
	font-size: 0.85em;
	color: var(--gpe-muted);
}

.gpe-card__more {
	margin-top: auto;
	padding-top: 12px;
	color: var(--gpe-accent);
	font-size: 0.9em;
	font-weight: 600;
	text-decoration: none;
}

.gpe-card__more span[aria-hidden] {
	display: inline-block;
	margin-left: 4px;
	transition: transform 0.18s ease;
}

.gpe-card__more:hover span[aria-hidden] {
	transform: translateX(3px);
}

/* Search
------------------------------------------------------------------ */

.gpe-search {
	display: flex;
	gap: 8px;
	margin-bottom: var(--gpe-gap);
}

.gpe-search__input {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 420px;
	padding: 10px 14px;
	border: 1px solid var(--gpe-card-border);
	border-radius: var(--gpe-card-radius);
	font: inherit;
	color: inherit;
	background: transparent;
}

.gpe-search__button {
	padding: 10px 18px;
	border: 1px solid currentColor;
	border-radius: var(--gpe-card-radius);
	background: transparent;
	color: var(--gpe-accent);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.gpe-search__button:hover {
	opacity: 0.8;
}

/* Pagination, notices
------------------------------------------------------------------ */

.gpe-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	justify-content: center;
	margin-top: var(--gpe-gap);
}

.gpe-page {
	display: inline-block;
	min-width: 40px;
	padding: 8px 12px;
	border: 1px solid var(--gpe-card-border);
	border-radius: var(--gpe-card-radius);
	color: inherit;
	font-size: 0.9em;
	text-align: center;
	text-decoration: none;
}

.gpe-page:hover {
	border-color: currentColor;
}

.gpe-page--current {
	border-color: currentColor;
	font-weight: 700;
}

.gpe-page--gap {
	border-color: transparent;
	min-width: 0;
	padding: 8px 4px;
}

.gpe-empty,
.gpe-notice {
	margin: 0;
	padding: 16px 18px;
	border: 1px dashed var(--gpe-card-border);
	border-radius: var(--gpe-card-radius);
	color: var(--gpe-muted);
}

.gpe-notice {
	border-style: solid;
	border-left-width: 4px;
	border-left-color: #d63638;
}

/* Focus and motion
------------------------------------------------------------------ */

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

@media (prefers-reduced-motion: reduce) {
	.gpe-card,
	.gpe-card__media img,
	.gpe-card__more span[aria-hidden] {
		transition: none;
	}

	.gpe-card:hover {
		transform: none;
	}

	.gpe-card:hover .gpe-card__media img {
		transform: none;
	}
}

/* Breakpoints. Elementor's own responsive controls have higher specificity and
   override these when the widget is used. */

@media (max-width: 1024px) {
	.gpe-cols-3,
	.gpe-cols-4 { --gpe-columns: 2; }
}

@media (max-width: 640px) {
	.gpe-cols-2,
	.gpe-cols-3,
	.gpe-cols-4 { --gpe-columns: 1; }

	.gpe-search {
		flex-wrap: wrap;
	}

	.gpe-search__input {
		max-width: none;
	}
}

/* Fallback in case the theme does not define it. */

.gpe-wrap .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}
