/* ==========================================================================
   BLOG — SYNCROAPP GASTOS — estilos comunes (index + articulos)
   ==========================================================================
   Mismo esqueleto que los blogs de Talonario y Anfitrion (ancho 720px para
   lectura larga, nav sticky, callouts, tabla, CTA box), con la identidad
   PROPIA de Gastos: tema claro plano y marca teal.

   Diferencia deliberada con los otros dos blogs: aca NO hay serif. Gastos es
   una herramienta de uso diario, no una marca de hospitalidad; Inter en todo
   mantiene la continuidad visual con la landing /gastos/.

   La paleta se replica a proposito: el blog es standalone y no depende del
   CSS de la landing. Si cambia la marca, sincronizar con
   frontend/gastos/index.html.
   ========================================================================== */

:root {
    --bg: #f5f6f8; --surface: #ffffff; --surface-2: #f0f2f5;
    --borde: #e3e6eb; --borde-alto: #cbd1da;
    --ink: #1a1d23; --muted: #4b5563; --faint: #6b7280;
    --brand: #1f6e60; --brand-d: #1a5f53; --brand-l: #e6f0ee;
    --brand-tx: #1d6a5c; --brand-suave: rgba(31, 110, 96, .10);
    --grad-brand: linear-gradient(180deg, #23796a 0%, #1c6357 100%);
    --verde-tx: #2f7d33; --rojo-tx: #b91c1c;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg); color: var(--ink); margin: 0; line-height: 1.65;
    letter-spacing: -0.01em; -webkit-font-smoothing: antialiased;
}
a { color: var(--brand-tx); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Nav */
header.nav {
    background: rgba(245, 246, 248, .9); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--borde); position: sticky; top: 0; z-index: 40;
    padding: 12px 0;
}
header.nav .wrap {
    max-width: 900px; margin: 0 auto; padding: 0 20px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.logo:hover { text-decoration: none; }
.logo-badge {
    width: 34px; height: 34px; border-radius: 10px; background: var(--grad-brand);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-name { font-weight: 800; font-size: 1.1rem; letter-spacing: -.02em; }
.logo-sub { font-size: .62rem; color: var(--faint); letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
.cta {
    background: var(--grad-brand); color: #fff; padding: 10px 18px; border-radius: .625rem;
    font-weight: 700; font-size: .85rem; text-decoration: none; display: inline-block;
    white-space: nowrap;
}
.cta:hover { background: var(--brand-d); text-decoration: none; }

/* Article */
main.article { max-width: 720px; margin: 0 auto; padding: 30px 20px 60px; }
.breadcrumb { color: var(--faint); font-size: .78rem; margin-bottom: 24px; }
.badge {
    display: inline-block; font-size: .66rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: .1em; color: var(--brand-tx); background: var(--brand-suave);
    padding: 5px 12px; border-radius: 999px; margin-bottom: 14px;
}
article h1 {
    font-size: clamp(1.7rem, 5vw, 2.2rem); font-weight: 900; line-height: 1.15;
    margin: 0 0 16px; letter-spacing: -.025em; color: var(--ink);
}
article h2 {
    font-size: 1.4rem; font-weight: 800; margin: 42px 0 14px;
    letter-spacing: -.02em; color: var(--ink);
}
article h3 { font-size: 1.05rem; font-weight: 700; margin: 28px 0 10px; color: var(--ink); }
article .lead { font-size: 1.1rem; color: var(--muted); line-height: 1.6; margin: 0 0 14px; }
article .meta { color: var(--faint); font-size: .78rem; margin: 0 0 30px; }
article p { color: var(--muted); font-size: 1rem; line-height: 1.75; margin: 0 0 14px; }
article ul, article ol { color: var(--muted); font-size: 1rem; line-height: 1.75; padding-left: 24px; margin: 0 0 18px; }
article li { margin-bottom: 8px; }
article strong { color: var(--ink); }
article a { color: var(--brand-tx); font-weight: 600; }
article code {
    background: var(--surface-2); border: 1px solid var(--borde);
    padding: 1px 6px; border-radius: 5px; font-size: .88em;
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
}

/* Callout (avisos, advertencias, reglas) */
.callout {
    background: var(--brand-suave); border-left: 3px solid var(--brand);
    padding: 14px 18px; border-radius: 10px; margin: 24px 0;
    color: var(--ink); font-size: .95rem; line-height: 1.6;
}
.callout.alerta { background: rgba(185, 28, 28, .07); border-left-color: #b91c1c; }
.callout strong { color: var(--ink); }

/* CTA box al final del articulo */
.cta-box {
    background: linear-gradient(135deg, var(--brand-l), rgba(230, 240, 238, .35));
    border: 1px solid var(--brand); border-radius: 16px;
    padding: 28px 24px; text-align: center; margin: 40px 0;
}
.cta-box h3 { color: var(--ink); font-size: 1.25rem; margin: 0 0 8px; font-weight: 800; letter-spacing: -.02em; }
.cta-box p { color: var(--muted); margin: 0 0 18px; }

/* Tablas de cifras. En movil se desplazan en horizontal en vez de aplastar
   las columnas: una tabla de plata ilegible no sirve de nada */
.tabla-scroll { overflow-x: auto; margin: 20px 0; -webkit-overflow-scrolling: touch; }
article table {
    width: 100%; border-collapse: collapse; font-size: .9rem;
    background: var(--surface); border: 1px solid var(--borde);
    border-radius: 10px; overflow: hidden; min-width: 420px;
}
article th, article td { padding: 10px 14px; border-bottom: 1px solid var(--borde); text-align: left; }
article th {
    background: var(--surface-2); color: var(--ink); font-weight: 700;
    text-transform: uppercase; font-size: .68rem; letter-spacing: .06em;
}
article tr:last-child td { border-bottom: none; }
article td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
article th.num { text-align: right; }
article .total td { font-weight: 700; color: var(--ink); background: var(--surface-2); }

/* Tarjetas del index del blog */
.post-list { max-width: 900px; margin: 0 auto; padding: 20px 20px 60px; display: grid; gap: 16px; }
.post-card {
    background: var(--surface); border: 1px solid var(--borde); border-radius: 14px;
    padding: 22px; transition: transform .15s ease, box-shadow .15s ease;
    display: block; color: inherit;
}
.post-card:hover {
    text-decoration: none; transform: translateY(-2px);
    box-shadow: 0 14px 30px -18px rgba(16, 24, 40, .35);
}
.post-card h2 {
    font-size: 1.2rem; font-weight: 800; margin: 10px 0 8px;
    color: var(--ink); line-height: 1.3; letter-spacing: -.02em;
}
.post-card p { color: var(--muted); font-size: .92rem; margin: 0; line-height: 1.6; }
.blog-hero { max-width: 900px; margin: 0 auto; padding: 40px 20px 10px; }
.blog-hero h1 {
    font-size: clamp(1.9rem, 5vw, 2.5rem); font-weight: 900;
    margin: 8px 0 10px; letter-spacing: -.025em; color: var(--ink);
}
.blog-hero p { color: var(--muted); font-size: 1.05rem; max-width: 60ch; margin: 0; }
.eyebrow {
    font-size: .68rem; text-transform: uppercase; letter-spacing: .12em;
    font-weight: 700; color: var(--brand-tx); margin: 0;
}
@media (min-width: 720px) {
    .post-list { grid-template-columns: 1fr 1fr; }
}

/* Footer */
footer {
    border-top: 1px solid var(--borde); background: var(--surface-2);
    padding: 24px 20px; text-align: center; color: var(--faint);
    font-size: .8rem; margin-top: 60px;
}
footer a { color: var(--brand-tx); margin: 0 6px; }
footer p { margin: 6px 0; }
