/* ============================================
   Robofy Blog – Modern Design System
   ============================================ */

:root {
    --blog-primary: #2F80ED;
    --blog-primary-dark: #1a6fd4;
    --blog-purple: #7B2FF7;
    --blog-gradient: linear-gradient(135deg, #2F80ED 0%, #4b56f7 100%);
    --blog-text: #1a1a2e;
    --blog-body: #4a4a6a;
    --blog-muted: #8890a4;
    --blog-light-bg: #f5f7ff;
    --blog-card-bg: #ffffff;
    --blog-border: #eef0f7;
    --blog-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ── Page Layout ── */
.blog-container {
    padding-top: 40px;
    padding-bottom: 80px;
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* ── Hero Header (Blog Listing) ── */
.blog-hero {
    background: var(--blog-gradient);
    border-radius: 24px;
    padding: 70px 40px;
    margin-bottom: 56px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.10) 0%, transparent 55%),
        radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.07) 0%, transparent 45%);
    pointer-events: none;
}

.blog-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
    font-family: var(--blog-font);
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.blog-hero .lead {
    font-size: 1.15rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    font-family: var(--blog-font);
}

/* ── Blog Cards ── */
.blog-card {
    background: var(--blog-card-bg);
    border: 1px solid var(--blog-border);
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.05);
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 44px rgba(47, 128, 237, 0.13);
    border-color: rgba(47, 128, 237, 0.25);
}

/* Top gradient accent strip */
.blog-card-strip {
    height: 5px;
    background: var(--blog-gradient);
    flex-shrink: 0;
}

.blog-card .card-body {
    padding: 24px 26px 22px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    font-family: var(--blog-font);
}

/* Category Badge */
.blog-card .card-category {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 4px 11px;
    border-radius: 7px;
    margin-bottom: 13px;
    background: var(--blog-light-bg);
    color: var(--blog-primary);
    border: 1px solid rgba(47, 128, 237, 0.18);
}

/* Also style badge-primary inside cards */
.blog-card .badge-primary {
    background: var(--blog-gradient) !important;
    color: #fff !important;
    border: none !important;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    padding: 5px 12px;
    border-radius: 7px;
}

/* Title */
.blog-card .card-title {
    font-size: 1.08rem;
    font-weight: 700;
    line-height: 1.45;
    color: var(--blog-text);
    margin-bottom: 10px;
}

.blog-card .card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.blog-card .card-title a:hover {
    color: var(--blog-primary);
    text-decoration: none;
}

/* Excerpt */
.blog-card .card-text {
    font-size: 0.9rem;
    color: var(--blog-body);
    line-height: 1.68;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 18px;
}

/* Read More */
.btn-read-more {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--blog-primary);
    text-decoration: none;
    transition: gap 0.2s, color 0.2s;
    margin-bottom: 18px;
}

.btn-read-more:hover {
    color: var(--blog-primary-dark);
    text-decoration: none;
    gap: 9px;
}

/* Card Footer (author / date) */
.blog-card .card-footer-custom {
    padding-top: 14px;
    border-top: 1px solid var(--blog-border);
    font-size: 0.8rem;
    color: var(--blog-muted);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.blog-card .author {
    display: flex;
    align-items: center;
    gap: 6px;
    font-weight: 600;
    color: var(--blog-text);
}

.blog-card .author i {
    color: var(--blog-primary);
    font-size: 0.85rem;
}

.blog-card .date {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* ── Blog Grid Row Spacing ── */
.blog-grid [class*="col-"] {
    margin-bottom: 28px;
}

/* ── Pagination ── */
.pagination-container {
    margin-top: 48px;
    display: flex;
    justify-content: center;
}

.pagination .page-link {
    color: var(--blog-text);
    border: 1.5px solid var(--blog-border);
    margin: 0 4px;
    border-radius: 10px;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.88rem;
    transition: all 0.2s;
    font-family: var(--blog-font);
    background: #fff;
}

.pagination .page-item.active .page-link {
    background: var(--blog-gradient);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 4px 14px rgba(47, 128, 237, 0.35);
}

.pagination .page-link:hover {
    background: var(--blog-light-bg);
    color: var(--blog-primary);
    border-color: var(--blog-primary);
}

/* ── Category / Tag Page Hero ── */
.cat-hero {
    background: var(--blog-light-bg);
    border-radius: 20px;
    padding: 52px 40px;
    margin-bottom: 52px;
    text-align: center;
    border: 1px solid var(--blog-border);
}

.cat-hero .breadcrumb {
    background: transparent;
    padding: 0;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 0.875rem;
}

.cat-hero .breadcrumb-item a {
    color: var(--blog-primary);
    text-decoration: none;
}

.cat-hero .breadcrumb-item.active {
    color: var(--blog-muted);
}

.cat-hero h1 {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--blog-text);
    margin-bottom: 10px;
    font-family: var(--blog-font);
    letter-spacing: -0.3px;
}

.cat-hero h1 .text-primary {
    background: var(--blog-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cat-hero .lead {
    color: var(--blog-body);
    font-size: 1rem;
    margin-bottom: 0;
}

/* ── Single Post Article ── */
.blog-article {
    font-family: var(--blog-font);
}

/* Breadcrumb */
.blog-article .breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 28px;
    font-size: 0.875rem;
}

.blog-article .breadcrumb-item a {
    color: var(--blog-primary);
    text-decoration: none;
}

.blog-article .breadcrumb-item.active {
    color: var(--blog-muted);
}

/* Post Meta Bar */
.blog-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 22px;
}

.blog-meta .badge-primary {
    background: var(--blog-gradient) !important;
    color: #fff !important;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    border-radius: 8px;
    padding: 6px 14px;
    border: none !important;
}

.blog-meta .text-muted {
    font-size: 0.875rem;
    color: var(--blog-muted) !important;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Reading time badge */
.read-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: #F0F4FF;
    color: var(--blog-body);
    font-size: 0.76rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid var(--blog-border);
}

/* Post Title */
.blog-article h1 {
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--blog-text);
    line-height: 1.25;
    letter-spacing: -0.5px;
    margin-bottom: 32px;
}

