/*
 * Recipe page, Figma node 813:45227. The lists, the product card and the tips come from
 * recipe-modal.css, shared with the Produtos modal; this file lays out the page around
 * them and repoints what the page draws differently.
 *
 * Mobile first. The frame only exists at 1440: red band of 272 (184 below the header),
 * photo 412 x 360 at x 112 and a 721 content column at x 607, sticky photo. Below 1024
 * the photo stacks on top of the content.
 */

/* The red band and its breadcrumb live in components/detail-band.css. */

/* Photo and content */

.recipe-detail {
	background-color: var(--color-surface);
	/* The page titles its groups in the heading colour, Dark Red like the modal's. */
	--recipe-group-title-color: var(--color-heading);
}

.recipe-detail__inner {
	display: flex;
	flex-direction: column;
	gap: var(--space-5);
	padding-block: var(--space-2) var(--space-7);
}

.recipe-detail__media {
	/* Context of the clip over the photo (media-motion.css); sticky from 1024px is positioned too. */
	position: relative;
	aspect-ratio: 412 / 360;
	border-radius: var(--radius-card);
	background-color: var(--color-surface-muted);
	overflow: hidden;
}

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

.recipe-detail__content {
	display: flex;
	flex-direction: column;
	gap: var(--space-6);
	min-width: 0;
}

.recipe-detail__title {
	font-size: var(--font-h1);
}

/*
 * H4 | 28 B in the frame, for "Ingredientes", "Modo de preparo" and "Dicas". The blocks
 * stay in normal flow instead of flex with gap: the shared partials print the group
 * titles and the lists as siblings, and their spacing comes from recipe-modal.css margins.
 */
.recipe-detail__heading {
	margin-block-end: var(--space-3);
	font-size: var(--font-h4);
}

/* Sand box, 36 of padding and 24 between title and list in the frame. */
.recipe-detail__ingredients {
	padding: var(--space-4);
	border-radius: var(--radius-card);
	background-color: var(--color-surface-sand);
}

.recipe-detail__ingredients > .recipe-detail__heading {
	margin-block-end: var(--space-4);
}

/* 8 between ingredients here, against the 16 of the modal. */
.recipe-detail .ingredient-list {
	gap: var(--space-1);
}

/* 48 between the list and the product card, and the card stops at 598 like the node. */
.recipe-detail .recipe-product-list {
	max-width: 598px;
	margin-block-start: calc(var(--space-4) * 2);
}

/*
 * Steps and tips are Gray BRAND in the frame, with one empty line between items. Gray
 * BRAND over white is 3.2:1, below the 4.5:1 of body text: the colour follows the Figma
 * and the debt is pinned in tools/test-a11y.mjs and in the handoff (BACKLOG).
 */
.recipe-detail .recipe-steps {
	gap: 1.4em;
	padding-inline-start: 27px;
}

.recipe-detail .recipe-steps__item,
.recipe-detail .recipe-tips__title,
.recipe-detail .recipe-tips__text {
	color: var(--color-text-muted);
}

.recipe-detail .recipe-tips {
	gap: 1.4em;
}

.recipe-detail .recipe-tips__item {
	gap: 0;
}

/* Related recipes */

.recipe-related {
	overflow: clip;
	padding-block: var(--space-7);
	background-color: var(--color-surface-sand);
}

.recipe-related__header {
	margin-block-end: var(--space-6);
}

.recipe-related__item {
	width: min(84vw, 340px);
}

/* Arrows on the vertical centre of the 412 tile, not of the tile plus the dots. */
.recipe-related .carousel__nav {
	top: calc(206px - 26px);
}

@media (min-width: 640px) {
	/* Stacked on a tablet, a 412:360 photo at full width would fill the whole screen. */
	.recipe-detail__media {
		aspect-ratio: 16 / 9;
	}
}

@media (min-width: 768px) {
	.recipe-detail__ingredients {
		padding: 36px;
	}

	.recipe-related__item {
		width: 392px;
	}
}

@media (min-width: 1024px) {
	/* 412 photo, 83 of gap, 721 of content: the 1216 of the container. */
	.recipe-detail__inner {
		display: grid;
		grid-template-columns: 412fr 721fr;
		align-items: start;
		gap: 83px;
		padding-block: 19px var(--section-padding-end);
	}

	.recipe-detail__media {
		position: sticky;
		top: calc(var(--header-height) + var(--space-4));
		aspect-ratio: 412 / 360;
	}

	/* The title starts at 72 in the frame, 53 below the top of the photo. */
	.recipe-detail__content {
		gap: var(--space-gap-section);
		padding-block-start: 53px;
	}

	.recipe-related {
		padding-block: var(--section-padding-end);
	}

	.recipe-related__header {
		margin-block-end: calc(var(--space-4) * 2);
	}
}
