/* ============================================
   BLOG MAIN STYLES
   Based on research from Josh W. Comeau, Sara Soueidan
   ============================================ */

:root {
    /* Colors */
    --color-primary: #0B1F3A;
    --color-secondary: #FF7A00;
    --color-accent: #0EA5E9;
    --color-text: #1A1A1A;
    --color-text-light: #64748B;
    --color-bg: #FFFFFF;
    --color-bg-alt: #F8FAFC;
    --color-border: #E2E8F0;
    
    /* Typography */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

/* ============================================
   ANIMATIONS
   ============================================ */

@keyframes blob {
    0%, 100% {
        transform: translate(0, 0) scale(1);
    }
    33% {
        transform: translate(30px, -50px) scale(1.1);
    }
    66% {
        transform: translate(-20px, 20px) scale(0.9);
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-dot {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.animate-blob {
    animation: blob 7s infinite;
}

.animation-delay-2000 {
    animation-delay: 2s;
}

.animation-delay-4000 {
    animation-delay: 4s;
}

.animate-fade-in-up {
    animation: fade-in-up 0.6s ease-out;
}

.animation-delay-200 {
    animation-delay: 0.2s;
    animation-fill-mode: backwards;
}

.animation-delay-400 {
    animation-delay: 0.4s;
    animation-fill-mode: backwards;
}

.animation-delay-600 {
    animation-delay: 0.6s;
    animation-fill-mode: backwards;
}

.animation-delay-800 {
    animation-delay: 0.8s;
    animation-fill-mode: backwards;
}

/* ============================================
   CATEGORY BUTTONS
   ============================================ */

.category-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: white;
    border: 2px solid var(--color-border);
    border-radius: 0.75rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.category-btn:hover {
    border-color: var(--color-secondary);
    color: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.category-btn.active {
    background: linear-gradient(135deg, var(--color-secondary), #ff9933);
    border-color: var(--color-secondary);
    color: white;
    box-shadow: var(--shadow-lg);
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 122, 0, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.category-btn:active::before {
    width: 300px;
    height: 300px;
}

/* ============================================
   BLOG CARDS
   ============================================ */

.blog-card {
    background: white;
    border-radius: 1rem;
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
    position: relative;
}

.blog-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--color-secondary), var(--color-accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
    border-color: var(--color-secondary);
}

.blog-card:hover::before {
    transform: scaleX(1);
}

.blog-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image {
    transform: scale(1.05);
}

.blog-card-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--color-secondary), #ff9933);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-primary);
    line-height: 1.4;
    margin: 0.75rem 0;
    transition: color 0.3s ease;
}

.blog-card:hover .blog-card-title {
    color: var(--color-secondary);
}

.blog-card-excerpt {
    color: var(--color-text-light);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--color-text-light);
}

.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.blog-card-tag {
    padding: 0.25rem 0.5rem;
    background: var(--color-bg-alt);
    color: var(--color-text-light);
    font-size: 0.75rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
}

.blog-card-tag:hover {
    background: var(--color-secondary);
    color: white;
    transform: translateY(-2px);
}

/* ============================================
   POPULAR POSTS
   ============================================ */

.popular-post-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 0.75rem;
    transition: all 0.3s ease;
}

.popular-post-item:hover {
    background: var(--color-bg-alt);
    transform: translateX(4px);
}

.popular-post-number {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, var(--color-secondary), #ff9933);
    color: white;
    font-weight: 700;
    border-radius: 0.5rem;
    flex-shrink: 0;
}

.popular-post-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-primary);
    line-height: 1.4;
    transition: color 0.3s ease;
}

.popular-post-item:hover .popular-post-title {
    color: var(--color-secondary);
}

.popular-post-views {
    font-size: 0.75rem;
    color: var(--color-text-light);
    margin-top: 0.25rem;
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.75rem;
    background: white;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    font-weight: 500;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
    border-color: var(--color-secondary);
    color: var(--color-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.pagination-btn.active {
    background: var(--color-secondary);
    border-color: var(--color-secondary);
    color: white;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   LOADING STATES
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--color-bg-alt) 0%,
        #e2e8f0 50%,
        var(--color-bg-alt) 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 0.5rem;
}

.skeleton-text {
    height: 1rem;
    margin-bottom: 0.5rem;
}

.skeleton-title {
    height: 1.5rem;
    width: 80%;
    margin-bottom: 0.75rem;
}

.skeleton-image {
    height: 200px;
    width: 100%;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .category-btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.75rem;
    }
    
    .blog-card-title {
        font-size: 1.125rem;
    }
    
    .blog-card-image {
        height: 160px;
    }
}

/* ============================================
   MOBILE MENU
   ============================================ */

#mobile-menu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
}

#mobile-menu.active {
    max-height: 500px;
}

/* ============================================
   STICKY NAVIGATION SCROLL EFFECT
   ============================================ */

#main-nav.scrolled {
    box-shadow: var(--shadow-md);
}

/* ============================================
   COUNTER ANIMATION
   ============================================ */

[data-counter] {
    transition: all 0.3s ease;
}

/* ============================================
   SMOOTH SCROLL
   ============================================ */

html {
    scroll-behavior: smooth;
}

/* ============================================
   FOCUS STATES (ACCESSIBILITY)
   ============================================ */

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .no-print {
        display: none !important;
    }
}
