/* Kukinas — widget "Receta — Detalle". */

.kk-recipe {
	background: var(--kk-canvas);
}

.kk-recipe p,
.kk-recipe h1,
.kk-recipe h2,
.kk-recipe h3,
.kk-recipe ul,
.kk-recipe ol,
.kk-recipe dl,
.kk-recipe dd {
	margin: 0;
}

/* ---------- Cabecera ---------- */

.kk-recipe__header {
	display: flex;
	flex-direction: column;
	gap: 26px;
	padding-block: 48px 40px;
}

.kk-recipe__heading {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 32px;
}

.kk-recipe__titles {
	display: flex;
	flex-direction: column;
	gap: 24px;
	max-width: 1060px;
}

.kk-recipe__note {
	flex: none;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	width: 172px;
	color: var(--kk-brand-text);
	font-family: var(--kk-font-hand);
	font-size: 29px;
	line-height: 1.05;
	text-align: center;
	transform: rotate(-5deg);
	transform-origin: center;
}

.kk-recipe__note-arrow {
	width: 46px;
	height: 46px;
	/* El SVG apunta a la izquierda; compensa también los -5° de la nota. */
	transform: rotate(-85deg);
}

/* ---------- Datos prácticos ---------- */

.kk-recipe .kk-recipe__facts {
	display: grid;
	grid-template-columns: repeat(var(--kk-facts, 4), minmax(0, 1fr));
	gap: 32px;
	margin: 20px 0 48px;
	padding: 28px 32px;
	background: var(--kk-surface);
	border: 1px solid var(--kk-border);
	border-radius: 20px;
}

.kk-recipe__facts[data-count="1"] { --kk-facts: 1; }
.kk-recipe__facts[data-count="2"] { --kk-facts: 2; }
.kk-recipe__facts[data-count="3"] { --kk-facts: 3; }

.kk-recipe__fact {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
}

.kk-recipe__fact-icon {
	width: 28px;
	height: 28px;
	color: var(--kk-brand-text);
}

.kk-recipe__fact dt {
	color: var(--kk-ink-2);
	font-size: 13px;
	line-height: 1.6;
}

.kk-recipe__fact dd {
	margin-top: 4px;
	color: var(--kk-ink);
	font-size: 20px;
	font-weight: 600;
	line-height: 1.6;
}

/* ---------- Ingredientes + preparación ---------- */

.kk-recipe__body {
	display: grid;
	grid-template-columns: 420px minmax(0, 1fr);
	gap: 64px;
	align-items: start;
	padding-bottom: 64px;
}

.kk-recipe__jump {
	display: none;
}

/* Mantel cuadriculado: bandas de 28 px y líneas finas, como en Pencil. */
.kk-recipe__ingredients {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 32px;
	border: 1px solid #e8cfc1;
	border-radius: 12px 40px 12px 40px;
	background-color: #fffaf4;
	background-image:
		linear-gradient(90deg, rgba(201, 31, 40, 0.06) 1px, transparent 1px),
		linear-gradient(rgba(201, 31, 40, 0.06) 1px, transparent 1px),
		linear-gradient(90deg, rgba(229, 43, 47, 0.035) 50%, transparent 50%),
		linear-gradient(rgba(229, 43, 47, 0.035) 50%, transparent 50%);
	background-size: 56px 56px;
	scroll-margin-top: 88px;
}

.kk-recipe__ing-title {
	color: var(--kk-cocoa);
	font-family: var(--kk-font-display);
	font-size: 36px;
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -0.8px;
}

.kk-recipe__yield {
	margin-top: -8px !important;
	color: var(--kk-ink-2);
	font-size: 13px;
	line-height: 1.6;
}

.kk-recipe__group {
	color: var(--kk-brand-text);
	font-family: var(--kk-font-body);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.6;
	letter-spacing: 0.4px;
}

.kk-recipe__ing-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 0;
	list-style: none;
}

.kk-recipe__ing-list li {
	position: relative;
	padding-left: 18px;
	color: var(--kk-cocoa);
	font-size: 16px;
	line-height: 1.65;
}

.kk-recipe__ing-list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.72em;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--kk-brand);
}

.kk-recipe__ing-list strong {
	font-weight: 700;
}

.kk-recipe__steps {
	display: flex;
	flex-direction: column;
	gap: 24px;
	scroll-margin-top: 88px;
}

.kk-recipe__steps-title {
	color: var(--kk-ink);
	font-family: var(--kk-font-display);
	font-size: 40px;
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -0.8px;
}

.kk-recipe__step-list {
	display: flex;
	flex-direction: column;
	gap: 24px;
	padding: 0;
	list-style: none;
}

.kk-recipe__step {
	display: flex;
	gap: 20px;
	padding-bottom: 22px;
	border-bottom: 1px solid var(--kk-border);
	scroll-margin-top: 88px;
}

.kk-recipe__step-num {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--kk-brand);
	color: #fff;
	font-size: 17px;
	font-weight: 700;
	line-height: 1;
}

