/* ==========================================================================
   Tutoriales — /tutoriales/ y /tutoriales/{id}/ (page-templates/tutoriales-nudge.php)
   Solo variables y piezas del sitio (home-nudge.css): sirve igual en modo claro y oscuro.
   Celular primero; el escritorio arranca en 768px.
   ========================================================================== */

/* ---------- Portada: hero y buscador ---------- */

.nh-tut-hero { gap: 18px; padding-bottom: 28px; }
.nh-tut-hero__titulo { max-width: 15em; font-size: clamp(34px, 9.4vw, 44px); }
.nh-tut-buscar {
	position: relative; width: 100%; max-width: 560px; margin: 4px 0 0;
}
.nh-tut-buscar > svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); color: var(--nh-texto-2); pointer-events: none; }
.nh-body .nh-tut-buscar input {
	width: 100%; min-height: 52px; padding: 0 18px 0 50px; border-radius: var(--nh-pill);
	border: 1px solid var(--nh-borde-3); background: var(--nh-superficie); color: var(--nh-texto);
	font: 500 16px/1.2 var(--nh-sans); -webkit-appearance: none; appearance: none;
}
.nh-body .nh-tut-buscar input::placeholder { color: var(--nh-texto-4); opacity: 1; }
.nh-body .nh-tut-buscar input:focus { outline: 2px solid var(--nh-oro); outline-offset: 1px; border-color: var(--nh-oro); }
.nh-tut-buscar input::-webkit-search-cancel-button { cursor: pointer; }
.nh-tut-hero__cuenta { font-size: 14px; color: var(--nh-texto-2); }
.nh-tut-hero__cuenta strong { color: var(--nh-texto); }

/* ---------- Portada: filtros y categorías ---------- */

