/**
 * Neksio Tools - Scoped Blog Shell Stylesheet
 * 
 * Provides professional responsive styling for Single Blog Posts.
 * All rules are scoped under .neksio-blog-shell to prevent global leakage.
 *
 * @package NeksioTools
 */

/* Main Blog Wrapper */
.neksio-blog-shell {
    background-color: var(--nek-idx-bg, #0b0f19);
    color: var(--nek-idx-text-main, #f3f4f6);
}

.nek-blog-main-wrapper {
    width: 100%;
}

/* Article Header */
.nek-blog-article-header {
    margin-bottom: 28px;
}

.nek-blog-cat-badge {
    display: inline-block;
    background: rgba(99, 102, 241, 0.15);
    color: var(--nek-idx-primary, #6366f1);
    border: 1px solid rgba(99, 102, 241, 0.3);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 14px;
}

.nek-blog-post-title {
    font-size: 36px;
    font-weight: 800;
    color: var(--nek-idx-text-main, #ffffff);
    margin: 0 0 16px 0;
    line-height: 1.25;
    letter-spacing: -0.7px;
}

.nek-blog-meta-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
    color: var(--nek-idx-text-muted, #9ca3af);
}

.nek-meta-item strong {
    color: var(--nek-idx-text-main, #ffffff);
}

.nek-meta-sep {
    color: var(--nek-idx-text-subtle, #4b5563);
}

/* Featured Media */
.nek-blog-featured-media {
    margin-bottom: 32px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--nek-idx-border, #2e3d5b);
    background: var(--nek-idx-surface, #111827);
    max-height: 480px;
}

.nek-blog-featured-img {
    width: 100%;
    height: auto;
    max-height: 480px;
    object-fit: cover;
    display: block;
}

/* Article Body Typography & Element Styling */
.nek-blog-article-body {
    max-width: 860px;
    margin: 0 auto 48px auto;
    font-size: 16px;
    line-height: 1.8;
    color: var(--nek-idx-text-main, #e5e7eb);
}

.nek-blog-article-body p {
    margin-bottom: 22px;
}

.nek-blog-article-body h2 {
    font-size: 26px;
    font-weight: 700;
    color: var(--nek-idx-text-main, #ffffff);
    margin: 40px 0 16px 0;
    line-height: 1.3;
    letter-spacing: -0.4px;
}

.nek-blog-article-body h3 {
    font-size: 21px;
    font-weight: 700;
    color: var(--nek-idx-text-main, #ffffff);
    margin: 32px 0 14px 0;
    line-height: 1.35;
}

.nek-blog-article-body h4 {
    font-size: 18px;
    font-weight: 600;
    color: var(--nek-idx-text-main, #ffffff);
    margin: 24px 0 12px 0;
}

.nek-blog-article-body a {
    color: var(--nek-idx-primary, #6366f1);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.nek-blog-article-body a:hover {
    color: #818cf8;
}

.nek-blog-article-body ul, .nek-blog-article-body ol {
    margin: 0 0 24px 0;
    padding-left: 28px;
}

.nek-blog-article-body li {
    margin-bottom: 8px;
}

.nek-blog-article-body blockquote {
    margin: 32px 0;
    padding: 20px 24px;
    background: var(--nek-idx-surface, #111827);
    border-left: 4px solid var(--nek-idx-primary, #6366f1);
    border-radius: 0 12px 12px 0;
    font-style: italic;
    color: var(--nek-idx-text-muted, #9ca3af);
}

.nek-blog-article-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 20px 0;
    display: block;
}

/* Tables */
.nek-blog-article-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 28px 0;
    overflow-x: auto;
    display: block;
    border: 1px solid var(--nek-idx-border, #2e3d5b);
    border-radius: 10px;
}

.nek-blog-article-body th, .nek-blog-article-body td {
    padding: 12px 16px;
    border: 1px solid var(--nek-idx-border, #2e3d5b);
    text-align: left;
}

.nek-blog-article-body th {
    background: var(--nek-idx-surface, #111827);
    color: var(--nek-idx-text-main, #ffffff);
    font-weight: 700;
}

/* Code & Pre Blocks */
.nek-blog-article-body pre, .nek-blog-article-body code {
    font-family: 'Fira Code', Consolas, Monaco, monospace;
    font-size: 14px;
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 8px;
}

.nek-blog-article-body code {
    padding: 2px 6px;
    color: #38bdf8;
}

.nek-blog-article-body pre {
    padding: 18px 20px;
    overflow-x: auto;
    line-height: 1.5;
}

.nek-blog-article-body pre code {
    padding: 0;
    background: transparent;
    border: none;
    color: #e2e8f0;
}

/* Rank Math / Plugin Table of Contents Styling */
.nek-blog-article-body .rank-math-block,
.nek-blog-article-body #rank-math-toc,
.nek-blog-article-body .ez-toc-container {
    background: var(--nek-idx-surface, #111827) !important;
    border: 1px solid var(--nek-idx-border, #2e3d5b) !important;
    border-radius: 12px !important;
    padding: 20px 24px !important;
    margin: 28px 0 !important;
}

/* Social Share Bar */
.nek-blog-share-section {
    max-width: 860px;
    margin: 0 auto 48px auto;
    background: var(--nek-idx-surface, #111827);
    border: 1px solid var(--nek-idx-border, #2e3d5b);
    padding: 20px 24px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}

.nek-share-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--nek-idx-text-main, #ffffff);
}

.nek-share-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.nek-share-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    color: #ffffff !important;
    transition: opacity 0.2s ease, transform 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.nek-share-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.nek-share-fb { background: #1877f2; }
.nek-share-tw { background: #1da1f2; }
.nek-share-wa { background: #25d366; }
.nek-share-li { background: #0a66c2; }

/* Related Articles Grid */
.nek-blog-related-section {
    max-width: 860px;
    margin: 0 auto 48px auto;
    padding-top: 32px;
    border-top: 1px solid var(--nek-idx-border, #2e3d5b);
}

.nek-related-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--nek-idx-text-main, #ffffff);
    margin: 0 0 24px 0;
}

.nek-blog-related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.nek-blog-card {
    background: var(--nek-idx-surface, #111827);
    border: 1px solid var(--nek-idx-border, #2e3d5b);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.nek-blog-card:hover {
    transform: translateY(-3px);
    border-color: var(--nek-idx-primary, #6366f1);
}

.nek-card-img-wrap {
    width: 100%;
    height: 140px;
    overflow: hidden;
    background: #0f172a;
}

.nek-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.nek-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.nek-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--nek-idx-text-main, #ffffff);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.nek-card-excerpt {
    font-size: 13px;
    color: var(--nek-idx-text-muted, #9ca3af);
    margin: 0 0 14px 0;
    line-height: 1.5;
    flex: 1;
}

.nek-card-readmore {
    font-size: 13px;
    font-weight: 600;
    color: var(--nek-idx-primary, #6366f1);
}

/* Comments Section */
.nek-blog-comments-section {
    max-width: 860px;
    margin: 0 auto;
    padding-top: 32px;
    border-top: 1px solid var(--nek-idx-border, #2e3d5b);
}

.nek-blog-comments-section #reply-title,
.nek-blog-comments-section .comments-title {
    color: var(--nek-idx-text-main, #ffffff) !important;
    font-size: 22px !important;
    font-weight: 700 !important;
}

.nek-blog-comments-section label {
    color: var(--nek-idx-text-muted, #9ca3af);
    font-size: 14px;
}

.nek-blog-comments-section input[type="text"],
.nek-blog-comments-section input[type="email"],
.nek-blog-comments-section input[type="url"],
.nek-blog-comments-section textarea {
    width: 100%;
    background: var(--nek-idx-surface, #111827);
    border: 1px solid var(--nek-idx-border, #2e3d5b);
    color: var(--nek-idx-text-main, #ffffff);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 14px;
    margin-top: 4px;
    box-sizing: border-box;
}

.nek-blog-comments-section input[type="submit"] {
    background: var(--nek-idx-primary, #6366f1);
    color: #ffffff;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
}

.nek-blog-comments-section input[type="submit"]:hover {
    background: #4f46e5;
}

/* Responsive Rules */
@media (max-width: 868px) {
    .nek-blog-post-title {
        font-size: 28px;
    }
    .nek-blog-related-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 580px) {
    .nek-blog-post-title {
        font-size: 24px;
    }
    .nek-blog-related-grid {
        grid-template-columns: 1fr;
    }
    .nek-blog-share-section {
        flex-direction: column;
        align-items: flex-start;
    }
}
