/* Ask Brotega — random taco recipe modal */

.ortega-ask-brotega-modal {
	bottom: 0;
	height: 100%;
	left: 0;
	position: fixed;
	right: 0;
	top: 0;
	width: 100%;
	z-index: 100000;
}

.ortega-ask-brotega-modal[hidden] {
	display: none;
}

.ortega-ask-brotega-modal.is-open {
	display: block;
}

.ortega-ask-brotega-modal__backdrop {
	background: rgb(0 0 0 / 60%);
	bottom: 0;
	height: 100%;
	left: 0;
	position: absolute;
	right: 0;
	top: 0;
	width: 100%;
}

.ortega-ask-brotega-modal__dialog {
	align-items: center;
	box-sizing: border-box;
	display: flex;
	inset: 0;
	justify-content: center;
	padding: clamp(12px, 3vw, 40px);
	position: absolute;
}

.ortega-ask-brotega-modal__dialog:focus {
	outline: none;
}

.ortega-ask-brotega-modal__panel {
	--ortega-abm-navy: #093272;
	--ortega-abm-blue: #0058a4;
	--ortega-abm-yellow: #ffe400;
	--ortega-abm-yellow-hover: #ffd000;
	--ortega-abm-watermark: #c9c9c9;
	background-color: #f3f1ee;
	background-image: url("../images/ask-brotega-modal/modal-texture.jpg");
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
	border-radius: clamp(12px, 1.5vw, 20px);
	box-sizing: border-box;
	color: var(--ortega-abm-navy);
	isolation: isolate;
	max-height: min(90vh, 820px);
	max-width: min(1337px, 100%);
	overflow: hidden;
	position: relative;
	width: 100%;
}

.ortega-ask-brotega-modal__stage {
	inset: 0;
	pointer-events: none;
	position: absolute;
	z-index: 1;
}

.ortega-ask-brotega-modal__character-wrap {
	inset: 0;
	pointer-events: none;
	position: absolute;
}

.ortega-ask-brotega-modal__character-wrap picture {
	display: block;
	height: 100%;
	width: 100%;
}

.ortega-ask-brotega-modal__stage .ortega-ask-brotega-modal__close {
	pointer-events: auto;
}

.ortega-ask-brotega-modal__edge {
	display: none;
}

.ortega-ask-brotega-modal__watermark {
	align-items: center;
	display: flex;
	gap: clamp(1rem, 2.5vw, 2.25rem);
	left: -0.5%;
	margin: 0;
	pointer-events: none;
	position: absolute;
	top: clamp(0.25rem, 0.8vw, 0.5rem);
	user-select: none;
	white-space: nowrap;
	z-index: 0;
}

.ortega-ask-brotega-modal__watermark-text {
	-webkit-text-fill-color: transparent;
	-webkit-text-stroke: 3px var(--ortega-abm-watermark);
	color: transparent;
	font-family: var(--ortega-font-display);
	font-size: clamp(72px, 12vw, 175px);
	font-weight: 700;
	letter-spacing: 2px;
	line-height: 1.06;
	paint-order: stroke fill;
	text-stroke: 3px var(--ortega-abm-watermark);
	text-transform: uppercase;
}

.ortega-ask-brotega-modal__watermark-chili {
	display: block;
	flex: 0 0 auto;
	height: auto;
	opacity: 0.85;
	width: clamp(64px, 8vw, 123px);
}

.ortega-ask-brotega-modal__character {
	bottom: 0;
	display: block;
	height: auto;
	left: clamp(-4%, -2vw, 0);
	max-height: min(88%, 680px);
	object-fit: contain;
	object-position: bottom left;
	pointer-events: none;
	position: absolute;
	width: min(48%, 660px);
	z-index: 2;
}

.ortega-ask-brotega-modal__close {
	align-items: center;
	background: transparent;
	border: 0;
	border-radius: 999px;
	box-shadow: none;
	cursor: pointer;
	display: inline-flex;
	height: 48px;
	justify-content: center;
	padding: 0;
	pointer-events: auto;
	position: absolute;
	right: clamp(12px, 2vw, 24px);
	top: clamp(12px, 2vw, 24px);
	width: 48px;
	z-index: 10;
}

.ortega-ask-brotega-modal__close:hover,
.ortega-ask-brotega-modal__close:focus-visible,
.ortega-ask-brotega-modal__close:active {
	background: transparent;
	background-color: transparent;
	box-shadow: none;
}

.ortega-ask-brotega-modal__close:focus-visible {
	outline: 2px solid var(--ortega-abm-navy);
	outline-offset: 3px;
}

.ortega-ask-brotega-modal__close-icon {
	display: block;
	height: 100%;
	width: 100%;
}

