/* Recipe modal. */

.recipe-modal::backdrop {
	background-color: var(--color-scrim-dialog);
}

.recipe-modal .dialog__box {
	width: 100%;
	/* 1234 in the node, 11px more than the product modal. Pendency 8 of modal-receita.md:
	   not unified into one token, that would move a modal already signed off in QA. */
	max-width: 1234px;
	margin-block: var(--space-7);
	padding: var(--space-7);
	max-height: calc(100vh - var(--space-7) * 2);
	overflow-y: auto;
	overscroll-behavior: contain;
}

/*
 * The text scrolls under the close button while the photo stays (hotfix/client-feedback-2),
 * so the button is in flow and sticky at the same 32/32 corner, as in the product modal:
 * Chrome measures a sticky top from inside the scroll container's padding, hence the
 * negative top, and the bottom margin gives back its height and the pull.
 *
 * No circle at rest: the group "Ellipse 157" of 589:12019 is empty. The fill is the white
 * of the box, which looks the same and hides the text passing under the X. The hover
 * 589:12024 shows the circle, Light Gray, and keeps the X Dark Red.
 */
.recipe-modal .dialog__close {
	position: sticky;
	top: calc(var(--space-5) - var(--space-7));
	right: auto;
	z-index: 1;
	margin: calc(var(--space-5) - var(--space-7)) calc(var(--space-5) - var(--space-7)) calc(var(--space-7) - var(--space-5) - 48px) auto;
}

.recipe-modal .dialog__close--bare {
	background-color: var(--color-surface);
}

.recipe-modal .dialog__close--bare:hover {
	background-color: var(--color-hover-surface);
	color: var(--color-icon-accent);
}

/* The asset draws its 16px X on a 48 box: it must not shrink inside the button. */
.recipe-modal .dialog__close svg {
	flex: none;
	width: 48px;
	height: 48px;
}

.recipe-modal__content {
	display: flex;
	/*
	 * CONTENT of 752:43911: 1062 wide, centred in the box. The node stretches the photo to
	 * the height of the text; the client asked for the photo to stay while the text
	 * scrolls, as in the product modal, so it keeps its own height instead.
	 */
	align-items: flex-start;
	gap: var(--space-7);
	max-width: 1062px;
	margin-inline: auto;
}

/*
 * Sticky, as in the product modal (client feedback, 2026-11-19): only the text scrolls.
 * 500 was the minimum height of the photo; the cap keeps it whole inside the box on a
 * short window (the box is the viewport less 64 of margin and 64 of padding per side).
 */
.recipe-modal__media {
	position: sticky;
	top: 0;
	flex: none;
	width: 400px;
	height: min(500px, calc(100vh - var(--space-7) * 4));
	border-radius: var(--radius-card);
	background-color: var(--color-surface-subtle);
	overflow: hidden;
}

.recipe-modal__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.recipe-modal__body {
	display: flex;
	/* The text column is 598 in 752:43911. */
	flex: 0 1 598px;
	flex-direction: column;
	gap: var(--space-4);
	min-width: 0;
	max-width: 100%;
}

.recipe-modal__title {
	padding-inline-end: var(--space-gap-section);
	color: var(--color-heading-dialog);
	font-size: var(--font-h3);
}

.recipe-tabs {
	display: flex;
	flex-direction: column;
	gap: var(--space-gap-section);
}

/* Same reason as .calculator__tabs: overflow-x would let the strip collapse. */
.recipe-tabs__list {
	flex-shrink: 0;
}

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

/*
 * Group title: "Recheio", "Calda", "Montagem". Not drawn in the Figma, whose only recipe
 * with content has a single group, so it borrows the type of the tip titles and their
 * colour, which the recipe page repoints through the variable. Provisional.
 */
.recipe-group__title {
	color: var(--recipe-group-title-color, var(--color-heading-dialog));
	font-family: var(--font-body);
	font-size: var(--font-p2);
	font-weight: 500;
	line-height: 1.4;
	letter-spacing: var(--ls-body);
}

.recipe-group__title:not(:first-child) {
	margin-block-start: var(--space-5);
}

.recipe-group__title + .ingredient-list,
.recipe-group__title + .recipe-steps {
	margin-block-start: var(--space-2);
}

/* Two untitled lists never follow each other, but a titled one can follow a list. */
.ingredient-list + .ingredient-list,
.recipe-steps + .recipe-steps {
	margin-block-start: var(--space-5);
}

/* Ingredientes */

.ingredient-list {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	list-style: none;
}

.ingredient-list__item {
	display: flex;
	align-items: flex-start;
	gap: var(--space-3);
}

.ingredient-list__bullet {
	flex: none;
	width: 24px;
	height: 24px;
	color: var(--color-icon-brand);
}

.ingredient-list__text {
	color: var(--color-text);
	font-size: var(--font-p2);
	line-height: 1.4;
}

.recipe-product-list {
	display: flex;
	flex-direction: column;
	/* 8 between the rows in 590:12856 (754:45604). */
	gap: var(--space-1);
	margin-block-start: var(--space-6);
	list-style: none;
}

/* Modo de preparo */

.recipe-steps {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	/* "1. …" is plain text at x 0 in 590:12855: the number sits inside the line. */
	padding-inline-start: 0;
	list-style: decimal inside;
}

.recipe-steps__item {
	color: var(--color-text);
	font-size: var(--font-p2);
	line-height: 1.4;
}

/* Dicas */

.recipe-tips {
	display: flex;
	flex-direction: column;
	gap: 20px;
	counter-reset: tip;
	list-style: none;
}

.recipe-tips__item {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
	counter-increment: tip;
}

.recipe-tips__title {
	/* Main Red in 590:12854. */
	color: var(--color-title-card);
	font-size: var(--font-p2);
	font-weight: 500;
	line-height: 1.4;
}

.recipe-tips__title::before {
	content: counter(tip) '. ';
}

.recipe-tips__text {
	color: var(--color-text);
	font-size: var(--font-p2);
	line-height: 1.4;
}

@media (max-width: 1023px) {
	.recipe-modal .dialog__box {
		padding: var(--space-5);
	}

	/* The padding is 32 here, so the corner needs no pull. */
	.recipe-modal .dialog__close {
		top: 0;
		margin: 0 0 -48px auto;
	}

	.recipe-modal__media {
		/* Sticky is unhelpful once the layout narrows, as in the product modal. */
		position: static;
		width: 280px;
		height: 350px;
	}

	.recipe-tabs {
		gap: var(--space-5);
	}
}

@media (max-width: 767px) {
	.recipe-modal .dialog__viewport {
		padding-inline: 0;
	}

	.recipe-modal .dialog__box {
		/* The viewport aligns to flex-start, so full screen needs an explicit stretch. */
		align-self: stretch;
		max-width: none;
		width: 100%;
		min-height: 100%;
		max-height: none;
		margin-block: 0;
		padding: var(--space-4);
		border-radius: 0;
	}

	.recipe-modal .dialog__close {
		top: var(--space-4);
		margin: 0 0 var(--space-2) auto;
	}

	.recipe-modal__content {
		flex-direction: column;
		/* stretch, not flex-start: flex-start sizes the body by the max-content of the
		   tablist and pushes the title past the viewport. */
		align-items: stretch;
		gap: var(--space-4);
	}

	.recipe-modal__media {
		width: 100%;
		height: 240px;
	}

	.recipe-modal__title {
		padding-inline-end: 0;
	}

	.recipe-tabs__list {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		padding-block-end: 4px;
	}

	.recipe-tabs__list::-webkit-scrollbar {
		display: none;
	}
}
