/* =========================================
   Scrutiny Global - Enterprise Blog Styles
   ========================================= */

:root {
    /* Brand Colors */
    --primary: #4F46E5;
    /* Indigo */
    --primary-dark: #4338ca;
    --secondary: #0EA5E9;
    /* Sky Blue */
    --accent: #F59E0B;
    /* Amber for subtle highlights if needed */

    /* Neutrals */
    --dark: #111827;
    /* Gray 900 */
    --text-main: #374151;
    /* Gray 700 */
    --text-light: #6B7280;
    /* Gray 500 */
    --bg-light: #F9FAFB;
    /* Gray 50 */
    --bg-white: #FFFFFF;
    --border: #E5E7EB;
    /* Gray 200 */

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    /* Typography */
    --font-main: 'Inter', sans-serif;
}

body {
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: var(--bg-light);
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-main);
    color: var(--dark);
    font-weight: 700;
    letter-spacing: -0.025em;
    /* Tight tracking for modern feel */
}

/* Section Layout */
.blog-section {
    padding: 140px 0 100px;
    /* More top padding for fixed header */
    background: linear-gradient(to bottom, #F3F4F6 0%, #FFFFFF 100%);
    min-height: 100vh;
}

/* Container padding for mobile */
@media (max-width: 991px) {
    .blog-section .container {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Header Area */
.blog-header {
    text-align: center;
    margin-bottom: 80px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.blog-header h1 {
    font-size: 48px;
    margin-bottom: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    position: relative;
    display: inline-block;
}

.blog-header p {
    font-size: 20px;
    color: var(--text-light);
    line-height: 1.6;
    font-weight: 400;
}

/* Filters & Search */
.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.filter-button {
    padding: 10px 24px;
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: var(--shadow-sm);
}

.filter-button:hover {
    border-color: var(--secondary);
    color: var(--secondary);
    transform: translateY(-1px);
}

.filter-button.active {
    background: var(--primary);
    color: var(--bg-white);
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

/* Search Input */
.form-control {
    border-radius: 50px;
    padding: 12px 24px;
    border: 1px solid var(--border);
    font-size: 15px;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

.form-control:focus {
    border-color: var(--secondary);
    box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.1);
}

.btn-primary {
    background: var(--primary);
    border: none;
    border-radius: 50px;
    padding: 10px 30px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

/* Blog Grid Container */
.row.g-4 {
    overflow: visible; /* Allow hover effects */
}

.row.g-4 > [class*="col-"] {
    padding-bottom: 8px; /* Space for hover lift */
}

/* Blog Cards */
.blog-card {
    background: var(--bg-white);
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.04);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
    position: relative;
    top: 0;
    margin-bottom: 8px; /* Add space for hover lift */
    contain: layout style; /* Improve performance and contain overflow */
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(79, 70, 229, 0.1);
    margin-bottom: 0; /* Remove margin on hover to prevent layout shift */
}

.img-wrapper {
    position: relative;
    padding-top: 60%;
    /* 16:9 Aspect Ratio approx */
    overflow: hidden;
    background-color: #f3f4f6;
}

.img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .img-wrapper img {
    transform: scale(1.05);
}

.category-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: var(--shadow-sm);
    z-index: 2;
}

.blog-card .content {
    padding: 32px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden; /* Prevent content overflow */
    min-height: 0; /* Allow flex shrinking */
}

.blog-card h3 {
    font-size: 20px;
    line-height: 1.4;
    margin-bottom: 16px;
    overflow: hidden; /* Prevent text overflow */
    word-wrap: break-word; /* Break long words */
    hyphens: auto; /* Auto-hyphenate if needed */
}

.blog-card h3 a {
    color: var(--dark);
    text-decoration: none;
    transition: color 0.2s;
    background: linear-gradient(to right, var(--primary), var(--primary)) 0% 100% / 0% 2px no-repeat;
    transition: background-size 0.3s, color 0.3s;
}

.blog-card:hover h3 a {
    color: var(--primary);
    background-size: 100% 2px;
}

.blog-card p {
    color: var(--text-light);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 24px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-wrap: break-word; /* Break long words */
    overflow-wrap: break-word; /* Modern property */
    hyphens: auto; /* Auto-hyphenate */
}

.blog-card .meta {
    padding-top: 20px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.read-time {
    font-size: 13px;
    color: var(--text-light);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.read-time i {
    color: var(--secondary);
}

.btn-read {
    color: var(--primary);
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    transition: gap 0.2s;
}

.btn-read:hover {
    gap: 8px;
    color: var(--primary-dark);
}

/* Professional Pagination Styles */
.blog-pagination-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-top: 60px;
    padding: 40px 0;
    width: 100%;
}

.blog-pagination {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

.blog-pagination .pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.blog-pagination .page-item {
    margin: 0;
}

.blog-pagination .page-link {
    min-width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    color: #475569;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

.blog-pagination .page-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(79, 70, 229, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.blog-pagination .page-link:hover {
    background: #f8fafc;
    border-color: #4F46E5;
    color: #4F46E5;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
}

.blog-pagination .page-link:hover::before {
    width: 100%;
    height: 100%;
}

.blog-pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #4F46E5 0%, #4338ca 100%);
    border-color: #4F46E5;
    color: white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
    transform: translateY(-2px);
}

.blog-pagination .page-item.active .page-link::before {
    display: none;
}

.blog-pagination .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
}

.blog-pagination .page-item.disabled .page-link:hover {
    transform: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #94a3b8;
}

.blog-pagination .page-link i {
    font-size: 16px;
}

/* Pagination Info */
.pagination-info {
    text-align: center;
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
    padding: 10px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-info span {
    margin: 0;
}

.pagination-info .text-muted {
    color: #94a3b8;
    font-weight: 400;
}

    @media (max-width: 991px) {
        .blog-section {
            padding: 100px 0 60px;
        }

        .blog-header {
            margin-bottom: 40px;
            padding: 0 15px;
        }

        .blog-header h1 {
            font-size: 32px;
            margin-bottom: 16px;
            line-height: 1.2;
        }

        .blog-header p {
            font-size: 16px;
            line-height: 1.5;
        }

        /* Search & Filters Row */
        .row.mb-5 {
            margin-bottom: 30px !important;
        }

        .blog-filters {
            justify-content: flex-start;
            overflow-x: auto;
            padding-bottom: 10px;
            white-space: nowrap;
            flex-wrap: nowrap;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: thin;
            margin-bottom: 20px;
        }

        .blog-filters::-webkit-scrollbar {
            height: 4px;
        }

        .blog-filters::-webkit-scrollbar-thumb {
            background: var(--border);
            border-radius: 2px;
        }

        .filter-button {
            flex: 0 0 auto;
            padding: 8px 18px;
            font-size: 13px;
            white-space: nowrap;
        }

        /* Search Form Mobile */
        .search-form-mobile {
            flex-direction: column;
            gap: 12px;
        }

        .search-form-mobile .form-control {
            width: 100%;
            margin-right: 0 !important;
            margin-bottom: 0;
        }

        .search-form-mobile .btn-primary {
            width: 100%;
            padding: 12px 24px;
        }

        @media (min-width: 768px) {
            .search-form-mobile {
                flex-direction: row;
            }

            .search-form-mobile .form-control {
                margin-right: 0.5rem !important;
            }

            .search-form-mobile .btn-primary {
                width: auto;
            }
        }

        /* Blog Cards */
        .blog-card {
            margin-bottom: 24px;
        }

        .blog-card .content {
            padding: 20px;
        }

        .blog-card h3 {
            font-size: 18px;
            line-height: 1.3;
            margin-bottom: 12px;
        }

        .blog-card p {
            font-size: 14px;
            line-height: 1.5;
            margin-bottom: 16px;
            -webkit-line-clamp: 2;
        }

        .blog-card .meta {
            flex-direction: column;
            align-items: flex-start;
            gap: 12px;
            padding-top: 16px;
        }

        .btn-read {
            width: 100%;
            justify-content: center;
            padding: 10px;
            border: 1px solid var(--border);
            border-radius: 8px;
            transition: all 0.2s;
        }

        .btn-read:hover {
            background: var(--primary);
            color: var(--bg-white);
            border-color: var(--primary);
        }

        /* Pagination Mobile */
        .blog-pagination-wrapper {
            margin-top: 40px;
            padding: 30px 0;
        }

        .blog-pagination .pagination {
            flex-wrap: wrap;
            justify-content: center;
            gap: 6px;
        }

        .blog-pagination .page-link {
            min-width: 40px;
            height: 40px;
            font-size: 14px;
            padding: 0 8px;
        }

        .blog-pagination .page-link i {
            font-size: 14px;
        }

        .pagination-info {
            font-size: 12px;
            padding: 8px 0;
            flex-direction: column;
            gap: 4px;
        }
    }

    @media (max-width: 576px) {
        .blog-section {
            padding: 80px 0 40px;
        }

        .blog-header {
            margin-bottom: 30px;
        }

        .blog-header h1 {
            font-size: 28px;
            margin-bottom: 12px;
        }

        .blog-header p {
            font-size: 15px;
        }

        .container {
            padding-left: 15px;
            padding-right: 15px;
        }

        .blog-filters {
            margin-left: -15px;
            margin-right: -15px;
            padding-left: 15px;
            padding-right: 15px;
        }

        .filter-button {
            padding: 7px 16px;
            font-size: 12px;
        }

        .img-wrapper {
            padding-top: 65%;
        }

        .category-badge {
            top: 12px;
            left: 12px;
            padding: 5px 12px;
            font-size: 11px;
        }

        .read-time {
            font-size: 12px;
        }

        .blog-pagination .page-link {
            min-width: 36px;
            height: 36px;
            font-size: 13px;
            padding: 0 6px;
        }

        .blog-pagination .page-link i {
            font-size: 12px;
        }

        .pagination-info {
            font-size: 11px;
            flex-direction: column;
            gap: 2px;
        }

        /* Empty State Mobile */
        .col-12.text-center.py-5 {
            padding: 40px 20px !important;
        }

        .col-12.text-center.py-5 h3 {
            font-size: 20px;
            margin-bottom: 12px;
        }

        .col-12.text-center.py-5 p {
            font-size: 14px;
        }
    }

    /* Extra Small Devices */
    @media (max-width: 375px) {
        .blog-header h1 {
            font-size: 24px;
        }

        .blog-header p {
            font-size: 14px;
        }

        .filter-button {
            padding: 6px 14px;
            font-size: 11px;
        }

        .blog-card .content {
            padding: 14px;
        }

        .blog-card h3 {
            font-size: 15px;
        }
    }