/*
 * Default look for the Recipe Grid and Recipe Content modules, matching the
 * Cycle Vita reference design. Divi's own Design/Advanced tab options on
 * each module can still override colors/spacing/fonts per-instance -- these
 * rules are the out-of-the-box appearance.
 */

.cvr_recipe_grid__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.5em;
	margin-bottom: 1.5em;
}

.cvr_recipe_grid__search-wrap {
	position: relative;
	flex: 1 1 320px;
	display: flex;
	align-items: center;
	background: #d7f0e8;
	border-radius: 999px;
	padding: 0.35em 0.35em 0.35em 1.5em;
}

.cvr_recipe_grid__search {
	flex: 1;
	border: 0;
	background: transparent;
	outline: none;
	font-size: 1em;
	color: #1a1a1a;
	padding: 0.5em 0;
}

.cvr_recipe_grid__search::placeholder {
	color: #5a6b66;
}

.cvr_recipe_grid__search-button {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.5em;
	height: 2.5em;
	border: 0;
	border-radius: 50%;
	background: #4a9b8e;
	color: #fff;
	cursor: pointer;
}

.cvr_recipe_grid__search-button:hover {
	background: #3d8377;
}

.cvr_recipe_grid__filter-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5em;
}

.cvr_recipe_grid__filter-tab {
	border: 0;
	background: none;
	padding: 0;
	font-size: 1em;
	font-weight: 600;
	color: #1a1a1a;
	cursor: pointer;
}

.cvr_recipe_grid__filter-tab.is-active {
	color: #c2255c;
}

.cvr_recipe_grid__grid {
	display: grid;
	gap: 1.75em;
	grid-template-columns: repeat(3, 1fr);
}

.cvr_recipe_grid__grid--columns-2 {
	grid-template-columns: repeat(2, 1fr);
}

.cvr_recipe_grid__grid--columns-4 {
	grid-template-columns: repeat(4, 1fr);
}

@media ( max-width: 900px ) {
	.cvr_recipe_grid__grid,
	.cvr_recipe_grid__grid--columns-2,
	.cvr_recipe_grid__grid--columns-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media ( max-width: 600px ) {
	.cvr_recipe_grid__grid,
	.cvr_recipe_grid__grid--columns-2,
	.cvr_recipe_grid__grid--columns-4 {
		grid-template-columns: 1fr;
	}
}

.cvr_recipe_grid__card {
	display: block;
	text-decoration: none;
	color: inherit;
	background: #0f1e2e;
	border-radius: 20px;
	overflow: hidden;
	transition: transform 0.15s ease;
}

.cvr_recipe_grid__card:hover {
	transform: translateY(-2px);
}

.cvr_recipe_grid__card-image {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}

.cvr_recipe_grid__card-image img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
}

.cvr_recipe_grid__card-image::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(15, 30, 46, 0) 45%, rgba(15, 30, 46, 0.85) 100%);
	pointer-events: none;
}

.cvr_recipe_grid__card-arrow {
	position: absolute;
	top: 1em;
	right: 1em;
	z-index: 1;
	width: 2.25em;
	height: 2.25em;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f3dfab;
	color: #1a1a1a;
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.cvr_recipe_grid__card-body {
	padding: 1.5em;
}

.cvr_recipe_grid__card-title {
	margin: 0 0 0.5em;
	color: #fff;
	font-size: 1.25em;
	font-weight: 700;
	line-height: 1.3;
}

.cvr_recipe_grid__card-meta {
	margin: 0;
	color: #b7c2cc;
	font-size: 0.9em;
}

.cvr_recipe_grid__pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75em;
	margin-top: 2.5em;
}

.cvr_recipe_grid__page-link,
.cvr_recipe_grid__page-arrow {
	border: 0;
	background: none;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 1.75em;
	height: 1.75em;
	padding: 0 0.25em;
	font-size: 1em;
	font-weight: 600;
	color: #1a1a1a;
	cursor: pointer;
	border-radius: 50%;
}

.cvr_recipe_grid__page-link.is-active {
	color: #fff;
	background: #c2255c;
}

.cvr_recipe_grid__page-arrow {
	color: #1a1a1a;
}

.cvr_recipe_grid__page-arrow:disabled {
	color: #c6c6c6;
	cursor: default;
}

.cvr_recipe_grid__page-ellipsis {
	color: #1a1a1a;
}

.cvr_recipe_grid__empty {
	grid-column: 1 / -1;
}

.cvr_recipe_grid--loading {
	opacity: 0.6;
}

.cvr_recipe_grid__error {
	color: #b00020;
}

/* ---- Top: image + description/meta ---- */

.cvr_recipe_content__top {
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	gap: 2em;
	align-items: start;
	margin-bottom: 2.5em;
}

.cvr_recipe_content__image {
	position: relative;
	border-radius: 16px;
	overflow: hidden;
	padding-left: 6px;
	background: linear-gradient(180deg, #7c3aed, #c4b5fd);
}

.cvr_recipe_content__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0 14px 14px 0;
}

