/**
 * Category Page Styles - OpaNoticias
 * 
 * Estilos específicos para páginas de categoría.
 * Mobile-first approach para mejor rendimiento.
 */

/* ==================== BREADCRUMBS ==================== */
.breadcrumbs {
    background: #f8f9fa;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.breadcrumbs-list {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-item a:hover {
    color: #e63946;
}

.breadcrumb-item .separator {
    margin: 0 8px;
    color: #ccc;
}

.breadcrumb-item.current span {
    color: #1a1a2e;
    font-weight: 500;
}

/* ==================== CATEGORY HEADER ==================== */
.category-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #2d2d44 100%);
    color: white;
    padding: 30px 0;
    margin-bottom: 30px;
}

.category-header-content {
    text-align: center;
}

.category-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.category-description {
    font-size: 15px;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 15px;
    line-height: 1.5;
}

.category-stats {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    opacity: 0.85;
}

.category-stats .stat-item strong {
    color: #e63946;
}

/* ==================== MAIN LAYOUT ==================== */
.category-main {
    padding-bottom: 50px;
}

.category-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
}

/* ==================== POSTS GRID ==================== */
.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

/* ==================== POST CARD ==================== */
.post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.post-card-image {
    display: block;
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}

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

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

.post-card-category {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #e63946;
    color: white;
    padding: 4px 10px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 4px;
    letter-spacing: 0.5px;
    z-index: 2;
}

.post-card-body {
    padding: 16px;
}

.post-card-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 10px;
}

.post-card-title a {
    color: #1a1a2e;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-title a:hover {
    color: #e63946;
}

.post-card-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #999;
}

.post-card-author {
    font-weight: 500;
    color: #666;
}

/* ==================== FEATURED POST (First) ==================== */
.post-card-featured .post-card-title {
    font-size: 18px;
}

.post-card-featured .post-card-excerpt {
    -webkit-line-clamp: 3;
}

/* ==================== PAGINATION ==================== */
.pagination {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #eee;
}

.pagination-inner {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    min-height: 44px; /* Touch target */
}

.pagination-btn:hover:not(.disabled) {
    background: #e63946;
    border-color: #e63946;
    color: white;
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-btn svg {
    flex-shrink: 0;
}

.pagination-numbers {
    display: flex;
    gap: 4px;
}

.pagination-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
}

.pagination-number:hover:not(.current) {
    border-color: #e63946;
    color: #e63946;
}

.pagination-number.current {
    background: #e63946;
    border-color: #e63946;
    color: white;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    padding: 0 6px;
    color: #999;
}

/* ==================== SIDEBAR ==================== */
.category-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-widget {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.widget-title {
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e63946;
    color: #1a1a2e;
}

/* Sidebar Categories */
.sidebar-categories {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-categories li {
    margin-bottom: 6px;
}

.sidebar-categories a {
    display: block;
    padding: 10px 14px;
    color: #333;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.sidebar-categories a:hover {
    background: #f8f9fa;
    color: #e63946;
    padding-left: 18px;
}

.sidebar-categories a.active {
    background: #e63946;
    color: white;
}

/* Newsletter Widget */
.sidebar-newsletter p {
    font-size: 13px;
    color: #666;
    margin: 0 0 12px;
    line-height: 1.5;
}

.newsletter-form input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 14px;
    transition: border-color 0.2s ease;
}

.newsletter-form input:focus {
    outline: none;
    border-color: #e63946;
}

.newsletter-form button {
    width: 100%;
    padding: 12px 20px;
    background: #e63946;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.newsletter-form button:hover {
    background: #c5303c;
}

/* Sidebar Banner */
.sidebar-banner {
    text-align: center;
}

.sidebar-banner .ad-label {
    display: block;
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.sidebar-banner img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* ==================== NO POSTS ==================== */
.no-posts {
    text-align: center;
    padding: 50px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.no-posts-icon {
    color: #ddd;
    margin-bottom: 16px;
}

.no-posts h2 {
    font-size: 22px;
    color: #333;
    margin: 0 0 8px;
}

.no-posts p {
    color: #666;
    margin: 0 0 20px;
    font-size: 14px;
}

.btn-primary {
    display: inline-block;
    padding: 12px 28px;
    background: #e63946;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: background 0.2s ease;
}

.btn-primary:hover {
    background: #c5303c;
}

/* ==================== TABLET (768px+) ==================== */
@media (min-width: 768px) {
    .category-header {
        padding: 40px 0;
    }
    
    .category-title {
        font-size: 32px;
    }
    
    .posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
    
    .post-card-featured {
        grid-column: span 2;
    }
    
    .post-card-featured .post-card-image {
        aspect-ratio: 21/9;
    }
    
    .post-card-featured .post-card-title {
        font-size: 22px;
    }
    
    .post-card-body {
        padding: 20px;
    }
    
    .post-card-title {
        font-size: 17px;
    }
    
    .pagination-btn span {
        display: inline;
    }
    
    .sidebar-widget {
        padding: 24px;
    }
}

/* ==================== DESKTOP (1024px+) ==================== */
@media (min-width: 1024px) {
    .category-layout {
        grid-template-columns: 1fr 300px;
        gap: 40px;
    }
    
    .category-sidebar {
        position: sticky;
        top: 100px;
        height: fit-content;
    }
    
    .post-card-featured .post-card-title {
        font-size: 24px;
    }
    
    .post-card-featured .post-card-excerpt {
        font-size: 15px;
        -webkit-line-clamp: 4;
    }
}

/* ==================== LARGE DESKTOP (1200px+) ==================== */
@media (min-width: 1200px) {
    .category-header {
        padding: 50px 0;
    }
    
    .category-title {
        font-size: 36px;
    }
    
    .posts-grid {
        gap: 30px;
    }
    
    .category-layout {
        grid-template-columns: 1fr 320px;
    }
}