/* ========== SHOWTHREAD ========== */
/* Layout Wrapper for Single Article View */
.blog-post-wrapper {
    max-width: 850px; /* Kept tight and optimized for readable long-form layout lines */
    margin: 4rem auto;
    padding: 2.5rem; /* Added inner container padding to define the content card structure */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Dynamic Theme Sync Hooks */
    background-color: var(--color-bg-surface);
    color: var(--color-text-main);
    border: 1px solid var(--color-border-subtle);
    border-radius: 0.75rem;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

/* Header Context Custom Elements */
.blog-post-header {
    margin-bottom: 2rem;
    text-align: left;
}

.blog-post-title {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1.2;
    color: var(--color-text-main);
    letter-spacing: -0.03em;
    transition: color 0.3s ease;
}

/* Large Hero Cover Banner Element */
.blog-post-cover-wrap {
    width: 100%;
    max-height: 450px;
    overflow: hidden;
    border-radius: 0.75rem;
    margin-bottom: 3rem;
    border: 1px solid var(--color-border-subtle);
    transition: border-color 0.3s ease;
}

/* Automatically collapses the cover block area out of sight if the article has no image uploaded */
.blog-post-cover-wrap:has(img[src=""]),
.blog-post-cover-wrap:has(img:not([src])) {
    display: none !important;
}

.blog-post-cover-img {
    width: 100%;
    height: 100%;
    max-height: 450px;
    object-fit: cover;
}

/* Post Content Main Area Tuning */
.blog-post-body {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--color-text-main);
    transition: color 0.3s ease;
}

/* Separator styling for additional replies down the page */
.blog-comments-section {
    margin-top: 5rem;
    border-top: 2px solid var(--color-border-subtle);
    padding-top: 3rem;
    transition: border-color 0.3s ease;
}

.comments-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text-main);
    margin-bottom: 2rem;
    transition: color 0.3s ease;
}

/* Card Pagination and Reply Block alignment styles */
.blog-post-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-border-subtle);
    transition: border-color 0.3s ease;
}

/* Clean Admin Mod Tools Footer tray layout grid */
.blog-admin-tray {
    margin-top: 4rem;
    padding: 1.25rem;
    background-color: var(--color-bg-surface-hover);
    border: 1px solid var(--color-border-subtle);
    border-radius: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Quick Reply container block spacing styles */
.blog-quickreply-container {
    margin-top: 3rem;
}

/* Responsive Adaptive Sizing Layers */
@media (max-width: 768px) {
    .blog-post-wrapper {
        margin: 0 auto;
        padding: 1.5rem 1rem;
        border: none; /* Merges the card flat into the background layer on tiny screens */
        background-color: transparent; 
        border-radius: 0;
    }
    
    .blog-post-title {
        font-size: 2rem;
    }
    
    .blog-post-cover-wrap {
        max-height: 280px;
        margin-bottom: 2rem;
    }
    
    .blog-admin-tray {
        flex-direction: column;
        align-items: stretch;
    }
}



/* ========= POSTBIT BLOG POST ========= */

/* Blog Entry Wrapper Box Model */
.blog-entry-container {
    background-color: var(--color-bg-surface);
    color: var(--color-text-main);
    padding: 2.5rem 0; /* Clean vertical whitespace layout */
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--color-border-subtle);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Minimal Header Details Bar */
.blog-entry-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    font-size: 0.95rem;
}

.entry-author-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.entry-username a {
    color: var(--color-text-main);
    font-weight: 700;
    text-decoration: none;
}

.entry-username a:hover {
    color: var(--color-primary);
}

.entry-usertitle {
    color: var(--color-text-muted);
    font-weight: 500;
}

.entry-meta-divider {
    color: var(--color-text-disabled);
}

.entry-date-info {
    color: var(--color-text-muted);
    font-size: 0.9rem;
}

/* Post Content Main View Area Adjustments */
.blog-entry-content {
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--color-text-main);
    text-align: left;
}

/* Restructuring MyBB core default images to match modern scaling properties */
.blog-entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
}

/* Minimal Action Footer Layout rules (Aligns Edit button cleanly to the right) */
.blog-entry-actions {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 0.5rem;
}

/* Styling your theme's default postbit buttons dynamically */
.entry-management-buttons a,
.entry-management-buttons button {
    display: inline-flex;
    align-items: center;
    background-color: var(--color-bg-surface-hover);
    color: var(--color-text-muted) !important;
    border: 1px solid var(--color-border-subtle);
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 0.375rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.entry-management-buttons a:hover {
    background-color: var(--color-primary);
    color: var(--color-primary-contrast) !important;
    border-color: var(--color-primary-hover);
}

/* Responsive Structural Breakdown Layer */
@media (max-width: 640px) {
    .blog-entry-container {
        padding: 1.5rem;
    }
    
    .blog-entry-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }
    
    .blog-entry-content {
        font-size: 1.05rem;
    }
}


