/* -----------------------------------------------------------------------------
   IY Recipe — visual match for WP Recipe Maker “Meadow” on this site
   (see style.css: .wprm-recipe-container, --meadow-main-background-color: #78b500).
   Reference: recipe pages like wholemeal scones vs iy-recipes singles.
   ----------------------------------------------------------------------------- */

/* Hide Avada Page Title Bar on IY Recipe singles */
.single-iy_recipe .avada-page-titlebar-wrapper,
body.single-iy_recipe .fusion-page-title-bar {
	display: none !important;
}

.iy-recipe-single-wrap,
.iy-recipe-shell {
	width: 100%;
	max-width: min(1100px, 100%);
	margin-left: auto;
	margin-right: auto;
	padding: 0.5rem 0.75rem 2.5rem;
	box-sizing: border-box;
}

/* Match WPRM Meadow outer shell */
.iy-recipe-card {
	--iy-meadow-green: #78b500;
	--iy-meta-pill-green: #008c4a;
	--iy-recipe-border: #000;
	--iy-recipe-text: #111;
	box-sizing: border-box;
	font-family: "Lato", Arial, Helvetica, sans-serif;
	color: var(--iy-recipe-text);
	background: #fff;
	border: 1px solid var(--iy-recipe-border);
	border-radius: 20px;
	overflow: hidden;
	padding-bottom: 0;
	margin-bottom: 0;
}

.iy-recipe-card *,
.iy-recipe-card *::before,
.iy-recipe-card *::after {
	box-sizing: border-box;
}

/* Header: image | title + actions (WPRM-style top white band) */
.iy-recipe-card__header {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 1.5rem 2rem;
	padding: 1.5rem 1.75rem 1.35rem;
	background: #fff;
}

.iy-recipe-card__media {
	flex: 0 1 320px;
	max-width: 100%;
	align-self: flex-start;
}

.iy-recipe-card__media img,
.iy-recipe-card__thumb {
	width: 100%;
	height: auto;
	display: block;
	border-radius: 12px;
	vertical-align: middle;
}

.iy-recipe-card__heading {
	flex: 1 1 240px;
	min-width: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	padding-top: 0.15rem;
}

.iy-recipe-card__title {
	margin: 0 0 1rem;
	font-family: "Lato", Arial, Helvetica, sans-serif;
	font-size: clamp(1.5rem, 2.8vw, 2rem);
	font-weight: 700;
	line-height: 1.2;
	color: var(--iy-recipe-text);
	letter-spacing: -0.02em;
}

/*
 * Avada tags this h1 with .fusion-responsive-typography-calculated and sets font-size via JS
 * (inline style / data-fontsize), which overrides the clamp above — same class of issue as product
 * title fixes elsewhere in this theme.
 */
body.single-iy_recipe h1.iy-recipe-card__title.fusion-responsive-typography-calculated,
body.single-iy_recipe h1.iy-recipe-card__title[data-fontsize],
body.single-iy_recipe h1.iy-recipe-card__title[style*="font-size"],
body.single-iy_recipe h1.iy-recipe-card__title[style*="--fontSize"] {
	font-size: clamp(1.5rem, 2.8vw, 2rem) !important;
	line-height: 1.2 !important;
	font-weight: 700 !important;
	color: var(--iy-recipe-text) !important;
	letter-spacing: -0.02em !important;
	text-transform: none !important;
}

.iy-recipe-card__categories {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 0.5rem;
	margin: -0.35rem 0 1rem;
}

.iy-recipe-card__title + .iy-recipe-card__categories {
	margin-top: -0.65rem;
}

.iy-recipe-card__category {
	display: inline-block;
	padding: 0.2rem 0.65rem;
	font-family: "Lato", Arial, Helvetica, sans-serif;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--iy-meta-pill-green);
	background: rgba(0, 140, 74, 0.08);
	border-radius: 999px;
}

.iy-recipe-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	align-items: center;
}

