/**
 * Layali blog section (Elementor widget).
 *
 * Scoped under `.ly-blog-section` so it doesn't fight site-wide rules. The
 * widget's controls drive colors / radius / aspect / columns via Elementor
 * selectors — this file owns layout + the gradient overlay.
 */

.ly-blog-section {
	width: 100%;
	margin: 0 auto;
	max-width: 1280px;
	box-sizing: border-box;
}

/* ---------- Header ---------- */

.ly-blog-section__header {
	text-align: center;
	margin-bottom: 32px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
}

.ly-blog-section__eyebrow {
	font-size: 0.95rem;
	font-weight: 700;
	letter-spacing: 0;
}

.ly-blog-section__heading {
	margin: 0;
	font-family: var( --ly-text-heading, 'Bricolage Grotesque', sans-serif );
	font-size: clamp( 1.6rem, 3vw, 2.4rem );
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.01em;
}

.ly-blog-section__view-all {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-top: 4px;
	font-size: 1rem;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 4px;
	transition: opacity 150ms ease;
}

.ly-blog-section__view-all:hover,
.ly-blog-section__view-all:focus-visible {
	opacity: 0.75;
	outline: none;
}

.ly-blog-section__view-all svg {
	display: block;
}

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

.ly-blog-section__grid {
	display: grid;
	grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
	gap: 24px;
}

@media ( max-width: 1024px ) {
	.ly-blog-section__grid {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media ( max-width: 600px ) {
	.ly-blog-section__grid {
		grid-template-columns: 1fr;
	}
}

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

.ly-blog-card {
	display: flex;
	flex-direction: column;
	color: inherit;
	text-decoration: none;
	transition: transform 200ms ease;
}

.ly-blog-card:hover,
.ly-blog-card:focus-visible {
	outline: none;
}

.ly-blog-card:focus-visible .ly-blog-card__media {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.ly-blog-card__media {
	position: relative;
	display: block;
	border-radius: 24px;
	overflow: hidden;
	aspect-ratio: 4 / 3;
	background: var( --ly-color-surface-subtle, #f4f0eb );
	margin-bottom: 16px;
}

/* The combined class+element selector ties Elementor's `.elementor img`
   on specificity (0,1,1); the !importants then defeat their `height: auto`
   that would otherwise leave the container background showing for any
   image that isn't already 4:3. */
.ly-blog-card .ly-blog-card__image,
.ly-blog-card__media img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover !important;
	transition: transform 350ms ease;
}

.ly-blog-card:hover .ly-blog-card__image,
.ly-blog-card:focus-visible .ly-blog-card__image {
	transform: scale( 1.04 );
}

/* Gradient overlay anchored to the bottom of the image — lets the title
   stay readable against any photo. Pure CSS, no extra DOM. */
.ly-blog-card__media::after {
	content: '';
	position: absolute;
	inset: 35% 0 0 0;
	background: linear-gradient( to bottom, rgba( 0, 0, 0, 0 ) 0%, rgba( 0, 0, 0, 0.55 ) 100% );
	pointer-events: none;
}

.ly-blog-card__title {
	position: absolute;
	left: 18px;
	right: 18px;
	bottom: 16px;
	z-index: 1;
	color: #ffffff;
	font-weight: 700;
	font-size: clamp( 0.95rem, 1.4vw, 1.1rem );
	line-height: 1.3;
	text-shadow: 0 1px 4px rgba( 0, 0, 0, 0.35 );
}

.ly-blog-card__excerpt {
	margin: 0 0 12px;
	font-size: 0.92rem;
	line-height: 1.55;
	color: var( --ly-color-text, #1f1f23 );

	/* 3-line clamp — keeps cards even-height visually. */
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ly-blog-card__more {
	display: inline-block;
	font-size: 0.92rem;
	font-weight: 600;
	color: var( --ly-color-text, #1f1f23 );
	text-decoration: underline;
	text-underline-offset: 3px;
	transition: color 150ms ease;
}

.ly-blog-card:hover .ly-blog-card__more {
	color: var( --ly-color-primary, #53225e );
}

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

.ly-blog-section--empty {
	padding: 48px;
	text-align: center;
	border: 2px dashed var( --ly-color-border, #ece6e0 );
	border-radius: 16px;
	color: var( --ly-color-text-muted, #4a4a52 );
}
