/* Recipes (wpo-recipes) — the list in Wiedza and the recipe page in the Expert Zone shell.
   Uses the host's dashboard.css tokens (--wpo-ed-*), never brand hexes. Image rules start
   with .wpo-ed-app: WooCommerce's `.woocommerce-page img { height: auto }` reaches the
   account page and would win otherwise. */

/* --------------------------------------------- customer pages (outside the shell)
   The shell defines the --wpo-ed-* tokens on .wpo-ed-app; on the shop's own pages the
   same names come from the configurable palette (--wpo-ed-c-*, printed on :root by the
   host) with the shipped colours as the fallback. */

.wpo-rc-public {
	--wpo-ed-primary: var(--wpo-ed-c-primary, #1e5c93);
	--wpo-ed-primary-dark: var(--wpo-ed-c-primary-dark, #12456f);
	--wpo-ed-primary-soft: var(--wpo-ed-c-primary-soft, #eef4fa);
	--wpo-ed-primary-rgb: var(--wpo-ed-c-primary-rgb, 30, 92, 147);
	--wpo-ed-accent-dark: var(--wpo-ed-c-accent-dark, #a65018);
	--wpo-ed-accent-soft: var(--wpo-ed-c-accent-soft, #fff5ec);
	--wpo-ed-bg: #f8f9fa;
	--wpo-ed-card: #ffffff;
	--wpo-ed-text: #2d3748;
	--wpo-ed-muted: #a0aec0;
	--wpo-ed-line: #e2e8f0;
	--wpo-ed-radius: 15px;
	--wpo-ed-shadow: 0 3.5px 5.5px rgba(0, 0, 0, .04);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 22px;
	width: 100%;
	max-width: 1240px;
	margin: 0 auto;
	padding: 0 16px 64px;
	color: var(--wpo-ed-text);
}

.wpo-rc-public *,
.wpo-rc-public *::before,
.wpo-rc-public *::after { box-sizing: border-box; }

/* The theme styles bare elements; the recipe's own lists and headings start clean. */
.wpo-rc-public ul,
.wpo-rc-public ol { margin: 0; padding: 0; list-style: none; }
.wpo-rc-public h1,
.wpo-rc-public h2,
.wpo-rc-public h3 { letter-spacing: normal; text-transform: none; }

.wpo-rc-box {
	border-radius: var(--wpo-ed-radius);
	background: var(--wpo-ed-card);
	box-shadow: var(--wpo-ed-shadow);
}

.wpo-rc-public .wpo-rc-box { border: 1px solid var(--wpo-ed-line); box-shadow: none; }
.wpo-rc-public .wpo-rc-filters,
.wpo-rc-public .wpo-rc-card__link { border: 1px solid var(--wpo-ed-line); box-shadow: none; }

.wpo-rc-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* archive header + intro */
.wpo-rc-hero--archive { align-items: center; justify-content: center; text-align: center; }
.wpo-rc-hero--archive .wpo-rc-hero__title { text-transform: uppercase; }
.wpo-rc-hero__sub { margin: 0; font-size: 17px; font-weight: 600; }

.wpo-rc-intro { max-width: 860px; margin: 0 auto; text-align: center; font-size: 16px; line-height: 1.65; }
.wpo-rc-intro__title { margin: 0 0 8px; color: var(--wpo-ed-primary-dark); font-size: 24px; font-weight: 700; }
.wpo-rc-intro p { margin: 0 0 8px; }

.wpo-rc-pills { margin: 0; }

/* the recipe's expert banner (customer page) */
.wpo-rc-banner { border-radius: var(--wpo-ed-radius); overflow: hidden; }
:is(.wpo-ed-app, .wpo-rc-public) .wpo-rc-banner__img { display: block; width: 100%; height: auto; border-radius: 0; }

/* ----------------------------------------------------------------- pills */

.wpo-rc-pill {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 36px;
	padding: 6px 14px;
	border: 1px solid var(--wpo-ed-line);
	border-radius: 999px;
	background: var(--wpo-ed-card);
	color: var(--wpo-ed-text);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	white-space: nowrap;
}

.wpo-rc-pill .wpo-rc-icon { flex: 0 0 auto; color: var(--wpo-ed-primary); }

.wpo-rc-pill--back {
	border-color: var(--wpo-ed-primary);
	background: var(--wpo-ed-primary);
	color: #fff;
	transition: background-color .15s;
}

.wpo-rc-pill--back .wpo-rc-icon { color: #fff; }

.wpo-rc-pill--back:hover,
.wpo-rc-pill--back:focus-visible {
	border-color: var(--wpo-ed-primary-dark);
	background: var(--wpo-ed-primary-dark);
	color: #fff;
}

.wpo-rc-pill--pdf {
	margin-left: auto;
	border-color: transparent;
	background: var(--wpo-ed-primary-soft);
	color: var(--wpo-ed-primary);
	transition: background-color .15s;
}

.wpo-rc-pill--pdf:hover,
.wpo-rc-pill--pdf:focus-visible { background: rgba(var(--wpo-ed-primary-rgb), .16); color: var(--wpo-ed-primary); }

/* ----------------------------------------------------------------- list */

.wpo-rc-list { display: flex; flex-direction: column; gap: 16px; }

.wpo-rc-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	padding: 14px;
	border-radius: var(--wpo-ed-radius);
	background: var(--wpo-ed-card);
	box-shadow: var(--wpo-ed-shadow);
}

.wpo-rc-filters__field { flex: 0 1 200px; min-width: 0; }

.wpo-rc-filters__select,
.wpo-rc-filters__input {
	width: 100%;
	min-height: 42px;
	padding: 8px 14px;
	border: 1px solid var(--wpo-ed-line);
	border-radius: 999px;
	background: #fff;
	color: var(--wpo-ed-text);
	font: inherit;
	font-size: 14px;
}

.wpo-rc-filters__search { flex: 1 1 220px; min-width: 0; }

.wpo-rc-filters__select:focus,
.wpo-rc-filters__input:focus {
	border-color: var(--wpo-ed-primary);
	outline: 2px solid rgba(var(--wpo-ed-primary-rgb), .18);
	outline-offset: 0;
}

.wpo-rc-filters__reset {
	min-height: 42px;
	padding: 8px 16px;
	border: 0;
	border-radius: 999px;
	background: var(--wpo-ed-primary-soft);
	color: var(--wpo-ed-primary);
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.wpo-rc-filters__reset[hidden] { display: none; }

.wpo-rc-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 18px;
}

.wpo-rc-empty {
	margin: 0;
	padding: 28px;
	border-radius: var(--wpo-ed-radius);
	background: var(--wpo-ed-card);
	color: var(--wpo-ed-text);
	text-align: center;
}

.wpo-rc-empty[hidden] { display: none; }

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

.wpo-rc-card { min-width: 0; }
.wpo-rc-card[hidden] { display: none; }

.wpo-rc-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	border-radius: var(--wpo-ed-radius);
	background: var(--wpo-ed-card);
	box-shadow: var(--wpo-ed-shadow);
	color: var(--wpo-ed-text);
	text-decoration: none;
	overflow: hidden;
	transition: box-shadow .2s, transform .2s;
}

.wpo-rc-card__link:hover,
.wpo-rc-card__link:focus-visible {
	box-shadow: 0 10px 26px rgba(var(--wpo-ed-primary-rgb), .14);
	transform: translateY(-2px);
	color: var(--wpo-ed-text);
}

.wpo-rc-card__media {
	display: block;
	aspect-ratio: 4 / 3;
	background: var(--wpo-ed-primary-soft);
	overflow: hidden;
}

:is(.wpo-ed-app, .wpo-rc-public) .wpo-rc-card__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}

.wpo-rc-card__body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 6px;
	padding: 14px 16px 16px;
}

/* The author, like on the expert material cards: the portrait overlaps the picture. */
.wpo-rc-card__byline {
	order: -1; /* after the title in the markup (reading order), first on screen */
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	margin-bottom: 2px;
}

.wpo-rc-card__avatar {
	position: relative;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 58px;
	height: 58px;
	margin-top: -43px; /* half over the picture: 29px + the body's 14px top padding */
	border: 3px solid var(--wpo-ed-card);
	border-radius: 50%;
	background: #eef1f4;
	color: var(--wpo-ed-muted);
	box-shadow: 0 4px 12px rgba(0, 0, 0, .14);
	overflow: hidden;
}

.wpo-rc-card__avatar .wpo-rc-icon { width: 26px; height: 26px; }

:is(.wpo-ed-app, .wpo-rc-public) .wpo-rc-card__avatar-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}

.wpo-rc-card__author {
	color: #5b6472;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
}

.wpo-rc-card__kicker {
	color: var(--wpo-ed-primary);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.wpo-rc-card__title {
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.wpo-rc-card__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	margin-top: auto;
	padding-top: 6px;
	color: #4a5568;
	font-size: 13px;
}

.wpo-rc-card__fact { display: inline-flex; align-items: center; gap: 5px; }
.wpo-rc-card__fact .wpo-rc-icon { width: 15px; height: 15px; color: var(--wpo-ed-primary); }

/* ------------------------------------------------------------ the recipe */

.wpo-rc-recipe { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.wpo-rc-note {
	margin: 0;
	padding: 12px 16px;
	border-radius: 12px;
	background: var(--wpo-ed-accent-soft);
	color: var(--wpo-ed-accent-dark);
	font-weight: 600;
}

.wpo-rc-hero {
	position: relative;
	isolation: isolate;
	display: flex;
	align-items: flex-end;
	min-height: 320px;
	padding: 40px 44px;
	border-radius: var(--wpo-ed-radius);
	background: linear-gradient(135deg, var(--wpo-ed-primary) 0%, var(--wpo-ed-primary-dark) 100%);
	color: #fff;
	overflow: hidden;
}

:is(.wpo-ed-app, .wpo-rc-public) .wpo-rc-hero__img {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}

/* Darker at the bottom, where the title sits. */
.wpo-rc-hero.has-image::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(180deg, rgba(20, 20, 20, .05) 20%, rgba(20, 20, 20, .72) 100%);
}

.wpo-rc-hero__inner { display: flex; flex-direction: column; gap: 10px; max-width: 860px; min-width: 0; text-shadow: 0 1px 12px rgba(0, 0, 0, .3); }

.wpo-rc-hero__kicker { margin: 0; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

.wpo-rc-hero__title {
	margin: 0;
	font-size: clamp(26px, 1.5vw + 18px, 42px);
	font-weight: 700;
	line-height: 1.15;
	overflow-wrap: anywhere;
}

.wpo-rc-author { display: inline-flex; align-items: center; gap: 10px; margin: 2px 0 0; font-size: 15px; }
.wpo-rc-author__label { opacity: .85; }
.wpo-rc-author__name { font-weight: 700; }

/* In the Expert Zone the author leads to the author's page. */
.wpo-rc-author__link { display: inline-flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; }
.wpo-rc-author__link:hover .wpo-rc-author__name,
.wpo-rc-author__link:focus-visible .wpo-rc-author__name { text-decoration: underline; text-underline-offset: 3px; }
.wpo-rc-author__link:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; border-radius: 999px; }

.wpo-rc-author__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	border: 2px solid rgba(255, 255, 255, .9);
	border-radius: 50%;
	background: rgba(255, 255, 255, .18);
	color: #fff;
	overflow: hidden;
}

:is(.wpo-ed-app, .wpo-rc-public) .wpo-rc-author__img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }

