/* 
  Ecom-BD Premium Blog/CMS Stylesheet
*/

:root {
    --blog-primary: var(--primary-color, var(--gh-primary, #1186d6));
    --blog-secondary: var(--secondary-color, var(--gh-secondary, #09880b));
    --blog-text: #2d3748;
    --blog-light: #f8fafc;
    --blog-border: #e2e8f0;
    --blog-card-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    --blog-font: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Grid & Structure */
.blog-container {
    font-family: var(--blog-font);
    color: var(--blog-text);
    padding: 40px 0;
    background-color: #fafbfc;
}

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

/* Premium Card Design */
.blog-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--blog-border);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--blog-card-shadow);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.blog-card-img-wrap {
    position: relative;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
    background-color: #f1f5f9;
}

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

.blog-card:hover .blog-card-img {
    transform: scale(1.06);
}

.blog-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: var(--blog-primary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 6px 12px;
    border-radius: 50px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

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

.blog-meta {
    font-size: 12px;
    color: #718096;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.blog-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.blog-card-title {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 12px;
}

.blog-card-title a {
    color: #1a202c;
    text-decoration: none;
    transition: color 0.2s;
}

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

.blog-card-excerpt {
    font-size: 14px;
    color: #4a5568;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.blog-card-footer {
    border-top: 1px solid #f1f5f9;
    padding: 16px 24px;
    background: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.blog-read-more:hover {
    text-decoration: underline;
}

/* Sidebar Styling */
.blog-sidebar {
    position: sticky;
    top: 20px;
}

.blog-widget {
    background: #fff;
    border-radius: 16px;
    border: 1px solid var(--blog-border);
    padding: 24px;
    margin-bottom: 30px;
    box-shadow: var(--blog-card-shadow);
}

.blog-widget-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
    color: #1a202c;
}

.blog-widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--blog-primary);
    border-radius: 10px;
}

/* Popular Posts list */
.widget-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-posts-item {
    display: flex;
    gap: 15px;
    margin-bottom: 18px;
}

.widget-posts-item:last-child {
    margin-bottom: 0;
}

.widget-posts-thumb {
    width: 70px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    background-color: #f1f5f9;
    flex-shrink: 0;
}

.widget-posts-title {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 4px 0;
}

.widget-posts-title a {
    color: #2d3748;
    text-decoration: none;
}

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

.widget-posts-meta {
    font-size: 11px;
    color: #a0aec0;
}

/* Categories List widget */
.widget-categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget-categories-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.widget-categories-item:last-child {
    border-bottom: none;
}

.widget-categories-item a {
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
}

.widget-categories-item a:hover {
    color: var(--blog-primary);
}

/* Tag Cloud widget */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud-item {
    background: #f1f5f9;
    color: #4a5568;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.2s;
}

.tag-cloud-item:hover {
    background: var(--blog-primary);
    color: #fff;
}

/* Single Post / Detail page styles */
.post-detail-wrap {
    background: #fff;
    border-radius: 20px;
    border: 1px solid var(--blog-border);
    padding: 40px;
    box-shadow: var(--blog-card-shadow);
}

.post-header {
    margin-bottom: 30px;
}

.post-title {
    font-size: 38px;
    font-weight: 800;
    line-height: 1.25;
    color: #1a202c;
    margin-bottom: 20px;
}

.post-featured-image-wrap {
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 35px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
}

.post-featured-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
}

/* Table of Contents */
.post-toc-widget {
    background: var(--blog-light);
    border: 1px solid var(--blog-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
}

.post-toc-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #1a202c;
}

.post-toc-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.post-toc-list li {
    margin-bottom: 8px;
}

.post-toc-list li.level-3 {
    padding-left: 20px;
}

.post-toc-list a {
    color: #4a5568;
    text-decoration: none;
    font-size: 13.5px;
    transition: color 0.15s;
}

.post-toc-list a:hover {
    color: var(--blog-primary);
    text-decoration: underline;
}

/* Post Content Typography */
.post-body {
    font-size: 16px;
    line-height: 1.8;
    color: #2d3748;
}

.post-body h2 {
    font-size: 26px;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 15px;
    color: #1a202c;
}

.post-body h3 {
    font-size: 20px;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 12px;
    color: #1a202c;
}

.post-body p {
    margin-bottom: 24px;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 20px 0;
}

.post-body blockquote {
    border-left: 4px solid var(--blog-primary);
    padding: 15px 20px;
    background-color: var(--blog-light);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    margin: 30px 0;
    color: #4a5568;
}

.post-body pre {
    background: #1e293b;
    color: #f8fafc;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 24px 0;
}

/* Related articles and prev/next links */
.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    border-top: 1px solid var(--blog-border);
    border-bottom: 1px solid var(--blog-border);
    padding: 24px 0;
    margin: 40px 0;
}

.post-nav-link {
    max-width: 48%;
}

.post-nav-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #a0aec0;
    font-weight: 700;
    margin-bottom: 6px;
}

.post-nav-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    margin: 0;
}

.post-nav-title a {
    color: #2d3748;
    text-decoration: none;
}

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

/* Share buttons */
.post-share {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
}

.post-share-title {
    font-weight: 700;
    font-size: 14px;
}

.share-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: transform 0.2s;
}

.share-btn:hover {
    transform: translateY(-2px);
    color: #fff;
}

.share-facebook { background-color: #1877f2; }
.share-twitter  { background-color: #1da1f2; }
.share-linkedin { background-color: #0077b5; }
.share-whatsapp { background-color: #25d366; }

/* Highlight styling for search results */
mark.highlight {
    background: #fef08a;
    color: #854d0e;
    padding: 2px 4px;
    border-radius: 4px;
}

/* Newsletter Widget form */
.widget-newsletter-input {
    border-radius: 8px;
    border: 1px solid var(--blog-border);
    padding: 10px 14px;
    margin-bottom: 10px;
    width: 100%;
}

.widget-newsletter-btn {
    width: 100%;
    border-radius: 8px;
}

@media(max-width: 768px) {
    .post-detail-wrap {
        padding: 20px;
    }
    .post-title {
        font-size: 28px;
    }
    .post-navigation {
        flex-direction: column;
    }
    .post-nav-link {
        max-width: 100%;
        margin-bottom: 20px;
    }
    .post-nav-link:last-child {
        margin-bottom: 0;
    }
}
