/**
 * Recipefy — single recipe premium zone v1.2.0
 * Hero is untouched. Styles here cover everything below:
 * intro, ingredients, steps timeline, nutrition, media.
 */

/* ─── Premium zone container ─── */
.arc-premium-zone {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin-top: 24px;
}

@media (min-width: 640px) {
	.arc-premium-zone {
		gap: 24px;
		margin-top: 32px;
	}
}

@media (min-width: 768px) {
	.arc-premium-zone {
		gap: 32px;
		margin-top: 40px;
	}
}

/* ─── Section cards ─── */
.arc-recipe-section {
	background: var(--rfy-surface);
	border-radius: var(--rfy-radius-md);
	padding: 16px;
	box-shadow: var(--rfy-shadow-sm);
	border: 1px solid var(--rfy-line);
}

@media (min-width: 640px) {
	.arc-recipe-section {
		padding: 24px;
		border-radius: var(--rfy-radius-lg);
	}
}

@media (min-width: 768px) {
	.arc-recipe-section {
		padding: 36px;
		box-shadow: var(--rfy-shadow-md);
	}
}

.arc-recipe-section--intro + .rfy-share--hero-strip,
.arc-recipe-section--intro + .rfy-share {
	margin-top: 0;
}

.arc-paywall-wrap > .rfy-share--hero-strip,
.arc-paywall-wrap > .rfy-share {
	margin-top: 0;
	margin-bottom: 8px;
}

/* Intro section — white bg */
.arc-recipe-section--intro {
	background: var(--rfy-surface);
}

/* Curriculum lesson — FAQ-answer / intro accent language (cream + terracotta stripe) */
.arc-recipe-section--lesson {
	background: var(--rfy-surface);
}

.rfy-recipe-lesson__stack {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin: 0;
	max-width: 68ch;
}

.rfy-recipe-lesson__card {
	margin: 0;
	padding: 16px 20px;
	background: var(--rfy-background);
	border-radius: var(--rfy-radius-sm);
	border-inline-start: 4px solid var(--rfy-primary);
}

.rfy-recipe-lesson__label {
	margin: 0 0 8px;
	font-size: var(--rfy-type-h3);
	font-weight: 700;
	line-height: 1.35;
	color: var(--rfy-foreground);
}

.rfy-recipe-lesson__text {
	margin: 0;
	font-size: var(--rfy-type-body);
	line-height: 1.7;
	color: var(--rfy-text);
}

.arc-recipe-section--lesson + .arc-recipe-section--intro {
	margin-top: 0;
}

/* Steps section — white, so card backgrounds inside are visible */
.arc-recipe-section--steps {
	background: var(--rfy-surface);
}

/* ─── Intro prose ─── */
.arc-recipe-prose {
	position: relative;
	padding-inline-start: 20px;
	border-inline-start: 4px solid var(--rfy-primary);
	max-width: 68ch;
	line-height: 1.7;
}

.arc-recipe-prose p {
	margin-bottom: 1em;
}

.arc-recipe-prose p:last-child {
	margin-bottom: 0;
}

/* Body prose — no intro accent stripe */
.arc-recipe-prose--body {
	padding-inline-start: 0;
	border-inline-start: 0;
	max-width: none;
}

/* ─── Ingredients (checklist list) ─── */
.arc-ingredients {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	grid-template-columns: 1fr;
	border: 1px solid var(--rfy-border);
	border-radius: var(--rfy-radius-md);
	background: var(--rfy-surface);
	overflow: hidden;
}

@media (min-width: 768px) {
	.arc-ingredients {
		grid-template-columns: 1fr 1fr;
	}
}

.arc-ingredient-row {
	margin: 0;
	border-bottom: 1px solid var(--rfy-line);
}

@media (min-width: 768px) {
	.arc-ingredient-row:nth-child(odd) {
		border-inline-end: 1px solid var(--rfy-line);
	}
}

.arc-ingredient-row:last-child {
	border-bottom: none;
}

.arc-ingredient-check {
	display: flex;
	align-items: flex-start;
	gap: var(--rfy-space-3);
	padding: 14px var(--rfy-space-4);
	cursor: pointer;
	min-height: 48px;
}

