/* Recipe Category Hero — ACF block */

.ortega-recipe-category-hero.is-text-entrance-pending .ortega-recipe-category-hero__headline,
.ortega-recipe-category-hero.is-text-entrance-pending .ortega-recipe-category-hero__dot-arc,
.ortega-recipe-category-hero.is-text-entrance-pending .ortega-recipe-category-hero__dropdown {
	visibility: hidden;
}

.ortega-recipe-category-hero {
	--ortega-rch-blue: #0058a4;
	--ortega-rch-navy: #092450;
	--ortega-rch-yellow: #ffe400;
	--ortega-rch-yellow-hover: #ffd000;
	--ortega-rch-white: #fff;
	--ortega-rch-cloud: #e9f2f9;
	--ortega-rch-radius: 16px;
	--ortega-rch-content-padding: clamp(1rem, 4vw, 3rem);
	/* How far the framed photo bleeds over the white edge below. */
	--ortega-rch-image-bleed: clamp(56px, 7vw, 120px);
	--ortega-rch-tilt: -2deg;
	--ortega-rch-nav-overlap: 0px;
	isolation: isolate;
	margin-inline: calc(50% - 50vw);
	max-width: 100vw;
	overflow: visible;
	position: relative;
	width: 100vw;
}

.ortega-recipe-category-hero__pattern {
	background-color: var(--ortega-rch-blue);
	background-image: url("../images/recipes/bg-pattern-blue.svg");
	background-position: center top;
	background-repeat: no-repeat;
	background-size: cover;
	inset: 0;
	overflow: hidden;
	position: absolute;
	z-index: 0;
}

.ortega-recipe-category-hero__inner {
	align-items: center;
	box-sizing: border-box;
	display: grid;
	gap: clamp(1.5rem, 4vw, 2.5rem);
	grid-template-columns: 1fr;
	margin-inline: auto;
	max-width: min(1440px, 100%);
	min-height: clamp(520px, 52vw, 704px);
	overflow: visible;
	padding:
		clamp(5.5rem, 10vw, 7.5rem)
		var(--ortega-rch-content-padding)
		clamp(2.5rem, 5vw, 4rem);
	position: relative;
	width: 100%;
	/* Above the rough edge so the framed photo bleeds over it (recipe single pattern). */
	z-index: 3;
}

/* Desktop: side-by-side so the framed image can’t cover the headline. */
@media (min-width: 900px) {
	.ortega-recipe-category-hero--has-image .ortega-recipe-category-hero__inner {
		align-items: end;
		gap: clamp(1.5rem, 3vw, 3rem);
		grid-template-columns: minmax(0, 1fr) minmax(240px, 38%);
		/* Extra bottom pad so bleed doesn’t steal filter space as aggressively. */
		padding-bottom: clamp(3rem, 5vw, 4.5rem);
	}

	.ortega-recipe-category-hero--has-image .ortega-recipe-category-hero__content {
		max-width: none;
		padding-bottom: clamp(1rem, 2vw, 2rem);
	}
}

.ortega-recipe-category-hero__content {
	container-type: inline-size;
	container-name: ortega-rch-content;
	display: flex;
	flex-direction: column;
	gap: clamp(1.25rem, 3vw, 2rem);
	max-width: 100%;
	min-width: 0;
	overflow: visible;
	position: relative;
	z-index: 3;
}

/* Category dropdown */

.ortega-recipe-category-hero__dropdown {
	position: relative;
	width: fit-content;
	z-index: 4;
}

.ortega-recipe-category-hero__dropdown-heading {
	font-size: inherit;
	font-weight: inherit;
	letter-spacing: inherit;
	line-height: inherit;
	margin: 0;
}

.ortega-recipe-category-hero__dropdown-toggle {
	align-items: center;
	appearance: none;
	background: var(--ortega-rch-yellow);
	border: 0;
	border-radius: 100px;
	box-sizing: border-box;
	color: var(--ortega-rch-navy);
	cursor: pointer;
	display: inline-flex;
	font-family: var(--ortega-font-display);
	font-size: clamp(16px, 1.8vw, 22.81px);
	font-weight: 400;
	gap: 10px;
	letter-spacing: 0.05em;
	line-height: 0.87;
	min-height: 54px;
	padding: 16px 32px;
	text-transform: uppercase;
	-webkit-tap-highlight-color: transparent;
}

.ortega-recipe-category-hero__dropdown-toggle:hover,
.ortega-recipe-category-hero__dropdown-toggle:focus-visible {
	background: var(--ortega-rch-yellow-hover);
}

.ortega-recipe-category-hero__dropdown-toggle:focus-visible {
	outline: 2px solid var(--ortega-rch-white);
	outline-offset: 3px;
}

.ortega-recipe-category-hero__dropdown-label {
	display: block;
}

.ortega-recipe-category-hero__dropdown-chevron {
	display: block;
	flex-shrink: 0;
	height: 8px;
	transform: none;
	transform-origin: center;
	transition: transform 0.2s ease;
	width: 14px;
}

