/* ==========================================================================
   Cómo se prepara — estilos sobre Bootstrap 5 (Understrap)
   Inspirado en Kiwilimón: fondo gris verdoso, paneles blancos, títulos en
   mayúsculas, verde como color principal.
   ========================================================================== */

:root {
	--csp-bg: #f3f5f2;
	--csp-surface: #fff;
	--csp-ink: #2d322e;
	--csp-muted: #6a726b;
	--csp-line: #e2e7e1;
	--csp-green: #5b9a2a;
	--csp-green-dark: #3f7419;
	--csp-green-soft: #edf5e4;
	--csp-tomato: #e0532b;
	--csp-tomato-soft: #fdebe5;
	--csp-radius: 10px;
	--csp-shadow: 0 1px 2px rgba(30, 40, 30, .06), 0 2px 10px rgba(30, 40, 30, .04);
	--csp-font: "Source Sans 3", "Source Sans Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
}

body {
	background: var(--csp-bg);
	color: var(--csp-ink);
	font-family: var(--csp-font);
	font-size: 17px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}
a { color: var(--csp-green-dark); }
a:hover { color: var(--csp-green); }
h1, h2, h3, h4 { font-family: var(--csp-font); color: var(--csp-ink); }
.csp-icon { flex: none; vertical-align: -4px; }
.csp-skip:focus { position: fixed; top: 8px; left: 8px; z-index: 2000; background: #fff; padding: 8px 14px; border-radius: 6px; }

/* --- Header ------------------------------------------------------------ */
.csp-header { background: var(--csp-surface); border-bottom: 1px solid var(--csp-line); position: sticky; top: 0; z-index: 1020; }
.admin-bar .csp-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .csp-header { top: 0; position: relative; } }
.csp-header__bar { display: flex; align-items: center; gap: 16px; min-height: 64px; }
.csp-header__toggle { background: none; border: 0; padding: 6px; color: var(--csp-ink); }
.csp-logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--csp-ink); white-space: nowrap; }
.csp-logo:hover { color: var(--csp-ink); }
.csp-logo__mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--csp-green); color: #fff; }
.csp-logo__text { font-size: 21px; letter-spacing: -.01em; }
.csp-logo__text strong { color: var(--csp-green); font-weight: 800; }
.csp-search { flex: 1; display: flex; max-width: 560px; margin-left: auto; background: var(--csp-bg); border: 1px solid var(--csp-line); border-radius: 999px; overflow: hidden; }
.csp-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 9px 16px; font-size: 15px; font-style: italic; }
.csp-search input:focus { outline: none; font-style: normal; }
.csp-search:focus-within { border-color: var(--csp-green); box-shadow: 0 0 0 3px var(--csp-green-soft); }
.csp-search button { border: 0; background: var(--csp-green); color: #fff; padding: 0 16px; }
.csp-header__cta { align-items: center; padding: 8px 16px; border-radius: 999px; background: var(--csp-tomato); color: #fff; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .03em; text-decoration: none; white-space: nowrap; }
.csp-header__cta:hover { background: #c8441f; color: #fff; }
@media (max-width: 575px) {
	.csp-header__bar { flex-wrap: wrap; gap: 8px 12px; padding-block: 10px; }
	.csp-search { order: 3; flex-basis: 100%; max-width: none; }
	.csp-logo__text { font-size: 19px; }
}

.csp-nav { border-top: 1px solid var(--csp-line); }
.csp-nav__list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.csp-nav__list::-webkit-scrollbar { display: none; }
.csp-nav__list a { display: block; padding: 10px 12px; font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--csp-ink); text-decoration: none; white-space: nowrap; border-bottom: 3px solid transparent; }
.csp-nav__list a:hover, .csp-nav__list a[aria-current], .csp-nav__list .current-menu-item a { color: var(--csp-green-dark); border-bottom-color: var(--csp-green); }
@media (max-width: 991px) {
	.csp-nav__list { flex-direction: column; padding-block: 6px; }
	.csp-nav__list a { border-bottom: 0; }
}

/* --- Estructura -------------------------------------------------------- */
.csp-main { min-height: 60vh; }
.csp-page { padding-block: 16px 48px; }
.csp-panel { background: var(--csp-surface); border-radius: var(--csp-radius); box-shadow: var(--csp-shadow); padding: 24px; margin-bottom: 20px; }
@media (max-width: 575px) { .csp-panel { padding: 18px 16px; border-radius: 8px; } }
.csp-panel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.csp-h2 { font-size: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; margin: 0 0 12px; }
.csp-panel__head .csp-h2 { margin: 0; }
.csp-h3 { font-size: 16px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--csp-green-dark); margin: 18px 0 8px; }
.csp-section { margin-top: 32px; }
.csp-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.csp-section__title { font-size: 22px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; margin: 0 0 16px; }
.csp-section__title::before { content: "★ "; color: var(--csp-green); }
.csp-section__more { font-weight: 700; text-decoration: none; white-space: nowrap; }

.csp-breadcrumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0 0 12px; padding: 0; font-size: 13px; color: var(--csp-muted); }
.csp-breadcrumbs li + li::before { content: "›"; margin: 0 7px; color: #b3bab3; }
.csp-breadcrumbs a { color: var(--csp-muted); text-decoration: none; }
.csp-breadcrumbs a:hover { color: var(--csp-green-dark); }
.csp-breadcrumbs [aria-current] { color: var(--csp-green-dark); }

/* --- Botones y chips --------------------------------------------------- */
.csp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 11px 22px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; font-size: 14px; text-decoration: none; cursor: pointer; white-space: nowrap; }
.csp-btn--primary { background: var(--csp-green); color: #fff; }
.csp-btn--primary:hover { background: var(--csp-green-dark); color: #fff; }
.csp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border: 1px solid var(--csp-line); border-radius: 999px; background: var(--csp-surface); color: var(--csp-ink); font-size: 14px; font-weight: 600; line-height: 1.4; text-decoration: none; cursor: pointer; }
.csp-chip small { color: var(--csp-muted); font-weight: 400; }
.csp-chip:hover { border-color: var(--csp-green); color: var(--csp-green-dark); }
.csp-chip.is-selected { background: var(--csp-green); border-color: var(--csp-green); color: #fff; }
.csp-chip.is-selected small { color: rgba(255, 255, 255, .8); }
.csp-chip button { border: 0; background: none; color: inherit; padding: 0; line-height: 1; }
.csp-chip button .csp-icon { width: 14px; height: 14px; vertical-align: -2px; }
.csp-chip--tipo { background: var(--csp-green-soft); border-color: transparent; color: var(--csp-green-dark); }
.csp-chip--cocina { background: #fff6e0; border-color: transparent; color: #8a5a00; }
.csp-chip--dieta { background: #e8f3f4; border-color: transparent; color: #1f6b73; }
.csp-tags { display: flex; flex-wrap: wrap; gap: 8px; }

/* --- Imágenes y marcador sin foto ------------------------------------- */
.csp-img { display: block; width: 100%; height: 100%; object-fit: cover; }
.csp-card__media > .csp-img, .csp-recipe__media > .csp-img { position: absolute; inset: 0; }
/* Understrap fuerza img.wp-post-image { height: auto }: hay que ganarle en especificidad. */
img.csp-img { width: 100%; height: 100%; max-width: none; object-fit: cover; }
.csp-recipe__media { position: relative; }
.csp-placeholder { position: relative; display: grid; place-items: center; background:
	radial-gradient(circle at 25% 20%, hsla(var(--h), 70%, 92%, 1), transparent 60%),
	linear-gradient(135deg, hsl(var(--h), 45%, 86%), hsl(calc(var(--h) + 40), 50%, 78%)); color: hsl(var(--h), 35%, 32%); overflow: hidden; }
.csp-placeholder span { font-size: clamp(36px, 8vw, 72px); font-weight: 800; opacity: .55; }
.csp-placeholder .csp-icon { position: absolute; right: 10%; bottom: 10%; width: 22%; height: auto; opacity: .25; }

/* --- Tarjetas ---------------------------------------------------------- */
.csp-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 991px) { .csp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) { .csp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.csp-card { background: var(--csp-surface); border-radius: var(--csp-radius); box-shadow: var(--csp-shadow); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.csp-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(30, 40, 30, .12); }
.csp-card__link { display: flex; flex-direction: column; height: 100%; color: inherit; text-decoration: none; }
.csp-card__link:hover { color: inherit; }
.csp-card__media { position: relative; aspect-ratio: 4 / 3; background: var(--csp-line); }
.csp-card__match { position: absolute; left: 8px; bottom: 8px; background: rgba(255, 255, 255, .95); color: var(--csp-ink); font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.csp-card__match.is-full { background: var(--csp-green); color: #fff; }
.csp-card__body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 14px; flex: 1; }
.csp-card__kicker { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--csp-green); }
.csp-card__title { font-size: 15px; font-weight: 800; text-transform: uppercase; letter-spacing: .02em; line-height: 1.25; margin: 0; }
.csp-card__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: auto; padding-top: 6px; font-size: 13px; color: var(--csp-muted); }
.csp-card__meta .csp-icon { width: 16px; height: 16px; margin-right: 3px; vertical-align: -3px; }

.csp-difficulty { display: inline-flex; align-items: center; gap: 5px; }
.csp-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 13px; }
.csp-bars i { width: 4px; background: var(--csp-line); border-radius: 1px; }
.csp-bars i:nth-child(1) { height: 6px; }
.csp-bars i:nth-child(2) { height: 9px; }
.csp-bars i:nth-child(3) { height: 13px; }
.csp-bars i.on { background: var(--csp-green); }

/* --- Carrusel de categorías ------------------------------------------- */
.csp-rail { display: flex; gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 8px; margin-top: 18px; scrollbar-width: thin; }
.csp-rail__item { flex: 0 0 auto; width: 104px; scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; color: var(--csp-ink); text-decoration: none; }
.csp-rail__img { width: 88px; height: 88px; border-radius: 12px; overflow: hidden; box-shadow: var(--csp-shadow); transition: transform .15s ease; }
.csp-rail__item:hover .csp-rail__img { transform: scale(1.04); }
.csp-rail__img .csp-placeholder span { font-size: 34px; }
.csp-rail__label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; line-height: 1.2; }
.csp-rail__count { font-size: 12px; color: var(--csp-muted); margin-top: -4px; }
.csp-rail--lg .csp-rail__item { width: 136px; }
.csp-rail--lg .csp-rail__img { width: 128px; height: 128px; border-radius: 50%; }

/* --- Portada ----------------------------------------------------------- */
.csp-hero { background:
	radial-gradient(circle at 85% 10%, rgba(224, 83, 43, .12), transparent 40%),
	radial-gradient(circle at 10% 90%, rgba(91, 154, 42, .18), transparent 45%), var(--csp-green-soft);
	padding: 48px 0 40px; border-bottom: 1px solid var(--csp-line); }
.csp-hero__title { font-size: clamp(30px, 5vw, 46px); font-weight: 800; text-transform: uppercase; letter-spacing: .01em; line-height: 1.05; margin: 0 0 10px; }
.csp-hero__lead { font-size: 19px; color: var(--csp-muted); max-width: 640px; margin-bottom: 22px; }

/* --- Buscador por ingredientes ---------------------------------------- */
.csp-finder { position: relative; max-width: 820px; }
.csp-finder__box { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; background: var(--csp-surface); border: 2px solid var(--csp-green); border-radius: 16px; padding: 6px 6px 6px 10px; box-shadow: 0 6px 24px rgba(63, 116, 25, .12); }
.csp-finder__chips { display: contents; list-style: none; }
.csp-finder__input { flex: 1 1 200px; min-width: 120px; border: 0; padding: 10px 6px; font-size: 17px; background: transparent; }
.csp-finder__input:focus { outline: none; }
.csp-finder__list { position: absolute; z-index: 50; left: 0; right: 0; top: calc(100% + 4px); list-style: none; margin: 0; padding: 6px; background: var(--csp-surface); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .15); max-height: 320px; overflow: auto; }
.csp-finder__list li { padding: 8px 12px; border-radius: 8px; cursor: pointer; display: flex; justify-content: space-between; }
.csp-finder__list li small { color: var(--csp-muted); }
.csp-finder__list li[aria-selected="true"], .csp-finder__list li:hover { background: var(--csp-green-soft); }
.csp-finder__suggest { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; color: var(--csp-muted); }
.csp-finder--compact .csp-finder__box { border-width: 1px; border-color: var(--csp-line); box-shadow: none; border-radius: 12px; }
.csp-finder--compact .csp-finder__box:focus-within { border-color: var(--csp-green); }
.csp-finder--compact .csp-finder__input { font-size: 15px; padding: 7px 4px; }
.csp-finder--compact .csp-btn { padding: 9px 14px; }
@media (max-width: 575px) {
	.csp-finder__box .csp-btn { flex-basis: 100%; }
}
.csp-aside .csp-finder--compact .csp-btn span { display: none; }

