/* ==========================================================================
   MG Education & Social Development Organization
   Premium Responsive Blogs Slider CSS (Matching Courses & Internships)
   ========================================================================== */

/* Main Section Wrapper */
.blogs-section {
    padding: 60px 0;
    background-color: #ffffff; /* White background to contrast with Internships background */
    border-top: 1px solid #eef2f6;
    font-family: 'Inter', sans-serif;
    color: #1c1d1f;
}

.blogs-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Headers */
.blogs-header {
    margin-bottom: 24px;
}

.blogs-header h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1c1d1f;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
}

.blogs-header p {
    font-size: 16px;
    color: #6a6f73;
    margin: 0;
}

/* Category Filter Tabs */
.blogs-filter-wrapper {
    margin-bottom: 28px;
    border-bottom: 1px solid #d1d7dc;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar */
.blogs-filter-wrapper::-webkit-scrollbar {
    display: none;
}
.blogs-filter-wrapper {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.blogs-filter-tabs {
    display: flex;
    gap: 24px;
    list-style: none;
    padding: 0;
    margin: 0;
    white-space: nowrap;
}

.blog-filter-tab {
    background: none;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: #6a6f73;
    padding: 12px 4px;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    outline: none;
}

.blog-filter-tab:hover {
    color: #1c1d1f;
}

.blog-filter-tab.active {
    color: #1c1d1f;
}

.blog-filter-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #1c1d1f;
    border-radius: 2px;
}

/* Slider Grid Wrapper */
.blogs-grid-container {
    position: relative;
    width: 100%;
    margin-bottom: 30px;
}

/* Blogs Grid Layout (Desktop Slider) */
.blogs-grid {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px;
}

.blogs-grid::-webkit-scrollbar {
    display: none;
}

/* Slider Navigation Buttons */
.blogs-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 1px solid #d1d7dc;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
    color: #1c1d1f;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
}

.blogs-nav-btn:hover {
    background-color: #f7f9fa;
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.15);
    border-color: #8c9096;
    transform: translateY(-50%) scale(1.05);
}

.blogs-nav-btn:active {
    transform: translateY(-50%) scale(0.95);
}

.blogs-nav-btn.prev-btn {
    left: -22px;
}

.blogs-nav-btn.next-btn {
    right: -22px;
}

.blogs-nav-btn:disabled {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
}

/* Card Item with SOLID BORDERS */
.blog-card {
    flex: 0 0 calc(25% - 15px); /* 4 cards visible on desktop */
    min-width: 260px;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: #1c1d1f;
    background-color: #ffffff;
    border: 1px solid #d1d7dc;
    border-radius: 8px;
    padding: 14px;
    box-sizing: border-box;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.blog-card.hidden {
    display: none !important;
}

/* Card Image Box */
.blog-image-box {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 12px;
    position: relative;
    background-color: #f7f9fa;
}

.blog-image-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
    border-color: #8c9096;
}

.blog-card:hover .blog-image-box img {
    transform: scale(1.02);
}

/* Card Body Details */
.blog-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.blog-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.25;
    color: #1c1d1f;
    margin: 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    min-height: 38px;
}

.blog-card:hover .blog-title {
    color: #4f46e5;
}

/* Date and Read time info */
.blog-meta-info {
    font-size: 11px;
    color: #6a6f73;
    margin: 0;
}

/* Short excerpt text */
.blog-excerpt {
    font-size: 12px;
    color: #4b5563;
    line-height: 1.4;
    margin: 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 34px;
}

/* Author Box */
.blog-author-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px dashed #e5e7eb;
}

.blog-author-box img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.author-name {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
}

/* Badges */
.blog-badge-container {
    margin-top: 6px;
}

.blog-badge {
    background-color: #f3e8ff; /* Lavender */
    color: #6b21a8;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 2px;
    display: inline-block;
}

/* Show All Footer Link */
.blogs-show-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #4f46e5;
    font-weight: 700;
    text-decoration: none;
    font-size: 15px;
    transition: gap 0.2s ease;
    margin-top: 15px;
}

.blogs-show-all:hover {
    gap: 12px;
    text-decoration: underline;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */

@media (max-width: 1024px) {
    .blog-card {
        flex: 0 0 calc(33.333% - 14px);
    }
}

@media (max-width: 768px) {
    .blogs-section {
        padding: 40px 0;
    }
    
    .blogs-header h2 {
        font-size: 22px;
        margin-bottom: 6px;
    }

    .blogs-header p {
        font-size: 14px;
    }

    /* Hide slider navigation arrows on mobile */
    .blogs-nav-btn {
        display: none !important;
    }

    /* High-density 2x2 grid layout on mobile */
    .blogs-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        overflow-x: visible !important;
        padding: 0 !important;
    }

    .blog-card {
        flex: none !important;
        min-width: 0 !important;
        padding: 10px !important;
        border-radius: 8px !important;
    }

    .blog-image-box {
        margin-bottom: 8px !important;
    }

    .blog-title {
        font-size: 13px;
        min-height: 32px;
    }

    .blog-excerpt {
        font-size: 11.5px;
        min-height: 30px;
    }

    .blog-author-box {
        gap: 6px !important;
    }

    .blog-author-box img {
        width: 20px;
        height: 20px;
    }

    .author-name {
        font-size: 11px;
    }

    .blog-badge {
        font-size: 9px;
        padding: 2px 6px;
    }
}