/* ========= POSTBIT COMMENT ========== */

/* Blog Comment Block Frame */
.blog-comment-item {
    background-color: var(--color-bg-surface);
    color: var(--color-text-main);
    padding: 1.5rem; /* Tighter box layout padding than the primary body article */
    margin-bottom: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid var(--color-border-subtle);
    
    /* Left border accent strip to give it a neat threaded comment appearance */
    border-left: 4px solid var(--color-border-strong);
    
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

/* Hover effect to bring out depth in the discussion space */
.blog-comment-item:hover {
    border-left-color: var(--color-primary);
    background-color: var(--color-bg-surface-hover);
}

/* Comment Header Metadata Grid Setup */
.comment-item-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.comment-author-details {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-username a {
    color: var(--color-text-main);
    font-weight: 700;
    text-decoration: none;
}

.comment-username a:hover {
    color: var(--color-primary);
}

.comment-usertitle {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.comment-meta-divider {
    color: var(--color-text-disabled);
}

.comment-date-details {
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

/* Comment Typographic Sizing */
.comment-item-body {
    font-size: 1.05rem; /* Slightly smaller layout track than primary post content */
    line-height: 1.7;
    color: var(--color-text-main);
    text-align: left;
}

.comment-item-body img {
    max-width: 100%;
    height: auto;
    border-radius: 0.375rem;
}

/* Comment Management Tray Formatting */
.comment-item-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.25rem;
}

.comment-management-buttons a,
.comment-management-buttons button {
    display: inline-flex;
    align-items: center;
    background-color: var(--color-bg-main);
    color: var(--color-text-muted) !important;
    border: 1px solid var(--color-border-subtle);
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 0.25rem;
    text-decoration: none;
    transition: all 0.15s ease;
}

.comment-management-buttons a:hover {
    background-color: var(--color-danger); /* Clean destructive alert for delete actions if mod */
    color: var(--color-primary-contrast) !important;
    border-color: var(--color-danger-hover);
}

/* Specifically isolating the Edit link from deletion modules if it exists */
.comment-management-buttons a[id*="edit"],
.comment-management-buttons a[href*="editpost"] {
    background-color: var(--color-bg-main);
}

.comment-management-buttons a[id*="edit"]:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary-hover);
}

/* Tablet & Mobile Grid Adaptive Viewports */
@media (max-width: 640px) {
    .blog-comment-item {
        padding: 1.25rem 1rem;
        border-left-width: 3px;
    }
    
    .comment-item-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }
}



/*========== QUICK REPLY (COMMENT FORM) ==========*/

/* Comment Form Base Container */
.blog-comment-form-wrap {
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: 0.75rem;
    padding: 2.5rem;
    margin-top: 3.5rem;
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.comment-form-heading {
    font-size: 1.35rem;
    font-weight: 750;
    color: var(--color-text-main);
    margin-bottom: 1.5rem;
}

/* Textarea Input Optimization */
.comment-input-block {
    width: 100%;
    margin-bottom: 1.25rem;
}

.comment-input-block textarea {
    width: 100%;
    min-height: 140px;
    background-color: var(--color-bg-main);
    color: var(--color-text-main);
    border: 1px solid var(--color-border-subtle);
    border-radius: 0.5rem;
    padding: 1.2rem;
    font-size: 1.05rem;
    font-family: inherit;
    line-height: 1.6;
    box-sizing: border-box;
    resize: vertical; /* Allows vertical adjustments while keeping widths locked */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.comment-input-block textarea:focus {
    outline: none;
    background-color: var(--color-bg-surface);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

/* Actions Layout Bar */
.comment-submit-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Reusable Blog Button Engine */
.blog-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.65rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 0.375rem;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease-in-out;
}

.blog-btn-primary {
    background-color: var(--color-primary);
    color: var(--color-primary-contrast);
}

.blog-btn-primary:hover {
    background-color: var(--color-primary-hover);
}

.blog-btn-secondary {
    background-color: transparent;
    border-color: var(--color-border-strong);
    color: var(--color-text-muted);
}

.blog-btn-secondary:hover {
    background-color: var(--color-bg-surface-hover);
    color: var(--color-text-main);
}

/* Dynamic Modern CSS Spinner replacing default GIF image */
.blog-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid var(--color-border-subtle);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: commentLoadingSpin 0.7s linear infinite;
    margin: 1.5rem auto;
}

@keyframes commentLoadingSpin {
    to { transform: rotate(360deg); }
}

/* Responsive Scaling Adjustment */
@media (max-width: 640px) {
    .blog-comment-form-wrap {
        padding: 1.5rem;
    }
    
    .comment-submit-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .blog-btn {
        width: 100%;
    }
}



/* ========== EDIT POST ========== */

/* Core Workspace Layout Framework */
.blog-editor-wrapper {
    max-width: 900px;
    margin: 4rem auto;
    padding: 0 1.5rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
}

.blog-editor-card {
    background-color: var(--color-bg-surface);
    border: 1px solid var(--color-border-subtle);
    border-radius: 0.75rem;
    padding: 3rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.01);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.blog-editor-header {
    border-bottom: 1px solid var(--color-border-subtle);
    padding-bottom: 1.5rem;
    margin-bottom: 2.5rem;
    text-align: center;
}

.blog-editor-heading {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-text-main);
    letter-spacing: -0.02em;
    margin: 0;
}

