/* Individual Blog Post Styles */

.post-loading,
.post-error {
    text-align: center;
    padding: 4rem 2rem;
}

.post-article {
    padding: 2rem 0 4rem;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.breadcrumbs a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumbs a:hover {
    text-decoration: underline;
}

/* Post Header */
.post-header {
    margin-bottom: 3rem;
}

.post-title {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.post-meta {
    display: flex;
    gap: 2rem;
    color: var(--text-secondary);
}

.post-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Post Layout */
.post-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
    align-items: start;
}

/* Table of Contents */
.post-toc {
    position: sticky;
    top: 100px;
    background: white;
    padding: 1.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
}

.post-toc h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

#toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#toc-nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    padding: 0.5rem;
    border-radius: 0.375rem;
    transition: all 0.2s;
}

#toc-nav a:hover,
#toc-nav a.active {
    color: var(--primary-color);
    background: #f7fafc;
}

/* Post Main Content */
.post-main {
    background: white;
    padding: 2.5rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-md);
}

.post-body {
    color: var(--text-primary);
    line-height: 1.8;
    font-size: 1.125rem;
}

.post-body h2 {
    font-size: 2rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    color: var(--text-primary);
    scroll-margin-top: 100px;
}

.post-body h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    color: var(--text-primary);
    scroll-margin-top: 100px;
}

.post-body p {
    margin-bottom: 1.5rem;
}

.post-body ul,
.post-body ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.post-body li {
    margin-bottom: 0.75rem;
}

.post-body a {
    color: var(--primary-color);
    text-decoration: underline;
}

.post-body strong {
    font-weight: 700;
    color: var(--text-primary);
}

.post-body em {
    font-style: italic;
}

.post-body blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-secondary);
}

.post-body code {
    background: #f7fafc;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.post-body pre {
    background: #1a202c;
    color: #f7fafc;
    padding: 1.5rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin: 2rem 0;
}

.post-body pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.post-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 2rem 0;
}

.post-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.post-body th,
.post-body td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

.post-body th {
    background: #f7fafc;
    font-weight: 600;
}

/* Share Buttons */
.post-share {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.post-share h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.share-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    color: white;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.share-whatsapp {
    background: #25D366;
}

.share-twitter {
    background: #1DA1F2;
}

.share-linkedin {
    background: #0077B5;
}

/* Back Button */
.post-back {
    margin-top: 3rem;
    text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
    .post-layout {
        grid-template-columns: 1fr;
    }

    .post-toc {
        display: none;
    }
}

@media (max-width: 768px) {
    .post-title {
        font-size: 2rem;
    }

    .post-main {
        padding: 1.5rem;
    }

    .post-body {
        font-size: 1rem;
    }

    .post-body h2 {
        font-size: 1.5rem;
    }

    .post-body h3 {
        font-size: 1.25rem;
    }

    .share-buttons {
        flex-direction: column;
    }

    .share-btn {
        width: 100%;
        justify-content: center;
    }
}