.ortega-recipe-category-hero__dropdown.is-open .ortega-recipe-category-hero__dropdown-chevron {
	transform: rotate(180deg);
}

/*
 * Open menu must clear both the hero edge/image AND the recipes-list
 * filter bar (a later sibling). Raise the whole hero stacking context.
 */
.ortega-recipe-category-hero:has(.ortega-recipe-category-hero__dropdown.is-open) {
	z-index: 20;
}

.ortega-recipe-category-hero:has(.ortega-recipe-category-hero__dropdown.is-open)
	.ortega-recipe-category-hero__inner {
	z-index: 5;
}

.ortega-recipe-category-hero__dropdown-list {
	background: var(--ortega-rch-yellow);
	border-radius: 24px;
	box-shadow: 0 12px 32px rgb(9 36 80 / 28%);
	left: 0;
	list-style: none;
	margin: 8px 0 0;
	max-height: min(60vh, 420px);
	min-width: 100%;
	overflow-y: auto;
	padding: 12px 0;
	position: absolute;
	top: 100%;
	width: max-content;
	z-index: 5;
}

.ortega-recipe-category-hero__dropdown-list[hidden] {
	display: none;
}

.ortega-recipe-category-hero__dropdown-option {
	color: var(--ortega-rch-navy);
	display: block;
	font-family: var(--ortega-font-display);
	font-size: clamp(15px, 1.5vw, 18px);
	font-weight: 400;
	letter-spacing: 0.05em;
	line-height: 1.1;
	padding: 12px 28px;
	text-decoration: none;
	text-transform: uppercase;
	white-space: nowrap;
}

.ortega-recipe-category-hero__dropdown-option:hover,
.ortega-recipe-category-hero__dropdown-option:focus-visible {
	background: rgb(9 36 80 / 8%);
}

.ortega-recipe-category-hero__dropdown-option:focus-visible {
	outline: 2px solid var(--ortega-rch-navy);
	outline-offset: -2px;
}

.ortega-recipe-category-hero__dropdown-option.is-active {
	font-weight: 700;
}

/* Headline + decoration arc */

.ortega-recipe-category-hero__headline-wrap {
	max-width: 100%;
	overflow: visible;
	position: relative;
	transform: rotate(var(--ortega-rch-tilt));
	transform-origin: left center;
	width: 100%;
}

.ortega-recipe-category-hero__headline {
	color: var(--ortega-rch-yellow);
	font-family: var(--ortega-font-display);
	font-size: clamp(52px, 8vw, 100px);
	font-weight: 700;
	letter-spacing: 0.016em;
	line-height: 0.92;
	margin: 0;
	max-width: 100%;
	overflow: visible;
	overflow-wrap: anywhere;
	text-transform: uppercase;
	word-break: normal;
}

.ortega-recipe-category-hero__headline :is(p, h1, h2, h3) {
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	letter-spacing: inherit;
	line-height: inherit;
	margin: 0;
	max-width: 100%;
	overflow: visible;
}

.ortega-recipe-category-hero__headline :is(p, h1, h2, h3) + :is(p, h1, h2, h3) {
	margin-top: 0;
}

.ortega-recipe-category-hero__headline :is(span, .ortega-recipe-category-hero__headline-lead) {
	color: var(--ortega-rch-white);
	display: block;
	/* Fallback before JS fit; --ortega-rch-lead-size is set to a fitted px value. */
	font-size: var(--ortega-rch-lead-size, clamp(28px, 7.5cqw, 60px));
	letter-spacing: 0.027em;
	line-height: 0.87;
	margin-bottom: 0.08em;
	max-width: 100%;
	overflow: visible;
	position: relative;
	white-space: nowrap;
	width: max-content;
}

.ortega-recipe-category-hero__headline :is(span, .ortega-recipe-category-hero__headline-lead).large {
	font-size: inherit;
}

.ortega-recipe-category-hero__dot-arc {
	height: auto;
	left: auto;
	pointer-events: none;
	position: absolute;
	right: -50px;
	top: -50px;
	transform: scaleX(-1) rotate(160deg);
	transform-origin: center center;
	width: clamp(56px, 8vw, 114px);
	z-index: 1;
}

/*
 * Category image — same framed treatment as recipe single:
 * white rough-edge panel, rounded photo, bleeds over the section edge.
 */

.ortega-recipe-category-hero__figure {
	justify-self: end;
	/* Hang over the white tear (same idea as recipe single hero bleed). */
	margin-bottom: calc(-1 * var(--ortega-rch-image-bleed));
	max-width: min(100%, 520px);
	pointer-events: none;
	position: relative;
	width: 100%;
	z-index: 4;
}

.ortega-recipe-category-hero__media {
	aspect-ratio: 782 / 697;
	box-sizing: border-box;
	padding: clamp(14px, 1.8vw, 28px);
	position: relative;
	width: 100%;
}

/* Rough white torn-rectangle backing that peeks out around the photo. */
.ortega-recipe-category-hero__media::before {
	background-color: var(--ortega-rch-white);
	content: "";
	inset: 0;
	-webkit-mask-image: url("../images/recipe/hero-image-mask.svg");
	mask-image: url("../images/recipe/hero-image-mask.svg");
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
	position: absolute;
	z-index: 0;
}

