/* Seu Negócio section. */

.business {
	overflow: clip;
	background-color: var(--color-surface-muted);
	/* 680:26737 ends 104 under the carousel: 788 - 140 - 544. */
	padding-block-end: 104px;
}

/* ARROW at y 171 of the 440 carousel in 680:28020, not centred on the card and the dots. */
.business .carousel__nav {
	top: 171px;
}

.business__header {
	margin-block-end: var(--space-gap-section);
}

.business__item {
	width: 289px;
}

/*
 * Geometry from the prototype: image box 290x299 at (0, 40) inside a 289x400 card, and
 * a white title band 290x69 pinned to the bottom. The band hugs its content because on
 * hover it grows to 98px or 123px depending on how the revealed line wraps.
 */
.segment-card {
	position: relative;
	display: block;
	width: 100%;
	height: 400px;
	border: 1px solid var(--color-surface-muted);
	border-radius: var(--radius-media);
	background-color: var(--segment-bg, var(--color-surface-segment));
	overflow: clip;
	transition: background-color var(--duration-base) var(--ease-out);
}

.segment-card:hover,
.segment-card:focus-visible {
	background-color: var(--color-surface);
}

.segment-card__media {
	position: absolute;
	top: 10%;
	right: 0;
	left: 0;
	height: 74.75%;
	overflow: clip;
	transition: opacity var(--duration-base) var(--ease-out);
}

/*
 * The hover swaps the photo, it does not zoom it: the default (685:42370) shows the
 * packshot inside the inset box and the hover (685:42371) shows the dish of the segment,
 * a different photograph, bleeding from the top edge of the card down behind the title
 * band. Hence the full width from the top edge here, against the 10% inset of the packshot.
 *
 * The layer ends where the default band starts (69px of 400), not where the expanded band
 * starts: the band grows while the photo fades in, and a shorter layer would let a strip
 * of the card show between the two for the length of the transition.
 *
 * Each dish is cropped by hand in the node, with no rule shared by the five cards, so the
 * crop travels inside each asset and the CSS covers from the centre, as in step 13.
 */
.segment-card__dish {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 17.25%;
	left: 0;
	opacity: 0;
	transition: opacity var(--duration-base) var(--ease-out);
}

.segment-card--has-dish:hover .segment-card__media,
.segment-card--has-dish:focus-visible .segment-card__media {
	opacity: 0;
}

.segment-card--has-dish:hover .segment-card__dish,
.segment-card--has-dish:focus-visible .segment-card__dish {
	opacity: 1;
}

/*
 * Animated card (change typology-media): the Tirolez loop is 290x330, the box from the top
 * edge of the card down to the 69px title band (400 - 69 = 331), so it takes that whole box
 * instead of the 10% inset of the packshot. The poster is the image; the video sits on top
 * and only shows once it plays (segment-video.js), so a slow or blocked load keeps the poster.
 */
.segment-card--has-video .segment-card__media {
	top: 0;
	height: 82.75%;
}

.segment-card__video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	opacity: 0;
	transition: opacity var(--duration-base) var(--ease-out);
}

.segment-card__video.is-playing {
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.segment-card__video {
		display: none;
	}
}

.segment-card__image,
.segment-card__dish-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.segment-card__label {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	flex-direction: column;
	padding: 20px var(--space-1);
	background-color: var(--color-surface);
	text-align: center;
	transition: padding-inline var(--duration-base) var(--ease-out);
}

/* 16 of side padding in the hover band of 685:42366, against the 8 of the default. */
.segment-card:hover .segment-card__label,
.segment-card:focus-visible .segment-card__label {
	padding-inline: var(--space-3);
}

.segment-card__title {
	display: block;
	color: var(--color-title-card);
	font-family: var(--font-heading);
	font-size: var(--font-h5);
	font-weight: var(--weight-heading);
	line-height: var(--lh-heading);
	letter-spacing: var(--ls-heading);
	overflow-wrap: anywhere;
}

/*
 * grid-template-rows from 0fr to 1fr is what lets the band animate to the natural height
 * of the revealed line instead of a hardcoded max-height.
 */
.segment-card__recipe-reveal {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows var(--duration-base) var(--ease-out);
}

.segment-card:hover .segment-card__recipe-reveal,
.segment-card:focus-visible .segment-card__recipe-reveal {
	grid-template-rows: 1fr;
}

.segment-card__recipe {
	overflow: hidden;
	color: var(--color-text);
	font-size: var(--font-p2);
	line-height: 1.4;
	opacity: 0;
	transition: opacity var(--duration-base) var(--ease-out),
		margin-block-start var(--duration-base) var(--ease-out);
}

/*
 * The 8px above the revealed line only exists while the line does. As a gap on the band
 * it kept its space with the row collapsed, so the two cards that have a recipe started
 * 8px taller than the other three and neighbouring titles no longer lined up. A margin
 * on the collapsed row would do the same: "0fr" means "minmax(auto, 0fr)", and the
 * automatic minimum counts the margin of the item.
 */
.segment-card:hover .segment-card__recipe,
.segment-card:focus-visible .segment-card__recipe {
	/* TITLE of 685:42366 stacks the two lines 4 apart. */
	margin-block-start: 4px;
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.segment-card,
	.segment-card__media,
	.segment-card__dish,
	.segment-card__recipe-reveal,
	.segment-card__recipe {
		transition: none;
	}
}

@media (max-width: 767px) {
	.business__header {
		margin-block-end: var(--space-6);
	}

	.business__item {
		width: min(78vw, 289px);
	}

	.segment-card {
		height: min(138vw, 400px);
	}
}
