/* Blog Page - Modern Dark Theme */

/* Override header visibility */
.header-area {
    display: block !important;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-darker);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* Blog Search Section */
.blog-search-section {
    padding: 2rem 0 3rem;
    position: relative;
}

.blog-container {
    padding: 80px 0;
}

.category-filter {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 4rem;
}

.filter-btn {
    padding: 12px 24px;
    border: 2px solid var(--border-light);
    background: var(--bg-darker);
    color: var(--text-secondary);
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    text-decoration: none;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2.5rem;
    margin-bottom: 4rem;
}

.blog-card {
    background: var(--bg-darker);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: all 0.4s ease;
    position: relative;
    border: 1px solid var(--border-light);
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.blog-card-image {
    height: 240px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    position: relative;
    overflow: hidden;
}

.blog-card-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
}

.blog-card-image .icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    font-size: 3rem;
    color: white;
}

/* Fix for regular blog card images */
.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.blog-card-content {
    padding: 2rem;
}

/* Updated blog meta layout for ALL screen sizes */
.blog-meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.meta-inline {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    order: 2;
}

.category-tag {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    align-self: flex-start;
    order: 1;
}

/* Hide the bullet separator for all screens */
.meta-inline span:nth-child(2) {
    display: none;
}

.blog-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.3;
    color: var(--text-primary);
}