.ortega-recipe-category-hero__image-mask {
	background-color: var(--ortega-rch-cloud);
	border-radius: var(--ortega-rch-radius);
	height: 100%;
	overflow: hidden;
	position: relative;
	width: 100%;
	z-index: 1;
}

.ortega-recipe-category-hero__image {
	display: block;
	height: 100%;
	object-fit: cover;
	object-position: center center;
	position: relative;
	width: 100%;
	z-index: 1;
}

.ortega-recipe-category-hero__edge {
	bottom: -1px;
	display: block;
	height: auto;
	left: 50%;
	pointer-events: none;
	position: absolute;
	transform: translateX(-50%);
	width: 110vw;
	/* Below __inner so the bleeding photo sits on top of the tear. */
	z-index: 2;
}

.ortega-recipe-category-hero-placeholder {
	background: #f7f7f8;
	border: 1px dashed #0058a4;
	color: #0058a4;
	padding: 24px;
	text-align: center;
}

@media (max-width: 899px) {
	.ortega-recipe-category-hero__inner {
		align-items: start;
		min-height: 0;
		padding-bottom: clamp(1.5rem, 4vw, 2.5rem);
	}

	.ortega-recipe-category-hero__content {
		gap: 0;
		max-width: 100%;
	}

	.ortega-recipe-category-hero__headline-wrap {
		margin-top: 40px;
	}

	/* Stack under copy; keep bleed over the white edge. */
	.ortega-recipe-category-hero__figure {
		justify-self: center;
		margin-bottom: calc(-1 * var(--ortega-rch-image-bleed));
		margin-top: clamp(0.75rem, 2.5vw, 1.5rem);
		max-width: min(86vw, 420px);
		width: min(86vw, 420px);
	}

	.ortega-recipe-category-hero__media {
		aspect-ratio: 332 / 296;
		padding: clamp(12px, 3vw, 20px);
	}

	.ortega-recipe-category-hero__dot-arc {
		right: -30px;
		top: -30px;
	}
}

/* Clearance under the bleeding photo for the recipes-list filter row. */
.ortega-recipe-category-hero--has-image + .ortega-recipes-list,
.wp-block-post-content > .ortega-recipe-category-hero--has-image + .ortega-recipes-list,
.wp-block-post-content > .wp-block-acf-recipe-category-hero:has(.ortega-recipe-category-hero--has-image) + .wp-block-acf-recipes-list .ortega-recipes-list {
	/* Match --ortega-rch-image-bleed + a little breathing room. */
	padding-top: calc(clamp(56px, 7vw, 120px) + clamp(1.5rem, 3.5vw, 2.75rem));
}

.ortega-recipe-category-hero--has-image + .ortega-recipes-list .ortega-recipes-list__inner,
.wp-block-post-content > .ortega-recipe-category-hero--has-image + .ortega-recipes-list .ortega-recipes-list__inner,
.wp-block-post-content > .wp-block-acf-recipe-category-hero:has(.ortega-recipe-category-hero--has-image) + .wp-block-acf-recipes-list .ortega-recipes-list__inner {
	padding-top: 0;
}

body.ortega-hero-nav-scroll .ortega-recipe-category-hero {
	--ortega-rch-nav-overlap: 112px;
}

@media (max-width: 781px) {
	body.ortega-hero-nav-scroll .ortega-recipe-category-hero {
		--ortega-rch-nav-overlap: 73px;
	}

	.ortega-recipe-category-hero__inner {
		padding-top: calc(var(--ortega-rch-nav-overlap) + clamp(2rem, 6vw, 3rem));
	}

	.ortega-recipe-category-hero__content {
		margin-top: clamp(1.25rem, 5vw, 2rem);
	}

	.ortega-recipe-category-hero__dropdown-toggle {
		min-height: 48px;
		padding: 14px 24px;
	}

	.ortega-recipe-category-hero__headline-wrap {
		width: 100%;
	}

	.ortega-recipe-category-hero__headline {
		font-size: clamp(40px, 12vw, 64px);
		line-height: 0.9;
	}

	.ortega-recipe-category-hero__headline :is(span, .ortega-recipe-category-hero__headline-lead) {
		font-size: var(--ortega-rch-lead-size, clamp(22px, 8cqw, 36px));
		max-width: 100%;
	}

	.ortega-recipe-category-hero__headline :is(span, .ortega-recipe-category-hero__headline-lead).large {
		font-size: inherit;
	}

	.ortega-recipe-category-hero__dot-arc {
		width: 64px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ortega-recipe-category-hero__dropdown-chevron {
		transition: none;
	}

	.ortega-recipe-category-hero.is-text-entrance-pending .ortega-recipe-category-hero__headline,
	.ortega-recipe-category-hero.is-text-entrance-pending .ortega-recipe-category-hero__dot-arc,
	.ortega-recipe-category-hero.is-text-entrance-pending .ortega-recipe-category-hero__dropdown {
		visibility: visible;
	}
}