.nh-tut-lista { padding-bottom: var(--nh-seccion-y); }
.nh-tut-chips {
	display: flex; gap: 8px; margin: 0 calc(var(--nh-gutter) * -1); padding: 2px var(--nh-gutter) 6px;
	overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.nh-tut-chips::-webkit-scrollbar { display: none; }
.nh-body .nh-tut-chip {
	flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 16px;
	border-radius: var(--nh-pill); border: 1px solid var(--nh-borde-3); background: transparent; color: var(--nh-texto-3);
	font: 600 14px/1 var(--nh-sans); cursor: pointer; transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}
.nh-tut-chip span { font-size: 12px; font-weight: 700; color: var(--nh-texto-4); }
.nh-body .nh-tut-chip:hover { border-color: var(--nh-acento); color: var(--nh-texto); }
.nh-body .nh-tut-chip[aria-pressed="true"] { background: var(--nh-oro); border-color: var(--nh-oro); color: var(--nh-negro); }
.nh-tut-chip[aria-pressed="true"] span { color: var(--nh-oro-tinta); }

.nh-tut-estado { min-height: 20px; margin: 10px 0 6px; font-size: 14px; color: var(--nh-texto-2); }
.nh-tut-estado:empty { margin-block: 6px 0; min-height: 0; }

.nh-tut-cats { display: grid; gap: 14px; margin-top: 12px; }
.nh-tut-cat {
	padding: 22px 20px 12px; border: 1px solid var(--nh-borde); border-radius: var(--nh-radio-card);
	background: var(--nh-superficie); scroll-margin-top: calc(var(--nh-header-alto) + 16px);
}
.nh-tut-cat[hidden] { display: none; }
.nh-tut-cat__cab { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.nh-tut-cat__ico {
	width: 44px; height: 44px; flex: none; display: flex; align-items: center; justify-content: center;
	border-radius: 14px; background: var(--nh-chip); color: var(--nh-acento);
}
.nh-tut-cat__n { font-size: 12.5px; font-weight: 700; letter-spacing: .04em; color: var(--nh-texto-4); }
.nh-tut-cat__tit { font-family: var(--nh-serif); font-size: 24px; font-weight: 500; letter-spacing: -0.015em; line-height: 1.15; color: var(--nh-texto); }
.nh-tut-cat__desc { margin-top: 6px; font-size: 14.5px; line-height: 1.5; color: var(--nh-texto-2); }
.nh-tut-cat__lista { margin-top: 12px; }
.nh-tut-cat__lista li[hidden] { display: none; }
.nh-tut-cat__lista li + li { border-top: 1px solid var(--nh-borde); }
.nh-body .nh-tut-item {
	display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 10px 0;
	color: var(--nh-texto-suave); text-decoration: none; font-size: 15.5px; font-weight: 600; line-height: 1.35;
}
.nh-tut-item__tit { flex: 1 1 auto; min-width: 0; }
.nh-tut-item__min { flex: none; font-size: 12.5px; font-weight: 600; color: var(--nh-texto-4); white-space: nowrap; }
.nh-tut-item > svg { flex: none; color: var(--nh-texto-4); transition: transform .15s ease, color .15s ease; }
.nh-body .nh-tut-item:hover { color: var(--nh-texto); }
.nh-body .nh-tut-item:hover > svg { color: var(--nh-acento); transform: translateX(3px); }
.nh-tut-item mark { background: rgba(212, 168, 67, .28); color: inherit; border-radius: 3px; padding: 0 1px; }

.nh-tut-badge {
	display: inline-block; margin-left: 4px; padding: 3px 8px; border-radius: var(--nh-pill); vertical-align: 2px;
	background: var(--nh-oro); color: var(--nh-negro); font-size: 10.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; line-height: 1.2;
}

.nh-tut-vacio {
	margin-top: 12px; padding: 28px 22px; border: 1px dashed var(--nh-borde-3); border-radius: var(--nh-radio-card);
	display: flex; flex-direction: column; align-items: flex-start; gap: 10px; font-size: 15px; color: var(--nh-texto-2);
}
.nh-tut-vacio[hidden] { display: none; }
.nh-tut-vacio__tit { font-size: 18px; font-weight: 700; color: var(--nh-texto); }
.nh-tut-vacio .nh-btn { margin-top: 6px; display: inline-flex; }

/* ---------- Un tutorial ---------- */

.nh-tut-cab__in { gap: 16px; padding-bottom: 8px; }
.nh-tut-migas { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 14px; font-weight: 600; color: var(--nh-texto-4); }
.nh-body .nh-tut-migas a { color: var(--nh-acento); text-decoration: none; }
.nh-body .nh-tut-migas a:hover { text-decoration: underline; text-underline-offset: 3px; }
.nh-tut-cab__titulo { max-width: 20em; font-size: clamp(32px, 8.6vw, 40px); line-height: 1.08; }
.nh-tut-cab__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: 14px; color: var(--nh-texto-2); }
.nh-tut-cab__cat { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; color: var(--nh-texto-3); }
.nh-tut-cab__cat svg { width: 18px; height: 18px; color: var(--nh-acento); }
.nh-tut-cab__meta .nh-tut-badge { margin-left: 0; vertical-align: 0; }

.nh-tut-cuerpo { display: grid; gap: 32px; padding-top: 20px; padding-bottom: var(--nh-seccion-y); }
.nh-tut-art { min-width: 0; max-width: 760px; }
.nh-tut-art__lead { font-size: 17.5px; line-height: 1.65; color: var(--nh-texto-suave); text-wrap: pretty; }

.nh-tut-art code, .nh-tut-tip code {
	padding: 2px 7px; border-radius: 6px; background: var(--nh-chip); color: var(--nh-texto);
	font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace; font-size: .86em; white-space: normal; overflow-wrap: anywhere;
}
.nh-tut-art strong, .nh-tut-tip strong { color: var(--nh-texto); font-weight: 700; }

.nh-tut-pasos { margin-top: 28px; display: flex; flex-direction: column; }
.nh-tut-paso {
	display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 16px; padding: 22px 0;
	border-top: 1px solid var(--nh-borde); scroll-margin-top: calc(var(--nh-header-alto) + 16px);
}
.nh-tut-paso:last-child { border-bottom: 1px solid var(--nh-borde); }
.nh-tut-paso__num {
	width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; border-radius: 50%;
	border: 1.5px solid var(--nh-oro); color: var(--nh-acento); font-size: 14px; font-weight: 800; letter-spacing: .02em;
}
.nh-tut-paso__tit { font-size: 18px; font-weight: 800; line-height: 1.3; color: var(--nh-texto); margin-top: 8px; }
.nh-tut-paso__txt p { margin-top: 8px; font-size: 16px; line-height: 1.7; color: var(--nh-texto-3); text-wrap: pretty; }

.nh-tut-tip {
	margin-top: 28px; padding: 20px 22px; border-radius: 18px; border: 1px solid var(--nh-borde);
	border-left: 3px solid var(--nh-oro); background: var(--nh-superficie);
	font-size: 15.5px; line-height: 1.65; color: var(--nh-texto-3);
}
.nh-tut-tip__tit { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 13px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--nh-acento); }

