/* Hero Section */
.hero-section {
    color: white;
    padding: 4rem 0 0 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::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="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-container {
    max-width: 1400px;
    margin: 0 auto;
    /*padding: 2rem;*/
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 800;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, #ffffff 0%, #f7fafc 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
    margin-left: auto;
    margin-right: auto;
}

/* Controls Container */
.controls-container {
    margin: 0 auto;
    padding: 2rem 0;
}

/* Search bar */
.search-container {
    margin-bottom: 1.5rem;
}

.search-wrapper {
    position: relative;
    max-width: 450px;
    margin: 0 auto;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 1rem;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: none;
    border-radius: 50px;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #2d3748;
    transition: all 0.3s ease;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.search-input:focus {
    outline: none;
    background: white;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.search-input::placeholder {
    color: #a0aec0;
}

/* Tag Filter Tabs */
.tag-tabs-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.tag-tab {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 0.6rem 1.25rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    backdrop-filter: blur(10px);
}

.tag-tab:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.tag-tab.active {
    background: white;
    color: #4c51bf;
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.tag-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.25rem 0.5rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.tag-tab.active .tag-count {
    background: #e2e8f0;
    color: #4a5568;
}

/* Posts Grid */
.posts-container {
    display: grid;
    gap: 2.5rem;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
}

.post-card {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    /* Initial hidden state */
    opacity: 0;
    transform: translateY(10px);
    /* Prepare for expansion animation */
    transform-origin: center;
    will-change: transform;
}

/* Animation class that gets added by JavaScript */
.post-card.animate-in {
    animation: postFadeIn 0.3s ease forwards;
}

/* Enhanced hover effect */
.post-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Fast, consistent animation for all posts */
@keyframes postFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

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

.post-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #1a202c;
    line-height: 1.3;
}

.post-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: #667eea;
}

.post-excerpt {
    color: #4a5568;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    font-size: 0.85rem;
    color: #64748b;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #64748b;
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    color: #553c9a;
    transform: translateX(4px);
}

/* Post Tags in Homepage Cards */
.post-card .post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

/* No Results State */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: #cbd5e0;
    grid-column: 1 / -1; /* Span all columns in grid */
}

.no-results-content {
    max-width: 400px;
    margin: 0 auto;
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: #cbd5e0;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #cbd5e0;
}

.no-results p {
    color: #cbd5e0;
}


/* Responsive - Homepage */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-container {
        padding: 1rem;
    }
    
    .controls-container {
        padding: 1rem;
    }
    
    .posts-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .post-card {
        padding: 1.5rem;
    }
    
    .tag-tabs-container {
        gap: 0.25rem;
    }
    
    .tag-tab {
        padding: 0.5rem 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .hero-section {
        padding: 2rem 1rem;
    }
    
    .hero-container {
        padding: 1rem;
    }
    
    .controls-container {
        padding: 0.5rem 1rem;
    }
    
    .search-wrapper {
        max-width: 100%;
        padding: 0 0.5rem;
    }
    
    .tag-tabs-container {
        padding: 0 0.5rem;
    }
}
