/**
 * Blog Styles - PrecisionTex
 * Estilos mejorados para el blog con diseño premium
 */

/* ===== VARIABLES ADICIONALES PARA BLOG ===== */
:root {
    --blog-card-bg: #ffffff;
    --blog-card-border: rgba(0, 0, 0, 0.08);
    --blog-text-primary: #1F2937;
    --blog-text-secondary: #4B5563;
    --blog-text-muted: #6B7280;
    --blog-bg-light: #f8fafc;
    --blog-bg-muted: #f1f5f9;
    --blog-shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --blog-shadow-medium: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --blog-shadow-large: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* ===== BLOG SECTION BACKGROUND ===== */
.blog-section {
    background: var(--blog-bg-light);
    padding: var(--spacing-16) 0;
}

/* ===== BLOG LAYOUT ===== */
.blog-container {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .blog-container {
        grid-template-columns: 1fr;
    }
}

/* ===== BLOG GRID ===== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 28px;
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== BLOG CARD - DISEÑO PREMIUM ===== */
.blog-card {
    background: var(--blog-card-bg);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--blog-card-border);
    box-shadow: var(--blog-shadow-soft);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--blog-shadow-large);
    border-color: rgba(130, 180, 64, 0.3);
}

/* Card Image */
.blog-card .blog-image {
    position: relative;
    height: 220px;
    overflow: hidden;
    background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
}

.blog-card .blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card:hover .blog-image img {
    transform: scale(1.08);
}

/* Category Badge */
.blog-card .blog-category-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: linear-gradient(135deg, #82B440 0%, #6b9935 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 2px 8px rgba(130, 180, 64, 0.4);
}

/* Card Content */
.blog-card .blog-content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    background: var(--blog-card-bg);
}

/* Meta Info */
.blog-card .blog-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.8rem;
    color: var(--blog-text-muted);
    margin-bottom: 12px;
    font-weight: 500;
}

.blog-card .blog-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Card Title */
.blog-card h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
    letter-spacing: -0.02em;
}

.blog-card h3 a {
    color: var(--blog-text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card h3 a:hover {
    color: #82B440;
}

/* Card Excerpt */
.blog-card .blog-excerpt {
    color: var(--blog-text-secondary);
    font-size: 0.925rem;
    line-height: 1.7;
    margin-bottom: 20px;
    flex-grow: 1;
}

/* Card Tags */
.blog-card .blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.blog-card .blog-tags .tag {
    background: var(--blog-bg-muted);
    color: var(--blog-text-secondary);
    padding: 5px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.blog-card .blog-tags .tag:hover {
    background: #82B440;
    color: white;
    border-color: #82B440;
}

/* Read More Link */
.blog-card .read-more {
    color: #82B440;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.blog-card .read-more:hover {
    gap: 12px;
    color: #6b9935;
}

/* ===== FEATURED ARTICLE ===== */
.blog-featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 0;
    background: var(--blog-card-bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--blog-card-border);
    box-shadow: var(--blog-shadow-medium);
    margin-bottom: 12px;
}

@media (max-width: 900px) {
    .blog-featured {
        grid-template-columns: 1fr;
    }
}

.blog-featured .blog-image {
    height: 100%;
    min-height: 380px;
}

.blog-featured .blog-content {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.blog-featured .blog-category-badge {
    position: static;
    display: inline-block;
    width: fit-content;
    margin-bottom: 16px;
}

.blog-featured h3 {
    font-size: 1.75rem;
    margin-bottom: 16px;
    line-height: 1.3;
}

.blog-featured .blog-excerpt {
    font-size: 1rem;
    margin-bottom: 24px;
}

/* ===== SIDEBAR ===== */
.blog-sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-widget {
    background: var(--blog-card-bg);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--blog-card-border);
    box-shadow: var(--blog-shadow-soft);
}

.sidebar-widget h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--blog-text-primary);
    padding-bottom: 12px;
    border-bottom: 3px solid #82B440;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Search Widget */
.sidebar-search .search-form {
    display: flex;
    gap: 0;
}

.sidebar-search input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-right: none;
    border-radius: 10px 0 0 10px;
    font-size: 0.9rem;
    color: var(--blog-text-primary);
    background: #f8fafc;
    transition: all 0.3s ease;
}

