/* ═══════════════════════════════════════════════════════════
   BLOG — Theme alfa01
   ═══════════════════════════════════════════════════════════

   Reemplaza al /assets/blog.css global. Usa las variables del
   theme (tokens.css) en lugar de colores hardcodeados.

   Se sirve desde: /assets/themes/alfa01/blog.css
   ═══════════════════════════════════════════════════════════ */

/* ── Layout del blog ─────────────────────────────────────── */
.blog-layout {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: var(--space-4xl) var(--container-padding);
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-4xl);
}

@media (min-width: 992px) {
    .blog-layout {
        grid-template-columns: minmax(0, 1fr) 320px;
        align-items: start;
    }
}

/* ── Post card ───────────────────────────────────────────── */
.post-card {
    background: var(--white);
    border: 1.5px solid var(--bg-dark);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform .2s, box-shadow .2s, border-color .2s;
}

@media (hover: hover) {
    .post-card:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-hover);
        border-color: var(--primary);
    }
}

.post-card-link {
    display: block;
    padding: var(--space-lg);
    text-decoration: none;
    color: inherit;
}

.post-card-cat {
    display: inline-block;
    background: var(--primary-bg);
    color: var(--brand);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-sm);
}

.post-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: var(--space-xs);
    color: var(--text-dark);
}

.post-card-meta {
    font-size: 0.82rem;
    color: var(--text-light);
}

/* ── Post individual ─────────────────────────────────────── */
.post-header {
    margin-bottom: var(--space-2xl);
}

.post-header h1 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: var(--space-sm);
    color: var(--text-dark);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    align-items: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

.post-category {
    background: var(--primary-bg);
    color: var(--brand);
    padding: 3px 10px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.78rem;
}

.post-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-dark);
}

.post-body h2,
.post-body h3,
.post-body h4 {
    margin-top: var(--space-2xl);
    margin-bottom: var(--space-sm);
    color: var(--text-dark);
}

.post-body p {
    margin-bottom: var(--space-md);
}

.post-body a {
    color: var(--brand);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.post-body ul,
.post-body ol {
    margin: 0 0 var(--space-md) var(--space-lg);
}

.post-body blockquote {
    border-left: 4px solid var(--brand);
    padding-left: var(--space-md);
    margin: var(--space-lg) 0;
    color: var(--text-mid);
    font-style: italic;
}

.post-body img {
    border-radius: var(--radius-lg);
    margin: var(--space-lg) 0;
}

/* ── Sidebar ─────────────────────────────────────────────── */
.sidebar {
    position: sticky;
    top: calc(var(--nav-height) + var(--space-lg));
}

.sidebar-widget {
    background: var(--white);
    border: 1px solid var(--bg-dark);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-bottom: var(--space-lg);
}

.sidebar-widget h3,
.sidebar-widget h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: var(--space-sm);
    color: var(--text-dark);
}

/* TSL358bis — listas del widget (categorías/servicios): sin esto los <li> quedan con los bullets/indent default del navegador */
.sidebar-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-widget ul li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--bg-dark);
    font-size: 0.9rem;
}
.sidebar-widget ul li:last-child { border-bottom: none; }
.sidebar-widget ul li a {
    color: var(--text-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
}
.sidebar-widget ul li a:hover { color: var(--brand); text-decoration: underline; }

/* ── CTA intermedio (TSL358) — discreto, dentro del cuerpo, distinto del CTA final ── */
.post-cta-inline {
    background: var(--bg-light, #f3f4ff);
    border-left: 4px solid var(--brand);
    border-radius: var(--radius-md, 8px);
    padding: var(--space-md, .9rem) var(--space-lg, 1.2rem);
    margin: var(--space-xl, 1.6rem) 0;
}
.post-cta-inline p { margin: 0; color: var(--text-dark); }
.post-cta-inline a { color: var(--brand); font-weight: 700; text-decoration: underline; }

/* ── CTA / Promo ─────────────────────────────────────────── */
.post-cta,
.sidebar-promo {
    background: var(--gradient-brand);
    color: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-2xl);
    text-align: center;
}

.post-cta h2,
.sidebar-promo h3 {
    color: var(--white);
    margin-bottom: var(--space-sm);
}

.btn-cta,
.btn-promo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    background: var(--white);
    color: var(--brand);
    padding: var(--space-sm) var(--space-2xl);
    border-radius: var(--radius-lg);
    font-weight: 700;
    text-decoration: none;
    min-height: 48px;
    transition: transform var(--transition-base), box-shadow var(--transition-base);
}

@media (hover: hover) {
    .btn-cta:hover,
    .btn-promo:hover {
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
        color: var(--brand-dark);
    }
}

/* ── Paginación ──────────────────────────────────────────── */
.pagination {
    display: flex;
    justify-content: center;
    gap: var(--space-xs);
    margin-top: var(--space-2xl);
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 var(--space-sm);
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 600;
    color: var(--text-mid);
    background: var(--white);
    border: 1px solid var(--bg-dark);
}

.pagination .current,
.pagination a:hover {
    background: var(--brand);
    color: var(--white);
    border-color: var(--brand);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
    .blog-layout {
        padding: var(--space-2xl) var(--space-md);
    }

    .sidebar {
        position: static;
    }
}

/* ════════════════════════════════════════════════════════════════
   SISTEMA UNIFICADO — blog alineado con funnel + landing
   ════════════════════════════════════════════════════════════════ */

