/* =========================================
   BLOG ARCHIVE PAGE STYLES (Fixed Width & Sticky)
   ========================================= */
   /* 1. Unlock sticky in Kadence (CRITICAL) */
   
/* 2. Sticky Sidebar */
/* ENABLE STICKY SCROLLING (Fixes Kadence Conflict) */
body, html, #wrapper, #inner-wrap, .site-main {
    overflow: visible !important;
    overflow-x: clip !important; /* Allows sticky to calculate height */
}

/* Re-assert Sticky Logic */
.sidebar-sticky-wrapper {
    position: -webkit-sticky !important;
    position: sticky !important;
    top: 120px !important;
    height: fit-content;
    z-index: 10;
}


/* 1. CONTAINER LOCK (Fixes Edge Touching) */
.blog-page-wrapper {
    width: 100%;
    background-color: #f9f9f9;
}

/* Ensure content stays in the middle */
.container {
    max-width: 1240px; 
    margin: 0 auto;    
    padding: 0 24px;   /* Safety padding from edges */
    width: 100%;       
    box-sizing: border-box; 
}

/* 2. LAYOUT GRID (Content + Sidebar) */
.blog-layout-grid {
    display: grid;
    /* Ratio: Content (70%) | Sidebar (30%) */
    grid-template-columns: 7fr 3fr; 
    gap: 50px;
    
    /* CRITICAL FOR STICKY: */
    align-items: start; 
    position: relative;
    padding-top: 60px;
    padding-bottom: 80px; /* Space before footer */
}

/* 3. MAIN POSTS GRID (3 Cards Per Line) */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr); 
    gap: 25px;
}

/* 4. BLOG CARD STYLING */
.blog-card-premium {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%; /* Ensures all cards in row are same height */
}

.blog-card-premium:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1);
    border-color: #215a5d;
}

/* Image */
.card-image-wrapper {
    position: relative;
    height: 180px; 
    overflow: hidden;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card-premium:hover .card-image-wrapper img {
    transform: scale(1.05);
}

.card-category-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #eebb5d;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
}

/* Body */
.card-body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-meta {
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 10px;
    display: flex;
    gap: 10px;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.4;
    color: #222;
}

.card-title a {
    color: #215a5d;
    text-decoration: none;
    transition: 0.3s;
}
.card-title a:hover { color: #eebb5d; }

.card-excerpt {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1; /* Pushes button down */
}

.btn-read-more-link {
    font-size: 0.85rem;
    color: #215a5d;
    font-weight: 700;
    text-decoration: none;
    align-self: flex-start;
}
.btn-read-more-link:hover { color: #eebb5d; }


/* 5. STICKY SIDEBAR (FIXED) */
.sidebar-sticky-wrapper {
    /* Sticky Magic */
    position: -webkit-sticky; 
    position: sticky;
    top: 120px; /* Stick 120px from top of screen */
    
    /* Ensure it doesn't stretch */
    height: fit-content; 
    
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.sidebar-widget {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.widget-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #215a5d;
    margin-bottom: 15px;
}
.heading-decorator-left {
    width: 40px; height: 3px; background: #215a5d; margin-bottom: 15px;
}
.heading-decorator-left.white-line { background: #fff; }

/* Widget Styles */
.date-display { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.date-display .day { font-size: 3rem; font-weight: 800; color: #eebb5d; line-height: 1; }
.date-display .month-year { font-size: 0.9rem; font-weight: 700; color: #215a5d; line-height: 1.2; text-transform: uppercase; }

.sidebar-post-list { list-style: none; padding: 0; margin: 0; }
.sidebar-post-list li { padding: 12px 0; border-bottom: 1px solid #eee; }
.sidebar-post-list li:last-child { border-bottom: none; }
.list-title { font-weight: 600; color: #333; font-size: 0.95rem; display: block; line-height: 1.4; text-decoration: none; }
.list-date { font-size: 0.75rem; color: #aaa; margin-top: 5px; display: block;}

/* CTA Widget */
.cta-widget { text-align: center; border: none; }
.bg-theme-solid { background-color: #215a5d; color: #fff; }
.text-white-80 { color: rgba(255,255,255,0.8); font-size: 0.9rem; }
.btn-glowing-gold {
    display: block; background: #eebb5d; color: #fff; padding: 12px;
    border-radius: 4px; text-decoration: none; font-weight: 700;
    text-transform: uppercase; font-size: 0.9rem; margin-top: 15px;
}
.text-white-link { color: #fff; text-decoration: none; font-weight: 600; }

/* 6. PAGINATION */
.blog-pagination {
    margin-top: 60px;
    text-align: center;
    grid-column: 1 / -1; 
}
.blog-pagination .page-numbers {
    display: inline-block; padding: 8px 14px; margin: 0 4px;
    background: #fff; border: 1px solid #ddd; color: #215a5d;
    text-decoration: none; border-radius: 4px; font-weight: 600;
}
.blog-pagination .page-numbers.current { background: #215a5d; color: #fff; border-color: #215a5d; }


/* 7. RESPONSIVE BREAKPOINTS */

/* Tablet: 2 Columns for cards, keep sidebar */
@media (max-width: 1200px) {
    .posts-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile/Small Tablet: Stack Sidebar below Content */
@media (max-width: 992px) {
    .blog-layout-grid {
        grid-template-columns: 1fr; /* Single Column Layout */
        gap: 60px;
    }
    
    .posts-grid {
        grid-template-columns: repeat(2, 1fr); /* Keep Grid on Tablet */
    }
    
    .sidebar-sticky-wrapper {
        position: static; /* No sticky on mobile */
    }
}

/* Small Mobile: Single Card Column */
@media (max-width: 600px) {
    .posts-grid { grid-template-columns: 1fr; }
    .container { padding: 0 20px; }
}