/* Ultra Premium Blog Styling */
:root {
    --secondary-color: #803101;
}

.blog-layout,
.article-body-container {
    max-width: 1400px;
    margin: 80px auto;
    padding: 0 40px;
    display: grid !important;
    grid-template-columns: 1fr 350px !important;
    gap: 60px;
    background: #fdfdfd;
    align-items: start !important;
    /* Crucial for sticky */
}

.article-body-container {
    max-width: 1300px;
    /* Slightly narrower for articles */
    background: transparent;
}

.section-heading h1 {
    font-size: 3.5rem;
    font-weight: 800;
    color: #1a1a1a;
    letter-spacing: -2px;
    margin-bottom: 40px;
    position: relative;
}

.section-heading h1::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 0;
    width: 80px;
    height: 4px;
    background: var(--secondary-color);
    border-radius: 2px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Reverted to 2 columns for better proportions */
    gap: 40px;
}

.blog-card {
    background: #ffffff;
    border-radius: 20px;
    /* overflow: hidden; Removed to allow tooltips */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    position: relative;
    border-bottom: 3px solid transparent;
}

.blog-card:hover {
    transform: translateY(-15px) !important;
    box-shadow: 0 30px 60px rgba(128, 49, 1, 0.15) !important;
    border-bottom-color: var(--secondary-color) !important;
}

.blog-card>a {
    display: block;
    overflow: hidden;
    border-radius: 20px 20px 0 0;
}

.blog-card img {
    width: 100%;
    height: 350px;
    /* Increased height for 2-column layout proportions */
    object-fit: cover;
    transition: transform 0.8s ease;
    display: block;
}

.blog-card:hover img {
    transform: scale(1.1) rotate(1deg) !important;
}

.blog-card-content {
    padding: 35px 30px;
    background: linear-gradient(to bottom, #ffffff 0%, #fafafa 100%);
}

.blog-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.blog-meta i {
    color: var(--secondary-color);
    margin-right: 5px;
}

.blog-card h3 {
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 25px;
}

.blog-card h3 a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card h3 a:hover {
    color: var(--secondary-color);
}

.blog-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.blog-tag {
    background: rgba(128, 49, 1, 0.05);
    color: var(--secondary-color);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.blog-card:hover .blog-tag {
    background: var(--secondary-color);
    color: #fff;
}

/* Sidebar Styling - Global Sticky */
body.blog-page {
    overflow: visible !important;
}

.blog-sidebar,
.article-sidebar {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 130px !important;
    /* Increased for more room */
    z-index: 100 !important;
    height: fit-content !important;
    align-self: start !important;
    display: block !important;
}

.sidebar-widget {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 40px;
    border-radius: 24px;
    margin-bottom: 40px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.sidebar-widget h4 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 30px;
    position: relative;
    padding-bottom: 15px;
}

.sidebar-widget h4::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--secondary-color);
}

.search-form input {
    width: 100%;
    padding: 15px 25px;
    border-radius: 50px;
    border: 2px solid #f0f0f0;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.search-form input:focus {
    border-color: var(--secondary-color);
    outline: none;
    box-shadow: 0 0 15px rgba(128, 49, 1, 0.1);
}

.widget-categories ul {
    list-style: none;
    padding: 0;
}

.widget-categories ul li {
    margin-bottom: 15px;
}

.widget-categories ul li a {
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.widget-categories ul li a:hover {
    color: var(--secondary-color);
    padding-left: 10px;
}

.widget-categories ul li a::before {
    content: '→';
    margin-right: 10px;
    opacity: 0;
    transition: all 0.3s ease;
}

.widget-categories ul li a:hover::before {
    opacity: 1;
}

/* Pagination */
.pagination {
    margin: 60px 0 40px;
    display: flex;
    justify-content: center;
    gap: 10px;
}

.pagination a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    border-radius: 50% !important;
    border: 1px solid #eee !important;
    background: #fff !important;
    color: #333 !important;
    font-weight: 600 !important;
    font-size: 0.95rem !important;
    text-decoration: none;
    transition: all 0.3s ease !important;
}

