/* =========================================
   BLOG HOME - CINCEL.AR
   ========================================= */

:root {
    /* --- Paleta de Colores (Slate & Brand) --- */
    --c-primary: #3e39ba;       /* Violeta Marca */
    --c-primary-dark: #312e81;  /* Hover Links */
    --c-primary-soft: #eef2ff;  /* Fondos sutiles */
    
    --c-secondary: #ffc61a;     /* Amarillo/Ambar (Acentos) */
    
    --c-text-main: #0f172a;     /* Slate 900 - Títulos */
    --c-text-body: #334155;     /* Slate 700 - Lectura */
    --c-text-muted: #64748b;    /* Slate 500 - Metadatos */
    
    --c-bg-page: #f8fafc;       /* Slate 50 - Fondo General */
    --c-bg-card: #ffffff;       /* Blanco Puro - Tarjetas */
    
    --c-border: #e2e8f0;        /* Slate 200 - Bordes Finos */
    --c-border-hover: #cbd5e1;  /* Slate 300 - Bordes Hover */

    /* --- Tipografía --- */
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    /* --- Espaciado y Radios --- */
    --radius-card: 12px;
    --radius-pill: 99px;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --shadow-hover: 0 12px 24px -8px rgba(0, 0, 0, 0.08), 0 4px 8px -4px rgba(0, 0, 0, 0.04);
}

/* =========================================
   LAYOUT GENERAL
   ========================================= */

.blog-section {
    padding: 5rem 1.5rem;
    background-color: var(--c-bg-page);
    font-family: var(--font-sans);
    color: var(--c-text-body);
    line-height: 1.6;
    position: relative;
    overflow-x: hidden; /* Evita scroll horizontal */
}

/* Patrón de fondo sutil (Toque Tech) */
.grid-pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 32px 32px;
    opacity: 0.4;
    pointer-events: none;
    z-index: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* =========================================
   HEADER (ESTILO EDITORIAL CLÁSICO)
   ========================================= */

.blog-header {
    text-align: center;
    margin-bottom: 5rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.section-kicker {
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--c-primary);
    margin-bottom: 1.5rem;
}

.blog-title {
    font-size: 3.5rem;
    font-weight: 800;
    color: var(--c-text-main);
    margin-bottom: 1.5rem;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.title-separator {
    width: 60px;
    height: 4px;
    background-color: var(--c-secondary);
    margin: 0 auto 2rem auto;
    border-radius: 2px;
}

.blog-subtitle {
    font-size: 1.25rem;
    color: var(--c-text-muted);
    line-height: 1.7;
    margin-bottom: 3.5rem;
    max-width: 680px;
    margin-left: auto;
    margin-right: auto;
    font-weight: 400;
}

.highlight {
    position: relative;
    display: inline-block;
    z-index: 1;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 4px; left: -2px; right: -2px;
    height: 12px;
    background-color: rgba(255, 198, 26, 0.25);
    z-index: -1;
    transform: rotate(-1deg);
}

/* =========================================
   FILTROS (TABS SYSTEM)
   ========================================= */

.blog-filters {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    background-color: #fff;
    padding: 0.5rem;
    border-radius: var(--radius-pill);
    border: 1px solid var(--c-border);
    box-shadow: var(--shadow-soft);
}

.filter-tab {
    text-decoration: none;
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--c-text-muted);
    transition: all 0.2s ease;
}

.filter-tab:hover {
    color: var(--c-text-main);
    background-color: var(--c-bg-page);
}

.filter-tab.active {
    background-color: var(--c-primary);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(62, 57, 186, 0.2);
}

/* =========================================
   GRID DE ARTÍCULOS
   ========================================= */

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2.5rem;
    margin-bottom: 5rem;
}

/* =========================================
   TARJETA DE ARTÍCULO (CARD)
   ========================================= */

.article-card {
    background: var(--c-bg-card);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), 
                box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), 
                border-color 0.2s;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--c-border-hover);
}

.card-link {
    position: absolute;
    inset: 0;
    z-index: 10;
    outline: none;
}

.card-link:focus-visible {
    box-shadow: 0 0 0 2px var(--c-primary);
}

/* --- Imagen de cabecera --- */
.card-image-wrapper {
    position: relative;
    height: 220px;
    overflow: hidden;
    background-color: #f1f5f9;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.article-card:hover .card-img {
    transform: scale(1.05);
}

/* --- Badge flotante --- */
.category-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--c-text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    z-index: 2;
    border: 1px solid rgba(0,0,0,0.05);
}

.dot-indicator {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

/* --- Cuerpo de Tarjeta --- */
.card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content { flex-grow: 1; }

.card-title {
    font-size: 1.25rem;
    line-height: 1.35;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--c-text-main);
    letter-spacing: -0.01em;
}

.card-excerpt {
    color: var(--c-text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Footer --- */
.card-meta {
    border-top: 1px solid var(--c-border);
    padding-top: 1rem;
    margin-top: auto;
}

.author-stack {
    display: flex;
    align-items: center;
    gap: 12px;
}

.meta-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.author-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--c-text-main);
}

.meta-date {
    font-size: 0.75rem;
    color: var(--c-text-muted);
    font-weight: 500;
}

/* ESTADO VACÍO */
.empty-state-container {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 0;
}

.empty-text {
    color: var(--c-text-muted);
    font-size: 1.1rem;
}

/* =========================================
   PAGINACIÓN
   ========================================= */
.blog-pagination {
    display: flex;
    justify-content: center;
    border-top: 1px solid var(--c-border);
    padding-top: 2rem;
    margin-top: 2rem;
}

/* =========================================
   RESPONSIVE Y ADAPTACIÓN MOBILE
   ========================================= */

@media (max-width: 768px) {
    .blog-section { padding: 3rem 1.25rem; }
    .blog-title { font-size: 2.25rem; }
    .blog-subtitle { font-size: 1.1rem; margin-bottom: 2.5rem; }
    
    /* Adaptación específica para que los filtros sean scrolleables con el dedo */
    .blog-filters {
        width: 100%;
        display: flex;
        flex-wrap: nowrap; /* Fuerza una sola línea */
        overflow-x: auto; /* Habilita el scroll horizontal */
        -webkit-overflow-scrolling: touch; /* Scroll suave en iOS */
        justify-content: flex-start;
        padding: 0.5rem;
        scrollbar-width: none; /* Oculta scrollbar en Firefox */
    }

    /* Oculta scrollbar en Chrome/Safari/Edge */
    .blog-filters::-webkit-scrollbar {
        display: none;
    }

    .filter-tab {
        flex-shrink: 0; /* Evita que los botones se aplasten */
        white-space: nowrap; /* Evita que el texto del botón se parta en dos líneas */
    }
    
    .blog-grid { grid-template-columns: 1fr; gap: 2rem; }
}

/* --- Píldora de Calificación en Cabecera --- */
.header-rating-badge {
    display: inline-flex;
    align-items: center;
    background-color: #fffbeb;
    color: #d97706;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.85rem;
    border: 1px solid #fef3c7;
    cursor: default;
}
.header-rating-badge strong {
    font-weight: 700;
    margin-left: 2px;
}