.arc-ingredient-check__input {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	margin-block-start: 2px;
	margin-inline: 0;
	accent-color: var(--rfy-secondary);
	cursor: pointer;
}

.arc-ingredient-check__input:focus-visible {
	outline: 2px solid var(--rfy-accent);
	outline-offset: 2px;
}

.arc-ingredient-check__body {
	flex: 1;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25em 0.65em;
	min-width: 0;
	line-height: 1.45;
	transition: opacity 0.2s ease, color 0.2s ease;
}

.arc-ingredient-name {
	font-size: var(--rfy-type-body);
	font-weight: 600;
	color: var(--rfy-text);
}

.arc-ingredient-qty {
	font-size: var(--rfy-type-body);
	font-weight: 700;
	color: var(--rfy-primary);
	white-space: nowrap;
}

.arc-ingredient-note {
	font-size: 0.9375rem;
	color: var(--rfy-muted);
	flex-basis: 100%;
}

.arc-ingredient-check:has(.arc-ingredient-check__input:checked) .arc-ingredient-check__body {
	text-decoration: line-through;
	opacity: 0.5;
	color: var(--rfy-muted);
}

/* Paywall preview — non-interactive rows */
.arc-paywall-preview .arc-ingredient-check__input {
	pointer-events: none;
	opacity: 0.35;
}

/* ─── Steps ─── */
.arc-steps {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

/* step layout: [num] [content] [image?] */
.arc-step {
	display: grid;
	grid-template-columns: 40px 1fr;
	gap: 16px 20px;
	align-items: start;
	padding: 20px;
	background: var(--rfy-surface);
	border: 1px solid var(--rfy-line);
	border-radius: var(--rfy-radius-md);
}

/* when a step has an image, add a third column */
.arc-step:has(.arc-step-image) {
	grid-template-columns: 40px 1fr 220px;
}

.arc-step-num {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--rfy-accent), #c4956a);
	color: var(--rfy-primary-dark);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: var(--rfy-type-min);
	flex-shrink: 0;
	box-shadow: 0 4px 12px rgba(212, 168, 83, 0.3);
}

.arc-step-content {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.arc-step-title {
	margin: 0;
	font-size: var(--rfy-type-h3);
	font-weight: 700;
	line-height: 1.3;
}

.arc-step-text {
	margin: 0;
	line-height: 1.7;
	color: var(--rfy-text);
}

.arc-step-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 15px;
	color: var(--rfy-muted);
}

.arc-step-time,
.arc-step-cue {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	background: var(--rfy-background);
	border: 1px solid var(--rfy-line);
	border-radius: var(--rfy-radius-pill);
	font-size: 14px;
}

/* Step image — side column, compact */
.arc-step-image {
	margin: 0;
	padding: 0;
	align-self: start;
}

.arc-step-image img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--rfy-radius-md);
	display: block;
}

/* Mobile: step num smaller, image below text */
@media (max-width: 640px) {
	.arc-step,
	.arc-step:has(.arc-step-image) {
		grid-template-columns: 28px 1fr;
		gap: 10px 12px;
		padding: 12px;
	}

	.arc-step-num {
		width: 28px;
		height: 28px;
		font-size: 13px;
	}

	.arc-step-image {
		grid-column: 1 / -1;
		max-width: 100%;
	}

	.arc-step-image img {
		aspect-ratio: 16 / 9;
	}
}

