/*
 * Featured Post — shared editor + frontend styles.
 * Plain CSS — no Sass / Vite style entry.
 * Visual: Figma HOME Desktop — Featured Post (node 4228:85)
 *         within Popular This Week (node 4136:293).
 * Mobile: Figma HOME Mobile — Popular This Week (node 152:317).
 */

.lwt-featured-post {
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	padding: var(--wp--preset--spacing--131) var(--wp--preset--spacing--20);
	background-color: var(--wp--preset--color--butter);
	color: var(--wp--preset--color--black);
}

.lwt-featured-post *,
.lwt-featured-post *::before,
.lwt-featured-post *::after {
	box-sizing: border-box;
}

.lwt-featured-post__heading {
	max-width: var(--wp--style--global--wide-size, 1340px);
	margin: 0 auto 5.625rem; /* 90px — Figma heading → media gap */
}

.lwt-featured-post__heading .wp-block-heading {
	margin-top: 0;
	margin-bottom: 0;
	font-weight: 200;
	line-height: 1.53;
	font-synthesis: none;
}

.lwt-featured-post__article {
	display: grid;
	grid-template-columns: minmax(0, 27.125rem) minmax(0, 1fr); /* 434px image */
	gap: var(--wp--preset--spacing--47) 5.625rem; /* 90px image → copy */
	align-items: start;
	max-width: var(--wp--style--global--wide-size, 1340px);
	margin-inline: auto;
}

.lwt-featured-post__media {
	display: block;
	width: 100%;
	aspect-ratio: 434 / 650;
	overflow: hidden;
	text-decoration: none;
}

.lwt-featured-post__image,
.lwt-featured-post__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform-origin: center center;
}

@media (prefers-reduced-motion: no-preference) {
	.lwt-featured-post__image,
	.lwt-featured-post__media img {
		transition: transform 0.8s ease-out;
	}

	.lwt-featured-post__media:hover img,
	.lwt-featured-post__media:focus-visible img {
		transform: scale(1.02);
	}
}

.lwt-featured-post__media-fallback {
	display: block;
	width: 100%;
	height: 100%;
	background-color: var(--wp--preset--color--wheat);
}

.lwt-featured-post__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
	min-width: 0;
	/* Figma: category sits 83px below media top within the 650px row */
	padding-top: 5.1875rem;
}

.lwt-featured-post__category {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.5625rem; /* 9px — Destination Category frame (32 − 23) */
	width: fit-content;
	max-width: 100%;
	margin: 0;
	color: var(--wp--preset--color--black);
	font-family: var(--wp--preset--font-family--manrope);
	font-size: var(--wp--preset--font-size--heading-4);
	font-style: normal;
	font-weight: 500;
	letter-spacing: 0.13em;
	line-height: normal;
	text-transform: uppercase;
}

.lwt-featured-post__category a {
	color: inherit;
	text-decoration: none;
	transition: color var(--wp--custom--category-link--hover-duration) ease;
}

.lwt-featured-post__category-underline {
	display: block;
	/* Trim the trailing letter-spacing after the last glyph. */
	width: calc(100% - 0.13em);
	height: 2px;
	margin: 0;
	border: 0;
	object-fit: fill;
}

/* Editor preview uses a span stand-in (no theme URI for the SVG). */
span.lwt-featured-post__category-underline {
	background-color: #7fa6af;
}

.lwt-featured-post__title {
	margin: 3.3125rem 0 0; /* 53px — underline → title */
	max-width: 24.375rem; /* 390px */
	color: var(--wp--preset--color--black);
	font-family: var(--wp--preset--font-family--ashcroft);
	font-size: var(--wp--preset--font-size--heading-2);
	font-style: normal;
	font-weight: 200;
	line-height: 1.4; /* 63 / 45 */
	font-synthesis: none;
}

.lwt-featured-post__title a {
	color: inherit;
	text-decoration: none;
}

.lwt-featured-post__category a:hover,
.lwt-featured-post__category a:focus-visible {
	color: var(--wp--custom--category-link--hover-color);
}

.lwt-featured-post__title a:hover,
.lwt-featured-post__title a:focus-visible {
	color: var(--wp--preset--color--sea);
}

.lwt-featured-post__excerpt {
	margin: 3rem 0 0; /* 48px — title → excerpt */
	max-width: 23.6875rem; /* 379px */
	color: var(--wp--preset--color--black);
	font-family: var(--wp--preset--font-family--inter);
	font-size: var(--wp--preset--font-size--body);
	font-weight: 300;
	line-height: 2.142857; /* 45 / 21 */
}

