/* Hero Section */
.hero {
    background: linear-gradient(rgba(0,0,0,0.4), rgba(0,0,0,0.4)), url('images/blog.jpeg');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 8rem 5% 3rem;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    overflow: hidden;
    position: relative;
    margin-top: 8px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.1;
}

.hero-content {
    padding: 2rem;
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 3rem);
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.2rem;
    font-weight: 500;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* Search Bar */
.search-section {
    max-width: 800px;
    margin: -2rem auto 0;
    position: relative;
    z-index: 10;
    padding: 0 5%;
}

.search-bar {
    display: flex;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.search-input {
    flex: 1;
    padding: 1.2rem 2rem;
    border: none;
    font-size: 1rem;
    outline: none;
}

.search-btn {
    background: #667eea;
    color: white;
    padding: 1.2rem 2.5rem;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s;
}

.search-btn:hover {
    background: #5568d3;
}

/* Main Content */
.main-content {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 3%;
    display: flex;
    gap: 3rem;
}

/* Blog Posts Area */
.blog-posts {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    min-width: 0; /* Prevents flex item from overflowing */
}

/* Category Filters */
.category-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.category-btn {
    padding: 0.6rem 1.5rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    color: #666;
}

.category-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.category-btn.active {
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    background: linear-gradient(135deg, #3712bd 0%, #57dd18 100%);
    color: white;
    border-color: transparent;
}

/* Featured Post */
.featured-post {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 3rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.featured-post:hover {
    transform: translateY(-5px);
}

.featured-image {
    height: 400px;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    background: linear-gradient(135deg, #3712bd 0%, #57dd18 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: white;
    position: relative;
}

.featured-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: #ff6b6b;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
}

.featured-content {
    padding: 2rem;
}

.post-meta {
    display: flex;
    gap: 1.5rem;
    color: #999;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.post-category {
    display: inline-block;
    background: #e8eaf6;
    color: #667eea;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.post-title {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #333;
    line-height: 1.3;
}

.post-excerpt {
    color: #666;
    line-height: 1.8;
    margin-bottom: 1.5rem;
    min-height: 3.6em; /* Ensure minimum height for excerpt (approx 2 lines) */
    flex-grow: 1;
}

.read-more {
    color: #667eea;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s;
    margin-top: auto;
    padding-top: 1rem;
}

.read-more:hover {
    gap: 1rem;
}

/* Regular Blog Post Card */
.blog-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.3s;
    min-height: 250px;
    width: 100%; /* Ensure full width */
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

/* Fix for the anchor tag inside blog-card */
.blog-card > a {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 0;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.blog-image {
    height: 250px;
    min-height: 250px;
    width: 100%;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    background: linear-gradient(135deg, #3712bd 0%, #57dd18 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: white;
    flex-shrink: 0;
}

.blog-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 250px;
}

.blog-title {
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
    color: #333;
    line-height: 1.3;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    width: 350px;
    flex-shrink: 0; /* Prevent sidebar from shrinking */
    max-width: 350px; /* Prevent sidebar from growing */
}

.sidebar-widget {
    background: white;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.widget-title {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.8rem;
}

/* Popular Posts Widget */
.popular-post {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    cursor: pointer;
    transition: transform 0.3s;
}

.popular-post:hover {
    transform: translateX(5px);
}

.popular-post:last-child {
    margin-bottom: 0;
}

.popular-thumb {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    background: linear-gradient(135deg, #3712bd 0%, #57dd18 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    flex-shrink: 0;
}

.popular-info h4 {
    font-size: 0.95rem;
    margin-bottom: 0.3rem;
    color: #333;
    line-height: 1.4;
}

.popular-date {
    color: #999;
    font-size: 0.85rem;
}

/* Categories Widget */
.category-list {
    list-style: none;
}

.category-item {
    padding: 0.8rem 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
    transition: padding-left 0.3s;
}

.category-item:hover {
    padding-left: 0.5rem;
    color: #667eea;
}

.category-item:last-child {
    border-bottom: none;
}

.category-count {
    background: #f0f0f0;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.85rem;
}

/* Tags Widget */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tag {
    padding: 0.5rem 1rem;
    background: #f0f0f0;
    border-radius: 20px;
    color: #666;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.tag:hover {
    background: #667eea;
    color: white;
}

/* Newsletter Widget */
.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.newsletter-input {
    padding: 0.8rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}

.newsletter-input:focus {
    outline: none;
    border-color: #667eea;
}

.newsletter-btn {
    padding: 0.8rem;
    /*background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);*/
    background: linear-gradient(135deg, #3712bd 0%, #57dd18 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.3s;
}

.newsletter-btn:hover {
    transform: translateY(-2px);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
}

.page-btn {
    padding: 0.7rem 1.2rem;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    color: #666;
}

.page-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.page-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        flex-direction: column;
    }

    .blog-posts {
        width: 100%;
        flex: none; /* Reset flex on mobile */
    }

    .pagination {
        max-width: 100%;
    }

    .sidebar {
        order: -1;
        width: 100%; /* Full width on mobile */
        max-width: 100%;
    }

    .blog-card {
        width: 100%;
    }

    .blog-card > a {
        grid-template-columns: 1fr;
    }

    .blog-image {
        width: 100%;
        height: 250px;
    }

    .blog-content {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        flex-direction: column;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }

    .search-bar {
        flex-direction: column;
        border-radius: 15px;
    }

    .search-btn {
        width: 100%;
    }

    .featured-image {
        height: 250px;
        font-size: 3rem;
    }

    .featured-content {
        padding: 1.5rem;
    }

    .post-title {
        font-size: 1.5rem;
    }

    .blog-card {
        grid-template-columns: 1fr;
    }

    .blog-card > a {
        grid-template-columns: 1fr;
    }

    .blog-image {
        width: 100%;
        height: 200px;
    }

    .blog-content {
        padding: 1.5rem;
    }

    .category-filters {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .category-filters::-webkit-scrollbar {
        display: none;
    }

    .category-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
}