/* Smoothie Builder
   Teaches the formula by building one. A Beginner / Advanced switch, then each step as a linen
   card (number, title in the heading face, the step's amount in the shared brass tag) holding its
   ingredients as rounded ivory buttons with Brass Dark labels; a picked one turns brass with a
   black label. The step number sits in its own column on the left. Under the steps, the recipe card on dark green: a mason jar that fills in one smoothie colour, the title,
   one line per ingredient, and the Print and Start over buttons.
--------------------------------------------- */
.block-smoothie-builder {
	margin-block: var(--wp--custom--layout--block-gap);
}

/* Beginner / Advanced: a linen pill with the chosen side in dark green */
.block-smoothie-builder__modes {
	display: inline-flex;
	gap: 4px;
	margin-bottom: 16px;
	padding: 4px;
	border-radius: 999px;
	background: var(--wp--preset--color--secondary);
}

.block-smoothie-builder__mode-button {
	padding: 9px 18px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	cursor: pointer;
	font-family: var(--wp--preset--font-family--secondary);
	font-size: var(--wp--custom--caps--label);
	font-weight: 700;
	letter-spacing: var(--wp--custom--caps--tracking-tiny);
	text-transform: uppercase;
	color: var(--wp--preset--color--brass-dark);
	transition: background var(--wp--custom--transition--speed) ease, color var(--wp--custom--transition--speed) ease;
}

.block-smoothie-builder__mode-button[aria-pressed="true"] {
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--background);
}

.block-smoothie-builder__mode-button:focus-visible,
.block-smoothie-builder__option:focus-visible,
.block-smoothie-builder__summary:focus-visible {
	outline: 2px solid var(--wp--preset--color--quaternary);
	outline-offset: 2px;
}

/* Steps */
.block-smoothie-builder__step {
	position: relative; /* holds the step number in its own left column */
	margin: 0 0 10px;
	padding: 20px 22px 22px 88px;
	border-radius: var(--wp--custom--border-radius--small);
	background: var(--wp--preset--color--secondary);
}

.block-smoothie-builder__summary {
	display: flex;
	align-items: center;
	gap: 12px;
	cursor: pointer;
	list-style: none;
}

.block-smoothie-builder__summary::-webkit-details-marker {
	display: none;
}

.block-smoothie-builder__number {
	position: absolute;
	top: 18px;
	left: 22px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: var(--wp--preset--color--primary);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1;
	color: var(--wp--preset--color--background);
}

.block-smoothie-builder .block-smoothie-builder__title { /* outranks the content heading styles */
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-variation-settings: "SOFT" 100, "WONK" 1;
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--wp--preset--color--black);
}

/* The amount wears the shared brass tag (sidebar Browse tags); this only keeps it on one line */
.block-smoothie-builder__amount {
	white-space: nowrap;
}

.block-smoothie-builder__options {
	display: flex;
	margin-top: 14px;
	flex-wrap: wrap;
	gap: 8px;
}

/* Small group labels inside a long list ("Protein", "Flavor") */
.block-smoothie-builder__group {
	flex-basis: 100%;
	margin: 8px 0 0;
	font-size: var(--wp--custom--caps--tiny);
	font-weight: 700;
	letter-spacing: var(--wp--custom--caps--tracking-tiny);
	text-transform: uppercase;
	color: var(--wp--preset--color--brass-dark);
}

/* The group's amount after its name ("PROTEIN · ¼ CUP") */
.block-smoothie-builder__group-amount {
	color: var(--wp--preset--color--black);
}

.block-smoothie-builder__group-amount::before {
	content: "·";
	margin-right: 6px;
	color: var(--wp--preset--color--brass-dark);
}

.block-smoothie-builder__group:first-child {
	margin-top: 0;
}

/* Ingredients: ivory pills with Brass Dark labels; picked, the pill turns brass and the label black */
.block-smoothie-builder__option {
	padding: 9px 16px;
	border: 0;
	border-radius: 999px;
	background: var(--wp--preset--color--background);
	cursor: pointer;
	font-family: var(--wp--preset--font-family--secondary);
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.2;
	color: var(--wp--preset--color--brass-dark);
	transition: background var(--wp--custom--transition--speed) ease, color var(--wp--custom--transition--speed) ease;
}

.block-smoothie-builder__option:hover {
	color: var(--wp--preset--color--black);
}

.block-smoothie-builder__option[aria-pressed="true"] {
	background: var(--wp--preset--color--quaternary);
	color: var(--wp--preset--color--black);
}

