/* ===================================
   BLOG - Styles
   =================================== */

/* --- Blog Index Page --- */
.blog-hero {
    padding: 140px 0 60px;
    background: linear-gradient(180deg, var(--primary-50) 0%, var(--bg) 100%);
    text-align: center;
}

.blog-hero h1 {
    margin-bottom: 12px;
}

.blog-hero p {
    color: var(--text-light);
    font-size: 1.15rem;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Blog Grid --- */
.blog-section {
    padding: 60px 0 100px;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 32px;
}

.blog-card {
    background: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.blog-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.blog-card-link:hover {
    color: inherit;
}

.blog-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary-light) 0%, #ddd6fe 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-card-image svg {
    width: 80px;
    height: 80px;
    opacity: 0.5;
}

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

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 0.82rem;
    color: var(--text-light);
}

.blog-card-category {
    display: inline-block;
    padding: 3px 10px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
}

.blog-card-body h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.blog-card-body h3 a {
    color: var(--text-dark);
}

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

.blog-card-body p {
    color: var(--text-light);
    font-size: 0.92rem;
    line-height: 1.7;
    flex: 1;
}

.blog-card-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.blog-card-read {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.blog-card-read:hover {
    gap: 10px;
}

.blog-card-time {
    font-size: 0.82rem;
    color: var(--text-light);
}

/* --- Blog Post Page --- */
.post-hero {
    padding: 140px 0 0;
    background: linear-gradient(180deg, var(--primary-50) 0%, var(--bg) 100%);
}

.post-hero-inner {
    max-width: 800px;
    margin: 0 auto;
}

.post-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 24px;
}

.post-breadcrumb a {
    color: var(--primary);
    font-weight: 500;
}

.post-breadcrumb a:hover {
    text-decoration: underline;
}

.post-category {
    display: inline-block;
    padding: 4px 14px;
    background: var(--primary-light);
    color: var(--primary);
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 16px;
}

.post-hero h1 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    line-height: 1.25;
    margin-bottom: 20px;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.post-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.post-meta-item svg {
    width: 16px;
    height: 16px;
}

.post-cover {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.post-cover img {
    width: 100%;
    height: auto;
    display: block;
}

.post-cover-placeholder {
    width: 100%;
    height: 400px;
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 50%, #2563eb 100%);
    background-size: 200% 200%;
    animation: gradientShift 8s ease infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.post-cover-placeholder svg {
    width: 120px;
    height: 120px;
    opacity: 0.3;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* --- Post Content --- */
.post-content {
    max-width: 740px;
    margin: 0 auto;
    padding: 48px 24px 80px;
}

.post-content h2 {
    font-size: 1.6rem;
    margin-top: 48px;
    margin-bottom: 16px;
    padding-top: 32px;
    border-top: 1px solid var(--border-light);
}

.post-content h2:first-of-type {
    border-top: none;
    padding-top: 0;
}

.post-content h3 {
    font-size: 1.25rem;
    margin-top: 32px;
    margin-bottom: 12px;
}

.post-content p {
    margin-bottom: 20px;
    color: var(--text);
    line-height: 1.85;
    font-size: 1.05rem;
}

.post-content ul, .post-content ol {
    margin-bottom: 20px;
    padding-left: 24px;
}

.post-content li {
    margin-bottom: 8px;
    line-height: 1.75;
    color: var(--text);
    font-size: 1.02rem;
    list-style: disc;
}

.post-content ol li {
    list-style: decimal;
}

.post-content strong {
    color: var(--text-dark);
    font-weight: 600;
}

.post-content a {
    color: var(--primary);
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: var(--primary-light);
    text-underline-offset: 3px;
}

.post-content a:hover {
    text-decoration-color: var(--primary);
}

/* --- Case Study Cards in Post --- */
.case-card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    margin: 32px 0;
    position: relative;
    overflow: hidden;
}

.case-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, var(--primary) 0%, #7c3aed 100%);
}

.case-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.case-card-icon {
    width: 52px;
    height: 52px;
    min-width: 52px;
    background: var(--primary-light);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
}

.case-card-icon svg {
    width: 28px;
    height: 28px;
    stroke: var(--primary);
}

.case-card-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.case-card-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.case-card p {
    font-size: 0.98rem;
}

.case-card-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.case-result {
    text-align: center;
}

.case-result-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1.2;
}

.case-result-label {
    font-size: 0.8rem;
    color: var(--text-light);
}

/* --- Highlight Box --- */
.post-highlight {
    background: linear-gradient(135deg, var(--primary) 0%, #7c3aed 100%);
    color: #fff;
    padding: 32px;
    border-radius: var(--radius);
    margin: 40px 0;
}

.post-highlight h3 {
    color: #fff;
    margin-top: 0;
    margin-bottom: 12px;
}

.post-highlight p {
    color: rgba(255,255,255,0.9);
    margin-bottom: 0;
}

.post-highlight a {
    color: #fff;
    text-decoration-color: rgba(255,255,255,0.5);
}

.post-highlight a:hover {
    text-decoration-color: #fff;
}

/* --- Post CTA --- */
.post-cta {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    text-align: center;
    margin: 48px 0 0;
}

.post-cta h3 {
    margin-top: 0;
    margin-bottom: 12px;
}

.post-cta p {
    color: var(--text-light);
    margin-bottom: 24px;
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.post-cta .btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* --- Post Share --- */
.post-share {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    margin-top: 48px;
}

.post-share span {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 0.9rem;
}

.post-share-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--bg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.post-share-btn:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.post-share-btn svg {
    width: 18px;
    height: 18px;
    stroke: var(--text);
}

/* --- Author Box --- */
.post-author {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 24px;
    background: var(--bg-alt);
    border-radius: var(--radius);
    margin-top: 32px;
    border: 1px solid var(--border-light);
}

.post-author-avatar {
    width: 56px;
    height: 56px;
    min-width: 56px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.post-author-info strong {
    display: block;
    font-size: 1rem;
    color: var(--text-dark);
}

.post-author-info span {
    font-size: 0.88rem;
    color: var(--text-light);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .post-cover-placeholder {
        height: 240px;
    }

    .post-content {
        padding: 32px 16px 60px;
    }

    .case-card {
        padding: 24px;
    }

    .case-card-results {
        grid-template-columns: 1fr 1fr;
    }

    .post-highlight {
        padding: 24px;
    }

    .post-cta {
        padding: 28px 20px;
    }

    .post-meta {
        gap: 12px;
    }
}

/* --- Dark mode adjustments --- */
[data-theme="dark"] .blog-card {
    background: var(--bg-dark);
    border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .blog-card:hover {
    border-color: var(--primary);
}

[data-theme="dark"] .case-card {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .post-cta {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.1);
}

[data-theme="dark"] .post-author {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.08);
}

[data-theme="dark"] .post-cover-placeholder {
    opacity: 0.85;
}

[data-theme="dark"] .blog-card-image {
    opacity: 0.85;
}
