/* Blog post page CSS */

/* Main Layout */
.main-layout {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 280px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 104px 2rem 4rem;
    gap: 3rem;
}

/* Article */
article {
    max-width: 720px;
}

.article-header {
    margin-bottom: 2.5rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    margin-bottom: 2rem;
    transition: all 0.2s;
}

.back-link:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

.back-link svg {
    width: 16px;
    height: 16px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.article-category {
    padding: 0.3rem 0.7rem;
    background: rgba(168, 85, 247, 0.15);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--purple);
}

.article-date {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.article-title {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 1.25rem;
}

.article-excerpt {
    font-size: 1.2rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
}

.author-avatar {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    overflow: hidden;
    box-shadow: 0 0 0 2px var(--accent);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-link:hover .author-avatar {
    transform: scale(1.05);
    box-shadow: 0 0 0 2px var(--accent), 0 0 12px rgba(249, 115, 22, 0.5);
}

.author-info {
    flex: 1;
}

.author-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.author-bio {
    font-size: 0.85rem;
    color: var(--text-dim);
}

.author-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
}

.author-link:hover {
    opacity: 0.8;
}

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

.read-time {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.read-time svg {
    width: 16px;
    height: 16px;
}

/* Admin Feature Button */
.admin-feature-form {
    margin-top: 1rem;
}

.admin-feature-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.admin-feature-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.admin-feature-btn.featured {
    background: rgba(249, 115, 22, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

.admin-feature-btn.featured:hover {
    background: rgba(249, 115, 22, 0.25);
}

.admin-feature-btn svg {
    width: 16px;
    height: 16px;
}

.admin-feature-btn.featured svg {
    fill: var(--accent);
}

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

.article-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text);
    margin: 2.5rem 0 1rem;
    letter-spacing: -0.02em;
}

.article-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text);
    margin: 2rem 0 0.75rem;
}

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

.article-content a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

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

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

.article-content ul,
.article-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

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

.article-content li::marker {
    color: var(--accent);
}

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

.article-content code {
    font-family: var(--font-mono);
    font-size: 0.9em;
    padding: 0.15rem 0.4rem;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: var(--accent);
}

.article-content pre {
    margin: 1.5rem 0;
    padding: 1.25rem 1.5rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow-x: auto;
}

.article-content pre code {
    padding: 0;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
}

.article-content img {
    max-width: 100%;
    border-radius: 10px;
    margin: 2rem 0;
}

.article-content hr {
    border: none;
    height: 1px;
    background: var(--border);
    margin: 3rem 0;
}

/* Syntax highlighting */
.hljs {
    background: transparent;
}

.hljs-keyword, .hljs-selector-tag, .hljs-built_in, .hljs-name { color: #c792ea; }
.hljs-string, .hljs-attr { color: #c3e88d; }
.hljs-number, .hljs-literal { color: #f78c6c; }
.hljs-comment { color: #546e7a; font-style: italic; }
.hljs-function .hljs-title, .hljs-title.function_ { color: #82aaff; }
.hljs-variable, .hljs-template-variable { color: #f07178; }
.hljs-type, .hljs-class .hljs-title { color: #ffcb6b; }

/* Article Footer */
.article-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.article-tag {
    padding: 0.4rem 0.8rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.2s;
}

.article-tag:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
    color: var(--accent);
}

.share-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.share-label {
    font-size: 0.9rem;
    color: var(--text-dim);
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
}

.share-btn {
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s;
}

.share-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text);
}

.share-btn svg {
    width: 16px;
    height: 16px;
}

/* Like Button */
.engagement-section {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 1.5rem;
}

.like-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.like-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent);
}

.like-btn.liked {
    background: rgba(249, 115, 22, 0.15);
    border-color: var(--accent);
    color: var(--accent);
}

.like-btn.liked svg {
    fill: var(--accent);
}

.like-btn svg {
    width: 18px;
    height: 18px;
}

.engagement-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-dim);
}

