/* =========================================
   BLOG CSS
   ========================================= */

/* --- ORIGINAL TEMPLATE VARIABLES & BASE --- */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --standard-color: #667eea;
    --dark-color: #333;
    --medium-color: #666;
    --light-color: #f8f9fa;
    --border-color: #e9ecef;
}

.hybrid-container {
    width: 100%; max-width: 1400px; margin: 0 auto; padding: 60px 20px;
}

/* --- BLOG FRONTEND CSS --- */
.blog-wrapper { font-size: 16px; }

.blog-header-banner {
    background: var(--primary-gradient); 
    padding: 40px 30px; 
    border-radius: 15px; 
    text-align: center; 
    margin-bottom: 40px; 
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
/* Ensure all header text is strictly white */
.blog-header-banner, 
.blog-header-banner * {
    color: #ffffff !important;
}
.blog-header-banner h1 { 
    font-size: 1.2rem; 
    font-weight: 800; 
    margin-bottom: 15px; 
}
.blog-header-banner p { 
    font-size: 1rem; 
    margin: 0 auto; 
    max-width: 600px; 
}

/* Controls: Search & Filters */
.blog-controls { display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 30px; justify-content: space-between; align-items: center; }
.blog-search-input { flex: 1; min-width: 250px; padding: 12px 20px; border: 2px solid var(--border-color); border-radius: 10px; font-size: 1rem; outline: none; transition: 0.3s; }
.blog-search-input:focus { border-color: var(--standard-color); }
.blog-categories { display: flex; gap: 10px; flex-wrap: wrap; }
.blog-cat-btn { padding: 8px 20px; border: 2px solid var(--standard-color); background: white; color: var(--standard-color); border-radius: 20px; cursor: pointer; font-weight: 600; font-size: 1rem; transition: 0.3s; }
.blog-cat-btn.active, .blog-cat-btn:hover { background: var(--standard-color); color: white; }

/* --- Grid Layout: EXACTLY 3 COLUMNS PER ROW --- */
.blog-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 30px; }
.blog-card { background: white; border-radius: 15px; overflow: hidden; box-shadow: 0 5px 20px rgba(0,0,0,0.05); transition: transform 0.3s ease, box-shadow 0.3s ease; display: flex; flex-direction: column; border: 1px solid var(--border-color); }
.blog-card:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.1); }
.blog-img { width: 100%; height: 220px; object-fit: cover; }
.blog-content { padding: 25px; flex: 1; display: flex; flex-direction: column; }
.blog-meta { font-size: 0.85rem; font-weight: 600; color: var(--standard-color); margin-bottom: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.blog-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 15px; color: var(--dark-color); line-height: 1.4; }
.blog-excerpt { font-size: 1rem; color: var(--medium-color); margin-bottom: 20px; flex: 1; line-height: 1.6; }
.read-more-btn { align-self: flex-start; font-size: 1rem; padding: 10px 20px; background: var(--light-color); color: var(--dark-color); border: 1px solid var(--border-color); border-radius: 8px; cursor: pointer; font-weight: 600; transition: 0.3s; }
.read-more-btn:hover { background: var(--standard-color); color: white; border-color: var(--standard-color); }

/* Pagination */
.blog-pagination { display: flex; justify-content: center; gap: 10px; margin-top: 50px; }
.page-btn { width: 40px; height: 40px; font-size: 1rem; border: 1px solid var(--border-color); background: white; cursor: pointer; border-radius: 8px; font-weight: 600; color: var(--dark-color); transition: 0.3s; display: flex; align-items: center; justify-content: center; }
.page-btn.active, .page-btn:hover { background: var(--standard-color); color: white; border-color: var(--standard-color); }

/* Single View */
#single-blog-view { display: none; background: white; padding: 40px; border-radius: 20px; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
.back-btn { background: transparent; border: 1px solid var(--border-color); font-size: 1rem; padding: 10px 20px; border-radius: 8px; cursor: pointer; margin-bottom: 30px; font-weight: 600; display: inline-flex; align-items: center; gap: 8px; transition: 0.3s; }
.back-btn:hover { background: var(--light-color); }
#single-blog-img { width: 100%; max-height: 450px; object-fit: cover; border-radius: 15px; margin-bottom: 30px; }
#single-blog-title { font-size: 1.2rem; font-weight: 800; color: var(--dark-color); margin-bottom: 15px; }
.single-meta-bar { display: flex; gap: 20px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); margin-bottom: 30px; color: var(--medium-color); font-size: 0.95rem; }
#single-blog-content { line-height: 1.8; color: #444; font-size: 1rem; }
#single-blog-content p { margin-bottom: 20px; }

/* NEW: Social Share */
.social-share { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border-color); display: flex; align-items: center; gap: 15px; }
.social-share strong { font-size: 1rem; color: var(--dark-color); }
.share-btn { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; text-decoration: none; transition: 0.3s; font-size: 1rem; border: none; cursor: pointer; }
.share-fb { background: #3b5998; }
.share-tw { background: #1da1f2; }
.share-li { background: #0077b5; }
.share-link { background: #6c757d; }
.share-btn:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(0,0,0,0.2); color: white; }

/* Responsive */
@media (max-width: 992px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) {
    .blog-grid { grid-template-columns: 1fr; }
    #single-blog-view { padding: 20px; }
    .single-meta-bar { flex-direction: column; gap: 10px; }
}
/* Server-driven states */
.blog-missing-notice { background: #fff3cd; color: #664d03; border: 1px solid #ffecb5; border-radius: 10px; padding: 14px 20px; margin-bottom: 25px; font-size: 0.95rem; }
.blog-card .blog-img.blog-img-placeholder { background: var(--primary-gradient); }
.blog-grid-message { grid-column: 1 / -1; text-align: center; padding: 40px; color: #666; font-size: 1rem; }