.cvr_recipe_content__description {
	color: #3a3a3a;
	line-height: 1.6;
}

.cvr_recipe_content__description p:first-child {
	margin-top: 0;
}

.cvr_recipe_content__meta {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 1em;
	margin-top: 1.5em;
}

.cvr_recipe_content__meta-item {
	display: flex;
	flex-direction: column;
	gap: 0.35em;
	background: #e6edf1;
	border-radius: 10px;
	padding: 0.9em 1.1em;
}

.cvr_recipe_content__meta-value {
	display: flex;
	align-items: center;
	gap: 0.5em;
	font-weight: 700;
	font-size: 20px;
	color: #16232b;
}

.cvr_recipe_content__meta-value svg {
	flex: 0 0 auto;
}

.cvr_recipe_content__meta-label {
	font-size: 16px;
	font-weight: 400;
	color: #5c6b73;
}

/* ---- Body: ingredients / method / video ---- */

.cvr_recipe_content__body {
	display: grid;
	grid-template-columns: minmax(0, 2.2fr) minmax(0, 3fr) minmax(0, 2.2fr);
	gap: 2em;
	align-items: start;
}

.cvr_recipe_content__ingredients h3,
.cvr_recipe_content__method-col h3 {
	margin: 0 0 0.9em;
	font-size: 1.75em;
	font-weight: 800;
	color: #16232b;
}

.cvr_recipe_content__ingredients {
	padding-right: 0;
}

.cvr_recipe_content__ingredients ul {
	list-style: none !important;
	margin: 0;
	padding: 0;
	color: #3a3a3a;
	line-height: 2;
}

.cvr_recipe_content__ingredients ul li {
	list-style: none !important;
}

.cvr_recipe_content__method-col {
	padding-left: 2em;
	padding-right: 2em;
	border-left: 2px solid #35c1ac;
}

.cvr_recipe_content__step {
	margin-bottom: 1.1em;
}

.cvr_recipe_content__step strong {
	display: block;
	color: #16232b;
	margin-bottom: 0.25em;
}

.cvr_recipe_content__step p {
	margin: 0;
	color: #3a3a3a;
	line-height: 1.6;
}

.cvr_recipe_content__disclaimer {
	display: flex;
	align-items: center;
	gap: 1.1em;
	border: 2px solid #35c1ac;
	border-radius: 12px;
	background: #f4fbfa;
	padding: 1.1em 1.5em;
	margin-top: 1.5em;
	color: #35c1ac;
}

.cvr_recipe_content__disclaimer span {
	color: #2b3a42;
	font-size: 16px;
	line-height: 1.55;
}

.cvr_recipe_content__disclaimer svg {
	flex: 0 0 auto;
}

/* ---- Video card ---- */

.cvr_recipe_content__video-col {
	width: 100%;
}

/* light panel the video sits inside; the expand button sits in the strip
   below the video rather than floating over it */
.cvr_recipe_content__video-frame {
	background: #e8edf2;
	border-radius: 16px;
	padding: 9px 9px 0;
}

.cvr_recipe_content__video-actions {
	display: flex;
	justify-content: flex-end;
	padding: 9px 0;
}

/*
 * Shape comes from the per-recipe Video Orientation setting, and stays the
 * same whether the card is idle or playing -- previously it sat at 3/4 then
 * snapped to 16/9 on play, which made the page jump.
 */
.cvr_recipe_content__video-card {
	position: relative;
	border-radius: 9px;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	/* shows through wherever the thumbnail does not cover -- while the image
	   loads, and behind videos that have no thumbnail at all */
	background: #005e8b;
}

.cvr_recipe_content__video-card.is-landscape {
	aspect-ratio: 16 / 9;
}

.cvr_recipe_content__video-card.is-portrait {
	aspect-ratio: 9 / 16;
	/* a full 9:16 column can run very tall on desktop; cap it so the video
	   never pushes the ingredients/method columns out of view */
	max-height: 78vh;
	margin: 0 auto;
}

.cvr_recipe_content__video-card iframe,
.cvr_recipe_content__video-card video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.cvr_recipe_content__video-trigger {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	padding: 0;
	margin: 0;
	cursor: pointer;
	background: none;
}

.cvr_recipe_content__video-thumb {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cvr_recipe_content__video-title {
	position: absolute;
	top: 0.9em;
	left: 0.9em;
	right: 0.9em;
	background: rgba(124, 58, 237, 0.85);
	color: #fff;
	font-weight: 700;
	font-size: 0.85em;
	line-height: 1.3;
	text-transform: uppercase;
	padding: 0.7em 0.9em;
	border-radius: 8px;
	text-align: center;
}

.cvr_recipe_content__video-play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: clamp( 56px, 26%, 96px );
	aspect-ratio: 1;
	height: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.9);
	color: #16232b;
	border-radius: 50%;
}

.cvr_recipe_content__video-expand {
	position: relative;
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 10px;
	background: #fbbb00;
	color: #000000;
	cursor: pointer;
	z-index: 1;
}

/* ---- "You might also like" banner ---- */