/* Featured Image */
.blog-article .img-fluid {
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.09);
    margin-bottom: 44px;
}

/* ── Post Content Typography ── */
.blog-content {
    font-size: 1.06rem;
    line-height: 1.82;
    color: var(--blog-body);
}

.blog-content h2 {
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--blog-text);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    letter-spacing: -0.3px;
    line-height: 1.3;
}

.blog-content h3 {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--blog-text);
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    line-height: 1.35;
}

.blog-content h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--blog-text);
    margin-top: 1.75rem;
    margin-bottom: 0.6rem;
}

.blog-content p {
    margin-bottom: 1.5rem;
}

.blog-content a {
    color: var(--blog-primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.blog-content a:hover {
    color: var(--blog-primary-dark);
}

.blog-content ul,
.blog-content ol {
    padding-left: 1.75rem;
    margin-bottom: 1.5rem;
}

.blog-content li {
    margin-bottom: 0.5rem;
}

.blog-content blockquote {
    border-left: 4px solid var(--blog-primary);
    padding: 18px 26px;
    margin: 2rem 0;
    background: var(--blog-light-bg);
    border-radius: 0 14px 14px 0;
    font-style: italic;
    color: var(--blog-body);
}

.blog-content pre {
    background: #f6f8fa;
    border-radius: 10px;
    padding: 20px;
    overflow-x: auto;
    border: 1px solid var(--blog-border);
    margin-bottom: 1.5rem;
    font-size: 0.88rem;
}

.blog-content code {
    background: #f0f2f8;
    border-radius: 5px;
    padding: 2px 7px;
    font-size: 0.88em;
    color: #c0392b;
}

.blog-content pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.blog-content img {
    border-radius: 12px;
    max-width: 100%;
    margin: 1.5rem auto;
    display: block;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}

/* ── Post Footer ── */
.blog-article footer {
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 1px solid var(--blog-border);
}

/* Tags */
.blog-tags {
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
    align-items: center;
}

.tags-label {
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--blog-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.blog-tags a,
.blog-tags .badge,
.blog-tags .badge-light {
    display: inline-block !important;
    background: var(--blog-light-bg) !important;
    color: var(--blog-primary) !important;
    border: 1px solid rgba(47, 128, 237, 0.2) !important;
    padding: 6px 14px !important;
    border-radius: 100px !important;
    font-size: 0.82rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    transition: all 0.2s;
}

.blog-tags a:hover,
.blog-tags .badge:hover {
    background: var(--blog-primary) !important;
    color: #fff !important;
    border-color: var(--blog-primary) !important;
    text-decoration: none !important;
}

/* Post footer nav */
.post-footer-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    flex-wrap: wrap;
    gap: 16px;
}

/* Back button */
.btn-back-blog {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 22px;
    border: 2px solid var(--blog-primary);
    color: var(--blog-primary);
    border-radius: 100px;
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: all 0.2s;
    font-family: var(--blog-font);
}

.btn-back-blog:hover {
    background: var(--blog-primary);
    color: #fff;
    text-decoration: none;
}

/* Share Section */
.share-section {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.share-label {
    font-size: 0.83rem;
    font-weight: 700;
    color: var(--blog-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1.5px solid var(--blog-border);
    color: var(--blog-body);
    font-size: 0.88rem;
    text-decoration: none;
    transition: all 0.2s;
    background: #fff;
}

.share-btn:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

.share-btn.fb:hover {
    background: #1877F2;
    border-color: #1877F2;
    color: #fff;
}

.share-btn.tw:hover {
    background: #000;
    border-color: #000;
    color: #fff;
}

.share-btn.li:hover {
    background: #0A66C2;
    border-color: #0A66C2;
    color: #fff;
}

/* ── No-posts Alert ── */
.alert-info,
.alert-warning {
    border-radius: 14px;
    border: none;
    padding: 22px 28px;
    font-weight: 500;
}

/* ── Comparison Tables ── */
.comparison-table-wrapper {
    overflow-x: auto;
    margin: 2rem 0 2.5rem;
    border-radius: 14px;
    border: 1px solid var(--blog-border);
    box-shadow: 0 2px 16px rgba(0,0,0,0.04);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    font-family: var(--blog-font);
    min-width: 520px;
}

.comparison-table thead tr {
    background: var(--blog-gradient);
    color: #fff;
}

.comparison-table th {
    padding: 14px 18px;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;
    letter-spacing: 0.2px;
}

.comparison-table td {
    padding: 12px 18px;
    border-bottom: 1px solid var(--blog-border);
    color: var(--blog-body);
    vertical-align: middle;
}

.comparison-table tbody tr:last-child td {
    border-bottom: none;
}

.comparison-table tbody tr:nth-child(even) {
    background: #fafbff;
}

.comparison-table tbody tr:hover {
    background: var(--blog-light-bg);
}

/* Highlight Robofy column */
.comparison-table .robofy-col {
    background: rgba(47, 128, 237, 0.07);
    font-weight: 600;
    color: var(--blog-text);
}

.comparison-table thead .robofy-col {
    background: rgba(255,255,255,0.18);
}

/* Feature cell icons */
.check {
    color: #16a34a;
    font-weight: 700;
}

.cross {
    color: #dc2626;
    font-weight: 700;
}

.partial {
    color: #ea580c;
    font-weight: 600;
    font-size: 0.85rem;
}

/* ── Highlight / CTA Box ── */
.cta-box {
    background: var(--blog-gradient);
    border-radius: 16px;
    padding: 32px 36px;
    text-align: center;
    margin: 2.5rem 0;
    color: #fff;
}

.cta-box h3 {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.cta-box p {
    color: rgba(255,255,255,0.9);
    font-size: 1rem;
    margin-bottom: 20px;
}

.btn-cta-white {
    display: inline-block;
    background: #fff;
    color: var(--blog-primary);
    font-weight: 700;
    padding: 12px 28px;
    border-radius: 100px;
    text-decoration: none;
    font-size: 0.95rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-cta-white:hover {
    text-decoration: none;
    color: var(--blog-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

/* ── Related Links Box ── */
.related-links-box {
    background: var(--blog-light-bg);
    border: 1px solid var(--blog-border);
    border-radius: 14px;
    padding: 22px 28px;
    margin: 2.5rem 0;
}

.related-links-box h4 {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--blog-muted);
    margin-bottom: 12px;
}

.related-links-box ul {
    margin: 0;
    padding-left: 1.2rem;
}

.related-links-box li {
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.related-links-box a {
    color: var(--blog-primary);
    font-weight: 500;
    text-decoration: none;
}

.related-links-box a:hover {
    text-decoration: underline;
}

/* ── Category card meta (list view fallback) ── */
.card-meta {
    font-size: 0.82rem;
    color: var(--blog-muted);
    margin-bottom: 10px;
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.card-meta i {
    margin-right: 4px;
    color: var(--blog-primary);
}

/* ── Table of Contents ── */
.blog-toc {
    background: var(--blog-light-bg);
    border: 1px solid var(--blog-border);
    border-left: 4px solid var(--blog-primary);
    border-radius: 0 14px 14px 0;
    padding: 22px 28px;
    margin: 2rem 0 2.5rem;
}

.blog-toc > p {
    margin-bottom: 14px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--blog-text);
}

.blog-toc ol,
.blog-toc ul {
    margin-bottom: 0;
    padding-left: 1.3rem;
}

.blog-toc li {
    margin-bottom: 7px;
    font-size: 0.92rem;
    color: var(--blog-body);
}

.blog-toc a {
    color: var(--blog-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.blog-toc a:hover {
    color: var(--blog-primary-dark);
    text-decoration: underline;
}

/* Offset anchored headings for fixed navbar (~100px) */
[id] {
    scroll-margin-top: 120px;
}

/* ── Responsive ── */
@media (max-width: 991px) {
    .blog-grid [class*="col-"] {
        margin-bottom: 22px;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 48px 24px;
        border-radius: 18px;
        margin-bottom: 40px;
    }

    .blog-hero h1 {
        font-size: 2rem;
    }

    .blog-article h1 {
        font-size: 1.8rem;
    }

    .blog-content {
        font-size: 1rem;
    }

    .cat-hero {
        padding: 36px 20px;
        border-radius: 16px;
        margin-bottom: 36px;
    }

    .cat-hero h1 {
        font-size: 1.65rem;
    }

    .post-footer-nav {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 576px) {
    .blog-container {
        padding-left: 16px;
        padding-right: 16px;
    }

    .blog-hero h1 {
        font-size: 1.75rem;
    }

    .blog-article h1 {
        font-size: 1.55rem;
    }
}