.ortega-ask-brotega-modal__body {
	box-sizing: border-box;
	display: grid;
	min-height: clamp(420px, 58vw, 765px);
	padding:
		clamp(4.5rem, 8vw, 7rem)
		clamp(1.25rem, 4vw, 3.5rem)
		clamp(1.5rem, 4vw, 3rem)
		clamp(1.25rem, 4vw, 2rem);
	position: relative;
	z-index: 3;
}

.ortega-ask-brotega-modal__status {
	color: var(--ortega-abm-navy);
	font-family: var(--ortega-font-body);
	font-size: var(--ortega-type-body);
	font-weight: 700;
	justify-self: end;
	margin: 0;
	max-width: min(420px, 100%);
	padding-top: 2rem;
	text-align: left;
}

.ortega-ask-brotega-modal__recipe {
	align-self: end;
	justify-self: end;
	max-width: min(640px, 100%);
	width: min(100%, 640px);
}

.ortega-ask-brotega-modal__recipe-layout {
	align-items: start;
	display: grid;
	gap: clamp(1rem, 2vw, 1.5rem);
	grid-template-areas:
		"title title"
		"media details";
	grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
}

.ortega-ask-brotega-modal__title {
	color: var(--ortega-abm-navy);
	font-family: var(--ortega-font-display);
	font-size: clamp(36px, 5vw, 64px);
	font-weight: 800;
	grid-area: title;
	letter-spacing: 0.02em;
	line-height: 0.9;
	margin: 0;
	text-transform: uppercase;
}

.ortega-ask-brotega-modal__media {
	aspect-ratio: 1;
	border-radius: 8px;
	grid-area: media;
	overflow: hidden;
	transform: rotate(-1.8deg);
	width: 100%;
}