.cvr_recipe_content__related {
	position: relative;
	display: block;
	margin-top: 2.5em;
	min-height: 260px;
	border-radius: 12px;
	overflow: hidden;
	text-decoration: none;
	background-color: #00131c;
	background-size: cover;
	background-position: center right;
	background-repeat: no-repeat;
}

/*
 * Dark wash over the featured image so the title stays readable, fading out
 * towards the right where the design lets the photo show through.
 */
.cvr_recipe_content__related::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(
		90deg,
		#00131c 0%,
		#00131c 20%,
		rgba(0, 19, 28, 0.88) 34%,
		rgba(0, 19, 28, 0) 64%
	);
}

/* no photo to fade against, so the flat background colour is enough */
.cvr_recipe_content__related.is-imageless::before {
	background: none;
}

.cvr_recipe_content__related-inner {
	position: relative;
	display: block;
	max-width: 620px;
	padding: 44px 48px;
}

.cvr_recipe_content__related-label {
	display: block;
	margin-bottom: 10px;
	color: #fbbb00;
	font-weight: 700;
	font-size: 15px;
}

.cvr_recipe_content__related-title {
	display: block;
	margin-bottom: 26px;
	color: #ffffff;
	font-weight: 700;
	font-size: 34px;
	line-height: 1.2;
}

.cvr_recipe_content__related-btn {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	padding: 9px 9px 9px 26px;
	border-radius: 100px;
	background: #f9e5a2;
	color: #000000;
	font-weight: 700;
	font-size: 16px;
}

.cvr_recipe_content__related-btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 100px;
	background: #fbbb00;
	color: #000000;
}

/* mirrors the site-wide button behaviour: pill deepens, disc goes white */
.cvr_recipe_content__related:hover .cvr_recipe_content__related-btn {
	background: #f5d165;
}

.cvr_recipe_content__related:hover .cvr_recipe_content__related-btn-icon {
	background: #ffffff;
}

@media ( max-width: 700px ) {
	.cvr_recipe_content__related {
		min-height: 0;
	}

	/* the photo can't carry text at this width, so wash the whole thing */
	.cvr_recipe_content__related::before {
		background: linear-gradient( 180deg, rgba( 0, 19, 28, 0.95 ) 0%, rgba( 0, 19, 28, 0.82 ) 100% );
	}

	.cvr_recipe_content__related-inner {
		max-width: none;
		padding: 28px 24px;
	}

	.cvr_recipe_content__related-title {
		font-size: 24px;
	}
}

@media ( max-width: 900px ) {
	.cvr_recipe_content__body {
		grid-template-columns: 1fr;
		gap: 2.5em;
	}

	.cvr_recipe_content__ingredients,
	.cvr_recipe_content__method-col {
		border-right: 0;
		border-left: 0;
		padding-right: 0;
		padding-left: 0;
	}

	.cvr_recipe_content__ingredients {
		border-bottom: 2px solid #35c1ac;
		padding-bottom: 2em;
	}

	/* only landscape videos widen out when the columns stack -- forcing 16/9
	   here would squash a portrait video */
	.cvr_recipe_content__video-card.is-landscape {
		aspect-ratio: 16 / 9;
	}

	.cvr_recipe_content__video-card.is-portrait {
		max-height: 70vh;
	}
}

@media ( max-width: 700px ) {
	.cvr_recipe_content__top {
		grid-template-columns: 1fr;
	}

	.cvr_recipe_content__image {
		aspect-ratio: 16 / 9;
	}
}

@media ( max-width: 480px ) {
	.cvr_recipe_content__meta {
		grid-template-columns: 1fr;
	}
}

/* ---- Video modal ----
 * Mirrors the Tutorials grid modal used on the App Support page, with one
 * addition: the dialog takes the video's orientation so a portrait video is
 * not letterboxed into a 16:9 frame.
 */

.cvr_recipe_content__modal[hidden] {
	display: none;
}

.cvr_recipe_content__modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1.5em;
}

.cvr_recipe_content__modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 20, 30, 0.75);
}

.cvr_recipe_content__modal-dialog {
	position: relative;
	z-index: 1;
	width: 100%;
	max-width: 900px;
	aspect-ratio: 16 / 9;
	background: #005e8b;
	border-radius: 12px;
	overflow: hidden;
}

.cvr_recipe_content__modal-dialog.is-portrait {
	aspect-ratio: 9 / 16;
	/* height-led rather than width-led, so a tall dialog still fits the
	   viewport on a laptop */
	max-width: min( 460px, 100% );
	max-height: 88vh;
	width: auto;
	height: 88vh;
}

.cvr_recipe_content__modal-body {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.cvr_recipe_content__modal-body iframe,
.cvr_recipe_content__modal-body video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.cvr_recipe_content__modal-close {
	position: absolute;
	top: 0.5em;
	right: 0.5em;
	z-index: 2;
	width: 2.25em;
	height: 2.25em;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.9);
	color: #16232b;
	font-size: 1.4em;
	line-height: 1;
	cursor: pointer;
}