/* ─── Nutrition ─── */
.arc-nutrition-grid {
	width: 100%;
	border-collapse: separate;
	border-spacing: 16px;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.arc-nutrition-grid tbody {
	display: contents;
}

.arc-nutrition-item {
	display: block;
	padding: 20px 16px;
	background: var(--rfy-background);
	border-radius: var(--rfy-radius-md);
	text-align: center;
	border: 1px solid var(--rfy-line);
	transition: box-shadow var(--rfy-transition);
}

.arc-nutrition-item:hover {
	box-shadow: var(--rfy-shadow-sm);
}

.arc-nutrition-label {
	display: block;
	font-size: 13px;
	color: var(--rfy-muted);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin-bottom: 6px;
	border: 0;
	padding: 0;
}

.arc-nutrition-value {
	display: block;
	font-weight: 900;
	font-size: var(--rfy-type-h2);
	color: var(--rfy-text);
	line-height: 1.1;
	border: 0;
	padding: 0;
}

.arc-nutrition-per {
	margin: 0 0 16px;
	color: var(--rfy-muted);
	font-size: var(--rfy-type-min);
}

.arc-nutrition-disclaimer {
	margin-top: 16px;
	font-size: 13px;
	color: var(--rfy-muted);
}

/* ─── Section background rule: all wide cards are white ─── */
.arc-recipe-section {
	background: var(--rfy-surface);
}

/* ─── Media section ─── */
.arc-recipe-section--media {
	background: var(--rfy-surface);
}

/* Final dish featured image */
.arc-final-dish-banner-wrap {
	display: block;
	width: 100%;
	margin-bottom: 24px;
}

.arc-final-dish-banner-wrap .arc-final-dish-banner {
	margin-bottom: 0;
}

.arc-final-dish-banner {
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	border-radius: var(--rfy-radius-lg);
	display: block;
	margin-bottom: 24px;
	box-shadow: var(--rfy-shadow-lg);
}

@media (max-width: 640px) {
	.arc-final-dish-banner {
		aspect-ratio: 4 / 3;
		border-radius: var(--rfy-radius-md);
	}
}

/* ─── Storage / reheating — separate section cards ─── */
.arc-recipe-section--storage,
.arc-recipe-section--reheating {
	background: var(--rfy-surface);
}

/* ─── Recipe FAQ accordion (inside premium zone) ─── */
.arc-recipe-section--faq .rfy-accordion--recipe-faq {
	margin-top: 4px;
}

/* ─── Steps header + step guide modal ─── */
.arc-steps-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 16px;
	margin-bottom: 20px;
}

.arc-steps-header .arc-section-heading {
	margin-bottom: 0;
}

.rfy-step-guide[hidden] {
	display: none !important;
}

.rfy-step-guide {
	--rfy-step-guide-pad-inline: 20px;
	--rfy-step-guide-pad-block: 16px;
	--rfy-step-guide-image-max: min(22dvh, 160px);
	--rfy-step-guide-bubble-max: min(36dvh, 240px);
	position: fixed;
	inset: 0;
	z-index: 10050;
	display: flex;
	align-items: center;
	justify-content: center;
	/* Lifted — never flush top/bottom on mobile. */
	padding: clamp(24px, 6dvh, 48px) 12px clamp(80px, 12dvh, 110px);
}

.rfy-step-guide__overlay {
	position: absolute;
	inset: 0;
	background: rgba(30, 12, 5, 0.55);
}

/*
 * Hug content height — no blank stretch.
 * Cap with max-height so long prep lists still fit + scroll.
 */
.rfy-step-guide__panel {
	--rfy-step-guide-font-scale: 1;
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	height: auto;
	max-height: min(78dvh, 640px);
	display: flex;
	flex-direction: column;
	background: var(--rfy-background);
	border-radius: var(--rfy-radius-lg);
	box-shadow: var(--rfy-shadow-lg);
	overflow: hidden;
}

.rfy-step-guide__panel,
.rfy-step-guide__panel * {
	box-sizing: border-box;
}

.rfy-step-guide__header {
	flex-shrink: 0;
	padding: max(12px, env(safe-area-inset-top, 0px)) var(--rfy-step-guide-pad-inline) 10px;
	border-bottom: 1px solid var(--rfy-line);
}

.rfy-step-guide__toolbar {
	display: flex;
	align-items: center;
	gap: 8px;
}

.rfy-step-guide__progress {
	flex: 1;
	min-width: 0;
	margin: 0;
	font-size: 1rem;
	font-weight: 700;
	color: var(--rfy-foreground);
}

.rfy-step-guide__font {
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.rfy-step-guide__font-down,
.rfy-step-guide__font-up,
.rfy-step-guide__close {
	min-width: 44px;
	min-height: 44px;
	padding: 0;
	border: 1px solid var(--rfy-line);
	border-radius: var(--rfy-radius-sm);
	background: var(--rfy-surface);
	color: var(--rfy-foreground);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
}

.rfy-step-guide__font-down:disabled,
.rfy-step-guide__font-up:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.rfy-step-guide__close {
	font-size: 1.5rem;
}

.rfy-step-guide__body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	min-height: 0;
}

