/**
 * Post Enhancements CSS
 * Modern Tags, Meta Card, Social Share, Related Posts, Comments
 */

/* ===== Modern Tags & Categories Pills ===== */
/* ===== Post Footer Actions (Tags & Share) ===== */
.entry-footer-actions {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
}

.post-taxonomy-pills {
    flex: 1;
    min-width: 280px;
}

.taxonomy-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.taxonomy-label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.pill-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.pill {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem;
    background: var(--bg-gray);
    border: 1px solid var(--border-color);
    border-radius: 50px;
    font-size: 0.813rem;
    font-weight: 600;
    color: var(--text-color);
    text-decoration: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, border-color 0.3s ease;
}

.pill-tag {
    color: var(--primary-color);
}

.pill:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

/* Minimalist Inline Share */
.post-share-inline {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-end;
}

.post-share-inline .share-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* No Tags Layout (Left aligned, horizontal) */
.entry-footer-actions.no-tags .post-share-inline {
    flex-direction: row;
    align-items: center;
    gap: 1.5rem;
}

.entry-footer-actions.no-tags .share-label {
    color: var(--text-color);
}

.entry-footer-actions.no-tags .share-label svg {
    color: var(--primary-color);
}

.share-buttons-container {
    display: flex;
    gap: 0.75rem;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-light);
    cursor: pointer;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, border-color 0.3s ease;
    padding: 0;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    color: white;
}

.share-facebook:hover {
    background: #1877F2;
    border-color: #1877F2;
}

.share-twitter:hover {
    background: #000000;
    border-color: #000000;
}

.share-linkedin:hover {
    background: #0A66C2;
    border-color: #0A66C2;
}

.share-whatsapp:hover {
    background: #25D366;
    border-color: #25D366;
}

.share-link:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Dark Mode Adjustments */
body.dark-mode .pill {
    background: #2d3748;
    border-color: #4a5568;
    color: #e2e8f0;
}

body.dark-mode .share-btn {
    background: #2d3748;
    border-color: #4a5568;
    color: #a0aec0;
}

@media (max-width: 768px) {
    .entry-footer-actions {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
    }

    .post-share-inline {
        align-items: flex-start;
    }
}

/* ===== Related Posts Modern ===== */
.related-posts-modern {
    margin: 0 0 0 0;
    padding: 0.5rem 0 0 0;
    border-top: 2px solid #e5e7eb;
}

.related-posts-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.related-post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
}

.related-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.related-post-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.related-card-thumbnail {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
}

.related-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post-card:hover .related-card-thumbnail img {
    transform: scale(1.05);
}

.related-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.2) 100%);
}

.related-placeholder-thumbnail {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.related-placeholder-icon svg {
    width: 48px;
    height: 48px;
    stroke: white;
    opacity: 0.9;
}

.related-card-content {
    padding: 1rem;
}

.related-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: #ede9fe;
    color: #6366f1;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.75rem;
}

.related-card-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.4;
    color: #1f2937;
    margin: 0 0 0.5rem 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.813rem;
    color: #6b7280;
}

.related-date,
.related-reading-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* ===== Comments System ===== */
.comments-area {
    margin: 0 0 0 0;
    padding: 0.5rem 0 0 0;
    border-top: 2px solid #e5e7eb;
}

.comments-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.5rem;
    font-weight: 800;
    color: #1f2937;
    margin-bottom: 0.5rem;
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment-item {
    margin-bottom: 2rem;
}

.comment-item .children {
    list-style: none;
    margin-left: 3rem;
    padding-left: 1.5rem;
    border-left: 2px solid #e5e7eb;
}

.comment-body {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 12px;
}

.comment-author-avatar {
    flex-shrink: 0;
}

.avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
}

.comment-content-wrapper {
    flex: 1;
}

.comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.comment-author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.comment-author-info .fn {
    font-weight: 700;
    color: #1f2937;
}

.comment-author-info .fn a {
    color: inherit;
    text-decoration: none;
}

.comment-badge {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-author {
    background: #dbeafe;
    color: #1e40af;
}

.badge-admin {
    background: #fef3c7;
    color: #92400e;
}

.comment-metadata {
    font-size: 0.813rem;
    color: #6b7280;
}

.comment-metadata a {
    color: inherit;
    text-decoration: none;
}

.comment-text {
    margin: 0.75rem 0;
    color: #374151;
    line-height: 1.6;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 0.75rem;
}

.comment-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    font-size: 0.813rem;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comment-like-btn:hover {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.comment-like-btn.liked {
    background: #fef2f2;
    border-color: #fca5a5;
    color: #dc2626;
}

.comment-like-btn svg {
    transition: transform 0.2s ease;
}

.comment-like-btn:hover svg {
    transform: scale(1.1);
}

.comment-reply-link {
    padding: 0.375rem 0.75rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 50px;
    font-size: 0.813rem;
    font-weight: 600;
    color: #2563eb;
    cursor: pointer;
    transition: all 0.2s ease;
}

.comment-reply-link:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: white;
}

/* ===== Comment Form ===== */
.comment-form {
    margin-top: 2.5rem;
    padding: 2rem;
    background: #f9fafb;
    border-radius: 12px;
}

.comment-reply-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 1.5rem;
}

