/* ============================================================
   CadaPeso.com — home.css (Fase 1 del rediseño)
   Estilos exclusivos de la portada. Sistema "editorial papel
   y tinta" sobre los tokens de main.css (Fase 0). Prefijo .rh-
   para no chocar con clases existentes.
   ============================================================ */

body.rh-home { background: var(--paper); }

/* ===== HERO ===== */
.rh-hero { padding: 56px 0 40px; }
/* Una columna en mobile; dos en desktop (≥861px), con la columna del 3D
   reservada desde el inicio para no provocar layout shift al montar. */
.rh-hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
  align-items: center;
}
@media (min-width: 861px) {
  .rh-hero__grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
}

.rh-kicker {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
  font-size: .76rem; font-weight: 700; letter-spacing: .2em;
  text-transform: uppercase; color: var(--ink-soft);
  margin-bottom: 18px;
}
.rh-kicker b { color: var(--color-accent-mid); font-weight: 700; }
/* En desktop vuelve a una línea: CadaPeso.com · estamos para ayudarte ——— */
@media (min-width: 861px) {
  .rh-kicker { flex-direction: row; align-items: center; gap: 14px; }
  .rh-kicker__sub::before { content: '·'; margin-right: 14px; color: var(--ink-soft); }
  .rh-kicker::after { content: ''; flex: 1; height: 1px; background: var(--line-paper); }
}

.rh-hero h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-display);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--ink);
  max-width: 16ch;
}
.rh-hero h1 .rh-scribble { position: relative; white-space: nowrap; }
.rh-hero h1 .rh-scribble svg {
  position: absolute; left: -2%; bottom: -0.14em;
  width: 104%; height: .3em; overflow: visible; pointer-events: none;
}
.rh-hero h1 .rh-scribble svg path {
  fill: none; stroke: var(--color-accent); stroke-width: 7;
  stroke-linecap: round; vector-effect: non-scaling-stroke;
}
.rh-hero__sub {
  font-size: clamp(1rem, 2vw, 1.15rem);
  color: var(--ink-mid);
  max-width: 48ch;
  margin: 18px 0 22px;
}
.rh-hero__meta {
  display: flex; gap: 20px; flex-wrap: wrap;
  font-size: .82rem; font-weight: 600; color: var(--ink-soft);
}
.rh-hero__meta span { display: inline-flex; align-items: center; gap: 7px; }
.rh-hero__meta i { width: 6px; height: 6px; border-radius: 50%; background: var(--color-accent); }

/* El contenedor 3D solo existe en desktop (en mobile no cargamos three.js).
   align-self: center lo mantiene centrado en el hero sin estirarse hacia
   las secciones de abajo. */
.rh-hero__3d { display: none; position: relative; height: 300px; align-self: center; }
.rh-hero__3d svg { display: block; width: 100%; height: 100%; }
@media (min-width: 861px) { .rh-hero__3d { display: block; } }

/* ===== BUSCADOR DE DUDAS ===== */
.rh-ask-band { padding: 8px 0 40px; }
.rh-ask-wrap { position: relative; max-width: 680px; }
.rh-ask {
  background: var(--card-paper);
  border: 1.5px solid var(--line-paper);
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  display: flex; align-items: center; gap: 12px;
  padding: 7px 7px 7px 22px;
  transition: box-shadow .2s, border-color .2s;
}
.rh-ask:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(224,92,58,.16), var(--shadow-soft);
}
.rh-ask svg { flex-shrink: 0; color: var(--ink-soft); }
.rh-ask input {
  flex: 1; border: none; outline: none; background: transparent;
  font-family: var(--font-primary); font-size: 1.02rem; color: var(--ink);
  min-width: 0; height: 44px;
}
.rh-ask input::placeholder { color: var(--color-gray-500); }
.rh-ask button {
  flex-shrink: 0; border: none; cursor: pointer;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-primary); font-weight: 700; font-size: .92rem;
  padding: 12px 24px; border-radius: 99px; min-height: 44px;
  transition: background .15s;
}
.rh-ask button:hover { background: var(--color-navy-mid); }

