/* ================================================
   BLOG - Clean, editorial design
   Follows learn.css variable conventions
   ================================================ */

/* CSS Variables */
:root {
    --blog-primary: #6366f1;
    --blog-primary-dark: #4f46e5;
    --blog-primary-light: #818cf8;
    --blog-text: #1e293b;
    --blog-text-muted: #64748b;
    --blog-bg: #ffffff;
    --blog-bg-alt: #f8fafc;
    --blog-border: #e2e8f0;
    --blog-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    --blog-shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --blog-radius: 12px;
    --blog-radius-sm: 8px;
}

/* ================================================
   HERO SECTION
   ================================================ */
.blog-hero {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    padding: 4rem 0 3rem;
    position: relative;
    overflow: hidden;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 30%, rgba(139, 92, 246, 0.03) 0%, transparent 50%);
    pointer-events: none;
}

.blog-hero-content {
    position: relative;
    z-index: 1;
    max-width: 640px;
    margin: 0 auto;
}

/* ================================================
   BLOG CARDS
   ================================================ */
.blog-card {
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--blog-shadow-md);
}

.blog-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card .card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blog-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card-title a:hover {
    color: var(--blog-primary) !important;
}

.blog-card-excerpt {
    font-size: 0.875rem;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* ================================================
   ARTICLE PAGE
   ================================================ */
.blog-article-header {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    padding: 3rem 0 2rem;
}

.blog-featured-image {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: var(--blog-radius);
}

/* Article body typography */
.blog-article-body {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: var(--blog-text);
}

.blog-article-body h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.blog-article-body h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--blog-border);
}

.blog-article-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.blog-article-body p {
    margin-bottom: 1.25rem;
}

.blog-article-body ul,
.blog-article-body ol {
    margin-bottom: 1.25rem;
    padding-left: 1.5rem;
}

.blog-article-body li {
    margin-bottom: 0.5rem;
}

.blog-article-body blockquote {
    border-left: 4px solid var(--blog-primary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    background: var(--blog-bg-alt);
    border-radius: 0 var(--blog-radius-sm) var(--blog-radius-sm) 0;
    color: var(--blog-text-muted);
    font-style: italic;
}

.blog-article-body pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.25rem;
    border-radius: var(--blog-radius-sm);
    overflow-x: auto;
    margin-bottom: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.6;
}

.blog-article-body code {
    background: var(--blog-bg-alt);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-size: 0.875em;
    color: var(--blog-primary-dark);
}

.blog-article-body pre code {
    background: transparent;
    padding: 0;
    color: inherit;
}

.blog-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--blog-radius-sm);
    margin: 1rem 0;
}

.blog-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.25rem;
    font-size: 0.9375rem;
}

.blog-article-body th,
.blog-article-body td {
    padding: 0.75rem 1rem;
    border: 1px solid var(--blog-border);
    text-align: left;
}

.blog-article-body th {
    background: var(--blog-bg-alt);
    font-weight: 600;
}

/* ================================================
   SIDEBAR
   ================================================ */
.blog-sidebar .card {
    border: 1px solid var(--blog-border);
    border-radius: var(--blog-radius);
}

.blog-sidebar .card-header {
    background: transparent;
    border-bottom: 1px solid var(--blog-border);
}

.blog-sidebar .list-group-item {
    border-left: none;
    border-right: none;
    padding: 0.75rem 1.25rem;
    font-size: 0.9375rem;
    transition: background-color 0.15s ease;
}

.blog-sidebar .list-group-item:first-child {
    border-top: none;
}

.blog-sidebar .list-group-item:last-child {
    border-bottom: none;
}

.blog-sidebar .list-group-item:hover {
    background-color: var(--blog-bg-alt);
}

/* ================================================
   RESPONSIVE
   ================================================ */
@media (max-width: 768px) {
    .blog-hero {
        padding: 3rem 0 2rem;
    }

    .blog-card-image {
        height: 160px;
    }

    .blog-article-body {
        font-size: 1rem;
    }

    .blog-featured-image {
        max-height: 300px;
    }
}
