/* ==========================================================================
   CATEGORY ARCHIVE PAGE STYLES
   ========================================================================== */

/* Hero Section - Default neutral background (can be overridden by inline style) */
/* Hero Section - Default neutral background (can be overridden by inline style) */
.category-hero {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 60px 20px;
    text-align: left;
    position: relative;
    overflow: hidden;
    min-height: 250px;
    contain: layout style paint;
    display: flex;
    align-items: center;
}

.category-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 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='%23000000' 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");
    opacity: 0.5;
}

.category-hero-container {
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 40px;
    width: 100%;
}

/* Icon Container */
.category-hero-icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 1. Image Style (Featured Image) - Prominent & Card-like */
.hero-image-wrapper {
    width: 280px; /* Increased from 180px */
    height: auto;
    background: #fff;
    padding: 12px;
    border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    transform: rotate(-2deg);
    transition: transform 0.3s ease;
}

.hero-image-wrapper:hover {
    transform: rotate(0deg) scale(1.02);
}

.hero-image-wrapper img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 16px;
    aspect-ratio: 1/1; /* Ensure square aspect ratio consistency */
    object-fit: contain; /* Don't crop, show full image */
}

/* 2. SVG Style - Clean & Simple */
.hero-svg-wrapper img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
}

/* 3. Emoji Style - Large & Fun */
.hero-emoji-wrapper {
    font-size: 5rem;
    line-height: 1;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.1));
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Content Area */
.category-hero-content {
    flex: 1;
}

/* Default text color for neutral background */
.category-hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: #1f2937;
    margin: 0 0 15px;
    line-height: 1.1;
    text-shadow: 2px 2px 0px rgba(255,255,255,0.5);
}

.category-hero-desc {
    font-size: 1.15rem;
    color: #4b5563;
    max-width: 600px;
    margin: 0 0 25px;
    line-height: 1.6;
}

.category-hero-stats {
    display: flex;
    justify-content: flex-start;
    gap: 30px;
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    color: #374151;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    font-weight: 600;
}

.stat-icon {
    font-size: 1.2em;
}

.stat-value {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--color-accent, #D97757);
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* When custom color is applied via inline style, override text to white */
.category-hero[style*="background"] .category-hero-title {
    color: #fff;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.category-hero[style*="background"] .category-hero-desc {
    color: rgba(255,255,255,0.95);
    font-weight: 500;
}

.category-hero[style*="background"] .stat-item {
    background: rgba(255,255,255,0.2);
    color: #fff;
    box-shadow: none;
    border: 1px solid rgba(255,255,255,0.3);
}

.category-hero[style*="background"] .stat-value {
    color: #fff;
}

.category-hero[style*="background"]::before {
    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.1'%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");
}


/* Siblings/Related Categories */
.category-siblings {
    background: #f8fafc;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    min-height: 80px;
    contain: layout style;
}

.siblings-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.siblings-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #64748b;
}

.siblings-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.sibling-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.sibling-chip:hover {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.sibling-chip .chip-icon {
    font-size: 1em;
}

.sibling-chip .chip-count {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: rgba(0,0,0,0.08);
    border-radius: 20px;
}

.sibling-chip:hover .chip-count {
    background: rgba(255,255,255,0.2);
}

/* Posts Section */
.category-posts-section {
    padding: 40px 20px 80px;
    background: #fff;
}

.category-posts-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Toolbar */
.category-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
}

.showing-info {
    font-size: 0.9rem;
    color: #64748b;
}

/* Posts Grid */
.category-posts-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

/* Post Card */
.category-post-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f1f5f9;
    contain: layout style;
}

.category-post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.12);
    border-color: #667eea;
}

.category-post-card .post-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.category-post-card .post-card-image {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f8fafc;
    contain: layout style paint;
}

.category-post-card .post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
    transition: transform 0.4s ease;
    aspect-ratio: 1 / 1;
}

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

.category-post-card .post-card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    display: flex;
    justify-content: space-between;
}

.category-post-card .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(8px);
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #374151;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-post-card .badge-icon {
    font-size: 0.85em;
}

.category-post-card .post-card-content {
    padding: 18px;
    text-align: center;
    min-height: 60px;
}

.category-post-card .post-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
}

/* Pagination */
.category-pagination {
    margin-top: 50px;
    text-align: center;
}

.category-pagination .page-numbers {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.category-pagination .page-numbers li {
    display: inline-block;
}

.category-pagination .page-numbers a,
.category-pagination .page-numbers span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: #f8fafc;
    color: #374151;
    font-weight: 500;
    text-decoration: none;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.category-pagination .page-numbers a:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
    transform: translateY(-2px);
}

.category-pagination .page-numbers .current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-color: transparent;
}

.category-pagination .nav-arrow {
    font-size: 1.2em;
}

.category-pagination .nav-text {
    margin: 0 5px;
}

/* No Posts */
.no-posts {
    text-align: center;
    padding: 80px 20px;
}

.no-posts-icon {
    font-size: 5rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-posts-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 10px;
}

.no-posts-text {
    font-size: 1.1rem;
    color: #6b7280;
    margin: 0 0 30px;
}

.back-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.back-home-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

/* Responsive */
@media (max-width: 1024px) {
    .category-posts-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .category-hero {
        padding: 40px 20px 50px;
        text-align: center; /* Center on mobile */
        display: block; /* Disable flex on hero wrapper */
    }
    
    .category-hero-container {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .category-hero-icon {
        margin-bottom: 10px;
    }

    .hero-image-wrapper {
        width: 200px; /* Increased from 140px */
        transform: rotate(0deg); /* No rotation on mobile */
        margin: 0 auto; /* Ensure centered */
    }

    .hero-emoji-wrapper {
        font-size: 4rem;
    }
    
    .category-hero-title {
        font-size: 2rem;
        margin-bottom: 10px;
    }

    .category-hero-desc {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .category-hero-stats {
        justify-content: center; /* Center stats on mobile */
    }
    
    .category-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .siblings-container {
        flex-direction: column;
    }
    
    .sibling-chip {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .category-toolbar {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .category-hero-title {
        font-size: 1.75rem;
    }
    
    .stat-item {
        padding: 8px 15px;
        font-size: 0.85rem;
    }
    
    .category-post-card .post-card-content {
        padding: 12px;
    }
    
    .category-post-card .post-card-title {
        font-size: 0.9rem;
    }
}
