/* =========================================
   1. VARIABLES & THEME SETUP
   ========================================= */
:root {
    /* Primary Brand Colors */
    --primary-color: #6c63ff;
    --primary-hover: #5a52d5;
    --primary-light: #e6f0fa;
    --secondary-color: #6c63ff;
    --accent-color: #f26c4f;

    /* Backgrounds */
    --bg-light: #f4f8fb;
    --bg-white: #ffffff;
    --bg-dark: #0b1120;
    --hero-gradient: linear-gradient(-135deg, #ffffff 50%, #eff6ff 50%);
    --card-bg: #ffffff;

    /* Text */
    --text-main: #334155;
    --text-light: #64748b;
    --text-dark: #1e293b;
    --text-white: #ffffff;

    /* Shadows & Effects */
    --shadow-sm: 0 4px 6px -1px rgba(3, 81, 149, 0.1);
    --shadow-md: 0 10px 15px -3px rgba(3, 81, 149, 0.1), 0 4px 6px -2px rgba(3, 81, 149, 0.05);
    --shadow-lg: 0 20px 25px -5px rgba(3, 81, 149, 0.1), 0 10px 10px -5px rgba(3, 81, 149, 0.04);
    --glass-bg: rgba(255, 255, 255, 0.95);

    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-btn: 6px;

    /* Spacing */
    --section-padding: 5rem 0;
    --container-width: 1400px;
    --blog-container-width: 1400px;
    /* Wider layout for Blog */

    /* Font */
    --font-main: 'Outfit', sans-serif;
}

/* =========================================
   2. RESET & BASE STYLES
   ========================================= */
* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    color: var(--text-main);
    background-color: var(--bg-white);
    line-height: 1.6;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--text-dark);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 1rem;
}

a {
    text-decoration: none;
    transition: 0.3s;
    color: inherit;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

img {
    max-width: 100%;
    display: block;
}

/* =========================================
   3. UTILITIES
   ========================================= */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Custom Wider Container for Blog */
.blog-container {
    max-width: var(--blog-container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: var(--section-padding);
    position: relative;
}

/* Add extra space between content and footer */
main.section-padding {
    padding-bottom: 10rem;
}

.bg-light {
    background-color: var(--bg-light);
}

.text-center {
    text-align: center;
}

.d-flex {
    display: flex;
}

.align-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-center {
    justify-content: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 2rem;
    border-radius: var(--border-radius-btn);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 12px rgba(242, 108, 79, 0.4);
}

.btn-primary:hover {
    background-color: #d65135;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(242, 108, 79, 0.6);
    color: white;
}

.btn-secondary {
    background-color: var(--primary-color);
    color: white;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

/* =========================================
   4. HEADER & MEGA MENU
   ========================================= */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: white;
    box-shadow: var(--shadow-sm);
    padding: 0;
}

.header .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
    padding: 0 1rem;
}

.nav-box {
    display: flex;
    align-items: center;
    gap: 2rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-box a {
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-box a:hover,
.nav-box a.active {
    color: var(--primary-color);
}

/* Mega Menu */
.mega-menu {
    position: static;
}

.mega-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    padding: 2rem;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 2rem;
    box-shadow: var(--shadow-md);
    border-top: 1px solid #eee;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: 0.3s;
}

.mega-menu:hover .mega-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.mega-column h3 {
    font-size: 1rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.mega-column ul li {
    margin-bottom: 0.5rem;
}

.mega-column ul li a {
    font-size: 0.9rem;
    color: var(--text-light);
}

.mega-column ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

/* =========================================
   5. BLOG PAGE SPECIFIC STYLES
   ========================================= */
.blog-hero {
    padding: 160px 0 80px;
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    position: relative;
}

.blog-card {
    background: #fff;
    border-radius: var(--border-radius-lg);
    border: 1px solid #f1f5f9;
    overflow: hidden;
    height: 100%;
    transition: 0.3s;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-5px);
    border-color: var(--primary-color);
}

.blog-img-wrapper {
    position: relative;
    padding-top: 60%;
    /* Aspect Ratio */
    overflow: hidden;
}

.blog-img-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-img-wrapper img {
    transform: scale(1.05);
}

.blog-content {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.blog-category {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    display: block;
}

.blog-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.4;
}

.blog-title a {
    color: var(--text-dark);
}

.blog-title a:hover {
    color: var(--primary-color);
}

.blog-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-footer {
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #f1f5f9;
}

.read-more-btn {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.read-more-btn:hover {
    gap: 8px;
}

/* Sidebar Widgets */
.sidebar-widget {
    background: #fff;
    padding: 30px;
    border-radius: var(--border-radius-lg);
    border: 1px solid #f1f5f9;
    margin-bottom: 30px;
}

.sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f5f9;
    position: relative;
}

.sidebar-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 50px;
    height: 2px;
    background: var(--primary-color);
}

.input-group-modern {
    position: relative;
}

.input-group-modern input {
    padding-right: 40px;
    border-radius: 50px;
}

.input-group-modern .search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    pointer-events: none;
}