.sidebar-search input::placeholder {
    color: var(--blog-text-muted);
}

.sidebar-search input:focus {
    outline: none;
    border-color: #82B440;
    background: white;
}

.sidebar-search button {
    padding: 12px 18px;
    background: linear-gradient(135deg, #82B440 0%, #6b9935 100%);
    color: white;
    border: none;
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-search button:hover {
    background: linear-gradient(135deg, #6b9935 0%, #5a8a2d 100%);
    box-shadow: 0 4px 12px rgba(130, 180, 64, 0.4);
}

/* Categories Widget */
.sidebar-categories ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-categories li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    color: var(--blog-text-secondary);
    text-decoration: none;
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar-categories li:last-child a {
    border-bottom: none;
}

.sidebar-categories li a:hover,
.sidebar-categories li a.active {
    color: #82B440;
}

.sidebar-categories .category-icon {
    font-size: 1.2rem;
}

.sidebar-categories .category-name {
    flex: 1;
    font-size: 0.95rem;
}

.sidebar-categories .category-count {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--blog-text-muted);
}

.sidebar-categories li a:hover .category-count,
.sidebar-categories li a.active .category-count {
    background: #82B440;
    color: white;
}

/* Latest Articles Widget */
.sidebar-latest ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-latest li a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sidebar-latest li:last-child a {
    border-bottom: none;
}

.sidebar-latest .latest-title {
    display: block;
    color: var(--blog-text-primary);
    font-size: 0.925rem;
    font-weight: 600;
    line-height: 1.5;
    margin-bottom: 6px;
    transition: color 0.3s ease;
}

.sidebar-latest li a:hover .latest-title {
    color: #82B440;
}

.sidebar-latest .latest-date {
    display: block;
    font-size: 0.8rem;
    color: var(--blog-text-muted);
}

/* Tags Cloud Widget */
.sidebar-tags .tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sidebar-tags .tag {
    display: inline-block;
    background: #f1f5f9;
    color: var(--blog-text-secondary);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.825rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.sidebar-tags .tag:hover,
.sidebar-tags .tag.active {
    background: #82B440;
    color: white;
    border-color: #82B440;
    box-shadow: 0 2px 8px rgba(130, 180, 64, 0.3);
}

/* Newsletter Widget */
.sidebar-newsletter {
    background: linear-gradient(135deg, #82B440 0%, #5a8a2d 100%);
    color: white;
    border: none;
}

.sidebar-newsletter h4 {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.3);
}

.sidebar-newsletter p {
    font-size: 0.9rem;
    opacity: 0.95;
    margin-bottom: 20px;
    line-height: 1.6;
}

.sidebar-newsletter input {
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: 10px;
    margin-bottom: 12px;
    font-size: 0.9rem;
    background: white;
    color: var(--blog-text-primary);
}

.sidebar-newsletter .btn {
    width: 100%;
    padding: 14px 20px;
    background: white;
    color: #82B440;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sidebar-newsletter .btn:hover {
    background: #f8fafc;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ===== PAGINATION ===== */
.blog-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 48px;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 12px 24px;
    background: var(--blog-card-bg);
    color: #82B440;
    border: 2px solid #82B440;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background: #82B440;
    color: white;
    box-shadow: 0 4px 12px rgba(130, 180, 64, 0.3);
}

.pagination-numbers {
    display: flex;
    gap: 8px;
}

.pagination-num {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--blog-card-bg);
    color: var(--blog-text-secondary);
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.pagination-num:hover {
    border-color: #82B440;
    color: #82B440;
}

.pagination-num.active {
    background: linear-gradient(135deg, #82B440 0%, #6b9935 100%);
    border-color: #82B440;
    color: white;
    box-shadow: 0 4px 12px rgba(130, 180, 64, 0.3);
}

.pagination-ellipsis {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--blog-text-muted);
    font-weight: 600;
}

/* ===== FILTER BAR ===== */
.blog-filters {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
    padding: 20px 24px;
    background: var(--blog-card-bg);
    border-radius: 14px;
    border: 1px solid var(--blog-card-border);
    box-shadow: var(--blog-shadow-soft);
}

.blog-filters .filter-info {
    color: var(--blog-text-secondary);
    font-size: 0.95rem;
    font-weight: 500;
}

.blog-filters .filter-info strong {
    color: var(--blog-text-primary);
    font-weight: 700;
}

.blog-filters .active-filter {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #82B440 0%, #6b9935 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(130, 180, 64, 0.3);
}

.blog-filters .active-filter a {
    color: white;
    opacity: 0.85;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    line-height: 1;
}

.blog-filters .active-filter a:hover {
    opacity: 1;
}

/* ===== EMPTY STATE ===== */
.blog-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 80px 40px;
    background: var(--blog-card-bg);
    border-radius: 20px;
    border: 1px solid var(--blog-card-border);
}

.blog-empty .empty-icon {
    font-size: 5rem;
    margin-bottom: 24px;
    opacity: 0.6;
}

.blog-empty h3 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--blog-text-primary);
}