/* Buttons like WPRM Print / Pin: light outline */
.iy-recipe-card__actions .iy-recipe-print-btn,
.iy-recipe-card__actions .iy-recipe-pin-btn {
	display: inline-block;
	padding: 0.45rem 1rem;
	font-family: "Lato", Arial, Helvetica, sans-serif;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	border: 1px solid var(--iy-recipe-border);
	background: #fff;
	color: var(--iy-recipe-text);
	border-radius: 6px;
	text-decoration: none;
	line-height: 1.35;
	transition: opacity 0.15s ease, background 0.15s ease;
}

.iy-recipe-card__actions .iy-recipe-print-btn:hover,
.iy-recipe-card__actions .iy-recipe-pin-btn:hover {
	opacity: 0.92;
	background: #fafafa;
}

/* Intro (editor) */
.iy-recipe-card__intro {
	padding: 0 1.75rem 1.1rem;
	font-size: 0.98rem;
	line-height: 1.6;
	font-family: "Lato", Arial, Helvetica, sans-serif;
}

.iy-recipe-card__intro > *:first-child {
	margin-top: 0;
}

/* Two columns — same green as WPRM Meadow main background */
.iy-recipe-card__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0;
	background: var(--iy-meadow-green);
	align-items: stretch;
	min-height: 0;
}

@media (max-width: 782px) {
	.iy-recipe-card__grid {
		grid-template-columns: 1fr;
	}
}

.iy-recipe-card__col {
	min-width: 0; /* allow grid columns to shrink so headings don’t bleed into the sibling column */
	padding: 1.35rem 1.5rem 1.6rem;
}

.iy-recipe-card__col-head {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin-bottom: 0.85rem;
	min-width: 0;
}