/* Subscribe Widget Theme */
.widget-subscribe {
    background: linear-gradient(135deg, var(--primary-color) 0%, #5a52d5 100%);
    color: white;
    border: none;
}

.widget-subscribe .sidebar-title,
.widget-subscribe h5 {
    color: white;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.widget-subscribe .sidebar-title::after {
    background: white;
}

.widget-subscribe p {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* =========================================
   6. FOOTER
   ========================================= */
.footer {
    background: var(--bg-dark);
    color: #9ca3af;
    padding-top: 4rem;
    padding-bottom: 2rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-col h5 {
    color: white;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-col ul li {
    margin-bottom: 0.8rem;
}

.footer-col ul li a {
    color: #9ca3af;
    font-size: 0.9rem;
    transition: 0.2s;
}

.footer-col ul li a:hover {
    color: var(--primary-color);
    padding-left: 5px;
}

.copyright {
    border-top: 1px solid #2b1c55;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
}

/* =========================================
   7. RESPONSIVE
   ========================================= */
@media (max-width: 1024px) {
    .nav-box {
        display: none;
    }
}

@media (max-width: 991px) {

    /* Adjust Main Content Padding for Mobile (Fixed Header clearance) */
    .section-padding.pt-5 {
        padding-top: 85px !important;
        /* Reduced from 100px */
        padding-bottom: 30px !important;
    }

    /* Reduce spacing for sidebar on mobile */
    .sidebar-widget {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    /* Ensure specific spacing for the sidebar container */
    aside.col-lg-3 {
        margin-bottom: 1rem !important;
    }

    .blog-hero {
        padding: 100px 0 30px;
        /* Reduced padding */
    }

    .blog-hero h1 {
        font-size: 1.8rem;
        /* Smaller hero title */
        margin-bottom: 0.5rem;
    }

    .blog-hero p.lead {
        font-size: 0.95rem;
        /* Smaller lead text */
        margin-bottom: 1rem;
    }

    /* Compact Blog Card for Mobile */
    .blog-card {
        margin-bottom: 0;
        /* Removing extra margin if any */
        border-radius: 12px;
        /* Slightly tighter radius */
    }

    .blog-img-wrapper {
        padding-top: 50%;
        /* Reduced aspect ratio for shorter images */
    }

    .blog-content {
        padding: 15px;
        /* Reduced from 24px */
    }

    .blog-category {
        font-size: 0.7rem;
        margin-bottom: 5px;
    }

    .blog-title {
        font-size: 1.1rem;
        /* Smaller title */
        margin-bottom: 8px;
        line-height: 1.3;
    }

    .blog-excerpt {
        font-size: 0.85rem;
        margin-bottom: 12px;
        -webkit-line-clamp: 2;
        /* Show fewer lines */
        line-clamp: 2;
    }

    .blog-footer {
        padding-top: 10px;
        margin-top: 5px;
    }

    .read-more-btn {
        font-size: 0.8rem;
    }

    /* Tighter Grid Gaps */
    .row.g-4,
    .row.g-5 {
        --bs-gutter-y: 1rem !important;
        /* Reduce vertical gap between cards */
    }

    .mb-5 {
        margin-bottom: 1.5rem !important;
        /* Reduce large bottom margins */
    }
}

@media (min-width: 992px) {
    aside.col-lg-3 {
        position: sticky;
        top: 100px;
        height: fit-content;
    }

    /* Ensure content is aligned properly on desktop */
    .section-padding.pt-5 {
        padding-top: 120px !important;
        /* More breathing room on desktop */
    }
}

@media (max-width: 576px) {
    .blog-hero {
        padding: 100px 0 40px;
    }

    .blog-hero h1 {
        font-size: 1.8rem;
    }

    /* Make search input more compact on small screens */
    .input-group-modern input {
        padding: 10px 35px 10px 15px;
        font-size: 0.9rem;
    }

    .sidebar-widget {
        padding: 1rem;
    }

    .blog-card {
        flex-direction: column;
    }
}