/* ============================================================
   Blog Styles
   ============================================================ */

/* ---------- Blog Index ---------- */
.blog-hero {
    padding: 60px 0 40px;
    text-align: center;
}

.blog-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--gold);
    margin-bottom: 14px;
}

.blog-hero p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    max-width: 640px;
    margin: 0 auto;
    line-height: 1.7;
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    padding: 40px 0 80px;
}

.article-card {
    display: block;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    color: var(--text-primary);
    transition: all var(--transition);
    position: relative;
    overflow: hidden;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition);
}

.article-card:hover {
    transform: translateY(-6px);
    border-color: var(--accent);
    box-shadow: var(--shadow-glow);
    color: var(--text-primary);
}

.article-card:hover::before {
    transform: scaleX(1);
}

.article-card-icon {
    font-size: 2.2rem;
    margin-bottom: 14px;
}

.article-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.35;
}

.article-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.article-card-meta {
    display: flex;
    gap: 14px;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.article-card-cta {
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    margin-top: 12px;
    display: inline-block;
    transition: transform var(--transition);
}

.article-card:hover .article-card-cta {
    transform: translateX(4px);
}

/* ---------- Article Page ---------- */
.article-page {
    padding: 40px 0 80px;
}

.article-header {
    text-align: center;
    padding: 30px 0 40px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}

.article-header h1 {
    font-size: clamp(1.9rem, 4.5vw, 2.8rem);
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.15;
    color: var(--gold);
    margin-bottom: 18px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.article-meta {
    display: flex;
    justify-content: center;
    gap: 18px;
    color: var(--text-muted);
    font-size: 0.9rem;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

.article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.article-lead {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.75;
    max-width: 740px;
    margin: 0 auto;
    text-align: center;
}

/* ---------- Article Body ---------- */
.article-body {
    max-width: 740px;
    margin: 0 auto;
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-primary);
}

.article-body h2 {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--gold-light);
    margin-top: 48px;
    margin-bottom: 18px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    letter-spacing: -0.015em;
}

.article-body h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gold-light);
    margin-top: 32px;
    margin-bottom: 12px;
}

.article-body p {
    margin-bottom: 20px;
    color: var(--text-primary);
}

.article-body a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-color: rgba(139, 92, 246, 0.4);
    text-underline-offset: 3px;
    transition: all var(--transition);
}

.article-body a:hover {
    color: var(--accent-hover);
    text-decoration-color: var(--accent-hover);
}

.article-body strong {
    color: var(--text-primary);
    font-weight: 700;
}

.article-body ul,
.article-body ol {
    margin-bottom: 24px;
    padding-left: 28px;
}

.article-body li {
    margin-bottom: 10px;
    line-height: 1.75;
}

.article-body li::marker {
    color: var(--accent);
    font-weight: 700;
}

.article-body code {
    background: var(--bg-card);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.92em;
    color: var(--gold-light);
    border: 1px solid var(--border);
}

.article-body blockquote {
    border-left: 4px solid var(--accent);
    padding: 16px 24px;
    margin: 24px 0;
    background: var(--bg-card);
    border-radius: var(--radius);
    font-style: italic;
    color: var(--text-secondary);
}

/* ---------- Table of Contents ---------- */
.toc {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 22px 26px;
    margin: 30px 0 40px;
    box-shadow: var(--shadow);
}

.toc-title {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--gold);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc ul li {
    margin: 0;
}

.toc ul li a {
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.95rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px dashed transparent;
    transition: all var(--transition);
}

.toc ul li a:hover {
    color: var(--gold-light);
    border-bottom-color: var(--gold-light);
    text-decoration: none;
    transform: translateX(4px);
}

.toc ul li a::before {
    content: '\2192';
    color: var(--accent);
    font-weight: 700;
}

/* ---------- Callout / Highlight Box ---------- */
.callout {
    background: var(--bg-card);
    border-left: 4px solid var(--gold);
    padding: 20px 24px;
    border-radius: var(--radius);
    margin: 28px 0;
    box-shadow: var(--shadow);
}

.callout.tip {
    border-left-color: var(--success);
}

.callout.warning {
    border-left-color: var(--warning);
}

.callout.danger {
    border-left-color: var(--danger);
}

.callout-title {
    font-weight: 700;
    color: var(--gold-light);
    margin-bottom: 8px;
    font-size: 1rem;
}

.callout p {
    margin-bottom: 0;
    color: var(--text-primary);
}

.callout p + p {
    margin-top: 12px;
}

/* ---------- In-Article CTA ---------- */
.article-cta {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(6, 182, 212, 0.1) 100%);
    border: 2px solid var(--accent);
    border-radius: var(--radius-lg);
    padding: 30px 28px;
    margin: 36px 0;
    text-align: center;
}

.article-cta h3 {
    color: var(--accent);
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.3rem;
}

.article-cta p {
    color: var(--text-secondary);
    margin-bottom: 20px;
    font-size: 1rem;
}

/* ---------- Table ---------- */
.article-body table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 24px 0;
    box-shadow: var(--shadow);
    font-size: 0.95rem;
}

.article-body th {
    background: #1f2937;
    color: var(--gold);
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
}

.article-body td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.article-body tr:last-child td {
    border-bottom: none;
}

/* ---------- FAQ (in article) ---------- */
.article-body details {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 22px;
    margin-bottom: 12px;
    transition: border-color var(--transition);
}

.article-body details[open] {
    border-color: var(--accent);
}

.article-body details summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 1.05rem;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-primary);
}

.article-body details summary::-webkit-details-marker { display: none; }

.article-body details summary::after {
    content: '+';
    font-size: 1.5rem;
    color: var(--accent);
    transition: transform var(--transition);
    line-height: 1;
    margin-left: 12px;
}

.article-body details[open] summary::after {
    transform: rotate(45deg);
}

.article-body details p {
    margin-top: 14px;
    margin-bottom: 0;
    color: var(--text-secondary);
    line-height: 1.75;
}

/* ---------- Related Articles ---------- */
.related-articles {
    margin-top: 60px;
    padding: 32px 28px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.related-articles h2 {
    border-bottom: none;
    text-align: center;
    margin-top: 0;
    padding: 0;
    font-size: 1.35rem;
    margin-bottom: 24px;
}

/* ---------- Back to Blog ---------- */
.back-to-blog {
    display: inline-block;
    margin-top: 40px;
    padding: 10px 22px;
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition);
    text-decoration: none;
}

.back-to-blog:hover {
    border-color: var(--accent);
    color: var(--accent);
    text-decoration: none;
    transform: translateX(-4px);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .blog-hero {
        padding: 40px 0 20px;
    }

    .blog-hero h1 {
        font-size: 1.7rem;
    }

    .blog-grid {
        grid-template-columns: 1fr;
        padding: 20px 0 50px;
    }

    .article-header {
        padding: 20px 0 28px;
    }

    .article-header h1 {
        font-size: 1.55rem;
    }

    .article-body {
        font-size: 1rem;
    }

    .article-body h2 {
        font-size: 1.35rem;
        margin-top: 36px;
    }

    .article-body h3 {
        font-size: 1.15rem;
    }

    .article-body table {
        font-size: 0.85rem;
    }

    .article-body th,
    .article-body td {
        padding: 8px 10px;
    }

    .article-cta {
        padding: 22px 18px;
    }
}