.wpo-rc-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

.wpo-rc-layout {
	display: grid;
	grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
	gap: 18px;
	align-items: start;
}

.wpo-rc-layout > .wpo-rc-box { min-width: 0; padding: 22px 24px; }

.wpo-rc-h2 {
	margin: 0 0 14px;
	color: var(--wpo-ed-primary-dark);
	font-size: 22px;
	font-weight: 700;
	line-height: 1.25;
}

/* servings */
.wpo-rc-servings {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 16px;
	padding: 4px;
	border-radius: 999px;
	background: var(--wpo-ed-primary-soft);
}

.wpo-rc-servings__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--wpo-ed-primary);
	color: #fff;
	font: inherit;
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	transition: background-color .15s;
}

.wpo-rc-servings__btn:hover,
.wpo-rc-servings__btn:focus-visible { background: var(--wpo-ed-primary-dark); }
.wpo-rc-servings__btn:disabled { opacity: .35; cursor: default; }

.wpo-rc-servings__value { min-width: 92px; color: var(--wpo-ed-primary-dark); font-size: 15px; font-weight: 700; text-align: center; }

/* ingredients */
.wpo-rc-ing { margin: 0 0 6px; padding: 0; list-style: none; }

.wpo-rc-ing__group {
	margin: 16px 0 8px;
	color: var(--wpo-ed-primary-dark);
	font-size: 15px;
	font-weight: 700;
}