/* Individual Form Field Blocks configuration layout */
.editor-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
}

.editor-label {
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-muted);
    text-align: left;
}

/* Input Fields Adjustments */
.editor-input-with-prefix {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

/* Select element overrides for custom prefix dropboxes if utilized */
.editor-input-with-prefix select {
    background-color: var(--color-bg-main);
    color: var(--color-text-main);
    border: 1px solid var(--color-border-subtle);
    border-radius: 0.375rem;
    padding: 0.75rem;
}

.blog-editor-input {
    flex: 1;
    background-color: var(--color-bg-main);
    color: var(--color-text-main);
    border: 1px solid var(--color-border-subtle);
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    font-size: 1.05rem;
    transition: all 0.2s ease;
}

.blog-editor-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: var(--color-bg-surface);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

/* Redesigning the Main Writing Textarea Frame Canvas */
.editor-textarea-wrap {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--color-border-subtle);
    border-radius: 0.5rem;
    overflow: hidden;
    background-color: var(--color-bg-main);
}

/* Modern styling constraints injected into default MyBB SCEditor/Code Toolbars */
.editor-textarea-wrap .sceditor-toolbar,
.editor-textarea-wrap .editor_control_bar {
    background-color: var(--color-bg-surface-hover) !important;
    border-bottom: 1px solid var(--color-border-subtle) !important;
    padding: 0.5rem !important;
}

.editor-textarea-wrap textarea {
    width: 100% !important;
    background-color: var(--color-bg-main);
    color: var(--color-text-main);
    border: none;
    padding: 1.25rem;
    font-size: 1.1rem;
    line-height: 1.7;
    font-family: inherit;
    box-sizing: border-box;
    resize: vertical;
    min-height: 350px;
    transition: background-color 0.2s;
}

.editor-textarea-wrap textarea:focus {
    outline: none;
    background-color: var(--color-bg-surface);
}

/* Custom XThreads element field injections layout rules configuration overrides */
.editor-custom-fields-group input,
.editor-custom-fields-group textarea {
    width: 100%;
    background-color: var(--color-bg-main);
    border: 1px solid var(--color-border-subtle);
    color: var(--color-text-main);
}

/* Control Footer Layout Engine configuration */
.blog-editor-actions {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    border-top: 1px solid var(--color-border-subtle);
    padding-top: 2rem;
    margin-top: 2.5rem;
}

.blog-btn-link {
    color: var(--color-text-muted);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
}

.blog-btn-link:hover {
    color: var(--color-danger); /* Highlights destructive cancellation gracefully */
}

/* Attachment Drop Tracks Box Alignment Overrides */
.editor-attachments-section {
    margin-top: 2rem;
    background-color: var(--color-bg-main);
    border-radius: 0.5rem;
    padding: 1rem;
}

/* Tablet & Mobile Grid Adaptive Breakdowns */
@media (max-width: 768px) {
    .blog-editor-wrapper {
        margin: 1.5rem auto;
        padding: 0 1rem;
    }
    
    .blog-editor-card {
        padding: 1.5rem;
        border-radius: 0.5rem;
    }
    
    .blog-editor-header {
        margin-bottom: 1.5rem;
    }
    
    .blog-editor-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .blog-editor-actions .blog-btn {
        width: 100%;
        text-align: center;
    }
    
    .blog-btn-link {
        order: 3;
        padding: 0.5rem;
    }
}

/* ========== XTHREAD ROW ========== */

/* XThreads Custom Fields Alignment Tuning */
.xthreads-dynamic-input-row {
    border-bottom: 1px dashed var(--color-border-subtle);
    padding-bottom: 1.5rem;
    margin-bottom: 1.75rem;
}

.xthreads-dynamic-input-row:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

/* Formats the raw HTML elements outputted natively by the XThreads engine */
.editor-input-wrapper input[type="text"],
.editor-input-wrapper input[type="file"],
.editor-input-wrapper textarea,
.editor-input-wrapper select {
    width: 100%;
    background-color: var(--color-bg-main);
    color: var(--color-text-main);
    border: 1px solid var(--color-border-subtle);
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    font-size: 1.05rem;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.editor-input-wrapper input:focus,
.editor-input-wrapper textarea:focus,
.editor-input-wrapper select:focus {
    outline: none;
    border-color: var(--color-primary);
    background-color: var(--color-bg-surface);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.12);
}

/* Subtle, elegant description hooks underneath the fields */
.editor-help-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    line-height: 1.4;
}