/* ===========================================================================
   Estilos de las guías (guia.html · como-funciona.html)
   Reusa los tokens y la barra superior de styles.css.
   ========================================================================= */

/* barra superior simplificada para las guías */
.topbar--guide .topbar__inner {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.backlink {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .9rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.backlink:hover { background: var(--accent-soft); border-color: var(--accent-soft); }
.backlink svg { width: 16px; height: 16px; }

/* contenedor de artículo */
.guide {
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 28px 20px 40px;
}

/* portada */
.hero { margin-bottom: 30px; }
.hero__kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.hero__kicker svg { width: 15px; height: 15px; }
.hero__title {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 2.3rem;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -.02em;
  color: var(--ink);
}
.hero__lead {
  font-size: 1.08rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-top: 12px;
  max-width: 60ch;
}

/* índice */
.toc {
  background: var(--surface);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}
.toc__title {
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
}
.toc ol { list-style: none; counter-reset: toc; display: grid; gap: 4px; }
.toc li { counter-increment: toc; }
.toc a {
  display: flex;
  gap: 10px;
  align-items: baseline;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 500;
  padding: 5px 6px;
  border-radius: 8px;
  transition: background .14s var(--ease), color .14s var(--ease);
}
.toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--accent);
  font-size: .85rem;
}
.toc a:hover { background: var(--accent-soft); color: var(--accent-deep); }

/* secciones */
.section { margin-top: 38px; scroll-margin-top: 90px; }
.section__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}
.section__no {
  flex: none;
  width: 38px; height: 38px;
  display: grid; place-items: center;
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--on-accent);
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-deep) 100%);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}
.section h2 {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--ink);
}
.section h3 {
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--ink);
  margin: 22px 0 8px;
}
.section p {
  color: var(--ink-soft);
  line-height: 1.65;
  margin: 10px 0;
  max-width: 66ch;
}
.section p a, .prose a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1.5px solid var(--accent-soft);
}
.section p a:hover { border-bottom-color: var(--accent); }
.section ul, .section ol { margin: 10px 0 10px 4px; padding-left: 22px; }
.section li { color: var(--ink-soft); line-height: 1.6; margin: 6px 0; }
.section strong { color: var(--ink); font-weight: 700; }
kbd {
  font-family: 'Inter', sans-serif;
  font-size: .82rem;
  font-weight: 600;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-bottom-width: 2.5px;
  border-radius: 7px;
  padding: 2px 8px;
  color: var(--ink);
  white-space: nowrap;
}

/* paso con captura al lado */
.step-row {
  display: grid;
  gap: 18px;
  align-items: center;
  background: var(--surface);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 20px;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}
.step-row__text p:first-child { margin-top: 0; }
.step-row__text p:last-child { margin-bottom: 0; }
.step-row__shot { justify-self: center; }

/* captura de pantalla enmarcada */
.shot {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 20px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  background: var(--surface);
}
.figure { margin: 18px 0; text-align: center; }
.figure figcaption {
  font-size: .85rem;
  color: var(--ink-faint);
  margin-top: 8px;
}

/* recuadros destacados */
.callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: var(--r-md);
  padding: 15px 16px;
  margin: 18px 0;
  font-size: .96rem;
  line-height: 1.55;
}
.callout svg { flex: none; width: 20px; height: 20px; margin-top: 1px; }
.callout p { margin: 0; max-width: none; }
.callout--tip  { background: var(--cold-soft); color: #0a5b65; }
.callout--note { background: var(--hot-soft);  color: #7c3a0b; }
.callout--key  { background: var(--accent-soft); color: var(--accent-deep); }
.callout strong { color: inherit; }

/* bloque de código */
.code {
  background: #2a1d14;
  color: #f3e7d6;
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin: 14px 0;
  overflow-x: auto;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: .86rem;
  line-height: 1.6;
}
.code .c { color: #b79b82; }       /* comentario */
.code .k { color: #f0a59b; }       /* palabra clave / acento */
.code .s { color: #d9c08f; }       /* string */

/* árbol de archivos */
.tree {
  background: var(--surface);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 16px 18px;
  margin: 14px 0;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: .85rem;
  line-height: 1.75;
  color: var(--ink-soft);
  overflow-x: auto;
}
.tree b { color: var(--accent); font-weight: 700; }
.tree .muted { color: var(--ink-faint); }

/* diagrama de flujo */
.flow {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin: 18px 0;
}
.flow__node {
  flex: 1 1 130px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 13px 12px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.flow__node svg { width: 24px; height: 24px; color: var(--accent); }
.flow__node b {
  display: block;
  font-size: .9rem;
  color: var(--ink);
  margin-top: 6px;
}
.flow__node span {
  display: block;
  font-size: .76rem;
  color: var(--ink-faint);
  margin-top: 2px;
}
.flow__arrow {
  align-self: center;
  color: var(--accent);
  font-size: 1.1rem;
  font-weight: 700;
}

/* tarjetas de datos */
.factgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.fact {
  background: var(--surface);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 14px 15px;
  box-shadow: var(--shadow-sm);
}
.fact__num {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--accent);
  line-height: 1;
}
.fact__label {
  font-size: .84rem;
  color: var(--ink-soft);
  margin-top: 5px;
}

/* navegación inferior entre páginas */
.guidenav {
  display: grid;
  gap: 12px;
  margin-top: 44px;
  padding-top: 26px;
  border-top: 1.5px solid var(--border);
}
.guidenav__card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: transform .15s var(--ease), box-shadow .2s var(--ease),
              border-color .2s var(--ease);
}
.guidenav__card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-soft);
}
.guidenav__ico {
  flex: none;
  width: 46px; height: 46px;
  display: grid; place-items: center;
  color: var(--on-accent);
  background: linear-gradient(160deg, var(--accent) 0%, var(--accent-deep) 100%);
  border-radius: 13px;
}
.guidenav__ico svg { width: 24px; height: 24px; }
.guidenav__txt small {
  display: block;
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.guidenav__txt b {
  font-family: 'Fraunces', Georgia, serif;
  font-size: 1.12rem;
  font-weight: 600;
  color: var(--ink);
}

.guide-footer {
  text-align: center;
  font-size: .82rem;
  color: var(--ink-faint);
  padding: 24px 16px calc(28px + env(safe-area-inset-bottom));
}

/* escritorio */
@media (min-width: 680px) {
  .hero__title { font-size: 2.9rem; }
  .step-row { grid-template-columns: 1fr 280px; padding: 24px; }
  .step-row--flip { grid-template-columns: 280px 1fr; }
  .step-row--flip .step-row__text { order: 2; }
  .guidenav { grid-template-columns: 1fr 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; }
}
