/* ====================== */
/* SINGLE POST PAGE STYLES */
/* ====================== */

/* Post Layout */
.blog-post {
    padding-top: 2rem;
    color: var(--text-primary);
    background-color: var(--bg-dark);
}

.post-header {
    margin-bottom: 2rem;
}

.post-meta {
    margin-bottom: 2rem;
}

.post-category-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--bg-darker);
    padding: 0.3rem 1rem;
    border-radius: 2rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    text-decoration: none;
    margin-bottom: 1.25rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-category-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(75, 238, 112, 0.3);
}

/* Post Title */
.post-title {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
    font-weight: 800;
    letter-spacing: -0.02em;
}

/* Author Info */
.author-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border);
    transition: border-color 0.2s ease;
}

.author-avatar:hover {
    border-color: var(--accent);
}

.author-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.author-name {
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.author-name:hover {
    color: var(--accent);
}

.post-stats {
    color: var(--text-secondary);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.stat-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.stat-item svg {
    opacity: 0.7;
}

.stat-divider {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Featured Image - Professional Padding */
.post-featured-image {
    margin-top: 2rem;
}

.featured-image-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.3s ease;
}

[data-theme="dark"] .featured-image-wrapper {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.featured-image-wrapper img {
    width: 100%;
    max-height: 550px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* Post Content Wrapper */
.post-content-wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    margin-top: 3rem;
    align-items: start;
}

/* ====================== */
/* TABLE OF CONTENTS */
/* ====================== */
.post-sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

.post-sidebar::-webkit-scrollbar {
    width: 4px;
}

.post-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.post-sidebar::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.toc-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.toc-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border);
    background: var(--bg-darker);
}

.toc-header svg {
    color: var(--accent);
    flex-shrink: 0;
}

.toc-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: 0.02em;
}

.toc-content {
    padding: 0.75rem 0;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-item {
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.toc-item.active {
    border-left-color: var(--accent);
    background: rgba(75, 238, 112, 0.06);
}

.toc-item a {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 0.45rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.toc-item:hover a {
    color: var(--text-primary);
    background: var(--bg-card-hover);
}

.toc-item.active a {
    color: var(--accent);
    font-weight: 600;
}

.toc-item.h2 a {
    font-weight: 600;
    font-size: 0.88rem;
}

.toc-item.h3 a {
    padding-left: 1.5rem;
    font-size: 0.82rem;
}

.toc-number {
    color: var(--accent);
    font-weight: 700;
    font-size: 0.8rem;
    min-width: 1.2rem;
    flex-shrink: 0;
}

.toc-indent {
    color: var(--border);
    font-size: 0.75rem;
    min-width: 1.2rem;
    flex-shrink: 0;
    font-family: monospace;
}

.toc-text {
    flex: 1;
}

.no-toc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    padding: 1rem 1.25rem;
    text-align: center;
    font-style: italic;
}

/* Reading Progress */
.toc-progress {
    height: 3px;
    background: var(--bg-darker);
}

.toc-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--accent), var(--primary-light, var(--accent-dark)));
    border-radius: 0 3px 3px 0;
    transition: width 0.1s ease;
}

/* ====================== */
/* CONTENT AREA */
/* ====================== */
.post-content {
    min-width: 0;
}

/* Social Sharing */
.social-sharing {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.social-sharing span {
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    font-size: 0.9rem;
}

.share-buttons {
    display: flex;
    gap: 8px;
}

.a2a_kit a {
    border-radius: 6px;
    transition: transform 0.2s ease;
}

.a2a_kit a:hover {
    transform: translateY(-2px);
}

/* Article Content */
.article-content {
    line-height: 1.8;
    font-size: 1.1rem;
    color: var(--text-primary);
}

.article-content p {
    margin-bottom: 1.5em;
}

.article-content h2 {
    font-size: 1.8rem;
    margin: 2em 0 1em;
    color: var(--text-primary);
    font-weight: 700;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border);
}

.article-content h3 {
    font-size: 1.4rem;
    margin: 1.5em 0 0.8em;
    color: var(--text-primary);
    font-weight: 600;
}

.article-content h4 {
    font-size: 1.2rem;
    margin: 1.3em 0 0.6em;
    color: var(--text-primary);
    font-weight: 600;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
}

.article-content a {
    color: var(--primary-light, var(--accent));
    text-decoration: underline;
    text-decoration-color: rgba(75, 238, 112, 0.3);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s ease;
}

.article-content a:hover {
    text-decoration-color: var(--accent);
}

.article-content blockquote {
    border-left: 4px solid var(--accent);
    margin: 1.5em 0;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border-radius: 0 8px 8px 0;
    color: var(--text-secondary);
    font-style: italic;
}

.article-content pre {
    background: var(--bg-darker);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.25rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-content code {
    font-family: var(--font-mono, 'Fira Code', monospace);
    font-size: 0.9em;
}

.article-content p code,
.article-content li code {
    background: var(--bg-darker);
    padding: 0.15em 0.4em;
    border-radius: 4px;
    border: 1px solid var(--border);
    font-size: 0.88em;
}

.article-content ul,
.article-content ol {
    margin: 1em 0;
    padding-left: 1.5em;
}

.article-content li {
    margin-bottom: 0.5em;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.article-content th {
    background: var(--bg-darker);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--border);
    color: var(--text-primary);
}

.article-content td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-primary);
}

