/* --- BLOG.HTML STYLES --- */

/* 1. MAGAZINE HERO */
.blog-hero {
    padding: 120px 0 80px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.hero-wrapper {
    display: flex;
    gap: 50px;
    align-items: center;
    background: #fff;
    padding: 20px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.hero-image {
    width: 50%;
    height: 400px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    position: relative;
}

.featured-badge {
    position: absolute;
    top: 20px; left: 20px;
    background: #0f172a;
    color: #fff;
    padding: 6px 14px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 4px;
}

.hero-text {
    width: 50%;
    padding-right: 20px;
}

.meta-tags {
    margin-bottom: 15px;
    display: flex; gap: 10px; align-items: center;
}
.meta-tags .tag {
    color: #38bdf8;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}
.meta-tags .date { color: #94a3b8; font-size: 0.85rem; }

.hero-text h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    color: #0f172a;
    font-weight: 800;
    margin-bottom: 20px;
}

.hero-text p {
    color: #64748b;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.author-row {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 30px;
}
.author-row img {
    width: 50px; height: 50px;
    border-radius: 50%;
    object-fit: cover;
}
.author-row div span { display: block; font-size: 0.75rem; color: #94a3b8; }
.author-row div h5 { font-size: 1rem; color: #0f172a; margin: 0; }

.read-btn {
    display: inline-flex; align-items: center; gap: 10px;
    color: #0f172a; font-weight: 700;
    border-bottom: 2px solid #0f172a;
    padding-bottom: 5px;
    transition: 0.2s;
}
.read-btn:hover { color: #38bdf8; border-color: #38bdf8; }

/* 2. FILTER BAR */
.blog-filter-bar {
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.blog-filter-bar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filter-list { display: flex; gap: 30px; }
.filter-list li {
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
    transition: 0.2s;
}
.filter-list li:hover, .filter-list li.active {
    color: #0f172a;
    border-color: #0f172a;
}

.search-mini {
    background: #f1f5f9;
    padding: 8px 15px;
    border-radius: 50px;
    display: flex; align-items: center; gap: 10px;
    border: 1px solid transparent;
}
.search-mini:focus-within { border-color: #cbd5e1; background: #fff; }
.search-mini input {
    border: none; background: transparent; outline: none;
    font-size: 0.9rem;
}

/* 3. ARTICLE GRID */
.blog-feed { padding: 60px 0; background: #fff; }

.grid-layout {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 60px;
}

.blog-card {
    display: flex; flex-direction: column;
    background: #fff;
    transition: 0.3s;
    cursor: pointer;
}
.blog-card:hover h3 { color: #38bdf8; }
.blog-card:hover .card-img { transform: scale(1.02); }

.card-img {
    height: 220px;
    background-size: cover;
    background-position: center;
    border-radius: 12px;
    margin-bottom: 20px;
    transition: 0.3s;
}

.card-content { display: flex; flex-direction: column; flex: 1; }

.tag-pill {
    font-size: 0.7rem; font-weight: 700; color: #64748b; text-transform: uppercase;
    margin-bottom: 10px; display: block;
}

.blog-card h3 {
    font-size: 1.4rem; font-weight: 800; color: #0f172a;
    line-height: 1.3; margin-bottom: 15px; transition: 0.2s;
}

.blog-card p {
    font-size: 1rem; color: #64748b; line-height: 1.6; margin-bottom: 20px;
}

.card-footer {
    margin-top: auto;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.85rem; color: #94a3b8; font-weight: 600;
}
.card-footer a { color: #0f172a; transition: 0.2s; }
.card-footer a:hover { color: #38bdf8; }

/* Pagination */
.pagination { display: flex; gap: 10px; justify-content: center; }
.page-btn {
    width: 40px; height: 40px;
    border: 1px solid #e2e8f0; background: #fff;
    border-radius: 8px; cursor: pointer;
    font-weight: 600; color: #64748b; transition: 0.2s;
}
.page-btn.active, .page-btn:hover {
    background: #0f172a; color: #fff; border-color: #0f172a;
}
.page-btn:last-child { width: auto; padding: 0 20px; }

/* 4. NEWSLETTER SECTION */
.newsletter-section {
    background: #ffffff;
    padding: 100px 0;
    border-top: 1px solid #e2e8f0;
}

.newsletter-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 60px;
    max-width: 1000px;
    margin: 0 auto;
}

.nl-content { max-width: 500px; }

.nl-tag {
    color: #38bdf8;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin-bottom: 15px;
    display: block;
}

.nl-content h2 {
    font-size: 2.5rem;
    color: #0f172a;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: 20px;
}

.nl-content p {
    color: #64748b;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.nl-features {
    display: flex;
    gap: 20px;
}
.nl-features span {
    font-size: 0.9rem;
    color: #475569;
    font-weight: 600;
    display: flex; align-items: center; gap: 8px;
}
.nl-features i { color: #22c55e; }

.nl-form-box {
    flex: 1;
    background: #f8fafc;
    padding: 40px;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.nl-form-box form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group {
    position: relative;
    display: flex; align-items: center;
}
.input-group i {
    position: absolute;
    left: 20px;
    color: #94a3b8;
    font-size: 1.1rem;
}
.input-group input {
    width: 100%;
    padding: 16px 16px 16px 50px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: 0.2s;
    color: #0f172a;
    background: #fff;
    -webkit-appearance: none;
    appearance: none; 
}
.input-group input:focus {
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

.nl-form-box button {
    background: #0f172a;
    color: #fff;
    padding: 16px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    display: flex; align-items: center; justify-content: center; gap: 10px;
}
.nl-form-box button:hover {
    background: #38bdf8;
    transform: translateY(-2px);
}

.form-note {
    text-align: center;
    margin-top: 15px;
    font-size: 0.8rem;
    color: #94a3b8;
}
.form-note a { color: #475569; text-decoration: underline; }

/* RESPONSIVE */
@media (max-width: 900px) {
    .hero-wrapper { flex-direction: column; }
    .hero-image, .hero-text { width: 100%; }
    .hero-image { height: 250px; }
    
    .grid-layout { grid-template-columns: 1fr; }
    .blog-filter-bar .container { flex-direction: column; gap: 20px; align-items: flex-start; }
    .filter-list { overflow-x: auto; width: 100%; padding-bottom: 10px; }
    
    .newsletter-wrapper { flex-direction: column; text-align: center; gap: 40px; }
    .nl-features { justify-content: center; }
    .nl-form-box { width: 100%; }
}

/* =========================================
   BLOG PAGE RESPONSIVE FIXES
   ========================================= */

@media (max-width: 900px) {

    /* --- 1. HERO SECTION --- */
    .blog-hero {
        padding: 60px 0 40px; /* Reduce massive top padding */
    }

    .hero-wrapper {
        flex-direction: column; /* Stack Image on top, Text below */
        gap: 30px;
        padding: 0; /* Remove internal padding for cleaner look */
        border: none; /* Remove border on mobile for edge-to-edge feel */
        box-shadow: none;
        background: transparent;
    }

    .hero-image {
        width: 100%;
        height: 250px; /* Shorter height for mobile */
        border-radius: 12px;
    }

    .hero-text {
        width: 100%;
        padding-right: 0;
        text-align: left; /* Keep text left-aligned for readability */
    }

    .hero-text h1 {
        font-size: 2rem; /* Smaller heading */
        margin-bottom: 15px;
    }

    .hero-text p {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    /* --- 2. FILTER BAR --- */
    .blog-filter-bar {
        padding: 15px 0;
        top: 60px; /* Adjust based on navbar height */
    }

    .blog-filter-bar .container {
        flex-direction: column; /* Stack Filter List and Search */
        gap: 15px;
        align-items: stretch; /* Full width */
    }

    .filter-list {
        width: 100%;
        overflow-x: auto; /* Enable horizontal scrolling */
        white-space: nowrap; /* Prevent wrapping */
        padding-bottom: 5px; /* Space for scrollbar */
        gap: 20px;
        -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
    }

    /* Hide ugly scrollbar but keep functionality */
    .filter-list::-webkit-scrollbar {
        display: none; 
    }

    .search-mini {
        width: 100%; /* Full width search bar */
    }

    .search-mini input {
        width: 100%;
    }

    /* --- 3. BLOG FEED (Grid) --- */
    .blog-feed {
        padding: 40px 0;
    }

    .grid-layout {
        display: flex !important; /* Force flex row */
        grid-template-columns: none !important; /* Disable grid */
        overflow-x: auto; /* Enable side scrolling */
        gap: 20px;
        padding-bottom: 30px; /* Space for scrollbar/shadows */
        
        /* Snap for clean scrolling feel */
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch; 
    }

    /* Adjust Card Image Height */
    .card-img {
        height: 200px; 
    }

    .blog-card {
        min-width: 280px; /* Fixed width so they don't squash */
        max-width: 280px;
        flex: 0 0 auto; /* Prevent shrinking */
        scroll-snap-align: center; /* Snap to center */
        margin-bottom: 0; /* Remove bottom margin since we scroll sideways */
    }
    .grid-layout::-webkit-scrollbar {
        display: none;
    }
    /* Pagination - Center it */
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* --- 4. NEWSLETTER SECTION --- */
    .newsletter-section {
        padding: 60px 0;
    }

    .newsletter-wrapper {
        flex-direction: column; /* Stack vertically */
        text-align: center;
        gap: 40px;
    }

    .nl-content {
        max-width: 100%;
        padding: 0 15px;
    }

    .nl-content h2 {
        font-size: 2rem;
    }

    .nl-features {
        justify-content: center; /* Center the icons */
    }

    .nl-form-box {
        width: 100%;
        padding: 30px 20px; /* Reduce padding */
    }

    .nl-form-box button {
        width: 100%; /* Full width button */
    }
}