.blog-card p {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

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

.read-more:hover {
    color: var(--accent-color);
    text-decoration: none;
    transform: translateX(4px);
}

.newsletter-section {
    background: var(--bg-darker);
    border-radius: 30px;
    padding: 4rem 2rem;
    margin: 4rem 0;
    text-align: center;
    box-shadow: var(--shadow-soft);
    border: 1px solid var(--border-light);
}

.newsletter-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.newsletter-section p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.newsletter-form {
    display: flex;
    max-width: 400px;
    margin: 0 auto;
    gap: 1rem;
}

.newsletter-form input {
    flex: 1;
    padding: 16px 20px;
    border: 2px solid var(--border-light);
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.newsletter-form input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 3px rgba(75, 142, 241, 0.1);
}

.newsletter-btn {
    padding: 16px 32px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* FEATURED POST STYLES */
/* Featured Post Fixes */
.featured-post {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    min-height: 400px;
    height: auto;
    margin-bottom: 2rem;
    padding: 0;
}

.featured-content {
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-post h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Fixed featured image container */
.featured-image {
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    height: 460px;
    min-height: 460px;
    padding: 0;
    margin: 0;
    border-radius: 0 12px 12px 0;
}

/* Featured image styling */
.featured-image .blog-card-image {
    height: 100%;
    background: none;
    position: relative;
    overflow: hidden;
    padding: 0;
    margin: 0;
}

.featured-image .blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: 0 12px 12px 0;
}

/* Icon fallback for featured image */
.featured-image .blog-card-image .icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    font-size: 4rem;
    color: white;
}

/* Ensure featured image takes full space when no image */
.featured-image .blog-card-image:not(:has(img)) {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

/* No posts message */
.no-posts-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 4rem 2rem;
}

.no-posts-message i {
    color: #ccc;
    margin-bottom: 1rem;
}

.no-posts-message h3 {
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.no-posts-message p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.btn:hover {
    background: var(--accent-color);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Mobile Responsive Design */
@media (max-width: 768px) {
    .blog-hero h1 {
        font-size: 2.5rem;
    }

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

    /* ============================================
       FEATURED POST - VERTICAL LAYOUT (MOBILE)
       Image on TOP, Content BELOW
       ============================================ */
    .featured-post {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: unset !important;
        grid-template-rows: unset !important;
        height: auto !important;
        min-height: auto !important;
    }

    /* Image on top - FIRST in visual order */
    .featured-image {
        order: -1 !important;
        height: 350px !important;
        min-height: 350px !important;
        max-height: 350px !important;
        width: 100% !important;
        flex-shrink: 0 !important;
        border-radius: 12px 12px 0 0 !important;
    }

    /* Content below image - SECOND in visual order */
    .featured-content {
        order: 1 !important;
        padding: 2rem !important;
        width: 100% !important;
        flex-shrink: 0 !important;
    }

    /* Ensure featured image container is fixed height */
    .featured-image .blog-card-image {
        height: 350px !important;
        min-height: 350px !important;
        max-height: 350px !important;
        position: relative !important;
    }

    /* Ensure image itself fills container */
    .featured-image .blog-card-image img {
        height: 100% !important;
        width: 100% !important;
        object-fit: cover !important;
        border-radius: 12px 12px 0 0 !important;
    }

    .newsletter-form {
        flex-direction: column;
    }

    .category-filter {
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 1rem;
    }

    .newsletter-section {
        padding: 3rem 1.5rem;
    }

    .newsletter-section h3 {
        font-size: 2rem;
    }
}

/* Extra Small Devices (Phones) */
@media (max-width: 480px) {
    /* Featured Post - Optimized for small screens */
    .featured-image {
        height: 280px !important;
        min-height: 280px !important;
        max-height: 280px !important;
    }

    .featured-image .blog-card-image {
        height: 280px !important;
        min-height: 280px !important;
        max-height: 280px !important;
    }

    .featured-image .blog-card-image img {
        height: 100% !important;
        width: 100% !important;
        object-fit: cover !important;
        border-radius: 12px 12px 0 0 !important;
    }

    .featured-content {
        padding: 1.5rem !important;
    }

    .featured-post h3 {
        font-size: 1.5rem !important;
    }

    /* Regular blog cards */
    .blog-card-image {
        height: 200px !important;
    }

    .blog-card-content {
        padding: 1.5rem !important;
    }

    /* Category filter scroll on small screens */
    .category-filter {
        justify-content: flex-start !important;
        gap: 0.75rem !important;
    }

    .filter-btn {
        padding: 10px 20px !important;
        font-size: 0.9rem !important;
        white-space: nowrap !important;
    }
}

/* Blog Search Styles */
.blog-search {
    margin-top: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.search-form {
    margin-bottom: 1rem;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 1rem 3.5rem 1rem 3.5rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.7);
}

.search-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.25);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.clear-search {
    position: absolute;
    right: 1.25rem;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}

.clear-search:hover {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.search-results-info {
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.95rem;
    margin-top: 1rem;
    margin-bottom: 0;
}

.search-results-info strong {
    color: white;
    font-weight: 600;
}

/* Animation Classes */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease;
}

.animate-on-scroll.animate {
    opacity: 1;
    transform: translateY(0);
}

/* ============================================
   DESKTOP ENHANCEMENTS (ABOVE MOBILE)
   ============================================ */

/* Featured Post Paragraph Truncation */
.featured-post p {
    display: -webkit-box !important;
    -webkit-line-clamp: 3 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    margin-bottom: 1.5rem !important;
}

/* Category Filter Active State with Border */
.filter-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
    border-color: var(--primary) !important;
    border-width: 3px !important;
    color: white !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3) !important;
}

/* Load More Section */
.load-more-section {
    text-align: center;
    padding: 3rem 0;
    margin-top: 2rem;
}

.load-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    padding: 16px 48px;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    overflow: hidden;
    text-decoration: none;
}

.load-more-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
    z-index: 0;
}

.load-more-btn .btn-text,
.load-more-btn i {
    position: relative;
    z-index: 1;
}

.load-more-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(99, 102, 241, 0.4);
    color: white;
    text-decoration: none;
}

.load-more-btn:hover::before {
    left: 100%;
}

.load-more-btn:active {
    transform: translateY(0);
}

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

.load-more-btn:hover i {
    transform: translateY(3px);
}

.load-more-btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.load-more-btn.loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .load-more-section {
        padding: 2rem 0;
    }

    .load-more-btn {
        padding: 14px 36px;
        font-size: 0.95rem;
    }
}