.wpo-rc-ing__row { border-bottom: 1px solid var(--wpo-ed-line); }
.wpo-rc-ing__row:last-child { border-bottom: 0; }

.wpo-rc-ing__label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 9px 0;
	font-size: 15px;
	line-height: 1.45;
	cursor: pointer;
}

.wpo-rc-ing__check {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 2px 0 0;
	accent-color: var(--wpo-ed-primary);
}

.wpo-rc-ing__qty { color: var(--wpo-ed-primary-dark); font-weight: 700; }

.wpo-rc-ing__check:checked + .wpo-rc-ing__text { color: var(--wpo-ed-muted); text-decoration: line-through; }
.wpo-rc-ing__check:checked + .wpo-rc-ing__text .wpo-rc-ing__qty { color: inherit; }

/* products used */
.wpo-rc-products { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--wpo-ed-line); }

.wpo-rc-products__title { margin: 0; color: var(--wpo-ed-primary-dark); font-size: 15px; font-weight: 700; }

.wpo-rc-product {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr);
	gap: 10px 12px;
	align-items: center;
	padding: 10px;
	border: 1px solid var(--wpo-ed-line);
	border-radius: 12px;
	background: #fff;
}

.wpo-rc-product__media { display: block; width: 64px; height: 64px; border-radius: 10px; background: var(--wpo-ed-bg); overflow: hidden; }
:is(.wpo-ed-app, .wpo-rc-public) .wpo-rc-product__img { display: block; width: 100%; height: 100%; object-fit: contain; border-radius: 0; }