.rh-ask-results {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 60;
  background: var(--card-paper); border: 1px solid var(--line-paper);
  border-radius: var(--radius-2xl); box-shadow: var(--shadow-soft);
  overflow: hidden; list-style: none; margin: 0; padding: 0;
}
.rh-ask-results[hidden] { display: none; }
.rh-ask-results a {
  display: flex; flex-direction: column; gap: 1px;
  padding: 12px 20px; border-bottom: 1px solid var(--line-paper);
  color: inherit;
}
.rh-ask-results li:last-child a { border-bottom: none; }
.rh-ask-results a:hover, .rh-ask-results a:focus { background: var(--color-accent-light); }
.rh-ask-results b { font-size: .93rem; color: var(--ink); font-weight: 600; }
.rh-ask-results small { font-size: .78rem; color: var(--ink-soft); }
.rh-ask-results .rh-ask-empty { padding: 14px 20px; font-size: .9rem; color: var(--ink-soft); }

.rh-chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.rh-chip {
  background: var(--card-paper); border: 1px solid var(--line-paper);
  border-radius: 99px; padding: 9px 16px;
  font-family: var(--font-primary); font-size: .84rem; font-weight: 500;
  color: var(--color-navy-mid); cursor: pointer;
  transition: border-color .15s, color .15s, background .15s, transform .15s;
}
.rh-chip:hover {
  border-color: var(--color-accent); color: var(--color-accent-mid);
  background: var(--color-accent-light); transform: translateY(-1px);
}

/* ===== CALCULADORA VIVA ===== */
.rh-live { padding: 16px 0 56px; }
.rh-live__card {
  background: var(--card-paper); border: 1.5px solid var(--ink);
  border-radius: 22px; box-shadow: var(--shadow-hard);
  overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
}
@media (max-width: 820px) { .rh-live__card { grid-template-columns: 1fr; } }
.rh-live__form { padding: 32px; }
.rh-tag {
  display: inline-block; background: var(--color-accent-light); color: var(--color-accent-mid);
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 99px; margin-bottom: 12px;
}
.rh-live__form h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.5rem; letter-spacing: -0.015em; line-height: 1.2;
  color: var(--ink); margin-bottom: 20px;
}
.rh-field { margin-bottom: 16px; }
.rh-field label {
  display: block; font-size: .8rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 7px;
}
.rh-field .rh-control {
  display: flex; align-items: center; gap: 8px;
  background: var(--paper); border: 1.5px solid var(--line-paper);
  border-radius: 12px; padding: 10px 16px;
  transition: border-color .15s, box-shadow .15s;
}
.rh-field .rh-control:focus-within { border-color: var(--ink); box-shadow: 3px 3px 0 var(--color-accent-light); }
.rh-field .rh-control b { color: var(--ink-soft); font-weight: 600; }
.rh-field input {
  flex: 1; border: none; outline: none; background: transparent; min-width: 0;
  font-family: var(--font-primary); font-size: 1.1rem; font-weight: 700;
  color: var(--ink); font-variant-numeric: tabular-nums; height: 28px;
}
.rh-field__hint { font-size: .78rem; color: var(--color-gray-500); margin-top: 5px; }
.rh-privacy {
  font-size: .8rem; color: var(--ink-soft);
  display: flex; gap: 8px; align-items: flex-start; margin-top: 8px;
}
.rh-privacy svg { flex-shrink: 0; margin-top: 3px; }

