/*
 * KINT · Artículos del blog (blog/*.html).
 * Misma línea visual que blog/marco-legal.html (hero navy, cuerpo de 46rem) en una hoja
 * compartida, más los componentes de los artículos de soluciones KIS-TA:
 * pasos, tabla de formatos, ficha de funciones, nota legal, enlace destacado y jerarquía.
 */

:root {
  --kint-blue: #00b2e2;
  --kint-blue-ink: #007a9c; /* cian legible para texto pequeño sobre blanco */
  --kint-dark: #002b49;
  --ba-ink: #334155;
  --ba-muted: #475569;
  --ba-line: #e2e8f0;
  --ba-surface: #f8fafc;
}
html.dark {
  --kint-blue-ink: #00b2e2;
  --ba-ink: #cbd5e1;
  --ba-muted: #94a3b8;
  --ba-line: #1e293b;
  --ba-surface: #0f1b2b;
}

/* Hero del artículo */
.article-hero {
  background: linear-gradient(160deg, var(--kint-dark) 0%, #00406e 55%, #005a8e 100%);
  padding: 4rem 1.5rem 3rem;
  position: relative;
  overflow: hidden;
}
.article-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 90% 70% at 70% -10%, rgba(0, 178, 226, 0.2), transparent 65%);
  pointer-events: none;
}
.article-hero__inner {
  position: relative;
  z-index: 1;
  max-width: 46rem;
  margin: 0 auto;
}
.article-hero h1 {
  font-size: clamp(1.65rem, 3.5vw, 2.4rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.2;
  margin: 0 0 1rem;
  text-wrap: balance;
}
.article-hero__lead {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.65;
  margin: 0;
}

/* Barra de metadatos */
.meta-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  margin-bottom: 1.25rem;
  color: rgba(255, 255, 255, 0.6);
}
.meta-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 700;
}
.chip-blog { background: rgba(0, 178, 226, 0.2); color: var(--kint-blue); }
.chip-cat { background: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.85); }
.meta-sep { color: rgba(255, 255, 255, 0.3); }