.wpo-rc-product__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wpo-rc-product__name { font-size: 14px; font-weight: 700; line-height: 1.3; overflow-wrap: anywhere; }
.wpo-rc-product__qty { color: #4a5568; font-size: 13px; }
.wpo-rc-product__amount { color: var(--wpo-ed-primary-dark); font-weight: 700; }

.wpo-rc-product__btn {
	grid-column: 1 / -1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	padding: 8px 14px;
	border-radius: 999px;
	background: var(--wpo-ed-primary);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	transition: background-color .15s;
}

.wpo-rc-product__btn:hover,
.wpo-rc-product__btn:focus-visible { background: var(--wpo-ed-primary-dark); color: #fff; }

/* steps */
.wpo-rc-steps__list { margin: 0; padding: 0; list-style: none; counter-reset: none; }

.wpo-rc-steps__item {
	display: grid;
	grid-template-columns: 38px minmax(0, 1fr);
	gap: 14px;
	padding: 0 0 18px;
}

.wpo-rc-steps__item:last-child { padding-bottom: 0; }

.wpo-rc-steps__n {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--wpo-ed-primary-soft);
	color: var(--wpo-ed-primary);
	font-size: 17px;
	font-weight: 700;
}

.wpo-rc-steps__text { padding-top: 7px; font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }

/* similar */
.wpo-rc-similar { margin-top: 8px; }

.wpo-rc-missing,
.wpo-rc-locked { padding: 28px; }

/* -------------------------------------------------------------- responsive */

@media (max-width: 1000px) {
	.wpo-rc-layout { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 640px) {
	.wpo-rc-hero { min-height: 240px; padding: 26px 20px; }
	.wpo-rc-layout > .wpo-rc-box { padding: 18px 16px; }
	.wpo-rc-pill--pdf { margin-left: 0; }
	.wpo-rc-filters__field { flex: 1 1 100%; }
	.wpo-rc-bar .wpo-rc-pill { white-space: normal; }
	.wpo-rc-steps__item { grid-template-columns: 32px minmax(0, 1fr); gap: 12px; }
	.wpo-rc-steps__n { width: 32px; height: 32px; font-size: 15px; }
	.wpo-rc-steps__text { padding-top: 5px; font-size: 15px; }
}
