/* ==========================================================================
   Mijote Kitchen – recipe card
   Uses the Mijote theme colors when available, with fallbacks for any theme.
   ========================================================================== */

.mjk-card {
	--k-primary: var(--wp--preset--color--primary, #191917);
	--k-primary-dark: var(--wp--preset--color--primary-dark, #000000);
	--k-honey: var(--wp--preset--color--honey, #E3C52C);
	--k-lemon: var(--wp--preset--color--lemon, #F5DC42);
	--k-paprika: var(--wp--preset--color--paprika, #F15025);
	--k-oat: var(--wp--preset--color--oat, #FFFBEA);
	--k-flour: var(--wp--preset--color--flour, #FFFDF4);
	--k-mint: var(--wp--preset--color--mint, #2EC5B6);
	--k-ink: var(--wp--preset--color--ink, #191917);
	--k-ink-soft: var(--wp--preset--color--ink-soft, #555555);
	--k-line: var(--wp--preset--color--neutral-200, #F2F2F2);
	--k-sunset: var(--wp--preset--gradient--sunset, linear-gradient(118deg, #F5DC42 0%, #E3C52C 100%));
	--k-radius: 16px;
	--k-heading: var(--wp--preset--font-family--heading, Georgia, serif);

	position: relative;
	container-type: inline-size;
	container-name: mjkcard;
	margin-block: 2.5rem;
	padding: 6px;
	border-radius: calc(var(--k-radius) * 1.5);
	background: var(--k-sunset);
	color: var(--k-ink);
	scroll-margin-top: 140px;
}
.mjk-card > * {
	background: var(--k-flour);
}
.mjk-card > :first-child { border-radius: calc(var(--k-radius) * 1.5 - 6px) calc(var(--k-radius) * 1.5 - 6px) 0 0; }
.mjk-card > :last-child { border-radius: 0 0 calc(var(--k-radius) * 1.5 - 6px) calc(var(--k-radius) * 1.5 - 6px); }
.mjk-card *,
.mjk-card *::before { box-sizing: border-box; }
.mjk-icon { flex: none; }

/* Head */
.mjk-card__head {
	display: grid;
	grid-template-columns: 240px 1fr;
	gap: 1.75rem;
	padding: 1.75rem;
	align-items: start;
}
.mjk-card__head--noimg { grid-template-columns: 1fr; }
.mjk-card__image { margin: 0; }
.mjk-card__image img {
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: var(--k-radius);
	box-shadow: 8px 8px 0 var(--k-lemon);
}
.mjk-card__intro > * { margin: 0 0 .75rem; }
.mjk-card__author { font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--k-primary-dark); }
.mjk-card__title { font-family: var(--k-heading); font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.1; color: var(--k-ink); }
.mjk-card__rating { display: flex; align-items: center; gap: .5rem; font-size: .9rem; color: var(--k-ink-soft); }
.mjk-card__summary { color: var(--k-ink); line-height: 1.6; }
.mjk-card__summary p { margin: 0 0 .5rem; }
.mjk-card__actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1rem; }

/* Buttons */
.mjk-btn {
	box-sizing: border-box;
	background-origin: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .45rem;
	min-height: 44px;
	padding: .55rem 1.15rem;
	border: 2px solid transparent;
	border-radius: 999px;
	background: #fff;
	color: var(--k-ink);
	font: inherit;
	font-size: .95rem;
	font-weight: 700;
	line-height: 1.1;
	text-decoration: none;
	cursor: pointer;
	transition: transform .15s ease, background-color .15s ease;
}
.mjk-btn:hover { transform: translateY(-1px); }
.mjk-btn:focus-visible { outline: 3px solid #191917; outline-offset: 2px; }
/* Ask: yellow accent with dark text (no border, so the background doesn't restart at the edges), icon in a dark chip */
.mjk-btn--ask { gap: .6rem; padding: .3rem 1.15rem .3rem .4rem; border: 0; background: var(--k-sunset); color: var(--k-ink); box-shadow: 0 6px 16px rgba(25, 25, 23, .14); }
.mjk-btn--ask:hover { color: var(--k-ink); box-shadow: 0 8px 20px rgba(25, 25, 23, .2); }
.mjk-btn__chip { display: grid; place-items: center; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--k-ink); color: var(--k-lemon, #F5DC42); }
.mjk-btn__chip .mjk-icon { width: 20px; height: 20px; }
.mjk-btn--dark { background: var(--k-ink); color: #fff; }
.mjk-btn--dark:hover { color: #fff; background: #2a2a2a; }
.mjk-btn--outline { border-color: var(--k-ink); background: transparent; }
.mjk-btn--save { border-color: var(--k-ink); background: transparent; }
.mjk-btn--save svg { fill: none; }
.mjk-btn--save .mjk-save-on { display: none; }
.mjk-btn--save[aria-pressed="true"] { border-color: var(--k-paprika); color: var(--k-primary-dark); background: var(--k-oat); }
.mjk-btn--save[aria-pressed="true"] svg { fill: var(--k-paprika); stroke: var(--k-paprika); }
.mjk-btn--save[aria-pressed="true"] .mjk-save-on { display: inline; }
.mjk-btn--save[aria-pressed="true"] .mjk-save-off { display: none; }

/* One-click rating on the card */
.mjk-vote { flex-wrap: wrap; }
.mjk-vote__stars { --mjk-stars: 0%; position: relative; display: inline-flex; width: 8.2em; height: 1.55em; font-size: 1rem; }
.mjk-vote__stars::before {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, var(--k-honey, #E3C52C) var(--mjk-stars), #DDDDDD var(--mjk-stars));
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 22'%3E%3Cg%3E%3Cpath id='s' d='M11 1l3 6.6 7.2.8-5.4 4.9 1.5 7.1L11 16.8 4.7 20.4l1.5-7.1L.8 8.4 8 7.6z'/%3E%3Cuse href='%23s' x='24.5'/%3E%3Cuse href='%23s' x='49'/%3E%3Cuse href='%23s' x='73.5'/%3E%3Cuse href='%23s' x='98'/%3E%3C/g%3E%3C/svg%3E") left center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 22'%3E%3Cg%3E%3Cpath id='s' d='M11 1l3 6.6 7.2.8-5.4 4.9 1.5 7.1L11 16.8 4.7 20.4l1.5-7.1L.8 8.4 8 7.6z'/%3E%3Cuse href='%23s' x='24.5'/%3E%3Cuse href='%23s' x='49'/%3E%3Cuse href='%23s' x='73.5'/%3E%3Cuse href='%23s' x='98'/%3E%3C/g%3E%3C/svg%3E") left center / contain no-repeat;
	pointer-events: none;
}
.mjk-vote__stars button { position: relative; flex: 1; height: 100%; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer; border-radius: 4px; }
.mjk-vote__stars button:focus-visible { outline: 2px solid var(--k-ink); outline-offset: 1px; }
.mjk-vote.is-voted .mjk-vote__stars::before { background: linear-gradient(90deg, var(--k-honey, #E3C52C) var(--mjk-stars), #DDDDDD var(--mjk-stars)); }
.mjk-vote__text { font-size: .9rem; }
.mjk-vote__text b { color: var(--k-ink); }

/* Stars */
.mjk-stars {
	--mjk-stars: 0%;
	display: inline-block;
	width: 6.1em;
	height: 1.15em;
	background: linear-gradient(90deg, var(--k-honey, #E3C52C) var(--mjk-stars), #DDDDDD var(--mjk-stars));
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 22'%3E%3Cg%3E%3Cpath id='s' d='M11 1l3 6.6 7.2.8-5.4 4.9 1.5 7.1L11 16.8 4.7 20.4l1.5-7.1L.8 8.4 8 7.6z'/%3E%3Cuse href='%23s' x='24.5'/%3E%3Cuse href='%23s' x='49'/%3E%3Cuse href='%23s' x='73.5'/%3E%3Cuse href='%23s' x='98'/%3E%3C/g%3E%3C/svg%3E") left center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 22'%3E%3Cg%3E%3Cpath id='s' d='M11 1l3 6.6 7.2.8-5.4 4.9 1.5 7.1L11 16.8 4.7 20.4l1.5-7.1L.8 8.4 8 7.6z'/%3E%3Cuse href='%23s' x='24.5'/%3E%3Cuse href='%23s' x='49'/%3E%3Cuse href='%23s' x='73.5'/%3E%3Cuse href='%23s' x='98'/%3E%3C/g%3E%3C/svg%3E") left center / contain no-repeat;
	vertical-align: middle;
}

/* Time tiles */
.mjk-times {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: .75rem;
	margin: 0;
	padding: 0 1.75rem 1.25rem;
}
.mjk-times__tile { padding: .9rem .75rem; border-radius: 12px; background: #fff; text-align: center; box-shadow: 0 2px 10px rgba(19, 19, 19, .06); }
.mjk-times__tile dt { font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--k-ink-soft); }
.mjk-times__tile dd { margin: .25rem 0 0; font-family: var(--k-heading); font-size: 1.25rem; font-weight: 700; }

/* Pills */
.mjk-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 0; padding: 0 1.75rem 1.5rem; list-style: none; }
.mjk-pills li { padding: .4rem .9rem; border-radius: 999px; background: var(--k-ink); color: #fff; font-size: .85rem; font-weight: 700; }
.mjk-pills__label { color: var(--k-lemon); }

/* Tabs */
.mjk-tabs { display: flex; flex-wrap: wrap; gap: .6rem; padding: 0 1.75rem 1.5rem; }
.mjk-tabs a {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: .3rem;
	min-width: 88px;
	padding: .7rem .8rem .6rem;
	border: 2px solid var(--k-line);
	border-radius: 14px;
	background: #fff;
	color: var(--k-ink);
	font-size: .8rem;
	font-weight: 700;
	text-decoration: none;
}
.mjk-tabs a span { white-space: nowrap; overflow-wrap: normal; word-break: normal; }
.mjk-tabs a:hover { border-color: var(--k-honey); background: var(--k-oat); }
.mjk-tabs .mjk-icon { width: 26px; height: 26px; color: var(--k-primary); }

/* Sections */
.mjk-section { padding: .5rem 1.75rem 1.75rem; scroll-margin-top: 140px; }
.mjk-section__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1rem; margin-bottom: .75rem; }
.mjk-section__title {
	display: flex;
	align-items: center;
	gap: .6rem;
	margin: 0;
	font-family: var(--k-heading);
	font-size: 1.5rem;
	color: var(--k-ink);
}
.mjk-section__title::before { content: ""; width: 6px; height: 1.3em; border-radius: 4px; background: var(--k-sunset); }
.mjk-section__title small { font-family: inherit; font-size: .8rem; font-weight: 400; color: var(--k-ink-soft); }
.mjk-group-title { margin: 1.25rem 0 .5rem; font-size: 1.05rem; font-weight: 800; color: var(--k-primary-dark); }

/* Servings adjuster */
.mjk-adjust { display: inline-flex; align-items: center; gap: .25rem; padding: 4px; border-radius: 999px; background: #fff; box-shadow: 0 2px 10px rgba(19, 19, 19, .08); }
.mjk-adjust__btn { width: 36px; height: 36px; border: 0; border-radius: 50%; background: var(--k-lemon); color: var(--k-ink); font-size: 1.25rem; font-weight: 800; line-height: 1; cursor: pointer; }
.mjk-adjust__btn:hover { background: var(--k-honey); }
.mjk-adjust__value { min-width: 7.5em; text-align: center; font-weight: 700; font-size: .95rem; }

/* Ingredients */
.mjk-ingredient-list,
.mjk-equipment { margin: 0; padding: 0; list-style: none; }
.mjk-ingredient { border-bottom: 1px dashed #E2DED3; }
.mjk-ingredient label { display: block; padding: .6rem 0 .6rem 2.2rem; position: relative; cursor: pointer; line-height: 1.45; }
.mjk-ingredient__check { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mjk-ingredient label::before {
	content: "";
	position: absolute;
	left: 0;
	top: .65rem;
	width: 22px;
	height: 22px;
	border: 2px solid var(--k-honey);
	border-radius: 7px;
	background: #fff;
}
.mjk-ingredient__check:checked + label::before {
	background: var(--k-mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 70% no-repeat;
	border-color: var(--k-mint);
}
.mjk-ingredient__check:checked + label { color: var(--k-ink-soft); text-decoration: line-through; }
.mjk-ingredient__check:focus-visible + label::before { outline: 3px solid #191917; outline-offset: 2px; }
.mjk-ingredient__amount,
.mjk-ingredient__unit { font-weight: 800; }
.mjk-ingredient__note { color: var(--k-ink-soft); font-style: italic; }
.mjk-ingredient__note::before { content: "— "; }
.mjk-equipment li { padding: .35rem 0 .35rem 1.4rem; position: relative; }
.mjk-equipment li::before { content: ""; position: absolute; left: .2rem; top: .85rem; width: 8px; height: 8px; border-radius: 50%; background: var(--k-honey); }

/* Steps */
.mjk-step-list { margin: 0; padding: 0; list-style: none; }
.mjk-step { position: relative; padding: .4rem 0 1.1rem 3.2rem; }
.mjk-step::before {
	content: attr(data-n);
	position: absolute;
	left: 0;
	top: .25rem;
	display: grid;
	place-items: center;
	width: 2.2rem;
	height: 2.2rem;
	border-radius: 50%;
	background: var(--k-ink);
	color: #fff;
	font-weight: 800;
}
.mjk-step__text { line-height: 1.65; }
.mjk-step__time { display: inline-block; margin-top: .4rem; padding: .15rem .6rem; border-radius: 999px; background: var(--k-oat); font-size: .8rem; font-weight: 700; }
.mjk-step__image { margin: .75rem 0 0; }
.mjk-step__image img { border-radius: 12px; max-width: 100%; height: auto; }
.mjk-step:target::before { background: var(--k-primary); }

/* Cook mode switch */
.mjk-cookmode { display: inline-flex; align-items: center; gap: .5rem; font-weight: 700; font-size: .9rem; cursor: pointer; }
.mjk-cookmode[hidden] { display: none; }
.mjk-cookmode input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mjk-cookmode__switch { position: relative; width: 44px; height: 26px; border-radius: 999px; background: #CFCFCF; transition: background-color .2s ease; }
.mjk-cookmode__switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .2s ease; }
.mjk-cookmode input:checked + .mjk-cookmode__switch { background: var(--k-mint); }
.mjk-cookmode input:checked + .mjk-cookmode__switch::after { transform: translateX(18px); }
.mjk-cookmode input:focus-visible + .mjk-cookmode__switch { outline: 3px solid #191917; outline-offset: 2px; }
.mjk-cookmode small { font-weight: 400; color: var(--k-ink-soft); }

/* Video, notes, nutrition */
.mjk-video__frame iframe { width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; border-radius: 12px; }
.mjk-notes { line-height: 1.65; }
.mjk-notes p { margin: 0 0 .75rem; }
.mjk-nutrition__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .5rem; margin: 0; }
.mjk-nutrition__list div { padding: .6rem .8rem; border-radius: 10px; background: #fff; }
.mjk-nutrition__list dt { font-size: .75rem; color: var(--k-ink-soft); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.mjk-nutrition__list dd { margin: 0; font-weight: 800; }

/* Footer */
.mjk-card__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.25rem 1.75rem 1.75rem; border-top: 1px solid var(--k-line); }
.mjk-card__foot p { margin: 0; }

/* Ratings in comments */
.mjk-rate { margin: 0 0 1rem; padding: 0; border: 0; }
.mjk-rate legend { font-weight: 700; margin-bottom: .25rem; }
.mjk-rate__stars { display: inline-flex; flex-direction: row-reverse; gap: .15rem; }
.mjk-rate__stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mjk-rate__stars label {
	width: 32px;
	height: 32px;
	cursor: pointer;
	background: #DDDDDD;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M11 1l3 6.6 7.2.8-5.4 4.9 1.5 7.1L11 16.8 4.7 20.4l1.5-7.1L.8 8.4 8 7.6z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 22 22'%3E%3Cpath d='M11 1l3 6.6 7.2.8-5.4 4.9 1.5 7.1L11 16.8 4.7 20.4l1.5-7.1L.8 8.4 8 7.6z'/%3E%3C/svg%3E") center / contain no-repeat;
}
.mjk-rate__stars label:hover,
.mjk-rate__stars label:hover ~ label,
.mjk-rate__stars input:checked ~ label { background: var(--wp--preset--color--honey, #E3C52C); }
.mjk-rate__stars input:focus-visible + label { outline: 3px solid #191917; outline-offset: 2px; }
.mjk-comment-rating { margin: 0 0 .4rem; }

/* Responsive */
@media (max-width: 640px) {
	.mjk-card__head { grid-template-columns: 1fr; padding: 1.25rem; }
	.mjk-card__image { max-width: 260px; margin: 0 auto; }
	.mjk-card__intro { text-align: center; }
	.mjk-card__actions { justify-content: center; }
	.mjk-card__rating { justify-content: center; }
	.mjk-times, .mjk-pills, .mjk-tabs, .mjk-section { padding-left: 1.1rem; padding-right: 1.1rem; }
	.mjk-tabs { justify-content: center; }
	.mjk-tabs a { min-width: 0; flex: 1 1 0; padding-left: .25rem; padding-right: .25rem; font-size: .76rem; }
	.mjk-step { padding-bottom: .5rem; }
}

/* Narrow column (sidebar layout, tablets): stack the head like on phones. */
@container mjkcard (max-width: 620px) {
	.mjk-card__head { grid-template-columns: 1fr; padding: 1.25rem; }
	.mjk-card__image { max-width: 260px; margin: 0 auto; width: 100%; }
	.mjk-card__intro { text-align: center; }
	.mjk-card__actions, .mjk-card__rating, .mjk-tabs { justify-content: center; }
	.mjk-times, .mjk-pills, .mjk-tabs, .mjk-section { padding-left: 1.1rem; padding-right: 1.1rem; }
	.mjk-tabs a { min-width: 0; flex: 1 1 0; padding-left: .25rem; padding-right: .25rem; font-size: .76rem; }
}

@media (prefers-reduced-motion: reduce) {
	.mjk-btn, .mjk-cookmode__switch, .mjk-cookmode__switch::after { transition: none; }
	.mjk-btn:hover { transform: none; }
}

@media print {
	.mjk-card { background: none; padding: 0; }
	.mjk-card > * { background: none; }
	.mjk-card__actions, .mjk-tabs, .mjk-adjust, .mjk-cookmode, .mjk-card__foot, .mjk-video { display: none !important; }
	.mjk-ingredient label::before { border-color: #999; }
}
