/* =========================================
   Blog Index (Grid)
   ========================================= */
.blog-hero {
    background-color: var(--home-bg);
    padding: 80px 0 60px;
    text-align: center;
    border-bottom: 1px solid var(--glass-border);
}

.blog-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    color: var(--text-main);
    margin-bottom: 1rem;
}

.blog-hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.blog-grid-section {
    padding: 60px 0 80px;
    background-color: var(--home-bg);
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 40px;
}

.blog-card {
    background: var(--home-card-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    border-color: var(--primary);
}

.blog-thumb-link {
    display: block;
    overflow: hidden;
    position: relative;
    padding-top: 56.25%;
    /* 16:9 Aspect Ratio */
}

.blog-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-thumb {
    transform: scale(1.05);
}

.blog-card-body {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-meta {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.blog-meta i {
    color: var(--primary);
}

.blog-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 12px;
}

.blog-title a {
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s;
}

.blog-title a:hover {
    color: var(--primary);
}

.blog-excerpt {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-read-more {
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: gap 0.2s;
}

.blog-read-more:hover {
    gap: 10px;
}

/* =========================================
   Blog Single Implementation
   ========================================= */
.article-header {
    background-color: var(--home-bg-secondary);
    padding: 10px 0;
    text-align: center;
}

.article-header .badge {
    background-color: rgba(99, 102, 241, 0.1);
    /* Primary with opacity */
    color: var(--primary);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 20px;
    display: inline-block;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.article-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 20px;
    line-height: 1.2;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 24px;
    color: var(--text-muted);
    font-size: 1rem;
}

.article-content-section {
    padding: 60px 0 100px;
    background: var(--home-bg);
}

.article-featured-image {
    width: 100%;
    max-width: 900px;
    height: auto;
    border-radius: var(--radius);
    margin: -100px auto 60px;
    /* Overlap effect */
    display: block;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
    position: relative;
    z-index: 10;
    border: 1px solid var(--glass-border);
}

/* Typography / Prose */
.blog-prose {
    max-width: 740px;
    margin: 0 auto;
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-main);
}

.blog-prose p {
    margin-bottom: 1.5em;
}

.blog-prose h1,
.blog-prose h2,
.blog-prose h3,
.blog-prose h4 {
    color: var(--text-main);
    font-weight: 700;
    margin-top: 2em;
    margin-bottom: 1em;
}

.blog-prose ul,
.blog-prose ol {
    margin-bottom: 1.5em;
    padding-left: 1.5em;
    color: var(--text-main);
}

.blog-prose li {
    margin-bottom: 0.5em;
}

.blog-prose blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.5em;
    font-style: italic;
    color: var(--text-muted);
    margin: 2em 0;
}

.blog-prose img {
    border-radius: 8px;
    max-width: 100%;
    height: auto;
    margin: 2em 0;
    border: 1px solid var(--glass-border);
}

.blog-prose a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* Share Footer (Redesign) */
.article-share-section {
    padding-top: 40px;
}

.share-title {
    font-size: 0.875rem;
    letter-spacing: 0.1em;
    color: var(--text-main);
}

.share-icon-link {
    color: var(--text-muted);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 10px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid transparent;
}

.share-icon-link:hover {
    color: var(--text-main);
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--glass-border);
    transform: translateY(-2px);
}

/* =========================================
   New Hero & Categories (Redesign)
   ========================================= */

.pt-120 {
    padding-top: 120px;
}

.blog-header {
    background: var(--home-bg);
}

/* Remove old mini hero if unused, or keep for legacy */

.blog-hero-featured {
    background: var(--home-bg);
}

.hero-card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    align-items: center;
    background: var(--home-card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 20px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2);
}

.hero-image-wrapper {
    height: 400px;
    border-radius: 16px;
    overflow: hidden;
}

.hero-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.hero-card:hover .hero-image-wrapper img {
    transform: scale(1.05);
}

.hero-content {
    padding: 20px 20px 20px 0;
}

.hero-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.hero-title a {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: var(--text-main);
    text-decoration: none;
    display: block;
    margin-bottom: 20px;
    transition: color 0.2s;
}

.hero-title a:hover {
    color: var(--primary);
}

.hero-excerpt {
    font-size: 1.125rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 0;
}

@media (max-width: 900px) {
    .hero-card {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .hero-image-wrapper {
        height: 250px;
    }

    .hero-content {
        padding: 0 10px 10px;
    }

    .hero-title a {
        font-size: 1.8rem;
    }
}

/* Category Navigation */
.category-nav {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.category-nav::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.category-nav {
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.category-pill {
    padding: 8px 16px;
    border-radius: 50px;
    background: var(--home-card-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-muted);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
}

.category-pill:hover,
.category-pill.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* =========================================
   Blog Single Sidebar Layout
   ========================================= */

.blog-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}

@media (min-width: 992px) {
    .blog-layout-grid {
        grid-template-columns: 1fr 320px;
        gap: 60px;
    }
}

/* Sidebar Styling */
.blog-sidebar {
    position: relative;
    position: -webkit-sticky;
    position: sticky;
    top: 100px;
    align-self: start;
}

.sidebar-widget {
    background: var(--home-bg-secondary);
    border: 1px solid var(--glass-border);
    padding: 24px;
    margin-bottom: 24px;
}

.widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text-main);
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}

/* Recent Posts Widget */
.sidebar-post-item {
    text-decoration: none;
    transition: transform 0.2s;
    background: transparent;
    padding: 8px;
    border-radius: 8px;
}

.sidebar-post-item:hover {
    transform: translateX(4px);
    background: var(--glass-border);
}

.sidebar-thumb {
    width: auto;
    height: 100px;
    margin: 10px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

/* Categories Widget */
.sidebar-cat-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

/* Main Content Adjustments */
.blog-main-content .article-featured-image {
    margin: 0 0 30px;
    /* Reset overlap logic from previous design */
    width: 100%;
    max-width: 100%;
}

.blog-main-content .blog-prose {
    max-width: 100%;
    /* Let grid control width */
}