/**
 * Recent Posts Loop — frontend styles.
 *
 * Principles:
 *   1. NO typographic or colour declarations on text elements. Title, date,
 *      excerpt, and read-more all inherit from the active theme by default.
 *      Elementor controls inject their own selectors with higher specificity
 *      when the user sets a value, so the cascade does the right thing.
 *   2. Only structural CSS (layout, separators, image sizing, hover effects)
 *      lives here.
 *   3. CSS custom properties expose the few values that Elementor needs to
 *      override at the row level (separator colour and thickness).
 */

.cew-rpl {
	--cew-rpl-separator-color: currentColor;
	--cew-rpl-separator-height: 1px;
	display: block;
}

/* ---------- Row layout ---------- */

.cew-rpl__row {
	display: flex;
	align-items: flex-start;
	gap: 40px;
	position: relative;
}

/* Separator drawn as a pseudo element so it can sit at top or bottom of row
   without affecting the inner padding. */
.cew-rpl--has-separator .cew-rpl__row::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: var(--cew-rpl-separator-height, 1px);
	background-color: var(--cew-rpl-separator-color, currentColor);
	opacity: 0.3;
	pointer-events: none;
}

.cew-rpl--separator-top .cew-rpl__row::before {
	top: 0;
}

.cew-rpl--separator-bottom .cew-rpl__row::before {
	bottom: 0;
}

/* Avoid double separators between adjacent rows when using the "top" variant. */
.cew-rpl--separator-top .cew-rpl__row + .cew-rpl__row::before {
	/* keep top separator on every row — visual matches screenshot */
}

/* ---------- Date column ---------- */

.cew-rpl__date {
	flex: 0 0 140px;
	/* No color or font declarations: inherits from theme. */
}

.cew-rpl__date time {
	display: inline-block;
}

/* ---------- Image column ---------- */

.cew-rpl__image-wrap {
	flex: 0 0 35%;
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	position: relative;
	line-height: 0;
}

.cew-rpl__image {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
	transition: transform 0.4s ease, opacity 0.3s ease;
}

.cew-rpl--image-hover-zoom .cew-rpl__image-wrap:hover .cew-rpl__image {
	transform: scale(1.05);
}

.cew-rpl--image-hover-fade .cew-rpl__image-wrap:hover .cew-rpl__image {
	opacity: 0.85;
}

/* ---------- Content column ---------- */

/* Made a flex column so the "Content Layout" control's justify-content
   value (top / centre / bottom / split) actually positions title,
   excerpt, and read-more link vertically. When the row uses
   align-items: stretch, this column will fill the image height,
   giving "Split" room to push the link to the bottom. */
.cew-rpl__content {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}

.cew-rpl__title {
	/* No font/color: pure layout. Theme heading styles apply. */
	margin: 0 0 16px;
}

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

.cew-rpl__excerpt {
	margin: 0 0 16px;
}

.cew-rpl__excerpt :last-child {
	margin-bottom: 0;
}

.cew-rpl__read-more {
	display: inline-block;
	text-decoration: none;
	transition: color 0.2s ease, opacity 0.2s ease;
}

.cew-rpl__read-more:hover {
	opacity: 0.85;
}

/* ---------- Empty state (editor only) ---------- */

.cew-rpl--empty {
	padding: 24px;
	text-align: center;
	border: 1px dashed currentColor;
	opacity: 0.6;
}

/* ---------- Responsive: stack on mobile ---------- */

@media (max-width: 767px) {
	.cew-rpl--stack-mobile .cew-rpl__row {
		flex-direction: column;
		align-items: stretch;
	}

	.cew-rpl--stack-mobile .cew-rpl__date,
	.cew-rpl--stack-mobile .cew-rpl__image-wrap,
	.cew-rpl--stack-mobile .cew-rpl__content {
		flex: 1 1 auto;
		width: 100%;
	}
}