.iy-recipe-card__icon {
	display: inline-block;
	width: 36px;
	height: 36px;
	flex-shrink: 0;
	background: #fff;
	border-radius: 6px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.iy-recipe-card__icon--ingredients {
	background: #fff
		url("data:image/svg+xml,%3Csvg width='54' height='50' viewBox='0 0 54 50' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_135_292)'%3E%3Cpath d='M23.424 37.308L47.8222 23.0331C48.4587 22.6607 49.2988 22.8556 49.688 23.4903L49.9024 23.84C54.3182 31.0416 51.9199 40.3821 44.5475 44.6956C37.175 49.0091 27.6129 46.6664 23.197 39.4648L22.9826 39.115C22.6014 38.4933 22.8008 37.6727 23.4506 37.2925L23.424 37.308Z' stroke='%237e8644' stroke-width='2.0908' stroke-miterlimit='10'/%3E%3Cpath d='M40.0314 27.5907L40.0777 27.6662C41.5615 30.097 40.8505 33.1921 38.4703 34.5812C36.09 35.9702 32.9523 35.1247 31.4685 32.709L31.4221 32.6335' stroke='%237e8644' stroke-width='2.0908' stroke-miterlimit='10'/%3E%3Cpath d='M31.7641 21.797C30.373 24.3637 27.4054 25.8735 24.4378 25.5414C23.294 25.4055 22.2584 25.0431 21.3619 24.5147C20.4655 23.9862 19.2908 24.3486 18.9971 25.3451L18.0388 28.6365C17.8842 29.18 17.3123 29.482 16.7559 29.331L12.3354 28.1081C11.7789 27.9571 11.4698 27.3984 11.6244 26.8549L12.629 23.3823C12.9227 22.3707 12.0881 21.4648 11.0061 21.5252C10.2024 21.5705 9.38319 21.4799 8.57946 21.2535C3.64885 19.8795 1.31493 13.8553 5.13267 9.38625C6.98745 7.2121 10.0324 6.56288 12.7991 7.40838C12.8609 7.42348 12.9227 7.45367 12.9845 7.46877C14.5302 4.43403 18.1315 2.80342 21.5938 3.7697C25.056 4.73599 27.2508 7.96701 26.9417 11.3339C27.0499 11.3339 27.1736 11.3792 27.2818 11.4094C31.7178 12.6324 34.0517 17.5846 31.7796 21.7819L31.7641 21.797Z' stroke='%237e8644' stroke-width='2.0908' stroke-miterlimit='10'/%3E%3Cpath d='M42.5578 7.29608L38.3924 8.74175C37.6041 9.01534 37.1921 9.86134 37.4722 10.6314L38.9522 14.7003C39.2323 15.4703 40.0983 15.8727 40.8866 15.5991L45.0521 14.1535C45.8403 13.8799 46.2523 13.0339 45.9723 12.2639L44.4923 8.19495C44.2122 7.42493 43.3461 7.02249 42.5578 7.29608Z' stroke='%237e8644' stroke-width='2.0908' stroke-miterlimit='10'/%3E%3Cpath d='M12.9856 7.46869C12.9856 7.46869 17.9162 9.52205 17.1434 14.7913' stroke='%237e8644' stroke-width='2.0908' stroke-miterlimit='10' stroke-linecap='round'/%3E%3Cpath d='M8.36171 46.8107C11.6311 46.8107 14.2815 44.2218 14.2815 41.0281C14.2815 37.8345 11.6311 35.2455 8.36171 35.2455C5.09229 35.2455 2.44189 37.8345 2.44189 41.0281C2.44189 44.2218 5.09229 46.8107 8.36171 46.8107Z' stroke='%237e8644' stroke-width='2.0908' stroke-miterlimit='10'/%3E%3Cpath d='M33.6169 46.2672L34.467 39.8504' stroke='%237e8644' stroke-width='2.0908' stroke-miterlimit='10' stroke-linecap='round'/%3E%3Cpath d='M47.451 42.4926L44.3906 39.02' stroke='%237e8644' stroke-width='2.0908' stroke-miterlimit='10' stroke-linecap='round'/%3E%3Cpath d='M51.5317 32.1806L46.7866 31.6219' stroke='%237e8644' stroke-width='2.0908' stroke-miterlimit='10' stroke-linecap='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_135_292'%3E%3Crect width='53.201' height='48.7612' fill='white' transform='translate(0 0.308289)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E")
		center / 72% no-repeat;
}

.iy-recipe-card__icon--method {
	background: #fff
		url("data:image/svg+xml,%3Csvg width='43' height='51' viewBox='0 0 43 51' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_135_313)'%3E%3Cpath d='M1.16528 30.2541V23.2404H41.6085V30.2541C41.6085 40.0501 32.5532 47.9913 21.3869 47.9913C10.2206 47.9913 1.16528 40.0357 1.16528 30.2541Z' stroke='%237e8644' stroke-width='2.07453' stroke-miterlimit='10' stroke-linecap='round'/%3E%3Cpath d='M30.9519 6.32898C35.9163 7.15498 39.2502 8.69104 39.2502 10.43C39.2502 12.5457 34.4023 14.3281 27.6763 14.9657' stroke='%237e8644' stroke-width='2.07453' stroke-miterlimit='10' stroke-linecap='round'/%3E%3Cpath d='M15.7369 14.5456C9.47678 13.85 5.05103 12.1255 5.05103 10.1113C5.05103 7.7202 11.2529 5.7494 19.3328 5.40161' stroke='%237e8644' stroke-width='2.07453' stroke-miterlimit='10' stroke-linecap='round'/%3E%3Cpath d='M18.0688 23.2403L27.2261 1.95276' stroke='%237e8644' stroke-width='2.07453' stroke-miterlimit='10' stroke-linecap='round'/%3E%3Cpath d='M1.16528 27.5006H41.6231' stroke='%237e8644' stroke-width='2.07453' stroke-miterlimit='10' stroke-linecap='round'/%3E%3Cpath d='M11.9092 48.9042H31.0244' stroke='%237e8644' stroke-width='2.07453' stroke-miterlimit='10' stroke-linecap='round'/%3E%3Cpath d='M30.995 7.85065L29.7721 6.05374C29.7721 6.05374 29.743 5.89434 29.8158 5.85087L31.621 4.63361' stroke='%237e8644' stroke-width='2.07453' stroke-miterlimit='10' stroke-linecap='round'/%3E%3Cpath d='M14.9666 12.8646L16.2769 14.6036C16.2769 14.6036 16.306 14.763 16.2477 14.8064L14.5007 16.1107' stroke='%237e8644' stroke-width='2.07453' stroke-miterlimit='10' stroke-linecap='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_135_313'%3E%3Crect width='42.6884' height='49.3843' fill='white' transform='translate(0 0.793579)'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E")
		center / 70% no-repeat;
}

.iy-recipe-card__section-title {
	margin: 0;
	font-family: "Lato", Arial, Helvetica, sans-serif;
	font-size: 1.35rem;
	font-weight: 800;
	color: var(--iy-recipe-text);
	letter-spacing: -0.02em;
}

/*
 * Mid-width tablets/small laptops: two columns are narrow; section titles + icons
 * otherwise overflow and overlap (783px is the breakpoint above single-column layout).
 */
@media (min-width: 783px) and (max-width: 1181px) {
	.iy-recipe-card__section-title {
		flex: 1 1 auto;
		min-width: 0;
		font-size: clamp(1rem, 2.15vw, 1.22rem);
		line-height: 1.15;
	}

	.iy-recipe-card__icon {
		width: 32px;
		height: 32px;
	}

	/* Avada can set h2 font-size via JS (same pattern as main recipe title). */
	body.single-iy_recipe h2.iy-recipe-card__section-title.fusion-responsive-typography-calculated,
	body.single-iy_recipe h2.iy-recipe-card__section-title[data-fontsize],
	body.single-iy_recipe h2.iy-recipe-card__section-title[style*="font-size"],
	body.single-iy_recipe h2.iy-recipe-card__section-title[style*="--fontSize"] {
		font-size: clamp(1rem, 2.15vw, 1.22rem) !important;
		line-height: 1.15 !important;
	}
}

/* Ingredients: white panel, row dividers */
.iy-recipe-card__ingredients-box {
	background: #fff;
	border-radius: 12px;
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.iy-recipe-card__ingredient-row {
	padding: 0.7rem 1rem;
	font-family: "Lato", Arial, Helvetica, sans-serif;
	font-size: 0.95rem;
	line-height: 1.5;
	border-bottom: 1px solid #ddd;
	color: var(--iy-recipe-text);
}

.iy-recipe-card__ingredient-row:last-child {
	border-bottom: none;
}

.iy-recipe-card__ingredient-row--heading {
	font-weight: 700;
	background: #fbfbfb;
}

/* Method: numbered list on meadow green */
.iy-recipe-card__method-list {
	margin: 0;
	padding-left: 1.5rem;
	font-family: "Lato", Arial, Helvetica, sans-serif;
	font-size: 0.95rem;
	line-height: 1.6;
	color: var(--iy-recipe-text);
	list-style-position: outside;
}

.iy-recipe-card__method-list li {
	margin-bottom: 0.55rem;
	padding-left: 0.25rem;
}

.iy-recipe-card__method-list li:last-child {
	margin-bottom: 0;
}

.iy-recipe-card__method-list .iy-recipe-card__method-heading {
	list-style: none;
	margin-left: -1.5rem;
	padding-left: 0;
	margin-top: 0.8rem;
	margin-bottom: 0.35rem;
	font-weight: 700;
}

.iy-recipe-card__method-list .iy-recipe-card__method-heading:first-child {
	margin-top: 0;
}

.iy-recipe-card__method-list li::marker {
	font-weight: 700;
	color: var(--iy-recipe-text);
}

.iy-recipe-card__method-heading {
	margin-top: 0.8rem;
	margin-bottom: 0.35rem;
	font-weight: 700;
}

.iy-recipe-card__method-sections > :first-child.iy-recipe-card__method-heading {
	margin-top: 0;
}

/* Legacy shortcode fragments */
.iy-recipe-ingredients {
	margin: 0 0 1rem 1.1rem;
}

@media print {
	body * {
		visibility: hidden;
	}

	.iy-recipe-print-area,
	.iy-recipe-print-area * {
		visibility: visible;
	}

	.iy-recipe-print-area {
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		padding: 0.5rem;
	}

	.iy-recipe-card__actions {
		display: none !important;
	}
}
