/**
 * Single recipe template.
 *
 * Colors and fonts come from Elementor Site Settings (global kit variables),
 * so changes there carry through. Hex values are fallbacks only.
 *
 * Every selector is scoped under .hc-recipe on purpose: Elementor's kit styles
 * (.elementor-kit-N h1, .elementor-kit-N a) and the Hello theme reset
 * (table, button) would otherwise override these rules.
 */

.hc-recipe {
	/* Brand tokens (Elementor globals) */
	--hc-red: var(--e-global-color-primary, #ED2226);
	--hc-text: var(--e-global-color-text, #202020);
	--hc-teal: var(--e-global-color-accent, #81EAE7);
	--hc-blue: var(--e-global-color-70e690e, #003049);
	--hc-font: var(--e-global-typography-text-font-family, "canada-type-gibson"), "Helvetica Neue", Arial, sans-serif;

	/* Layout */
	--hc-gutter: 24px;
	--hc-col: 810px;          /* recipe text column, measured from the Elementor page */
	--hc-container: 1200px;   /* Elementor container width */
	--hc-fyi-wide: 1200px;    /* call-out background breakout, maximum width */
	--hc-radius: 24px;
	--hc-ease: cubic-bezier(.2, .7, .2, 1);

	/* Type */
	--hc-title-size: var(--e-global-typography-secondary-font-size, 70px);
	--hc-title-lh: var(--e-global-typography-secondary-line-height, 80px);
	--hc-section-size: var(--e-global-typography-67ad9a5-font-size, 35px);   /* "Heading" global */
	--hc-section-lh: var(--e-global-typography-67ad9a5-line-height, 40px);
	--hc-small: 15px;         /* body text; 18px on desktop */
	--hc-nutrition: 16px;     /* nutrition table; 20px on desktop */
	--hc-ui: 16px;            /* buttons, servings row; 18px on desktop */

	color: var(--hc-text);
	font-family: var(--hc-font);
	font-weight: 300;
	padding-bottom: 120px;
	overflow-x: clip; /* the call-out's breakout background never causes sideways scrolling */
}

@media (min-width: 768px) {
	.hc-recipe { --hc-gutter: 40px; }
}

/* Desktop: 18px minimum text size, 20px nutrition table. */
@media (min-width: 1025px) {
	.hc-recipe {
		--hc-small: 18px;
		--hc-nutrition: 20px;
		--hc-ui: 18px;
	}
}

@media (min-width: 1920px) {
	.hc-recipe { --hc-container: 1640px; }
}

@media (max-width: 767px) {
	.hc-recipe {
		--hc-title-size: 30px;
		--hc-title-lh: 33px;
		padding-bottom: 80px;
	}
}

/* ---------- Hero ---------- */

.hc-recipe .hc-recipe__hero {
	margin: 0;
	height: clamp(200px, 31vw, 500px);
	overflow: hidden;
}

.hc-recipe .hc-recipe__hero-img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
}

/* ---------- Column ---------- */

.hc-recipe .hc-recipe__col {
	box-sizing: content-box;
	max-width: var(--hc-col);
	margin-inline: auto;
	padding-inline: var(--hc-gutter);
}

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

.hc-recipe .hc-recipe__header {
	padding-top: clamp(40px, 6vw, 100px);
}

.hc-recipe .hc-recipe__cuisine {
	margin: 0 0 12px;
	color: var(--hc-red);
	font-size: var(--hc-small);
	font-weight: 500;
	line-height: 1.4;
}

.hc-recipe .hc-recipe__title {
	margin: 0 0 clamp(32px, 4.5vw, 72px);
	color: var(--hc-text);
	font-family: var(--hc-font);
	font-size: var(--hc-title-size);
	font-weight: 700;
	line-height: var(--hc-title-lh);
}

.hc-recipe .hc-recipe__intro {
	font-size: var(--hc-small);
	line-height: 1.5;
}

.hc-recipe .hc-recipe__intro p { margin: 0 0 12px; }
.hc-recipe .hc-recipe__intro p:last-child { margin-bottom: 0; }

.hc-recipe .hc-recipe__meta {
	display: grid;
	grid-template-columns: 124px 1fr;
	align-items: baseline;
	margin: 20px 0 0;
	padding: 36px 0;
	border-top: 1px solid var(--hc-text);
	border-bottom: 2px solid var(--hc-text);
	font-size: var(--hc-ui);
	line-height: 1.3;
}

.hc-recipe .hc-recipe__meta dt {
	color: var(--hc-red);
	font-weight: 500;
}

.hc-recipe .hc-recipe__meta dd {
	margin: 0;
	font-weight: 500;
}

@media (max-width: 767px) {
	.hc-recipe .hc-recipe__meta {
		grid-template-columns: 90px 1fr;
		padding: 24px 0;
		font-size: 15px;
	}
}

/* ---------- Body: ingredients, callout, directions ---------- */

.hc-recipe .hc-recipe__body {
	display: flex;
	flex-direction: column;
	align-items: stretch;
}

.hc-recipe .hc-recipe__section-title {
	margin: 0 0 40px;
	color: var(--hc-text);
	font-family: var(--hc-font);
	font-size: var(--hc-section-size);
	font-weight: 600;
	line-height: var(--hc-section-lh);
}

.hc-recipe .hc-recipe__panel {
	padding-top: 56px;
}

.hc-recipe .hc-recipe__richtext {
	font-size: var(--hc-small);
	line-height: 1.5;
}

/* h3 sizes come from Site Settings (h3); only spacing is set here. */
.hc-recipe .hc-recipe__richtext h3 {
	margin: 32px 0 20px;
}

.hc-recipe .hc-recipe__richtext > :first-child { margin-top: 0; }

.hc-recipe .hc-recipe__richtext p { margin: 0 0 16px; }

.hc-recipe .hc-recipe__directions ol { padding-left: 1.25em; }

.hc-recipe .hc-recipe__directions li { margin-bottom: 8px; }

/* Tabs: mobile only */
.hc-recipe .hc-recipe__tabs { display: none; }

@media (max-width: 767px) {
	.hc-recipe .hc-recipe__tabs {
		display: flex;
		justify-content: center;
		gap: 24px;
		order: 0;
		padding-top: 32px;
	}

	/* Resets the Hello theme button styles (pink border/background). */
	.hc-recipe .hc-recipe__tabs [role="tab"],
	.hc-recipe .hc-recipe__tabs [role="tab"]:hover,
	.hc-recipe .hc-recipe__tabs [role="tab"]:focus {
		padding: 8px 4px;
		border: 0;
		border-bottom: 2px solid transparent;
		border-radius: 0;
		background: none;
		color: var(--hc-text);
		opacity: .55;
		font-family: var(--hc-font);
		font-size: 14px;
		font-weight: 500;
		cursor: pointer;
	}

	.hc-recipe .hc-recipe__tabs [aria-selected="true"],
	.hc-recipe .hc-recipe__tabs [aria-selected="true"]:hover,
	.hc-recipe .hc-recipe__tabs [aria-selected="true"]:focus {
		border-bottom-color: var(--hc-red);
		opacity: 1;
	}

	.hc-recipe .hc-recipe__panel { padding-top: 24px; }
	.hc-recipe .hc-recipe__panel--ingredients { order: 1; }
	.hc-recipe .hc-recipe__panel--directions { order: 2; }
	.hc-recipe .hc-recipe__panel:not(.is-active) { display: none; }

	/* Callout sits after the tabs, visible on both. */
	.hc-recipe .hc-recipe__body .hc-fyi { order: 3; }
}

/* ---------- Did you know callout ---------- */

/*
 * Motion rules: only transform and opacity animate, never width, height or
 * padding, so the call-out never shifts the page around it.
 *
 * .hc-fyi        scroll-timeline subject; never transformed itself.
 * .hc-fyi__card  holds the text (stays in the column) and lifts ~8px.
 *   ::before     the teal background; scales out sideways behind the card.
 *   ::after      a soft shadow layer that fades in with the lift.
 *
 * --hc-fyi-scale is the breakout: target width / column width. recipe.js
 * measures it; the CSS defaults cover wide desktops without JS.
 */

.hc-recipe .hc-fyi {
	--hc-fyi-pad: clamp(28px, 5vw, 56px);
	--hc-fyi-scale: 1;
	--hc-fyi-exit: calc(1 + (var(--hc-fyi-scale) - 1) * .85); /* exit: back to ~85% of the breakout */
	--hc-fyi-radius: var(--hc-radius);

	margin-top: 64px;
	color: var(--hc-blue);
	view-timeline: --hc-fyi block;
}

/* Wide desktop: 810px column to 1200px. */
@media (min-width: 1280px) {
	.hc-recipe .hc-fyi { --hc-fyi-scale: calc(1200 / 810); }
}

.hc-recipe .hc-fyi__card {
	position: relative;
	isolation: isolate;
	display: grid;
	gap: 20px;
	padding: var(--hc-fyi-pad);
}

.hc-recipe .hc-fyi__card::before,
.hc-recipe .hc-fyi__card::after {
	content: "";
	position: absolute;
	inset: 0;
	/* Corners are drawn for the scaled-out state, so they look round there. */
	border-radius: calc(var(--hc-fyi-radius) / var(--hc-fyi-scale)) / var(--hc-fyi-radius);
	pointer-events: none;
}

.hc-recipe .hc-fyi__card::before {
	z-index: -1;
	background: var(--hc-teal);
}

.hc-recipe .hc-fyi__card::after {
	z-index: -2;
	box-shadow: 0 18px 40px -12px rgba(0, 48, 73, .28);
	opacity: 0;
}

@media (min-width: 768px) {
	.hc-recipe .hc-fyi__card {
		grid-template-columns: auto minmax(0, 1fr);
		column-gap: 32px;
		align-items: start;
	}
}

/* Mobile and tablet: the background runs edge to edge, so square corners
   (only once recipe.js has measured a breakout; without JS it stays a card). */
@media (max-width: 1024px) {
	.hc-recipe .hc-fyi.is-measured { --hc-fyi-radius: 0px; }
}

.hc-recipe .hc-fyi__media { line-height: 0; }

.hc-recipe .hc-fyi__icon {
	display: block;
	width: 56px;
	height: 56px;
	color: var(--hc-blue);
}

.hc-recipe .hc-fyi__illustration {
	display: block;
	width: clamp(72px, 9vw, 112px);
	height: auto;
}

@media (min-width: 768px) {
	.hc-recipe .hc-fyi__icon { width: 72px; height: 72px; }
}

.hc-recipe .hc-fyi__heading {
	margin: 0;
	color: var(--hc-blue);
	font-family: var(--hc-font);
	font-weight: 700;
}

.hc-recipe .hc-fyi__eyebrow {
	display: block;
	margin-bottom: 12px;
	font-size: max(14px, calc(var(--hc-ui) - 2px));
	font-weight: 600;
	letter-spacing: .08em;
	line-height: 1.3;
	text-transform: uppercase;
}

.hc-recipe .hc-fyi__headline {
	display: block;
	font-size: clamp(26px, 1.1rem + 1.6vw, 40px);
	line-height: 1.15;
	text-wrap: balance;
}

/* Detail, source and link: a comfortable measure, under ~60 characters. */
.hc-recipe .hc-fyi__more {
	max-width: 58ch;
	padding-top: 20px;
}

.hc-recipe .hc-fyi__more[hidden] { display: none; }

.hc-recipe .hc-fyi__detail {
	font-size: var(--e-global-typography-99a5d3f-font-size, 22px);
	font-weight: 500;
	line-height: 1.45;
}

.hc-recipe .hc-fyi__detail p { margin: 0 0 1em; }

.hc-recipe .hc-fyi__detail ul,
.hc-recipe .hc-fyi__detail ol {
	margin: 0 0 1em;
	padding: 0 0 0 1.2em;
}

.hc-recipe .hc-fyi__detail li { margin-bottom: .4em; }

.hc-recipe .hc-fyi__detail strong { font-weight: 700; }

.hc-recipe .hc-fyi__detail > :last-child { margin-bottom: 0; }

.hc-recipe .hc-fyi__source {
	margin: 16px 0 0;
	font-size: var(--hc-small);
	font-style: italic;
	line-height: 1.4;
}

.hc-recipe .hc-fyi__link {
	display: inline-block;
	margin-top: 20px;
	color: var(--hc-blue);
	font-size: max(18px, var(--hc-ui));
	font-weight: 500;
	line-height: 1.4;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.hc-recipe .hc-fyi__link:hover { text-decoration-thickness: 2px; }

/* Resets the Hello theme button styles. */
.hc-recipe .hc-fyi__toggle,
.hc-recipe .hc-fyi__toggle:focus {
	display: inline-block;
	margin-top: 24px;
	padding: 12px 24px;
	border: 0;
	border-radius: 999px;
	background: var(--hc-blue);
	color: #fff;
	font-family: var(--hc-font);
	font-size: var(--hc-ui);
	font-weight: 500;
	line-height: 1.2;
	cursor: pointer;
}

.hc-recipe .hc-fyi__toggle:hover {
	background: var(--hc-text);
	color: #fff;
}

.hc-recipe .hc-fyi a:focus-visible,
.hc-recipe .hc-fyi__toggle:focus-visible,
.hc-recipe .hc-recipe__tabs [role="tab"]:focus-visible {
	outline: 2px solid var(--hc-blue);
	outline-offset: 3px;
}

/* ----- Motion (none at all with reduced motion: a static card at column width) ----- */

@media (prefers-reduced-motion: no-preference) {

	/* Scroll-driven: progress follows the card through the viewport, so it
	   replays on re-entry in either direction. */
	@supports (animation-timeline: view()) {
		.hc-recipe .hc-fyi__card,
		.hc-recipe .hc-fyi__card::before,
		.hc-recipe .hc-fyi__card::after {
			animation-duration: auto;
			animation-fill-mode: both;
			animation-timing-function: var(--hc-ease);
			animation-timeline: --hc-fyi;
			animation-range: entry 0% exit 100%;
		}

		.hc-recipe .hc-fyi__card { animation-name: hc-fyi-lift; }
		.hc-recipe .hc-fyi__card::before { animation-name: hc-fyi-breakout; }
		.hc-recipe .hc-fyi__card::after { animation-name: hc-fyi-shadow; }
	}

	/* IntersectionObserver fallback (recipe.js adds .is-io and the state classes). */
	.hc-recipe .hc-fyi.is-io .hc-fyi__card,
	.hc-recipe .hc-fyi.is-io .hc-fyi__card::before,
	.hc-recipe .hc-fyi.is-io .hc-fyi__card::after {
		transition: transform .6s var(--hc-ease), opacity .6s var(--hc-ease);
	}

	.hc-recipe .hc-fyi.is-io.is-in-view .hc-fyi__card { transform: translateY(-8px); }
	.hc-recipe .hc-fyi.is-io.is-in-view .hc-fyi__card::before { transform: scaleX(var(--hc-fyi-scale)); }
	.hc-recipe .hc-fyi.is-io.is-in-view .hc-fyi__card::after { transform: scaleX(var(--hc-fyi-scale)); opacity: 1; }

	.hc-recipe .hc-fyi.is-io.has-left .hc-fyi__card::before,
	.hc-recipe .hc-fyi.is-io.has-left .hc-fyi__card::after { transform: scaleX(var(--hc-fyi-exit)); }
}

@keyframes hc-fyi-lift {
	entry 0%   { transform: translateY(0); }
	entry 100% { transform: translateY(-8px); }
	exit 0%    { transform: translateY(-8px); }
	exit 100%  { transform: translateY(0); }
}

@keyframes hc-fyi-breakout {
	entry 0%   { transform: scaleX(1); }
	entry 100% { transform: scaleX(var(--hc-fyi-scale)); }
	exit 0%    { transform: scaleX(var(--hc-fyi-scale)); }
	exit 100%  { transform: scaleX(var(--hc-fyi-exit)); }
}

@keyframes hc-fyi-shadow {
	entry 0%   { transform: scaleX(1); opacity: 0; }
	entry 100% { transform: scaleX(var(--hc-fyi-scale)); opacity: 1; }
	exit 0%    { transform: scaleX(var(--hc-fyi-scale)); opacity: 1; }
	exit 100%  { transform: scaleX(var(--hc-fyi-exit)); opacity: 0; }
}

/* Reduced motion: no breakout, so normal round corners at column width. */
@media (prefers-reduced-motion: reduce) {
	.hc-recipe .hc-fyi {
		--hc-fyi-scale: 1;
		--hc-fyi-radius: var(--hc-radius);
	}
}

/* ---------- Nutrition ---------- */

.hc-recipe .hc-recipe__nutrition { padding-top: 96px; }

/* Resets the Hello theme table styles (cell borders, striped rows). */
.hc-recipe .hc-nutrition {
	width: 100%;
	margin: 0;
	border: 0;
	border-top: 1px solid var(--hc-text);
	border-collapse: collapse;
	font-size: var(--hc-nutrition);
}

.hc-recipe .hc-nutrition tr,
.hc-recipe .hc-nutrition tr:hover > td,
.hc-recipe .hc-nutrition tr:hover > th,
.hc-recipe .hc-nutrition th,
.hc-recipe .hc-nutrition td {
	background: transparent;
}

.hc-recipe .hc-nutrition th,
.hc-recipe .hc-nutrition td {
	width: 50%;
	padding: 28px 0;
	border: 0;
	border-bottom: 1px solid var(--hc-text);
	color: var(--hc-text);
	font-size: var(--hc-nutrition);
	text-align: left;
	vertical-align: middle;
	font-weight: 500;
	line-height: 1.3;
}

.hc-recipe .hc-nutrition__row--calories th { color: var(--hc-red); }

.hc-recipe .hc-nutrition__row--calories th,
.hc-recipe .hc-nutrition__row--calories td {
	padding: 38px 0;
	border-bottom-width: 2px;
}

@media (max-width: 767px) {
	.hc-recipe .hc-recipe__nutrition { padding-top: 64px; }

	.hc-recipe .hc-nutrition th,
	.hc-recipe .hc-nutrition td { padding: 20px 0; font-size: 15px; }

	.hc-recipe .hc-nutrition__row--calories th,
	.hc-recipe .hc-nutrition__row--calories td { padding: 26px 0; }
}

/* ---------- Related recipes ---------- */

.hc-recipe .hc-related {
	box-sizing: content-box;
	max-width: var(--hc-container);
	margin: 120px auto 0;
	padding-inline: var(--hc-gutter);
}

.hc-recipe .hc-related__title {
	margin: 0 0 64px;
	color: var(--hc-red);
	font-family: var(--hc-font);
	font-size: var(--e-global-typography-secondary-font-size, 70px);
	font-weight: 700;
	line-height: 1.15;
}

.hc-recipe .hc-related__grid {
	display: grid;
	gap: 48px 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (min-width: 768px) {
	.hc-recipe .hc-related__grid { grid-template-columns: repeat(3, 1fr); }
}

.hc-recipe .hc-related__link,
.hc-recipe .hc-related__link:hover,
.hc-recipe .hc-related__link:focus {
	display: block;
	color: var(--hc-text);
	text-decoration: none;
}

.hc-recipe .hc-related__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 5 / 4;
	object-fit: cover;
	border-radius: 20px;
}

.hc-recipe .hc-related__cuisine {
	display: block;
	margin: 28px 0 12px;
	color: var(--hc-red);
	font-size: var(--e-global-typography-accent-font-size, 18px);
	font-weight: 500;
	line-height: 1.3;
}

/* No underline on hover, per the Elementor original. */
.hc-recipe .hc-related__name {
	display: block;
	color: var(--hc-text);
	font-size: 30px;
	font-weight: 600;
	line-height: 1.25;
	text-decoration: none;
}

.hc-recipe .hc-related__link:focus-visible {
	outline: 2px solid var(--hc-red);
	outline-offset: 4px;
	border-radius: 20px;
}

@media (max-width: 767px) {
	.hc-recipe .hc-related { margin-top: 80px; }
	.hc-recipe .hc-related__title { font-size: 28px; margin-bottom: 32px; }
	.hc-recipe .hc-related__cuisine { margin-top: 16px; font-size: 15px; }
	.hc-recipe .hc-related__name { font-size: 22px; }
}
/* ---------- P2a: summary, facts, updated date, lists, notes ---------- */

.hc-recipe .hc-recipe__summary {
	margin: calc(clamp(32px, 4.5vw, 72px) * -0.5) 0 24px;
	font-size: calc(var(--hc-small) + 2px);
	font-weight: 500;
	line-height: 1.45;
}

/* Each fact is a <div> wrapping dt/dd; let them sit in the dl's grid. */
.hc-recipe .hc-recipe__fact { display: contents; }

.hc-recipe .hc-recipe__meta dd + div dt,
.hc-recipe .hc-recipe__meta dd + div dd { padding-top: 12px; }

.hc-recipe .hc-recipe__updated {
	margin: 16px 0 0;
	font-size: 14px;
	line-height: 1.4;
	opacity: .75;
}

.hc-recipe .hc-recipe__richtext .hc-recipe__group-title:first-child { margin-top: 0; }

.hc-recipe .hc-ingredients {
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
}

.hc-recipe .hc-ingredients li { margin: 0 0 8px; }

.hc-recipe .hc-ingredients:last-child { margin-bottom: 0; }

.hc-recipe .hc-steps {
	margin: 0 0 24px;
	padding-left: 1.25em;
}

.hc-recipe .hc-steps li { margin-bottom: 8px; }

.hc-recipe .hc-recipe__note { margin: 0 0 16px; }

.hc-recipe .hc-nutrition caption {
	caption-side: top;
	padding: 0 0 16px;
	font-size: var(--hc-small);
	text-align: left;
}

/* Related card titles are now h3 (were spans); reset heading margins. */
.hc-recipe h3.hc-related__name { margin: 0; font-family: var(--hc-font); }

/* ---------- Breadcrumbs (Rank Math) ---------- */

.hc-recipe .rank-math-breadcrumb {
	padding-top: 24px;
	font-size: 14px;
	line-height: 1.4;
}

.hc-recipe .rank-math-breadcrumb p { margin: 0; }

.hc-recipe .rank-math-breadcrumb a {
	color: var(--hc-text);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.hc-recipe .rank-math-breadcrumb .separator { margin: 0 6px; opacity: .6; }

.hc-recipe .rank-math-breadcrumb .last { opacity: .75; }