.kk-recipe__step-body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
	padding-top: 6px;
}

.kk-recipe__step-title {
	color: var(--kk-ink);
	font-family: var(--kk-font-display);
	font-size: 24px;
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -0.8px;
}

.kk-recipe__step-text {
	color: var(--kk-ink);
	font-size: 16px;
	line-height: 1.6;
}

.kk-recipe__tip {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 28px;
	border-radius: 8px 28px 8px 28px;
	background: var(--kk-pink-50);
}

.kk-recipe__tip-title {
	color: var(--kk-brand-text);
	font-family: var(--kk-font-hand);
	font-size: 27px;
	line-height: 1.1;
}

.kk-recipe__tip-text {
	color: var(--kk-ink-2);
	font-size: 15px;
	line-height: 1.6;
}

/* ---------- Productos utilizados ---------- */

.kk-recipe__products {
	display: flex;
	flex-direction: column;
	gap: 24px;
	padding-block: 40px 56px;
}

.kk-recipe__products-title {
	color: var(--kk-ink);
	font-family: var(--kk-font-display);
	font-size: 34px;
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -0.8px;
}

.kk-recipe__product {
	display: flex;
	align-items: center;
	gap: 40px;
	padding: 28px 36px;
	border-radius: 24px 64px 24px 64px;
	background: var(--kk-oat-50);
}

.kk-recipe__product-img {
	flex: none;
	width: 220px;
	height: 190px;
	transform: rotate(-4deg);
}

.kk-recipe .kk-recipe__product-img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.kk-recipe__product-info {
	display: flex;
	flex-direction: column;
	gap: 12px;
	min-width: 0;
}

.kk-recipe__product-name {
	color: var(--kk-ink);
	font-family: var(--kk-font-display);
	font-size: 28px;
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -0.8px;
}

.kk-recipe__product-text {
	color: var(--kk-ink-2);
	font-size: 15px;
	line-height: 1.6;
}

.kk-recipe__product-link {
	display: inline-flex;
	align-items: center;
	align-self: flex-start;
	gap: 6px;
	color: var(--kk-brand-text);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.6;
	text-decoration: none;
}

.kk-recipe__product-link:hover {
	text-decoration: underline;
	text-underline-offset: 4px;
}

/* ---------- Tablet ---------- */

@media (max-width: 1024px) {
	.kk-recipe .kk-recipe__facts {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 24px;
	}

	.kk-recipe__facts[data-count="1"] {
		grid-template-columns: minmax(0, 1fr);
	}

	.kk-recipe__body {
		grid-template-columns: 340px minmax(0, 1fr);
		gap: 40px;
	}

	.kk-recipe__note {
		width: 140px;
		font-size: 24px;
	}
}

/* ---------- Celular: una columna, ingredientes antes de los pasos ---------- */

@media (max-width: 767px) {
	.kk-recipe__header {
		gap: 20px;
		padding-block: 28px 28px;
	}

	.kk-recipe__heading {
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
	}

	.kk-recipe__titles {
		gap: 16px;
	}

	.kk-recipe .kk-nov-lead {
		font-size: 16px;
	}

	.kk-recipe__note {
		flex-direction: row;
		align-self: flex-end;
		width: auto;
		font-size: 24px;
		text-align: right;
	}

	.kk-recipe__note-arrow {
		width: 36px;
		height: 36px;
	}

	.kk-recipe .kk-recipe__facts {
		gap: 20px 16px;
		margin: 20px 0 32px;
		padding: 20px;
	}

	.kk-recipe__fact {
		gap: 10px;
		align-items: flex-start;
	}

	.kk-recipe__fact-icon {
		width: 24px;
		height: 24px;
		margin-top: 2px;
	}

	.kk-recipe__fact dt {
		font-size: 14px;
	}

	.kk-recipe__fact dd {
		margin-top: 0;
		font-size: 17px;
	}

	.kk-recipe__body {
		grid-template-columns: minmax(0, 1fr);
		gap: 32px;
		padding-bottom: 40px;
	}

	/*
	 * Accesos persistentes: la barra es sticky dentro del cuerpo de la
	 * receta, ocupa su propio lugar en el flujo (no se superpone al
	 * contenido al cargar) y se suelta al terminar la preparación, así que
	 * nunca tapa el pie ni los productos.
	 */
	.kk-recipe__jump {
		position: sticky;
		top: var(--wp-admin--admin-bar--height, 0px);
		z-index: 20;
		display: flex;
		gap: 8px;
		margin-inline: calc(var(--kk-gutter) * -1);
		padding: 10px var(--kk-gutter);
		background: rgba(255, 248, 238, 0.96);
		border-bottom: 1px solid var(--kk-border);
		-webkit-backdrop-filter: blur(6px);
		backdrop-filter: blur(6px);
	}

	.kk-recipe__jump a {
		flex: 1 1 0;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		min-height: 44px;
		padding: 8px 12px;
		border: 1px solid var(--kk-border);
		border-radius: 999px;
		background: var(--kk-surface);
		color: var(--kk-ink);
		font-size: 16px;
		font-weight: 600;
		text-decoration: none;
	}

	.kk-recipe__jump a.is-active {
		background: var(--kk-brand);
		border-color: var(--kk-brand);
		color: #fff;
	}

	.kk-recipe__ingredients,
	.kk-recipe__steps,
	.kk-recipe__step {
		scroll-margin-top: calc(var(--wp-admin--admin-bar--height, 0px) + 80px);
	}

	.kk-recipe__ingredients {
		padding: 24px 20px;
	}

	.kk-recipe__ing-title {
		font-size: 30px;
	}

	.kk-recipe__steps-title {
		font-size: 32px;
	}

	.kk-recipe__yield,
	.kk-recipe__group,
	.kk-recipe__tip-text,
	.kk-recipe__product-text,
	.kk-recipe__product-link {
		font-size: 16px;
	}

	.kk-recipe__ing-list li,
	.kk-recipe__step-text {
		font-size: 17px;
	}

	.kk-recipe__step {
		gap: 14px;
	}

	.kk-recipe__step-num {
		width: 36px;
		height: 36px;
		font-size: 16px;
	}

	.kk-recipe__step-body {
		padding-top: 4px;
	}

	.kk-recipe__step-title {
		font-size: 21px;
	}

	.kk-recipe__tip {
		padding: 22px 20px;
	}

	.kk-recipe__products {
		padding-block: 24px 40px;
	}

	.kk-recipe__products-title {
		font-size: 28px;
	}

	.kk-recipe__product {
		flex-direction: column;
		align-items: flex-start;
		gap: 16px;
		padding: 24px 20px;
		border-radius: 16px 40px 16px 40px;
	}

	.kk-recipe__product-img {
		width: 160px;
		height: 140px;
		align-self: center;
	}

	.kk-recipe__product-name {
		font-size: 24px;
	}
}