.article-content tr:last-child td {
    border-bottom: none;
}

.article-content tr:hover {
    background: var(--bg-card-hover);
}

/* Dark mode highlight.js override */
[data-theme="dark"] .hljs {
    background: var(--bg-darker) !important;
    color: var(--text-primary) !important;
}

/* ====================== */
/* NEWSLETTER CTA */
/* ====================== */
.newsletter-cta {
    margin: 3rem 0;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-darker) 100%);
    border: 1px solid var(--border);
    overflow: hidden;
    position: relative;
}

.newsletter-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--primary, #3776AB), var(--accent));
}

.newsletter-cta-inner {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.25rem;
}

.newsletter-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(75, 238, 112, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    border: 2px solid rgba(75, 238, 112, 0.2);
}

.newsletter-text h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
}

.newsletter-text p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 500px;
}

.newsletter-form {
    width: 100%;
    max-width: 480px;
}

.newsletter-input-group {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.35rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.newsletter-input-group:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(75, 238, 112, 0.1);
}

.newsletter-input-group input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    min-width: 0;
}

.newsletter-input-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.7;
}

.newsletter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--bg-darker);
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.newsletter-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(75, 238, 112, 0.3);
}

/* ====================== */
/* COMMENTS SECTION */
/* ====================== */
.comments-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comments-header .section-title {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    border: none;
}

.comments-header .section-title svg {
    color: var(--accent);
}

.comment-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: var(--bg-darker);
    padding: 0.35rem 0.85rem;
    border-radius: 2rem;
    font-weight: 600;
}

/* Comment Form */
.comment-form {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 2rem;
}

.comment-form-grid {
    display: grid;
    gap: 1rem;
}

.comment-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.comment-form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.comment-form input,
.comment-form textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: inherit;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(75, 238, 112, 0.1);
}

.comment-form input::placeholder,
.comment-form textarea::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.submit-button {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--bg-darker);
    border: none;
    padding: 0.85rem 1.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    margin-top: 0.5rem;
}

.submit-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(75, 238, 112, 0.3);
}

/* Comments List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    transition: border-color 0.2s ease;
}

.comment:hover {
    border-color: var(--accent);
}

.comment.odd {
    background: var(--bg-darker);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.commenter-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.commenter-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--bg-darker);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    flex-shrink: 0;
}

.commenter-info strong {
    color: var(--text-primary);
    font-size: 0.95rem;
}

.comment-date {
    color: var(--text-secondary);
    font-size: 0.82rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.comment-body {
    color: var(--text-primary);
    line-height: 1.7;
    font-size: 0.95rem;
    padding-left: calc(36px + 0.65rem);
}

.comment-body p:last-child {
    margin-bottom: 0;
}

.no-comments {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    text-align: center;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px dashed var(--border);
    border-radius: 12px;
}

.no-comments svg {
    margin-bottom: 1rem;
    opacity: 0.4;
}

.no-comments p {
    margin: 0;
    font-size: 0.95rem;
}

/* ====================== */
/* RELATED POSTS */
/* ====================== */
.related-posts {
    padding: 4rem 0;
    background-color: var(--bg-darker);
    border-top: 1px solid var(--border);
}

.related-posts .section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.related-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.related-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

[data-theme="light"] .related-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .related-card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.related-image {
    height: 200px;
    overflow: hidden;
}

.related-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.related-card:hover .related-image img {
    transform: scale(1.05);
}

.related-content {
    padding: 1.5rem;
}

.related-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.related-title:hover {
    color: var(--accent);
}

.related-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.related-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.82rem;
    color: var(--text-secondary);
    flex-wrap: wrap;
    gap: 0.5rem;
}

.related-meta .author {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.related-meta .author img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: cover;
}

.related-meta .stats {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* ====================== */
/* RESPONSIVE */
/* ====================== */
@media (max-width: 992px) {
    .post-content-wrapper {
        grid-template-columns: 1fr;
    }

    .post-sidebar {
        position: static;
        max-height: none;
        order: -1;
        margin-bottom: 1rem;
    }

    .toc-content {
        max-height: 200px;
        overflow-y: auto;
    }

    .post-title {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .post-title {
        font-size: 1.75rem;
    }

    .social-sharing {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .newsletter-cta-inner {
        padding: 2rem 1.5rem;
    }

    .newsletter-input-group {
        flex-direction: column;
    }

    .newsletter-btn {
        justify-content: center;
    }

    .comment-body {
        padding-left: 0;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .featured-image-wrapper {
        padding: 0.5rem;
    }

    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Alert Messages */
.alert-messages {
    margin-bottom: 1.5rem;
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-primary);
}

.alert-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    line-height: 1;
}

.alert-close:hover {
    color: var(--text-primary);
}
