/* Blog Page Specific Styles */

/* --- Hero Section --- */
.blog-hero {
    padding: 160px 0 80px;
    text-align: center;
    position: relative;
    background: radial-gradient(circle at center, rgba(76, 175, 80, 0.15) 0%, transparent 70%);
}

.blog-hero h1 {
    font-size: clamp(2rem, 8vw, 4rem);
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #1B5E20 0%, #66BB6A 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: 900;
    letter-spacing: -0.02em;
    animation: fadeInUp 0.8s ease-out;
}

.blog-hero p {
    font-size: clamp(1rem, 2vw, 1.3rem);
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

/* --- Toolbar --- */
.blog-toolbar {
    margin-bottom: 3rem;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-radius: 20px;
    padding: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.dark-mode .blog-toolbar {
    background: rgba(10, 20, 10, 0.4);
}

.filter-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-chip {
    padding: 10px 20px;
    border-radius: 24px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.filter-chip::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--accent) 0%, rgba(76, 175, 80, 0.5) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-chip:hover {
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.filter-chip.active {
    background: var(--accent);
    color: #000;
    font-weight: 700;
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(76, 175, 80, 0.4);
}

.filter-chip.active::before {
    opacity: 1;
}

.search-group {
    flex-grow: 1;
    max-width: 450px;
    position: relative;
}

.search-group input {
    width: 100%;
    padding: 12px 18px;
    padding-left: 45px;
    border-radius: 16px;
    border: 1px solid rgba(76, 175, 80, 0.2);
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(5px);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.search-group input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.search-group input::placeholder {
    color: var(--text-muted);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
}

/* --- Grid --- */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 2.5rem;
    padding-bottom: 120px;
}

/* --- Article Card --- */
.blog-card {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    height: 100%;
    position: relative;
    animation: fadeInUp 0.6s ease-out backwards;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(76, 175, 80, 0.1) inset;
}

.dark-mode .blog-card {
    background: linear-gradient(135deg, rgba(20, 30, 20, 0.6), rgba(10, 20, 10, 0.4));
}

.blog-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    padding: 1px;
    background: linear-gradient(135deg, transparent 0%, var(--accent) 50%, transparent 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.blog-card:hover::before {
    opacity: 0.6;
}

.blog-card:hover {
    transform: translateY(-12px);
    border-color: var(--accent);
    box-shadow: 0 20px 50px rgba(76, 175, 80, 0.15);
}

.card-cover-wrapper {
    position: relative;
    width: 100%;
    padding-top: 52.5%;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    overflow: hidden;
}

.card-cover {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0.85;
}

.blog-card:hover .card-cover {
    transform: scale(1.1);
    opacity: 1;
}

.card-body {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.card-meta {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.card-categories {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.cat-tag {
    color: var(--accent);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
    padding: 4px 10px;
    background: rgba(76, 175, 80, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(76, 175, 80, 0.2);
}

.card-title {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-heading);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.blog-card:hover .card-title {
    color: var(--accent);
}

.card-excerpt {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
}

.card-footer {
    margin-top: auto;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-read {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.95rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 8px 0;
}

.btn-read i {
    transition: transform 0.3s ease;
}

.blog-card:hover .btn-read {
    color: var(--accent);
}

.blog-card:hover .btn-read i {
    transform: translateX(6px);
}

/* --- Skeleton Loading --- */
.skeleton {
    background: linear-gradient(90deg, #1a1a1a 25%, #252525 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 8px;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation for cards */
.blog-card:nth-child(1) {
    animation-delay: 0s;
}

.blog-card:nth-child(2) {
    animation-delay: 0.1s;
}

.blog-card:nth-child(3) {
    animation-delay: 0.2s;
}

.blog-card:nth-child(4) {
    animation-delay: 0.3s;
}

.blog-card:nth-child(5) {
    animation-delay: 0.4s;
}

.blog-card:nth-child(6) {
    animation-delay: 0.5s;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    .blog-card,
    .blog-hero h1,
    .blog-hero p,
    .blog-toolbar {
        animation: none;
    }

    .blog-card:hover {
        transform: none;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 140px 0 50px;
    }

    .blog-toolbar {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        gap: 1.25rem;
    }

    .filter-group {
        justify-content: center;
        gap: 0.5rem;
    }

    .filter-chip {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

    .search-group {
        max-width: 100%;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .card-body {
        padding: 1.5rem;
    }
}