/* ---------- Impresión: título, tiempos, ingredientes y pasos ---------- */

@media (max-width: 767px) {
	.kk-recipe__note { font-size: 20px; }
	.kk-recipe__note-arrow { width: 24px; height: 24px; }
	.kk-recipe__jump a { padding-inline: 8px; gap: 6px; }
}

@media print {
	.elementor-location-header,
	.elementor-location-footer,
	#wpadminbar,
	.site-header,
	.site-footer,
	.kk-nov-topbar,
	.kk-nov-tag,
	.kk-recipe__intro,
	.kk-recipe__note,
	.kk-recipe__photo,
	.kk-recipe__jump,
	.kk-recipe__tip,
	.kk-recipe__products,
	.kk-related,
	.kk-nov-toast {
		display: none !important;
	}

	html,
	body,
	.kk-recipe {
		background: #fff !important;
	}

	.kk-recipe {
		--kk-gutter: 0;
		color: #000;
	}

	.kk-recipe .kk-nov-wrap {
		max-width: none;
	}

	.kk-recipe__header {
		padding: 0 0 12pt;
	}

	.kk-recipe .kk-nov-title {
		font-size: 24pt;
		letter-spacing: 0;
	}

	.kk-recipe .kk-recipe__facts {
		grid-template-columns: repeat(var(--kk-facts, 4), minmax(0, 1fr)) !important;
		gap: 12pt;
		margin: 0 0 16pt;
		padding: 8pt 12pt;
		border: 1px solid #999;
		border-radius: 6pt;
	}

	.kk-recipe__fact-icon {
		display: none;
	}

	.kk-recipe__fact dt {
		font-size: 9pt;
	}

	.kk-recipe__fact dd {
		margin: 0;
		font-size: 11pt;
	}

	.kk-recipe__body {
		display: block;
		padding: 0;
	}

	.kk-recipe__ingredients {
		margin-bottom: 16pt;
		padding: 0;
		border: 0;
		background: none;
		break-inside: avoid;
	}

	.kk-recipe__ing-title,
	.kk-recipe__steps-title {
		font-size: 16pt;
		color: #000;
	}

	.kk-recipe__ing-list li,
	.kk-recipe__step-text {
		font-size: 11pt;
		color: #000;
	}

	.kk-recipe__step {
		padding-bottom: 8pt;
		break-inside: avoid;
	}

	.kk-recipe__step-num {
		width: 22pt;
		height: 22pt;
		border: 1px solid #000;
		background: none;
		color: #000;
		font-size: 10pt;
	}

	.kk-recipe__step-title {
		font-size: 12pt;
	}

	/* Si la plantilla tiene otras secciones de Elementor, tampoco se imprimen. */
	.elementor-location-single .e-con:not(:has(.kk-recipe)),
	.elementor-location-single .elementor-element:not(:has(.kk-recipe)):not(.kk-recipe *) {
		display: none !important;
	}
}