.blog-empty p {
    color: var(--blog-text-secondary);
    margin-bottom: 24px;
    font-size: 1rem;
}

/* ===== PAGE HEADER PARA BLOG ===== */
.page-header.blog-header {
    background: linear-gradient(135deg, #1a472a 0%, #2d5a3f 50%, #1f3d2a 100%);
    color: white;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.page-header.blog-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.page-header.blog-header h1 {
    color: white;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 16px;
    position: relative;
}

.page-header.blog-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}

.page-header.blog-header .breadcrumb {
    position: relative;
    margin-top: 24px;
}

.page-header.blog-header .breadcrumb a,
.page-header.blog-header .breadcrumb span {
    color: rgba(255, 255, 255, 0.7);
}

.page-header.blog-header .breadcrumb a:hover {
    color: white;
}

/* ===== CTA SECTION BLOG ===== */
.blog-cta {
    background: linear-gradient(135deg, #82B440 0%, #5a8a2d 100%);
    padding: 80px 0;
    text-align: center;
    color: white;
}

.blog-cta h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    margin-bottom: 16px;
}

.blog-cta p {
    font-size: 1.1rem;
    opacity: 0.95;
    max-width: 600px;
    margin: 0 auto 32px;
}
/* ===== Mobile Fixes Blog Listado ===== */
@media (max-width: 768px) {
    /* Asegurar contencion */
    .blog-section,
    .blog-container,
    .blog-card,
    .blog-card * {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Quebrar palabras largas en textos */
    .blog-card h3,
    .blog-card .blog-excerpt,
    .blog-card .blog-meta {
        overflow-wrap: anywhere;
        word-wrap: break-word;
    }

    /* Reducir padding interno */
    .blog-section {
        padding: 30px 0;
    }

    .blog-card .blog-content {
        padding: 20px;
    }

    /* Featured article: layout vertical */
    .blog-featured .blog-content {
        padding: 24px;
    }

    .blog-featured h3 {
        font-size: 1.3rem;
    }

    .blog-featured .blog-image {
        min-height: 220px;
    }

    /* Page header */
    .page-header.blog-header {
        padding: 50px 0;
    }

    /* Filtros: layout vertical */
    .blog-filters {
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 18px;
    }

    /* Pagination: items mas compactos */
    .blog-pagination {
        gap: 8px;
        margin-top: 32px;
    }

    .pagination-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }

    .pagination-num,
    .pagination-ellipsis {
        width: 38px;
        height: 38px;
        font-size: 0.85rem;
    }

    /* Sidebar widgets */
    .sidebar-widget {
        padding: 20px;
    }

    /* Search en sidebar */
    .sidebar-search input {
        font-size: 0.9rem;
        padding: 10px 14px;
    }

    /* Blog grid: tarjetas a 1 columna ya esta, asegurar gap */
    .blog-grid {
        gap: 20px;
    }

    /* CTA del blog */
    .blog-cta {
        padding: 50px 20px;
    }
}

@media (max-width: 480px) {
    .blog-card .blog-image {
        height: 180px;
    }

    .blog-card h3 {
        font-size: 1.05rem;
    }

    .blog-card .blog-excerpt {
        font-size: 0.875rem;
    }

    .page-header.blog-header h1 {
        font-size: 1.75rem;
    }

    .page-header.blog-header p {
        font-size: 0.95rem;
    }
}
