/* Blog Page Styles */

/* Blog Controls */
.blog-controls {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}  

.search-container {
    display: flex;
    max-width: 500px;
    width: 100%;
}

#blog-search {
    flex: 1;
    padding: 0.8rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px 0 0 4px;
    background-color: var(--card-bg);
    color: var(--text-color);
    font-size: 1rem;
}

#search-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 0 4px 4px 0;
    padding: 0 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

#search-btn:hover {
    background-color: var(--secondary-color);
}

.tags-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.8rem;
    margin-top: 0.5rem;
}

.filter-label {
    font-weight: 500;
    margin-right: 0.5rem;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 30px;
    background-color: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.tag-btn:hover, .tag-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Blog Grid */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.blog-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px var(--shadow-color);
}

.blog-image {
    height: 200px;
    overflow: hidden;
}

.blog-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.blog-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background-color: rgba(140, 131, 255, 0.1);
    color: var(--primary-color);
    padding: 0.3rem 0.8rem;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 500;
}

.blog-title {
    font-size: 1.4rem;
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.blog-meta {
    display: flex;
    justify-content: space-between;
    color: #888;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.blog-excerpt {
    margin-bottom: 1.5rem;
    line-height: 1.6;
    color: var(--text-color);
    opacity: 0.9;
}

.read-more {
    color: var(--primary-color);
    font-weight: 500;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
    transition: color 0.3s ease;
}

.read-more:hover {
    color: var(--secondary-color);
}

.read-more i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.read-more:hover i {
    transform: translateX(3px);
}

/* Blog Post Page */
.blog-post {
    max-width: 800px;
    margin: 0 auto;
}

.blog-post-header {
    margin-bottom: 2rem;
}

.blog-post-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.blog-post-meta {
    display: flex;
    gap: 1.5rem;
    color: #888;
    margin-bottom: 1.5rem;
}

.blog-post-image {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.blog-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-post-content {
    line-height: 1.8;
    font-size: 1.1rem;
}

.blog-post-content p {
    margin-bottom: 1.5rem;
}

.blog-post-content h2 {
    margin: 2rem 0 1rem;
    font-size: 1.8rem;
}

.blog-post-content h3 {
    margin: 1.8rem 0 0.8rem;
    font-size: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .blog-controls {
        flex-direction: column;
    }
    
    .search-container {
        width: 100%;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .blog-post-title {
        font-size: 2rem;
    }
    
    .blog-post-image {
        height: 300px;
    }
}

/* Animation for blog cards */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.blog-card {
    animation: fadeIn 0.5s ease forwards;
}

.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;
}