.ortega-ask-brotega-modal__recipe-image {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.ortega-ask-brotega-modal__details {
	display: grid;
	gap: 0.85rem;
	grid-area: details;
	min-width: 0;
	padding-top: 0.15rem;
}

.ortega-ask-brotega-modal__meta {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.15rem;
}

.ortega-ask-brotega-modal__meta[hidden],
.ortega-ask-brotega-modal__meta-item[hidden] {
	display: none !important;
}

.ortega-ask-brotega-modal__meta-item {
	align-items: center;
	color: var(--ortega-abm-navy);
	display: inline-flex;
	font-family: var(--ortega-font-body);
	font-size: 15px;
	font-weight: 700;
	gap: 0.4rem;
	line-height: 1.2;
	margin: 0;
}

.ortega-ask-brotega-modal__meta-icon {
	display: block;
	flex: 0 0 auto;
	height: 16px;
	width: 16px;
}

.ortega-ask-brotega-modal__description {
	color: var(--ortega-abm-navy);
	font-family: var(--ortega-font-copy);
	font-size: clamp(15px, 1.3vw, 17px);
	font-weight: 500;
	line-height: 1.35;
	margin: 0;
	max-width: 34ch;
}

.ortega-ask-brotega-modal__actions {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 0.85rem 1.25rem;
	margin-top: 0.35rem;
}

.ortega-btn.ortega-ask-brotega-modal__make {
	font-size: 15px;
	letter-spacing: 0;
	line-height: 1;
	min-height: 48px;
	padding: 0.85rem 1.5rem;
	width: max-content;
}

.ortega-ask-brotega-modal__try {
	appearance: none;
	background: transparent;
	border: 0;
	color: var(--ortega-abm-navy);
	cursor: pointer;
	font-family: var(--ortega-font-body);
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	margin: 0;
	padding: 0 0 0.45rem;
}

/* Override global button:hover yellow (style.css). */
.ortega-ask-brotega-modal__try:hover,
.ortega-ask-brotega-modal__try:focus-visible,
.ortega-ask-brotega-modal__try:active {
	background: transparent;
	background-color: transparent;
	color: var(--ortega-abm-navy);
}

.ortega-ask-brotega-modal__try:focus-visible {
	outline: 2px solid var(--ortega-abm-navy);
	outline-offset: 4px;
}

.ortega-ask-brotega-modal.is-loading .ortega-ask-brotega-modal__recipe {
	pointer-events: none;
}

.ortega-ask-brotega-modal.is-loading .ortega-ask-brotega-modal__try {
	cursor: wait;
}

html.ortega-ask-brotega-modal-open,
body.ortega-ask-brotega-modal-open {
	overflow: hidden;
	overscroll-behavior: none;
}

body.ortega-ask-brotega-modal-open {
	left: 0;
	position: fixed;
	right: 0;
	width: 100%;
}

@media (min-width: 782px) {
	.ortega-ask-brotega-modal__dialog {
		align-items: center;
		justify-content: center;
	}

	.ortega-ask-brotega-modal__panel {
		/* Character width tracks viewport height so he shrinks on short screens. */
		--ortega-abm-char-w: min(48%, 660px, 58vh);
		height: auto;
		max-height: min(90vh, 820px);
	}

	.ortega-ask-brotega-modal__body {
		box-sizing: border-box;
		height: auto;
		max-height: none;
		min-height: 0;
		/* Clear the absolute wordmark, then start content. */
		padding-top: calc(
			clamp(0.25rem, 0.8vw, 0.5rem) + (clamp(72px, 12vw, 175px) * 1.06) + 0.75rem
		);
	}

	.ortega-ask-brotega-modal__character {
		width: var(--ortega-abm-char-w);
	}

	.ortega-ask-brotega-modal__recipe {
		align-self: start;
		/* Expand into space freed as the character gets narrower. */
		max-width: min(780px, calc(100% - var(--ortega-abm-char-w) - 2rem));
		width: min(100%, calc(100% - var(--ortega-abm-char-w) - 2rem));
	}

	.ortega-ask-brotega-modal__status {
		align-self: start;
		max-width: min(520px, calc(100% - var(--ortega-abm-char-w) - 2rem));
		padding-top: 0;
	}

	.ortega-ask-brotega-modal__recipe-layout {
		align-items: center;
	}

	.ortega-ask-brotega-modal__details {
		display: flex;
		flex-direction: column;
		gap: 0.85rem;
		height: auto;
		justify-content: center;
		min-height: 0;
	}

	.ortega-ask-brotega-modal__actions {
		margin-top: 0;
	}

	.ortega-ask-brotega-modal__watermark-text {
		-webkit-text-stroke: 4px var(--ortega-abm-watermark);
		letter-spacing: 3px;
		text-stroke: 4px var(--ortega-abm-watermark);
	}
}

@media (min-width: 1200px) {
	.ortega-ask-brotega-modal__watermark-text {
		-webkit-text-stroke: 5px var(--ortega-abm-watermark);
		letter-spacing: 4px;
		text-stroke: 5px var(--ortega-abm-watermark);
	}
}

/* Tablet — cap height, stay content-sized + vertically centered */
@media (min-width: 782px) and (max-width: 1199px) {
	.ortega-ask-brotega-modal__panel {
		--ortega-abm-char-w: min(42%, 460px, 50vh);
		height: auto;
		max-height: min(65vh, calc(100vh - 2 * clamp(12px, 3vw, 40px)));
	}

	.ortega-ask-brotega-modal__body {
		padding-left: clamp(1rem, 2vw, 1.5rem);
		padding-right: clamp(1.25rem, 3vw, 2rem);
	}

	.ortega-ask-brotega-modal__recipe-layout {
		grid-template-columns: minmax(110px, 160px) minmax(0, 1fr);
	}

	.ortega-ask-brotega-modal__title {
		font-size: clamp(32px, 4.2vw, 48px);
	}

	.ortega-ask-brotega-modal__actions {
		align-items: flex-start;
		flex-direction: column;
		gap: 16px;
	}
}

/* Mobile — Figma node 3:13 */
@media (max-width: 781px) {
	.ortega-ask-brotega-modal__dialog {
		align-items: stretch;
		justify-content: stretch;
		padding: 0;
	}

	.ortega-ask-brotega-modal__panel {
		/* Match mobile character aspect (~390×333) so he isn’t cropped. */
		--ortega-abm-stage-height: clamp(280px, 85vw, 340px);
		background-image: none;
		background-color: transparent;
		border-radius: 0;
		display: flex;
		flex-direction: column;
		height: 100%;
		max-height: none;
		max-width: none;
		overflow: hidden;
		width: 100%;
	}

	.ortega-ask-brotega-modal__stage {
		background-color: #f3f1ee;
		background-image: url("../images/ask-brotega-modal/modal-texture.jpg");
		background-position: center top;
		background-repeat: no-repeat;
		background-size: cover;
		flex: 0 0 auto;
		height: var(--ortega-abm-stage-height);
		min-height: 280px;
		overflow: visible;
		pointer-events: none;
		position: relative;
		z-index: 2;
	}

	.ortega-ask-brotega-modal__character-wrap {
		inset: 0;
		overflow: hidden;
		position: absolute;
	}

	.ortega-ask-brotega-modal__stage .ortega-ask-brotega-modal__close {
		pointer-events: auto;
	}

	.ortega-ask-brotega-modal__edge {
		display: block;
		height: auto;
		margin-top: -14px;
		position: relative;
		width: 100%;
		z-index: 3;
	}

	.ortega-ask-brotega-modal__watermark {
		bottom: auto;
		gap: 0;
		justify-content: center;
		left: 0;
		right: 0;
		/* Sit just above the navy, with the stroke overlapping into it (Figma y≈289 / blue at 343). */
		top: calc(var(--ortega-abm-stage-height) - 2.75rem);
		white-space: normal;
		z-index: 5;
	}

	.ortega-ask-brotega-modal__watermark-text {
		-webkit-text-fill-color: var(--ortega-abm-yellow);
		-webkit-text-stroke: 6px var(--ortega-abm-blue);
		color: var(--ortega-abm-yellow);
		font-size: clamp(42px, 13vw, 50px);
		font-weight: 400;
		letter-spacing: 0.02em;
		line-height: 1.12;
		paint-order: stroke fill;
		text-align: center;
		text-stroke: 6px var(--ortega-abm-blue);
		width: 100%;
	}

	.ortega-ask-brotega-modal__watermark-chili {
		display: none;
	}

	.ortega-ask-brotega-modal__character {
		bottom: 0;
		height: auto;
		left: 0;
		max-height: none;
		object-fit: contain;
		object-position: bottom center;
		top: auto;
		transform: none;
		width: 100%;
		z-index: 2;
	}

	.ortega-ask-brotega-modal__close {
		height: 30px;
		right: 12px;
		top: 12px;
		width: 30px;
	}

	.ortega-ask-brotega-modal__body {
		background: var(--ortega-abm-navy);
		display: flex;
		flex: 1 1 auto;
		flex-direction: column;
		min-height: 0;
		padding: 1.25rem 1.45rem max(2rem, env(safe-area-inset-bottom, 0px));
		z-index: 1;
	}

	.ortega-ask-brotega-modal__status {
		color: #fff;
		justify-self: stretch;
		max-width: none;
		padding-top: 0;
		text-align: center;
	}

	.ortega-ask-brotega-modal__recipe,
	.ortega-ask-brotega-modal__status {
		align-self: stretch;
		justify-self: stretch;
		max-width: none;
		width: 100%;
	}

	.ortega-ask-brotega-modal__recipe {
		display: flex;
		flex: 1 1 auto;
		flex-direction: column;
		min-height: 0;
	}

	.ortega-ask-brotega-modal__recipe-layout {
		display: grid;
		flex: 1 1 auto;
		gap: 0.5rem 0.75rem;
		grid-template-areas:
			"media title"
			"details details";
		grid-template-columns: 110px minmax(0, 1fr);
		grid-template-rows: auto minmax(0, 1fr);
		min-height: 0;
	}

	.ortega-ask-brotega-modal__title {
		align-self: center;
		color: #fff;
		font-size: clamp(24px, 7.2vw, 28px);
		font-weight: 700;
		letter-spacing: 0.02em;
		line-height: 1.14;
		margin: 0;
	}

	.ortega-ask-brotega-modal__media {
		max-width: 110px;
		transform: rotate(-1.8deg);
		width: 110px;
	}

	.ortega-ask-brotega-modal__details {
		display: flex;
		flex-direction: column;
		gap: 1rem;
		height: 100%;
		min-height: 0;
		padding-top: 0.35rem;
	}

	.ortega-ask-brotega-modal__meta {
		display: none !important;
	}

	.ortega-ask-brotega-modal__description {
		color: #fff;
		font-size: 14px;
		letter-spacing: 0.01em;
		line-height: 1.4;
		max-width: none;
	}

	.ortega-ask-brotega-modal__actions {
		align-items: center;
		flex-direction: column;
		gap: 24px;
		margin-top: auto;
		padding-top: 0.75rem;
	}

	.ortega-btn.ortega-ask-brotega-modal__make {
		font-size: 15px;
		min-height: 48px;
		padding: 0.85rem 1.5rem;
		width: 100%;
	}

	.ortega-ask-brotega-modal__try,
	.ortega-ask-brotega-modal__try:hover,
	.ortega-ask-brotega-modal__try:focus-visible,
	.ortega-ask-brotega-modal__try:active {
		color: var(--ortega-abm-yellow);
	}

	.ortega-ask-brotega-modal__try.ortega-link-wavy::after {
		background-image: url("../images/ask-brotega-modal/wave-x-yellow.svg");
	}

	.ortega-ask-brotega-modal__try:focus-visible {
		outline-color: var(--ortega-abm-yellow);
	}
}

@media (prefers-reduced-motion: reduce) {
	.ortega-ask-brotega-modal.is-loading .ortega-ask-brotega-modal__recipe {
		opacity: 0.45;
	}
}