.lwt-featured-post__empty {
	max-width: var(--wp--style--global--wide-size, 1340px);
	margin: 0 auto;
	font-family: var(--wp--preset--font-family--inter);
	font-size: var(--wp--preset--font-size--body);
}

/*
 * Side-by-side with custom list: keep both visible on smaller desktops,
 * but fluidly shrink the image column / gap so featured copy doesn’t cramp.
 * (Custom list still hides at 1200px via .desktop-only.)
 */
@media (max-width: 1600px) and (min-width: 1201px) {
	.wp-block-group.is-layout-flex:has(> .wp-block-mtt-featured-post)
		> .wp-block-mtt-featured-post {
		flex: 1 1 0;
		min-width: 0;
	}

	.wp-block-group.is-layout-flex:has(> .wp-block-mtt-featured-post)
		> .wp-block-mtt-custom-list {
		flex: 0 1 22rem;
		min-width: 16rem;
		max-width: 25.125rem;
	}

	.lwt-featured-post {
		padding-inline: clamp(1rem, 2vw, var(--wp--preset--spacing--20));
	}

	.lwt-featured-post__article {
		grid-template-columns: minmax(0, min(27.125rem, 42%)) minmax(0, 1fr);
		column-gap: clamp(1.5rem, 3.5vw, 5.625rem);
	}

	.lwt-featured-post__body {
		padding-top: clamp(1.25rem, 3.5vw, 5.1875rem);
	}

	.lwt-featured-post__title {
		max-width: none;
		font-size: clamp(1.75rem, 2.2vw, var(--wp--preset--font-size--heading-2));
		line-height: 1.35;
	}

	.lwt-featured-post__excerpt {
		max-width: none;
		font-size: clamp(1rem, 1.35vw, var(--wp--preset--font-size--body));
		line-height: 1.7;
	}
}

/* Soften the two-column article before the full mobile stack. */
@media (max-width: 1024px) {
	.lwt-featured-post {
		padding: var(--wp--preset--spacing--80) clamp(1.25rem, 4vw, 2.5rem);
	}

	.lwt-featured-post__heading {
		margin-bottom: 3.5rem;
	}

	.lwt-featured-post__article {
		grid-template-columns: minmax(0, 1fr);
		gap: 2.5rem;
		justify-items: center;
		text-align: center;
	}

	.lwt-featured-post__media {
		max-width: 22rem;
		width: 100%;
		aspect-ratio: 308 / 401;
	}

	.lwt-featured-post__body {
		align-items: center;
		width: 100%;
		max-width: 28rem;
		padding-top: 0;
	}

	.lwt-featured-post__title {
		margin-top: 2rem;
		text-align: center;
	}

	.lwt-featured-post__excerpt {
		margin-top: 2rem;
		text-align: center;
	}

	.lwt-featured-post__heading .wp-block-heading {
		text-align: center;
		line-height: 1.35;
	}
}

/* Mobile — Figma HOME Mobile 152:317 */
@media (max-width: 781px) {
	.lwt-featured-post {
		padding: 0 0 30px;
	}

	.lwt-featured-post__heading {
		margin-bottom: 20px;
	}

	.lwt-featured-post__heading .wp-block-heading {
		font-size: 1.875rem !important; /* 30px */
		line-height: 4.3125rem; /* 69px — Figma */
		text-align: center;
	}

	.lwt-featured-post__article {
		grid-template-columns: minmax(0, 1fr);
		gap: 2.875rem; /* image → category ~46px */
		justify-items: center;
	}

	.lwt-featured-post__media {
		max-width: 19.25rem; /* 308px */
		width: 100%;
		aspect-ratio: 308 / 401;
	}

	.lwt-featured-post__body {
		align-items: center;
		width: 100%;
		max-width: 22.4375rem; /* 359px excerpt measure */
		padding-top: 0;
	}

	.lwt-featured-post__category {
		font-size: 0.625rem; /* 10px */
		letter-spacing: 0.13em;
		gap: 0.5rem;
	}

	.lwt-featured-post__category-underline {
		height: 1px;
	}

	.lwt-featured-post__title {
		margin-top: 1.5rem; /* category → title ~37px */
		max-width: 16.25rem; /* 260px — Figma title measure */
		font-size: 1.875rem; /* 30px */
		line-height: 2.75rem; /* 44px */
		text-align: center;
	}

	.lwt-featured-post__excerpt {
		margin-top: 1rem;
		max-width: 22.4375rem; /* 359px */
		font-size: 1rem; /* 16px */
		font-weight: 300;
		line-height: 2.1875rem; /* 35px */
		text-align: center;
	}
}