/* Migas de pan */
.breadcrumb { display: flex; align-items: center; gap: 0.4rem; font-size: 0.8rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.breadcrumb a { color: var(--kint-blue); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb svg { width: 0.9rem; height: 0.9rem; color: rgba(255, 255, 255, 0.3); }
.breadcrumb [aria-current] { color: rgba(255, 255, 255, 0.55); }

/* Cuerpo */
.article-main { padding: 3.5rem 1.25rem 2rem; }
.article-body { max-width: 46rem; margin: 0 auto; }
.article-body h2 {
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1.3;
  color: var(--kint-dark);
  margin: 2.75rem 0 0.75rem;
  text-wrap: balance;
}
.article-body > h2:first-child { margin-top: 0; }
html.dark .article-body h2 { color: #f1f5f9; }
.article-body h3 { font-size: 1.05rem; font-weight: 700; color: var(--ba-ink); margin: 1.5rem 0 0.5rem; }
.article-body p { line-height: 1.8; margin: 0 0 1rem; color: var(--ba-muted); }
.article-body ul { padding-left: 1.25rem; margin: 0 0 1rem; list-style: disc; }
.article-body ul li { line-height: 1.75; margin-bottom: 0.4rem; color: var(--ba-muted); }
.article-body strong { color: var(--ba-ink); }
.article-body a:not([class]) { color: var(--kint-blue-ink); font-weight: 600; text-underline-offset: 3px; }
.article-body a:not([class]):hover { text-decoration: underline; }

/* Pasos (solo para procesos que de verdad son una secuencia) */
.ba-steps { list-style: none; padding: 0; margin: 1.5rem 0 2rem; counter-reset: ba-step; }
.ba-steps li {
  counter-increment: ba-step;
  display: grid;
  grid-template-columns: 2.25rem minmax(0, 1fr);
  gap: 0 1rem;
  padding: 1.1rem 0;
  border-top: 1px solid var(--ba-line);
}
.ba-steps li:last-child { border-bottom: 1px solid var(--ba-line); }
.ba-steps li::before {
  content: counter(ba-step);
  grid-row: span 2;
  display: grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: var(--kint-dark);
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
}
html.dark .ba-steps li::before { background: var(--kint-blue); color: var(--kint-dark); }
.ba-steps h3 { margin: 0.35rem 0 0.25rem; color: var(--kint-dark); }
html.dark .ba-steps h3 { color: #f1f5f9; }
.ba-steps p { margin: 0; }

/* Tabla (formatos de exportación) */
.ba-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.25rem 0 2rem; border: 1px solid var(--ba-line); border-radius: 0.75rem; }
.ba-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.ba-table th {
  background: var(--kint-dark);
  color: #fff;
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 700;
  font-size: 0.85rem;
}
.ba-table td { padding: 0.8rem 1rem; border-top: 1px solid var(--ba-line); vertical-align: top; color: var(--ba-ink); line-height: 1.55; }
.ba-table td:first-child { font-weight: 700; color: var(--kint-dark); white-space: nowrap; }
html.dark .ba-table td:first-child { color: #f1f5f9; }

/* Ficha de funciones: término a la izquierda, descripción a la derecha */
.ba-sheet { margin: 1.25rem 0 2rem; border-bottom: 1px solid var(--ba-line); }
.ba-sheet > div { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.2rem; padding: 1rem 0; border-top: 1px solid var(--ba-line); }
.ba-sheet dt { display: flex; align-items: center; gap: 0.6rem; font-weight: 700; color: var(--kint-dark); }
html.dark .ba-sheet dt { color: #f1f5f9; }
.ba-sheet dt svg, .ba-sheet dt i { width: 1.25rem; height: 1.25rem; color: var(--kint-blue); flex-shrink: 0; }
.ba-sheet dd { margin: 0; color: var(--ba-muted); line-height: 1.7; }
@media (min-width: 640px) {
  .ba-sheet > div { grid-template-columns: 14rem minmax(0, 1fr); gap: 1.5rem; }
}

/* Nota (referencia legal o dato clave) */
.ba-note {
  margin: 1.5rem 0 2rem;
  padding: 1.25rem 1.5rem;
  border-left: 4px solid var(--kint-blue);
  background: var(--ba-surface);
  border-radius: 0 0.75rem 0.75rem 0;
}
.ba-note p { margin: 0; }
.ba-note p + p { margin-top: 0.5rem; }

/* Enlace destacado a otra solución */
.ba-link-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin: 1.5rem 0 2rem;
  padding: 1.5rem;
  border: 1px solid var(--ba-line);
  border-radius: 1rem;
  text-decoration: none;
  transition: border-color 0.2s;
}
.ba-link-card:hover { border-color: var(--kint-blue); }
.ba-link-card:focus-visible { outline: 3px solid var(--kint-blue); outline-offset: 3px; }
.ba-link-card__icon {
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.85rem;
  background: var(--kint-dark);
  color: #fff;
  flex-shrink: 0;
}
.ba-link-card__icon svg, .ba-link-card__icon i { width: 1.5rem; height: 1.5rem; }
.ba-link-card strong { display: block; font-size: 1.05rem; color: var(--kint-dark); margin-bottom: 0.2rem; }
html.dark .ba-link-card strong { color: #f1f5f9; }
.ba-link-card > span:not([class]) > span { display: block; color: var(--ba-muted); font-size: 0.9rem; line-height: 1.5; }
.ba-link-card__go { margin-left: auto; color: var(--kint-blue); flex-shrink: 0; }

/* Jerarquía multisucursal: dirección arriba, sucursales debajo */
.ba-tree { margin: 1.5rem 0 2rem; padding: 1.5rem; background: var(--ba-surface); border-radius: 1rem; }
.ba-tree__root, .ba-tree__node {
  border: 1px solid var(--ba-line);
  background: #fff;
  border-radius: 0.75rem;
  padding: 0.85rem 1rem;
}
html.dark .ba-tree__root, html.dark .ba-tree__node { background: #0b1520; }
.ba-tree__root { max-width: 22rem; margin: 0 auto; text-align: center; border-color: var(--kint-dark); }
html.dark .ba-tree__root { border-color: var(--kint-blue); }
.ba-tree strong { display: block; color: var(--kint-dark); font-size: 0.95rem; }
html.dark .ba-tree strong { color: #f1f5f9; }
.ba-tree small { display: block; color: var(--ba-muted); font-size: 0.82rem; line-height: 1.45; margin-top: 0.15rem; }
.ba-tree__branches {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin-top: 1.75rem;
}
.ba-tree__branches::before {
  content: "";
  position: absolute;
  left: 50%;
  top: -1.75rem;
  height: 1.75rem;
  border-left: 2px solid var(--ba-line);
}
.ba-tree__node { text-align: center; }

/* Volver al blog */
.ba-back { text-align: center; margin-top: 2.5rem; }
.ba-back a { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--kint-blue-ink); font-size: 0.9rem; font-weight: 600; text-decoration: none; }
.ba-back a:hover { text-decoration: underline; }