/* ── Sidebar card — misma base canónica ─────────────────────── */
.sidebar-widget {
    background: var(--white);
    border: 1.5px solid var(--bg-dark);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
}

/* ── Tipografía del post — escala consistente ───────────────── */
.post-header h1 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* ── Post body — tipografía legible consistente ─────────────── */
.post-body {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-dark);
}
.post-body h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); font-weight: 700; letter-spacing: -0.01em; }
.post-body h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); font-weight: 700; }

/* ── Blog index hero — paridad completa con .hero de landing.css ──
   TSL321: sólo tenía el padding, nunca tuvo background/color — el <h1>
   ("📚 Blog") quedaba sin ninguna regla de color propia y caía al global
   h1,h2,...{color:var(--text-dark)} de base.css (TSL297) — mismo patrón
   de bug que TSL299 arregló en .hero/.cta-banner/.hub-hero, pero acá
   nunca se cubrió porque blog.css no estaba en el alcance de esa auditoría. */
.blog-hero {
    background: linear-gradient(145deg, var(--primary) 0%, var(--secondary) 50%, var(--primary) 100%);
    background-size: 200% 200%;
    color: #fff;
    padding: 100px 20px 80px;
    text-align: center;
}
.blog-hero h1 { color: inherit; }
.blog-hero p { color: inherit; opacity: .92; }

/* ── Post category badge — paridad con section-label ────────── */
.post-category,
.post-card-cat {
    background: var(--primary-bg, rgba(15,118,110,.08));
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.3px;
}

/* ════════════════════════════════════════════════════════════════
   TSL358bis — el theme no se aplicaba de verdad: BlogTemplate.php usaba su
   propia estructura (.layout/.post-content/.site-nav/.site-footer) y estilos
   inline con grises hardcodeados, casi sin relación con las clases de acá.
   Se corrigió el markup para usar las clases reales del theme (.blog-layout,
   nav/footer compartidos con barrio/hub) y estas reglas cubren lo que
   quedaba sin definir en ningún lado (antes vivía en <style> inline).
   ════════════════════════════════════════════════════════════════ */

/* ── Post individual: breadcrumb real del theme (portado de funnel.css, que el blog no carga) ── */
.breadcrumb {
    background: var(--white);
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--bg-dark);
}
.breadcrumb-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.9rem;
    flex-wrap: wrap;
}
.breadcrumb-list li { display: flex; align-items: center; gap: var(--space-xs); }
.breadcrumb-list a { color: var(--primary); text-decoration: none; transition: color var(--transition-base); }
.breadcrumb-list a:hover { color: var(--primary-dark); text-decoration: underline; }
.breadcrumb-list .separator { color: var(--text-light); user-select: none; }
.breadcrumb-list .current { color: var(--text-dark); font-weight: 500; }

/* ── Post individual: hero con el título (antes: título negro chico sobre fondo blanco, sin relación
   con las páginas de barrio/hub que sí tienen una franja de color debajo del nav) ── */
.post-hero {
    background: linear-gradient(145deg, var(--primary) 0%, var(--secondary) 50%, var(--primary) 100%);
    background-size: 200% 200%;
    color: #fff;
    padding: var(--space-2xl) var(--container-padding) var(--space-xl);
}
.post-hero .container { max-width: var(--max-width); margin: 0 auto; }
.post-hero .post-meta { color: rgba(255,255,255,.85); }
.post-hero .post-category { background: rgba(255,255,255,.2); color: #fff; }
.post-hero .post-date,
.post-hero .post-updated { color: rgba(255,255,255,.85); }
.post-hero h1 { color: inherit; margin: var(--space-sm) 0 var(--space-xs); }
.post-hero .post-byline { color: rgba(255,255,255,.85); margin-bottom: 0; }

.post-byline {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: var(--space-sm);
}

.post-updated {
    color: var(--text-light);
    font-size: 0.85rem;
    margin-left: var(--space-xs);
}

.author-bio {
    display: flex;
    gap: var(--space-md);
    align-items: flex-start;
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    margin-top: var(--space-2xl);
}
.author-bio-icon { font-size: 1.8rem; line-height: 1; }
.author-bio-name { display: block; color: var(--text-dark); margin-bottom: 4px; }
.author-bio-text { color: var(--text-light); font-size: 0.92rem; margin: 0; }

.back-link {
    display: inline-block;
    margin-top: var(--space-lg);
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}
.back-link:hover { text-decoration: underline; }

/* ── Home del blog: grid de tarjetas + contador de categoría ── */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-lg);
}

.cat-count {
    background: var(--bg-dark);
    color: var(--text-light);
    border-radius: var(--radius-full);
    padding: 1px 8px;
    font-size: 0.75rem;
    margin-left: 6px;
}

/* ── Respuesta directa + tabla dentro del cuerpo del post (antes <style> inline) ── */
.post-body .answer-direct {
    background: var(--bg-light);
    border-left: 4px solid var(--brand);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: 1.05rem;
    margin: 0 0 var(--space-lg);
}
.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: var(--space-lg) 0;
    font-size: 0.95rem;
    display: block;
    overflow-x: auto;
}
.post-body th,
.post-body td {
    border: 1px solid var(--bg-dark);
    padding: 0.55rem 0.7rem;
    text-align: left;
    vertical-align: top;
}
.post-body th { background: var(--bg-light); }