.pagination a.active {
    background: var(--secondary-color) !important;
    border-color: var(--secondary-color) !important;
    color: #fff !important;
    box-shadow: 0 5px 15px rgba(128, 49, 1, 0.3);
}

.pagination a:not(.active):hover {
    background: #f8f8f8 !important;
    border-color: #ccc !important;
    transform: translateY(-2px);
}

@media (max-width: 1200px) {

    .blog-layout,
    .article-body-container {
        grid-template-columns: 1fr !important;
        padding: 0 20px;
        margin: 40px auto;
        gap: 40px;
        align-items: stretch !important;
    }

    .blog-sidebar,
    .article-sidebar {
        position: static !important;
        width: 100% !important;
        margin-top: 40px !important;
    }

    .blog-sidebar {
        position: fixed;
        top: 0;
        right: -350px;
        /* Hidden by default */
        width: 320px;
        height: 100vh;
        z-index: 10000;
        background: #fff;
        padding: 80px 20px 40px;
        transition: right 0.4s cubic-bezier(0.23, 1, 0.32, 1);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
        overflow-y: auto;
        display: block;
        /* Ensure it's not hidden by display: none */
    }

    .blog-sidebar.active {
        right: 0;
    }

    .sidebar-overlay {
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 9999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

/* Sidebar Widget Variations */
.search-widget {
    border-top: 5px solid #803101;
}

.widget-categories {
    border-top: 5px solid #ff8a00;
}

.sidebar-widget h4 {
    color: #1a1a1a;
}

.search-widget h4 {
    color: #803101;
}

.widget-categories h4 {
    color: #ff8a00;
}

@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .section-heading h1 {
        font-size: 2.5rem;
    }

    .blog-layout {
        margin: 40px auto;
    }
}

/* Sidebar Toggle Button */
.blog-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: var(--secondary-color);
    color: #fff;
    border-radius: 50%;
    z-index: 9998;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 10px 25px rgba(128, 49, 1, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.blog-sidebar-toggle:hover {
    transform: scale(1.1);
    background: #a04101;
}

@media (max-width: 1200px) {
    .blog-sidebar-toggle {
        display: flex;
    }
}

/* Custom Premium Scrollbar for the site when on blog pages */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 10px;
    border: 3px solid #f1f1f1;
}

::-webkit-scrollbar-thumb:hover {
    background: #a04101;
}

/* Card Reveal Animation */
.blog-card {
    opacity: 0;
    transform: translateY(30px);
    animation: cardReveal 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes cardReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Article Hero Section */
.article-hero {
    position: relative;
    margin-bottom: 60px;
    border-radius: 30px;
    overflow: hidden;
    height: 600px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.15);
    background: #1a1a1a;
}

.article-hero div[style*="background: url"] {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1);
    transition: transform 1.5s cubic-bezier(0.23, 1, 0.32, 1);
    will-change: transform;
}

.article-hero:hover div[style*="background: url"] {
    transform: scale(1.08);
    /* Subtle zoom on hover for premium feel */
}

.header-overlay-v2 {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.1) 100%);
    padding: 80px 60px 60px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    z-index: 2;
}

.article-meta-modern a:hover {
    color: var(--secondary-color) !important;
}

.blog-grid .blog-card:nth-child(1) {
    animation-delay: 0.1s;
}

.blog-grid .blog-card:nth-child(2) {
    animation-delay: 0.2s;
}

.blog-grid .blog-card:nth-child(3) {
    animation-delay: 0.3s;
}

.blog-grid .blog-card:nth-child(4) {
    animation-delay: 0.4s;
}

.blog-grid .blog-card:nth-child(5) {
    animation-delay: 0.5s;
}

.blog-grid .blog-card:nth-child(6) {
    animation-delay: 0.6s;
}