/* --- Listados ---------------------------------------------------------- */
.csp-listing__title { font-size: clamp(24px, 3.4vw, 30px); font-weight: 800; text-transform: uppercase; letter-spacing: .02em; margin: 0 0 6px; }
.csp-listing__desc { color: var(--csp-muted); max-width: 760px; }
.csp-listing__desc p:last-child { margin-bottom: 0; }
.csp-filters { padding-block: 18px; }
.csp-filters__row { display: grid; gap: 10px; margin-top: 14px; }
.csp-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.csp-filter__label { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--csp-muted); margin-right: 4px; }
.csp-filter .csp-chip { font-size: 13px; padding: 4px 11px; }
.csp-results__count { color: var(--csp-muted); margin: 4px 0 14px; }
.csp-empty { text-align: center; padding: 40px 24px; }
.csp-pagination { margin-top: 28px; }
.csp-pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.csp-pagination .page-numbers { display: inline-block; min-width: 40px; padding: 8px 12px; text-align: center; border-radius: 8px; background: var(--csp-surface); box-shadow: var(--csp-shadow); text-decoration: none; font-weight: 700; color: var(--csp-ink); }
.csp-pagination .page-numbers.current { background: var(--csp-green); color: #fff; }

/* --- Receta ------------------------------------------------------------ */
.csp-recipe__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; padding: 0; overflow: hidden; }
.csp-recipe__media { aspect-ratio: 4 / 3; background: var(--csp-line); }
.csp-recipe__media .csp-placeholder span { font-size: 96px; }
.csp-recipe__intro { padding: 28px 28px 24px 0; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 767px) {
	.csp-recipe__head { grid-template-columns: 1fr; gap: 0; }
	.csp-recipe__intro { padding: 20px 16px; }
}
.csp-recipe__title { font-size: clamp(26px, 3.6vw, 36px); font-weight: 800; text-transform: uppercase; letter-spacing: .01em; line-height: 1.1; margin: 0; }
.csp-recipe__summary { color: var(--csp-muted); margin: 0; }
.csp-facts { display: flex; flex-wrap: wrap; gap: 10px 24px; list-style: none; margin: 0; padding: 12px 0; border-block: 1px solid var(--csp-line); }
.csp-facts li { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.csp-facts .csp-icon { color: var(--csp-green); width: 22px; height: 22px; }
.csp-facts small { display: block; color: var(--csp-muted); font-size: 12px; }
.csp-facts .csp-bars { height: 16px; }
.csp-facts .csp-bars i { width: 5px; }
.csp-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; }
.csp-action { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; min-width: 66px; padding: 8px 6px; border: 0; border-radius: 8px; background: transparent; color: var(--csp-muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .03em; text-decoration: none; }
.csp-action:hover { background: var(--csp-green-soft); color: var(--csp-green-dark); }
.csp-action.is-done { color: var(--csp-green); }

.csp-prose { font-size: 18px; }
.csp-prose h2 { font-size: 18px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; margin-top: 1.4em; }
.csp-prose > :last-child { margin-bottom: 0; }
.csp-prose iframe, .csp-prose .wp-block-embed { max-width: 100%; }

.csp-servings { display: inline-flex; align-items: center; gap: 4px; background: var(--csp-bg); border-radius: 999px; padding: 3px; }
.csp-servings button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--csp-surface); color: var(--csp-green-dark); box-shadow: var(--csp-shadow); }
.csp-servings button:hover { background: var(--csp-green); color: #fff; }
.csp-servings output { padding: 0 8px; font-size: 15px; }

.csp-checklist { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; }
@media (max-width: 767px) { .csp-checklist { columns: 1; } }
.csp-checklist li { break-inside: avoid; position: relative; padding: 7px 0 7px 34px; border-bottom: 1px dashed var(--csp-line); }
.csp-checklist input { position: absolute; left: 0; top: 9px; width: 22px; height: 22px; appearance: none; border: 2px solid #c6cec5; border-radius: 50%; cursor: pointer; }
.csp-checklist input:checked { background: var(--csp-green) 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' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: var(--csp-green); }
.csp-checklist input:focus-visible { outline: 3px solid var(--csp-green-soft); }
.csp-checklist label { cursor: pointer; }
.csp-checklist input:checked + label { color: var(--csp-muted); text-decoration: line-through; }
.csp-qty { color: var(--csp-green-dark); }

.csp-steps__list { list-style: none; margin: 0; padding: 0; }
.csp-step { display: flex; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--csp-line); cursor: pointer; }
.csp-step:last-child { border-bottom: 0; }
.csp-step__num { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--csp-green); color: #fff; font-weight: 800; font-size: 17px; }
.csp-step__body p { margin: 5px 0 0; font-size: 17px; }
.csp-step__img { margin-top: 10px; border-radius: 8px; max-width: 100%; }
.csp-step.is-done { opacity: .5; }
.csp-step.is-done .csp-step__num { background: var(--csp-muted); }
.csp-steps__end { margin: 16px 0 0; font-weight: 700; color: var(--csp-green-dark); }

.csp-mini-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.csp-mini-list a { display: flex; align-items: center; gap: 12px; color: var(--csp-ink); text-decoration: none; font-weight: 700; line-height: 1.25; }
.csp-mini-list a:hover { color: var(--csp-green-dark); }
.csp-mini-list .csp-img { flex: none; width: 64px; height: 64px; border-radius: 8px; }
.csp-mini-list .csp-placeholder span { font-size: 24px; }
@media (min-width: 992px) { .csp-aside > .csp-panel:last-child { position: sticky; top: 130px; } }

.csp-comments .comment-reply-title, .csp-comments .comments-title { font-size: 18px; font-weight: 800; text-transform: uppercase; }

/* --- Pie --------------------------------------------------------------- */
.csp-footer { background: #263028; color: #c9d1ca; padding: 40px 0 20px; margin-top: 40px; font-size: 15px; }
.csp-logo--light, .csp-logo--light:hover { color: #fff; }
.csp-logo--light .csp-logo__text strong { color: #9fd36a; }
.csp-footer__about { margin-top: 12px; max-width: 320px; }
.csp-footer__title { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: #fff; margin-bottom: 10px; }
.csp-footer__list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.csp-footer a { color: #c9d1ca; text-decoration: none; }
.csp-footer a:hover { color: #fff; }
.csp-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 28px; padding-top: 16px; font-size: 13px; }
.csp-footer__menu { display: flex; gap: 16px; list-style: none; margin: 0; padding: 0; }

/* --- Impresión: solo la receta ---------------------------------------- */
@media print {
	.csp-header, .csp-footer, .csp-breadcrumbs, .csp-actions, .csp-aside, .csp-section, .csp-comments, .csp-related-ingredients, .csp-servings, #wpadminbar { display: none !important; }
	body { background: #fff; font-size: 12pt; }
	.csp-panel { box-shadow: none; padding: 0; margin-bottom: 14pt; }
	.csp-recipe__head { grid-template-columns: 1fr 2fr; }
	.csp-recipe__intro { padding: 0; }
	.col-lg-8 { width: 100%; }
	.csp-checklist input { display: none; }
	.csp-checklist li { padding-left: 0; }
	.csp-step { break-inside: avoid; }
}
