/* ===== Base Container ===== */
.container {
    font-family: 'poppins';
    margin-top: -20px;
}

.blog-hero{
    background: linear-gradient(90deg, #071a3c, #380d0d);
    color:#fff;
    padding:50px 55px;
    margin-top: -30px;
}

.blog-hero .tag{
    color:#ff0000;
    font-size:14px;
    letter-spacing:2px;
    margin: 0;
    padding: 0;
}

.blog-hero h1{
    margin: 0;
    font-size:35px;
    font-weight: 500;
}

.blog-hero p{
    margin: 0;
    max-width:800px;
    opacity:.9;
    line-height:1.6;
}
/* ===== Blog Grid ===== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin: 30px 50px;
    align-items: stretch;
}

/* ===== Blog Card ===== */
.blog-card {
    display: flex;
    flex-direction: column;
    height: 100%; /* ✅ equal height */
    border-radius: 15px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    cursor: pointer;
    text-align: left;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    width: 100%;
    border: none;
    padding: 0;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}
/* ===== Image Section ===== */
.blog-card-img {
    grid-column: 1 / -1;
    width: 100%;
    height: 220px; /* slightly better height */
    
    display: flex;
    align-items: center;
    justify-content: center;

    background: #f5f5f5; /* ✅ light gray (cleaner) */
    border-radius: 12px; /* optional for modern UI */
    overflow: hidden; /* prevents overflow */
}

/* Image Styling */
.blog-img {
    max-width: 90%;   /* keeps padding inside */
    max-height: 90%;
    object-fit: contain;

    display: block;
    margin: auto; /* extra centering safety */
}
.blog-bg {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
}

.no-blog {
    height: 350px;
    width: 100%;
    grid-column: 1 / -1;
    display: flex;
    align-content: center;
    align-items: center;
    justify-content: center;
}

.no-blog p {
    font-size: 20px;
    color: #999;
    background: #f8f9fa;
    padding: 15px 25px;
    border-radius: 10px;
}

/* ===== Views Badge ===== */
.views {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ffffff;
    color: #333;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    backdrop-filter: blur(6px);
}

/* ===== View Icon ===== */
.view-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    filter: brightness(0) invert(0.50);
}

/* ===== Card Body ===== */
.blog-card-body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 18px;
}

/* ===== Blog Date ===== */
.blog-date {
    text-align: right;
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 8px;
}

/* ===== Subject ===== */
.blog-subject {
    font-size: 0.7rem;
    font-weight: 600;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ===== Title ===== */
.blog-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #222;
    margin: 6px 0;

    /* ✅ equal height text */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== Description ===== */
.blog-desc {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;

    /* ✅ prevent uneven height */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================= */
/* ===== MOBILE OPTIMIZATION ===== */
/* ============================= */

@media (max-width: 992px) {
    .container {
        margin: 0 50px;
    }

    h2 {
        font-size: 1.7rem;
        margin-bottom: 15px;
    }

    .blog-card-img {
        height: 200px;
    }
}

@media (max-width: 768px) {
    .container {
        margin: 0 25px;
    }

    h2 {
        font-size: 1.5rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .blog-card {
        border-radius: 12px;
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.06);
    }

    .blog-card-img {
        height: 200px;
        border-radius: 12px 12px 0 0;
    }

    .blog-card-body {
        padding: 16px;
    }

    .blog-subject {
        font-size: 0.8rem;
    }

    .blog-title {
        font-size: 1.1rem;
        margin-bottom: 5px;
    }

    .blog-desc {
        font-size: 0.9rem;
        line-height: 1.5;
    }
}

@media (max-width: 576px) {
    .container {
        margin: 0;
    }

    h2 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }

    .blog-grid {
        margin: 20px 10px;
    }

    .blog-card {
        border-radius: 10px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    }

    .blog-card-img {
        height: 200px;
    }

    .blog-card-body {
        padding: 14px;
    }

    .blog-title {
        font-size: 1rem;
    }

    .blog-desc {
        font-size: 0.88rem;
        line-height: 1.45;
    }
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .blog-date {
        text-align: right;
        margin-top: 3px;
        margin-right: 0;
        font-size: 0.85rem;
    }
}