.engagement-stat {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.engagement-stat svg {
    width: 16px;
    height: 16px;
}

/* Comments Section */
.comments-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.comments-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.comments-header h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.comments-count {
    padding: 0.2rem 0.6rem;
    background: var(--bg-card);
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.comment-form {
    margin-bottom: 2rem;
}

.comment-form textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    font-family: var(--font-body);
    font-size: 0.95rem;
    resize: vertical;
    margin-bottom: 0.75rem;
}

.comment-form textarea:focus {
    outline: none;
    border-color: var(--accent);
}

.comment-form textarea::placeholder {
    color: var(--text-dim);
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
}

.comment-submit {
    padding: 0.6rem 1.25rem;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: white;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.comment-submit:hover {
    opacity: 0.9;
}

.comment-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.login-prompt {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-align: center;
    margin-bottom: 2rem;
}

.login-prompt p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.login-prompt a {
    color: var(--accent);
    text-decoration: none;
}

.login-prompt a:hover {
    text-decoration: underline;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment {
    padding: 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--purple), var(--blue));
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
}

.comment-meta {
    flex: 1;
}

.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
}

.comment-date {
    font-size: 0.8rem;
    color: var(--text-dim);
}

.comment-content {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.no-comments {
    padding: 2rem;
    text-align: center;
    color: var(--text-dim);
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 88px;
    height: fit-content;
}

.sidebar-section {
    margin-bottom: 2rem;
}

.sidebar-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 0.75rem;
}

/* Table of Contents */
.toc {
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
}

.toc-list {
    list-style: none;
}

.toc-item {
    margin-bottom: 0.5rem;
}

.toc-item:last-child {
    margin-bottom: 0;
}

.toc-link {
    display: block;
    padding: 0.35rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
    border-left: 2px solid transparent;
    padding-left: 0.75rem;
    margin-left: -0.75rem;
}

.toc-link:hover,
.toc-link.active {
    color: var(--accent);
    border-left-color: var(--accent);
}

.toc-link.indent {
    padding-left: 1.5rem;
    font-size: 0.8rem;
}

/* Related Posts */
.related-posts {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.related-post {
    display: block;
    padding: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.related-post:hover {
    background: var(--bg-card-hover);
    transform: translateX(4px);
}

.related-post-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 0.25rem;
    line-height: 1.4;
}

.related-post-date {
    font-size: 0.75rem;
    color: var(--text-dim);
}

/* Prev/Next Navigation */
.prev-next-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.nav-link {
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s;
}

.nav-link:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.12);
}

.nav-link.next {
    text-align: right;
}

.nav-label {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-bottom: 0.4rem;
}

.nav-link.next .nav-label {
    justify-content: flex-end;
}

.nav-label svg {
    width: 14px;
    height: 14px;
}

.nav-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
}

/* Mobile TOC Dropdown */
.mobile-toc {
    display: none;
    margin-bottom: 2rem;
}

.mobile-toc-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-toc-toggle:hover {
    background: var(--bg-card-hover);
}

.mobile-toc-toggle svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.mobile-toc.open .mobile-toc-toggle svg {
    transform: rotate(180deg);
}

.mobile-toc-content {
    display: none;
    padding: 0.75rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 8px 8px;
}

.mobile-toc.open .mobile-toc-content {
    display: block;
}

.mobile-toc.open .mobile-toc-toggle {
    border-radius: 8px 8px 0 0;
}

.mobile-toc-content .toc-list {
    list-style: none;
}

.mobile-toc-content .toc-link {
    display: block;
    padding: 0.5rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
}

.mobile-toc-content .toc-link.indent {
    padding-left: 1rem;
    font-size: 0.8rem;
}

@media (max-width: 900px) {
    .main-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        display: none;
    }

    .mobile-toc {
        display: block;
    }

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

    .prev-next-nav {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .main-layout {
        padding: 88px 1rem 2rem;
    }
}