.comment-form-field {
    margin-bottom: 1.25rem;
}

.comment-form-field label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
}

.comment-form-field input[type="text"],
.comment-form-field input[type="email"],
.comment-form-field input[type="url"],
.comment-form-field textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s ease;
}

.comment-form-field input:focus,
.comment-form-field textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== Premium Minimalist Comment Form ===== */
.comment-modern-container {
    position: relative;
    background: #fdfdfd;
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    margin-bottom: 0.5rem;
}

.comment-modern-container:hover {
    border-color: #d1d5db;
}

.comment-modern-container:focus-within {
    background: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 10px 25px -10px rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.comment-modern-container textarea {
    width: 100%;
    border: none !important;
    padding: 1.5rem 1.5rem 2.5rem;
    font-size: 1rem;
    line-height: 1.7;
    background: transparent !important;
    resize: none;
    min-height: 160px;
    color: var(--text-color);
    font-family: inherit;
    display: block;
}

.comment-modern-container textarea:focus {
    outline: none !important;
    box-shadow: none !important;
}

.comment-status-bar {
    position: absolute;
    bottom: 0.75rem;
    right: 1.25rem;
    pointer-events: none;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.comment-modern-container:focus-within .comment-status-bar {
    opacity: 1;
}

.char-counter {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

.char-counter.warning {
    color: #ef4444;
}

/* Dark Mode Integration */
body.dark-mode .comment-modern-container {
    background: #1f2937;
    border-color: #374151;
}

body.dark-mode .comment-modern-container:focus-within {
    background: #111827;
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body.dark-mode .comment-modern-container textarea {
    color: #e5e7eb;
}

body.dark-mode .char-counter {
    color: #9ca3af;
}

@media (max-width: 768px) {
    .comment-modern-container textarea {
        padding: 1rem 1rem 2rem;
        min-height: 120px;
        font-size: 0.938rem;
    }

    .comment-form .submit-button {
        width: 100%;
        padding: 0.75rem 1.5rem;
    }
}

/* Stylish Submit Button - Restored & Refined */
.comment-form .submit-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.875rem 2.5rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.2);
    margin-top: 1rem;
}

.comment-form .submit-button:hover {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.comment-form .submit-button svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.comment-form .submit-button:hover svg {
    transform: translate(3px, -3px);
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .related-posts-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .related-card-thumbnail {
        height: 200px;
    }

    .related-posts-title {
        font-size: 1.25rem;
    }

    .related-card-title {
        font-size: 0.938rem;
    }
}

/* ===== Smart TOC (Table of Contents) - Simple & Organized ===== */
.blogio-toc-wrapper {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2.5rem 0;
}

.toc-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    margin-bottom: 1rem;
}

.toc-header svg {
    color: var(--primary-color);
    width: 18px;
    height: 18px;
    display: block;
    flex-shrink: 0;
    transform: translateY(6px);
    /* Further offset to match the visual baseline of the text */
}

.toc-header h3 {
    font-size: 1.125rem;
    font-weight: 800;
    margin: 0;
    flex: 1;
    color: var(--text-color);
    line-height: 1.2;
    /* Natural leading for better alignment */
}

.toc-toggle {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-light);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.blogio-toc-wrapper.collapsed .toc-toggle {
    transform: rotate(-90deg);
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.blogio-toc-wrapper.collapsed .toc-list {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
}

.toc-item {
    margin-top: 0.25rem;
}

.toc-link {
    text-decoration: none;
    color: var(--text-light);
    font-size: 0.938rem;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    line-height: 1.6;
    padding: 0.4rem 0;
}

.toc-link::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--border-color);
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.toc-level-3 {
    margin-top: 0;
    padding-left: 0;
    /* Align all items on the same vertical line */
}

.toc-level-3 .toc-link {
    font-weight: 500;
    opacity: 0.85;
}

.toc-level-3 .toc-link::before {
    width: 4px;
    height: 4px;
    opacity: 0.6;
}

.toc-link:hover,
.toc-link.active {
    color: var(--primary-color);
}

.toc-link:hover::before,
.toc-link.active::before {
    background: var(--primary-color);
    transform: scale(1.3);
}

/* Dark Mode Support */
body.dark-mode .blogio-toc-wrapper {
    background: #1f2937;
    border-color: #374151;
}

body.dark-mode .toc-header h3 {
    color: #f3f4f6;
}

body.dark-mode .toc-link {
    color: #9ca3af;
}

body.dark-mode .toc-link:hover,
body.dark-mode .toc-link.active {
    color: #3b82f6;
}






@media (max-width: 768px) {
    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .comment-body {
        flex-direction: column;
        padding: 1.25rem;
    }

    .comment-author-avatar {
        margin-bottom: 0.75rem;
    }

    .comment-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .comment-item .children {
        margin-left: 0.75rem;
        padding-left: 0.75rem;
    }

    .comment-form {
        padding: 1.25rem;
    }

    .comment-actions {
        flex-wrap: wrap;
    }
}