.rh-live__result {
  background: var(--color-navy); color: var(--paper);
  padding: 32px; display: flex; flex-direction: column; justify-content: center; gap: 16px;
}
.rh-result-label {
  font-size: .72rem; font-weight: 800; letter-spacing: .2em;
  text-transform: uppercase; color: #D9A861;
}
.rh-result-headline {
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem); line-height: 1.22; letter-spacing: -0.01em;
}
.rh-result-headline em { font-style: italic; color: #FF9D7E; }
.rh-result-headline .rh-ok { font-style: italic; color: #8FD8AC; }
.rh-result-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rh-result-kpi { border-top: 1px solid rgba(246,240,230,.25); padding-top: 10px; }
.rh-result-kpi b {
  display: block; font-size: 1.4rem; font-weight: 700;
  font-variant-numeric: tabular-nums; line-height: 1.3;
}
.rh-result-kpi span { font-size: .78rem; color: rgba(246,240,230,.6); }
.rh-live__cta {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--color-accent); color: #fff;
  font-weight: 700; font-size: .92rem;
  padding: 12px 24px; border-radius: 99px; min-height: 44px;
  transition: background .15s, transform .15s;
}
.rh-live__cta:hover { background: var(--color-accent-mid); color: #fff; transform: translateY(-1px); }

/* ===== RUTAS POR SITUACIÓN ===== */
.rh-routes-band { padding: 24px 0 56px; }
.rh-section-head { max-width: 56ch; margin-bottom: 28px; }
.rh-section-head h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--fs-h2-fluid); letter-spacing: -0.015em; line-height: 1.15;
  color: var(--ink); margin-bottom: 8px;
}
.rh-section-head p { color: var(--ink-mid); font-size: .98rem; }
.rh-routes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
@media (max-width: 860px) { .rh-routes { grid-template-columns: 1fr; } }
.rh-route {
  display: block; background: var(--card-paper);
  border: 1px solid var(--line-paper); border-radius: var(--radius-2xl);
  padding: 26px 24px; box-shadow: var(--shadow-sm); color: inherit;
  transition: transform .18s, box-shadow .18s;
}
.rh-route:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); color: inherit; }
.rh-route__icon {
  width: 48px; height: 48px; border-radius: 14px;
  display: grid; place-items: center; margin-bottom: 14px;
}
.rh-route--deuda .rh-route__icon { background: var(--color-accent-light); color: var(--color-accent-mid); }
.rh-route--ahorro .rh-route__icon { background: var(--color-success-bg); color: var(--color-success); }
.rh-route--credito .rh-route__icon { background: var(--color-navy-light); color: var(--color-navy-mid); }
.rh-route h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.2rem;
  color: var(--ink); margin-bottom: 6px;
}
.rh-route p { font-size: .9rem; color: var(--ink-soft); margin-bottom: 12px; }
.rh-route__go { font-size: .88rem; font-weight: 700; }
.rh-route--deuda .rh-route__go { color: var(--color-accent-mid); }
.rh-route--ahorro .rh-route__go { color: var(--color-success); }
.rh-route--credito .rh-route__go { color: var(--color-navy-mid); }

/* ===== MÓDULOS Y DUDAS (piel editorial sobre lo existente) ===== */
.rh-home .home-modules-secondary { background: transparent; }
.rh-home .module-card { background: var(--card-paper); border: 1px solid var(--line-paper); }
.rh-home .home-popular h2,
.rh-home .home-modules-secondary__heading {
  font-family: var(--font-display); font-weight: 600; letter-spacing: -0.015em;
  color: var(--ink);
}

/* ===== MANIFIESTO ===== */
.rh-manifesto-band { padding: 32px 0 8px; }
.rh-manifesto {
  background: linear-gradient(160deg, var(--color-navy) 0%, #14233E 100%);
  border-radius: var(--radius-3xl); color: #fff;
  padding: clamp(36px, 5vw, 60px);
  text-align: center; position: relative; overflow: hidden;
}
.rh-manifesto::before {
  content: ''; position: absolute; width: 360px; height: 360px; border-radius: 50%;
  background: rgba(224,92,58,.16); filter: blur(90px); top: -150px; right: -70px;
}
.rh-manifesto > * { position: relative; }
.rh-manifesto h2 {
  font-family: var(--font-display); font-weight: 600;
  font-size: var(--fs-h2-fluid); letter-spacing: -0.015em; line-height: 1.2;
  color: #fff; max-width: 28ch; margin: 0 auto 14px;
}
.rh-manifesto p { color: rgba(255,255,255,.75); max-width: 58ch; margin: 0 auto 22px; }
.rh-pledges { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 22px; }
.rh-pledge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
  border-radius: 99px; padding: 9px 18px; font-size: .87rem; font-weight: 600;
}
.rh-pledge svg { color: #6FCF97; }
.rh-manifesto__link { color: #D9A861; font-weight: 700; font-size: .92rem; }
.rh-manifesto__link:hover { color: #fff; }

/* ===== REVEALS (IntersectionObserver + CSS, sin librerías) ===== */
@media (prefers-reduced-motion: no-preference) {
  .rh-reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; }
  .rh-reveal.rh-in { opacity: 1; transform: none; }
}