.rfy-step-guide__scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	padding: var(--rfy-step-guide-pad-block) var(--rfy-step-guide-pad-inline);
}

/* Prevent flash of full step text before GSAP prep runs */
.rfy-step-guide__body[data-rfy-step-prep] .rfy-step-guide__bubble,
.rfy-step-guide__body[data-rfy-step-prep] .rfy-step-guide__image,
.rfy-step-guide__body[data-rfy-step-prep] .rfy-step-guide__num,
.rfy-step-guide__body[data-rfy-step-prep] .rfy-step-guide__title,
.rfy-step-guide__body[data-rfy-step-prep] .rfy-step-guide__meta,
.rfy-step-guide__body[data-rfy-step-prep] .rfy-step-guide__segment,
.rfy-step-guide__body[data-rfy-step-prep] .rfy-step-guide__prep-title {
	opacity: 0;
}

.rfy-step-guide__body[data-rfy-step-prep] .rfy-step-guide__word-inner {
	opacity: 0;
}

.rfy-step-guide__screen--cook {
	flex: 0 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
}

/* Shared column: bubble + image same width, same horizontal inset. */
.rfy-step-guide__cook-main {
	flex: 0 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
	padding: var(--rfy-step-guide-pad-block) var(--rfy-step-guide-pad-inline);
	gap: 12px;
}

/* White reading card — compact; overflow scrolls inside. */
.rfy-step-guide__bubble {
	display: flex;
	flex-direction: column;
	flex: 0 1 auto;
	max-height: var(--rfy-step-guide-bubble-max);
	width: 100%;
	padding: 14px 16px;
	background: var(--rfy-surface);
	border: 1px solid var(--rfy-line);
	border-radius: var(--rfy-radius-md);
	box-shadow: var(--rfy-shadow-sm);
	text-align: start;
	overflow: hidden;
}

.rfy-step-guide__bubble-scroll {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.rfy-step-guide__num {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin-bottom: 10px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--rfy-accent), #c4956a);
	color: var(--rfy-primary-dark);
	font-weight: 800;
	font-size: var(--rfy-type-min);
	box-shadow: 0 4px 12px rgba(212, 168, 83, 0.3);
}

.rfy-step-guide__title {
	margin: 0 0 10px;
	font-size: calc(clamp(1rem, 2.6vw, 1.125rem) * var(--rfy-step-guide-font-scale));
	font-weight: 700;
	color: var(--rfy-foreground);
	line-height: 1.35;
	transition: font-size 0.2s ease;
}