/* A step with four picks: the other ingredients dim and stop taking clicks until one comes off */
.block-smoothie-builder__option[aria-disabled="true"] {
	background: transparent;
	cursor: not-allowed;
	color: var(--wp--custom--color--neutral-600);
}

/* The recipe card */
.block-smoothie-builder__result {
	display: grid;
	grid-template-columns: 120px minmax(0, 1fr) auto; /* glass | recipe | buttons */
	gap: 32px;
	align-items: center;
	margin-top: 4px;
	padding: 26px 28px;
	border-radius: var(--wp--custom--border-radius--small);
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--background);
}

/* The glass: a mason jar drawn in brass lines (render.php), a striped ivory-and-brass paper straw,
   and the smoothie in one colour (green, red or orange from the picks; theme.json tokens). The
   smoothie grows from the bottom, a third for each step started, and stops below the band. */
.block-smoothie-builder__glass {
	align-self: start;
	width: 110px;
}

.block-smoothie-builder__jar {
	display: block;
	width: 100%;
	height: auto;
	overflow: visible;
}

.block-smoothie-builder__jar-line {
	fill: none;
	stroke: var(--wp--preset--color--quaternary);
	stroke-width: 2.5;
	stroke-linecap: round;
}

.block-smoothie-builder__band {
	fill: var(--wp--preset--color--primary); /* the band hides the straw where it passes behind */
}

.block-smoothie-builder__straw-base {
	fill: var(--wp--preset--color--background);
}

.block-smoothie-builder__straw-stripe {
	fill: var(--wp--preset--color--quaternary);
}

.block-smoothie-builder__liquid {
	fill: var(--wp--custom--color--smoothie-orange);
	transform: scaleY(var(--fill-scale, 0));
	transform-box: fill-box;
	transform-origin: bottom;
	transition: transform var(--wp--custom--transition--speed) ease, fill var(--wp--custom--transition--speed) ease;
}

.block-smoothie-builder__glass[data-tone="green"] .block-smoothie-builder__liquid {
	fill: var(--wp--custom--color--smoothie-green);
}

.block-smoothie-builder__glass[data-tone="red"] .block-smoothie-builder__liquid {
	fill: var(--wp--custom--color--smoothie-red);
}

.block-smoothie-builder__name {
	margin: 0 0 8px;
	font-family: var(--wp--preset--font-family--heading);
	font-variation-settings: "SOFT" 100, "WONK" 1;
	font-size: 1.375rem;
	font-weight: 700;
	line-height: 1.25;
	color: var(--wp--preset--color--background);
}

.block-smoothie-builder__lines {
	margin: 0;
	padding-left: 1.1em;
	font-size: 1rem;
	line-height: 1.35;
	list-style: disc;
	column-gap: 40px;
}

/* More than four ingredients: two columns, so the card stays short */
.block-smoothie-builder__lines.is-long {
	columns: 2;
}

.block-smoothie-builder__line {
	padding: 0 0 4px 0.35em;
	break-inside: avoid;
}

.block-smoothie-builder__line::marker {
	color: var(--wp--preset--color--quaternary);
}

.block-smoothie-builder__line.is-empty {
	color: var(--wp--custom--color--mist);
}

/* Print and Start over: the theme's dark-section buttons (brass, and brass outline), stacked in
   their own column to the right of the recipe; shown once anything is picked */
.block-smoothie-builder__actions {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 170px;
}

.block-smoothie-builder__actions[hidden] {
	display: none;
}

.block-smoothie-builder__actions .wp-element-button {
	width: 100%;
	cursor: pointer;
}

/* Phones: the glass sits beside the name only, the recipe below; a folded step shows its title row */
@media only screen and (max-width: 599px) {
	.block-smoothie-builder__step {
		padding: 16px 16px 18px 68px;
	}

	.block-smoothie-builder__number {
		top: 14px;
		left: 14px;
		width: 40px;
		height: 40px;
		font-size: 1.25rem;
	}

	.block-smoothie-builder__result {
		grid-template-columns: 76px minmax(0, 1fr);
		gap: 18px;
		padding: 18px;
	}

	.block-smoothie-builder__lines.is-long {
		columns: 1;
	}

	/* The buttons go under the glass and recipe, side by side */
	.block-smoothie-builder__actions {
		grid-column: 1 / -1;
		flex-direction: row;
		min-width: 0;
	}

	.block-smoothie-builder__actions .wp-element-button {
		flex: 1;
	}

	.block-smoothie-builder__glass {
		width: 72px;
	}
}