.nh-tut-ayuda {
	margin-top: 28px; padding: 22px; border-radius: var(--nh-radio-card); background: var(--nh-fondo-alt); border: 1px solid var(--nh-borde);
	display: flex; flex-direction: column; gap: 16px; font-size: 15px; color: var(--nh-texto-2);
}
.nh-tut-ayuda__tit { font-size: 18px; font-weight: 800; color: var(--nh-texto); margin-bottom: 2px; }

.nh-tut-nav { margin-top: 28px; display: grid; gap: 10px; }
.nh-body .nh-tut-nav a {
	display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border: 1px solid var(--nh-borde); border-radius: 16px;
	text-decoration: none; font-size: 15.5px; font-weight: 700; line-height: 1.35; color: var(--nh-texto);
}
.nh-tut-nav a span { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--nh-texto-4); }
.nh-body .nh-tut-nav a:hover { border-color: var(--nh-acento); }
.nh-tut-nav__sig { text-align: right; align-items: flex-end; }

.nh-tut-lado { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.nh-tut-lado__caja { padding: 20px; border: 1px solid var(--nh-borde); border-radius: 18px; background: var(--nh-superficie); }
.nh-tut-lado__tit { margin-bottom: 8px; font-size: 12px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; color: var(--nh-acento); }
.nh-tut-lado__caja li + li { border-top: 1px solid var(--nh-borde); }
.nh-body .nh-tut-lado__caja li a { display: block; padding: 10px 0; font-size: 14.5px; font-weight: 600; line-height: 1.4; color: var(--nh-texto-3); text-decoration: none; }
.nh-body .nh-tut-lado__caja li a:hover { color: var(--nh-acento); }
.nh-tut-lado__caja .nh-link { margin-top: 6px; }
/* El índice de pasos sirve en la columna del costado; en el celular, abajo, no suma. */
.nh-tut-indice { display: none; }
.nh-tut-indice ol { counter-reset: paso; }
.nh-tut-indice li { counter-increment: paso; }
.nh-body .nh-tut-indice li a { display: grid; grid-template-columns: 26px minmax(0, 1fr); }
.nh-tut-indice li a::before { content: counter(paso, decimal-leading-zero); font-size: 12.5px; font-weight: 800; color: var(--nh-texto-4); padding-top: 1px; }

@media (min-width: 768px) {
	.nh-tut-hero { padding-bottom: 36px; gap: 22px; }
	.nh-tut-hero__titulo { font-size: clamp(42px, 4.6vw, 64px); }
	.nh-tut-chips { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0; }
	.nh-tut-cats { display: block; columns: 2; column-gap: 18px; margin-top: 14px; }
	.nh-tut-cat { break-inside: avoid; margin-bottom: 18px; padding: 26px 26px 14px; }
	.nh-tut-cat__tit { font-size: 26px; }

	.nh-tut-cab__titulo { font-size: clamp(38px, 4.4vw, 56px); }
	.nh-tut-cuerpo { padding-top: 28px; }
	.nh-tut-paso { grid-template-columns: 44px minmax(0, 1fr); gap: 20px; padding: 26px 0; }
	.nh-tut-paso__num { width: 44px; height: 44px; }
	.nh-tut-paso__tit { font-size: 19px; margin-top: 9px; }
	.nh-tut-paso__txt p { font-size: 16.5px; }
	.nh-tut-ayuda { flex-direction: row; align-items: center; justify-content: space-between; padding: 24px 28px; }
	.nh-tut-ayuda .nh-btn { flex: none; }
	.nh-tut-nav { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 1100px) {
	.nh-tut-cats { columns: 3; }
	.nh-tut-cuerpo { grid-template-columns: minmax(0, 760px) 300px; justify-content: space-between; gap: 56px; }
	.nh-tut-lado { position: sticky; top: calc(var(--nh-header-alto) + 24px); align-self: start; max-height: calc(100vh - var(--nh-header-alto) - 48px); overflow-y: auto; }
	.nh-tut-indice { display: block; }
}

@media (prefers-reduced-motion: reduce) {
	.nh-tut-item > svg, .nh-body .nh-tut-chip { transition: none; }
}
