/**
 * Recipe Spotlight — double frame, mobile stack / desktop two-column.
 *
 * @package YaloFSE
 */

.wp-block-acf-recipe-spotlight.kb-recipe-spotlight {
	--kb-rs-navy: var(--kb-brand-blue, #001489);
	box-sizing: border-box;
	margin-top: 48px;
}

@media (min-width: 901px) {
	.wp-block-acf-recipe-spotlight.kb-recipe-spotlight {
		margin-top: 92px;
	}
}

/*
 * Desktop: folder frame matches `.kb-folder::after` + Why KB (4px blue, inset red).
 * Mobile: no borders — plain stack inside the section.
 */
.kb-recipe-spotlight__frame {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
	background: transparent;
	border: none;
	border-radius: 0;
	padding: clamp(1.25rem, 4vw, 2rem) 0;
}

.kb-recipe-spotlight__frame::after {
	display: none;
}

.kb-recipe-spotlight__inner {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin-left: auto;
	margin-right: auto;
	padding: 0;
	border: none;
	border-radius: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: clamp(1.25rem, 3vw, 1.75rem);
	min-width: 0;
}

@media (min-width: 901px) {
	.kb-recipe-spotlight__frame {
		border: 4px solid #001489;
		border-radius: 12px;
		padding: 56px 56px 96px;
	}

	.kb-recipe-spotlight__frame::after {
		display: block;
		content: "";
		position: absolute;
		top: 14px;
		left: 14px;
		right: 14px;
		bottom: 14px;
		height: auto;
		background: transparent;
		border: 1px solid #ee2e24;
		border-radius: 12px;
		z-index: 0;
		pointer-events: none;
	}

	.kb-recipe-spotlight__inner {
		width: 100%;
		max-width: 100%;
		margin-left: 0;
		margin-right: 0;
	}
}

/* Mobile order: image → label → title → description; CTA after text block */
.kb-recipe-spotlight__figure {
	order: 1;
	width: 100%;
	max-width: 100%;
	margin: 0;
	overflow: hidden;
	background: var(--color-grey-100, #ededed);
	aspect-ratio: 16 / 9;
}

.kb-recipe-spotlight__text {
	order: 2;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: clamp(0.75rem, 2vw, 1rem);
	min-width: 0;
}

.kb-recipe-spotlight__cta {
	order: 3;
}

.kb-recipe-spotlight__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.kb-recipe-spotlight__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 160px;
	background: var(--color-grey-200, #c8c8c8);
}

.kb-recipe-spotlight__label {
	margin: 0;
	font-family: var(--font-secondary);
	font-size: 1em;
	font-weight: 700;
	letter-spacing: 2px;;
	text-transform: uppercase;
	line-height: var(--line-height-snug, 1.2);
	color: var(--kb-rs-navy);
}

.kb-recipe-spotlight__title {
	margin: 0;
	font-family: var(--font-primary);
	font-size: clamp(1.5rem, 4.5vw, 2.25rem);
	font-weight: 700;
	line-height: var(--line-height-tight, 1.1);
	color: var(--kb-rs-navy);
	max-width: 20ch;
}

.kb-recipe-spotlight__desc {
	margin: 0;
	width: 100%;
	max-width: 36rem;
	font-family: var(--font-secondary);
	font-size: clamp(0.9375rem, 2vw, 1.0625rem);
	font-weight: 400;
	line-height: var(--line-height-relaxed, 1.5);
	color: var(--kb-rs-navy);
	text-align: center;
}

.kb-recipe-spotlight__desc > :first-child {
	margin-top: 0;
}

.kb-recipe-spotlight__desc > :last-child {
	margin-bottom: 0;
}

.kb-recipe-spotlight__desc p {
	margin: 0 0 0.75rem;
}

/*
 * Size matches `.kb-submit-recipe__button`; colors match Recipe Spotlight comps:
 * default ghost (white / blue border / blue text), hover filled blue / white text.
 */
.kb-recipe-spotlight__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-width: 170px;
	padding: 0.55rem 1.6rem;
	background: #fff;
	color: var(--kb-brand-blue, #001489) !important;
	text-decoration: none;
	text-transform: uppercase;
	font-family: var(--font-secondary);
	font-size: 1em;
	font-weight: 600;
	letter-spacing: 0.1em;
	line-height: 1.25;
	border: 1px solid var(--kb-brand-blue, #001489);
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.kb-recipe-spotlight__cta:hover,
.kb-recipe-spotlight__cta:focus-visible {
	background: var(--kb-brand-blue, #001489) !important;
	color: #fff !important;
	border-color: var(--kb-brand-blue, #001489) !important;
	outline: none;
}

@media (max-width: 640px) {
	.kb-recipe-spotlight__cta {
		display: flex;
		width: min(100%, 280px);
		max-width: 100%;
		margin-left: auto;
		margin-right: auto;
	}
}

@media (max-width: 420px) {
	.kb-recipe-spotlight__cta {
		width: 100%;
	}
}

.kb-recipe-spotlight--empty .kb-recipe-spotlight__preview-msg {
	margin: 0;
	padding: var(--spacing-md, 16px);
	font-family: var(--font-secondary);
	font-size: var(--font-size-sm, 14px);
	color: var(--color-grey-400, #5a5a5a);
	border: 1px dashed var(--color-grey-200, #c8c8c8);
}

/* Desktop: text left (~58%), image + CTA right; CTA under image, start-aligned */
@media (min-width: 992px) {
	.kb-recipe-spotlight__inner {
		display: grid;
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
		grid-template-rows: auto auto;
		grid-template-areas:
			"text figure"
			"text cta";
		column-gap: clamp(1.5rem, 3vw, 2.5rem);
		row-gap: clamp(1rem, 2vw, 1.25rem);
		align-items: start;
		text-align: left;
	}

	.kb-recipe-spotlight__figure {
		order: unset;
		grid-area: figure;
		aspect-ratio: 16 / 9;
		align-self: start;
	}

	.kb-recipe-spotlight__text {
		order: unset;
		grid-area: text;
		align-items: flex-start;
		text-align: left;
		align-self: center;
	}

	.kb-recipe-spotlight__title {
		max-width: none;
		font-size: clamp(1.75rem, 2.5vw, 2.5rem);
	}

	.kb-recipe-spotlight__desc {
		text-align: left;
		max-width: none;
	}

	.kb-recipe-spotlight__cta {
		order: unset;
		grid-area: cta;
		justify-self: start;
		align-self: start;
	}
}