.rfy-step-guide__segments {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.rfy-step-guide__text {
	margin: 0;
	font-size: calc(clamp(1rem, 2.6vw, 1.125rem) * var(--rfy-step-guide-font-scale));
	line-height: 1.55;
	color: var(--rfy-foreground);
	transition: font-size 0.2s ease;
}

.rfy-step-guide__word {
	display: inline-block;
}

.rfy-step-guide__word-inner {
	display: inline-block;
}

.rfy-step-guide__meta {
	margin: 12px 0 0;
	font-size: calc(clamp(0.9375rem, 2.2vw, 1rem) * var(--rfy-step-guide-font-scale));
	color: var(--rfy-muted);
	line-height: 1.45;
	transition: font-size 0.2s ease;
}

@media (prefers-reduced-motion: reduce) {
	.rfy-step-guide__title,
	.rfy-step-guide__text,
	.rfy-step-guide__meta {
		transition: none;
	}
}

/*
 * Step image — same width + radius as white card above (design: cards/images md).
 * Always in view; never full-bleed past the card inset.
 */
.rfy-step-guide__image {
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
	width: 100%;
	max-height: var(--rfy-step-guide-image-max);
	border-radius: var(--rfy-radius-md);
	overflow: hidden;
	line-height: 0;
	background: var(--rfy-surface);
}

.rfy-step-guide__image[hidden] {
	display: none !important;
}

.rfy-step-guide__image img {
	display: block;
	width: 100%;
	height: var(--rfy-step-guide-image-max);
	max-height: var(--rfy-step-guide-image-max);
	object-fit: cover;
	object-position: center;
}

.rfy-step-guide__announcer {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.rfy-step-guide__footer {
	flex-shrink: 0;
	display: flex;
	gap: 12px;
	padding: 12px var(--rfy-step-guide-pad-inline) max(16px, env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--rfy-line);
	background: var(--rfy-surface);
}

.rfy-step-guide__footer .rfy-btn {
	flex: 1;
	min-width: 0;
}

body.rfy-step-guide-open {
	overflow: hidden;
}

/* Prep screens */
.rfy-step-guide__screen {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
	overflow: hidden;
}

.rfy-step-guide__screen[hidden] {
	display: none !important;
}

.rfy-step-guide__skip-prep {
	flex-shrink: 0;
	min-height: 44px;
	padding: 0 10px;
	border: 1px solid var(--rfy-line);
	border-radius: var(--rfy-radius-md);
	background: var(--rfy-surface);
	color: var(--rfy-foreground);
	font-size: 0.875rem;
	font-weight: 600;
	white-space: nowrap;
}

.rfy-step-guide__skip-prep[hidden],
.rfy-step-guide__font-down[hidden],
.rfy-step-guide__font-up[hidden] {
	display: none !important;
}

.rfy-step-guide__prep-title {
	margin: 0 0 16px;
	font-size: calc(1.125rem * var(--rfy-step-guide-font-scale, 1));
	font-weight: 800;
	color: var(--rfy-foreground);
	line-height: 1.5;
}

.rfy-step-guide__prep-list {
	list-style: disc;
	margin: 0;
	padding-inline-start: 1.25rem;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.rfy-step-guide__prep-item {
	margin: 0;
}

.rfy-step-guide__prep-line {
	display: inline;
	font-size: calc(1.0625rem * var(--rfy-step-guide-font-scale, 1));
	line-height: 1.55;
	color: var(--rfy-foreground);
}

.rfy-step-guide__prep-item::marker {
	color: var(--rfy-foreground);
}

.rfy-step-guide__prep-segments {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.rfy-step-guide__tip-mistake {
	margin: 0;
	font-size: calc(1.0625rem * var(--rfy-step-guide-font-scale, 1));
	font-weight: 700;
	line-height: 1.5;
	color: var(--rfy-foreground);
}

.rfy-step-guide__tip-fix {
	margin: 0;
	font-size: calc(1rem * var(--rfy-step-guide-font-scale, 1));
	color: var(--rfy-muted);
	line-height: 1.7;
}

/* Feedback screen — white surface card (contact_dual pattern). */
.rfy-step-guide__feedback-card {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 20px 18px;
	background: var(--rfy-surface);
	border: 1px solid var(--rfy-border);
	border-radius: var(--rfy-radius-md);
	box-shadow: var(--rfy-shadow-sm);
	text-align: start;
}

.rfy-step-guide__feedback-title {
	margin: 0;
	font-size: calc(1.25rem * var(--rfy-step-guide-font-scale, 1));
	font-weight: 800;
	line-height: 1.3;
	color: var(--rfy-foreground);
}

.rfy-step-guide__feedback-hint {
	margin: 0;
	font-size: calc(1.0625rem * var(--rfy-step-guide-font-scale, 1));
	line-height: 1.6;
	color: var(--rfy-muted);
}

.rfy-step-guide__feedback-missing {
	margin: 0;
	font-size: 1.125rem;
	color: var(--rfy-muted);
}

@media (min-width: 769px) {
	.rfy-step-guide {
		--rfy-step-guide-pad-inline: 24px;
		--rfy-step-guide-pad-block: 20px;
		--rfy-step-guide-image-max: min(22dvh, 200px);
		--rfy-step-guide-bubble-max: min(40dvh, 300px);
		align-items: center;
		padding: max(24px, env(safe-area-inset-top, 0px)) 24px max(24px, env(safe-area-inset-bottom, 0px));
	}

	.rfy-step-guide__panel {
		width: min(600px, calc(100vw - 48px));
		max-width: 600px;
		height: auto;
		max-height: min(85dvh, 720px);
	}

	.rfy-step-guide__header {
		padding-top: 16px;
	}
}
