/**
 * AIMade Theme Fixes — Consolidated CSS
 * Version: 1.0.0
 * Author: Monday ⚡
 *
 * Fixes Neve theme color bleed on the AIMade dark design system.
 * This single file replaces ALL scattered inline <style> fixes.
 *
 * Table of Contents:
 *   1. Neve CSS Variable Overrides (dark theme)
 *   2. Body & Global Background
 *   3. Header Rows
 *   4. Blog Card / Index Post Dark Theme
 *   5. Featured Post Fix
 *   6. Single Post Content Readability
 *   7. Meta / Date Text
 *   8. Form Fields
 *   9. Footer Fixes (hide Neve, style am-footer)
 *   10. Mobile Navigation
 *   11. Sidebar / Menu Panel
 *   12. Scroll-to-Top Button
 *   13. Search & Archive Pages
 *   14. Comments Section
 *   15. Print Media
 */

/* ==========================================================================
   1. NEVE CSS VARIABLE OVERRIDES — Force dark palette
   ========================================================================== */

:root,
body,
.neve-main,
.global-styled {
    --nv-site-bg:          #0d1117 !important;
    --nv-light-bg:         #161b22 !important;
    --nv-dark-bg:          #0d1117 !important;
    --nv-text-color:       #e6edf3 !important;
    --nv-text-dark-bg:     #8b949e !important;
    --nv-primary-accent:   #00d4ff !important;
    --nv-secondary-accent: #00d4ff !important;
    --nv-c-1:              #9463ae !important;
    --nv-c-2:              #be574b !important;
}


/* ==========================================================================
   2. BODY & GLOBAL BACKGROUND
   ========================================================================== */

body {
    background: var(--am-bg-canvas, #0d1117) !important;
    color: var(--am-text-primary, #e6edf3) !important;
}

.neve-main {
    background: transparent !important;
}


/* ==========================================================================
   3. HEADER ROWS — Force dark background on all Neve header builder rows
   ========================================================================== */

.header-top,
.header-main,
.header-bottom {
    --rowbcolor: var(--am-bg-canvas, #0d1117) !important;
    --bgcolor:   var(--am-bg-canvas, #0d1117) !important;
    --color:     var(--am-text-primary, #e6edf3) !important;
}


/* ==========================================================================
   4. BLOG CARD / INDEX POST DARK THEME
   ========================================================================== */

.nv-index-posts {
    --cardbgcolor:    var(--am-bg-default, #161b22) !important;
    --cardcolor:      var(--am-text-primary, #e6edf3) !important;
    --cardboxshadow:  0 1px 3px rgba(0,0,0,0.4) !important;
}

.nv-index-posts .post-thumbnail-wrap,
.nv-index-posts article,
.nv-index-posts .content,
.nv-index-posts .entry-title a,
.nv-index-posts .excerpt-wrap {
    background: var(--am-bg-default, #161b22) !important;
    color: var(--am-text-primary, #e6edf3) !important;
}

.nv-index-posts .entry-title a:hover {
    color: var(--am-accent, #00d4ff) !important;
}

/* Blog grid layout — single column on all sizes for now */
.nv-blog-grid .posts-wrapper {
    grid-template-columns: 1fr !important;
}

.nv-blog-grid .posts-wrapper .article-content-col {
    margin-bottom: 1.5rem;
}

.nv-blog-grid .layout-grid .article-content-col .content {
    padding: 1.2rem;
}


/* ==========================================================================
   5. FEATURED POST FIX
   ========================================================================== */

.nv-ft-post .nv-ft-wrap:not(.layout-covers) {
    background: var(--am-bg-default, #161b22) !important;
}

.nv-ft-post .non-grid-content {
    color: var(--am-text-primary, #e6edf3) !important;
}

.nv-ft-post .entry-title a {
    color: var(--am-text-primary, #e6edf3) !important;
}

.nv-ft-post .entry-title a:hover {
    color: var(--am-accent, #00d4ff) !important;
}


/* ==========================================================================
   6. SINGLE POST CONTENT READABILITY
   ========================================================================== */

.nv-content-wrap,
.nv-content-wrap p,
.nv-content-wrap li,
.nv-content-wrap span,
.nv-content-wrap td,
.nv-content-wrap th,
.single-post .entry-content,
.single-post .entry-content p,
.single-post .entry-content li,
.single-post .entry-content td,
.single-post .entry-content th {
    color: var(--am-text-primary, #e6edf3) !important;
}

.nv-content-wrap a,
.single-post .entry-content a {
    color: var(--am-accent, #00d4ff) !important;
}

.nv-content-wrap a:hover,
.single-post .entry-content a:hover {
    opacity: 0.85;
}

/* Code blocks in posts */
.nv-content-wrap pre,
.nv-content-wrap code,
.single-post .entry-content pre,
.single-post .entry-content code {
    background: var(--am-bg-canvas, #0d1117) !important;
    color: var(--am-text-primary, #e6edf3) !important;
    border: 1px solid var(--am-border-default, #30363d) !important;
}

/* Blockquotes */
.nv-content-wrap blockquote,
.single-post .entry-content blockquote {
    border-left: 4px solid var(--am-accent, #00d4ff) !important;
    background: var(--am-bg-default, #161b22) !important;
    color: var(--am-text-secondary, #8b949e) !important;
    padding: 16px 20px !important;
}

/* Title meta wrap (boxed) */
.nv-is-boxed.nv-title-meta-wrap {
    --bgcolor: var(--am-bg-default, #161b22) !important;
    color: var(--am-text-primary, #e6edf3) !important;
}


/* ==========================================================================
   7. META / DATE TEXT
   ========================================================================== */

.nv-meta-list,
.nv-meta-list a,
.post-meta,
.entry-meta,
.entry-meta a,
.nv-meta-list li {
    color: var(--am-text-secondary, #8b949e) !important;
}

.nv-meta-list a:hover,
.entry-meta a:hover {
    color: var(--am-accent, #00d4ff) !important;
}


/* ==========================================================================
   8. FORM FIELDS — Dark inputs
   ========================================================================== */

:root {
    --formfieldbgcolor:     var(--am-bg-default, #161b22) !important;
    --formfieldbordercolor: var(--am-border-default, #30363d) !important;
    --formfieldcolor:       var(--am-text-primary, #e6edf3) !important;
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="search"],
input[type="password"],
textarea,
select {
    background: var(--am-bg-default, #161b22) !important;
    color: var(--am-text-primary, #e6edf3) !important;
    border-color: var(--am-border-default, #30363d) !important;
}


/* ==========================================================================
   9. FOOTER FIXES
   ========================================================================== */

/* Hide the Neve theme footer globally */
footer.site-footer#site-footer {
    display: none !important;
}

/* On blog pages where we inject am-footer via PHP,
   the Neve footer is already hidden above.
   On blog pages that ALSO show the Neve footer rows, hide those too. */
body.blog .hfg_footer .footer--row,
body.single-post .hfg_footer .footer--row,
body.archive .hfg_footer .footer--row,
body.search .hfg_footer .footer--row {
    background: var(--am-bg-default, #161b22) !important;
}

/* Footer builder rows — dark background */
.footer-top,
.footer-main,
.footer-bottom {
    --rowbcolor: var(--am-bg-canvas, #0d1117) !important;
    --bgcolor:   var(--am-bg-canvas, #0d1117) !important;
    --color:     var(--am-text-primary, #e6edf3) !important;
}

.footer-bottom {
    --color: var(--am-text-secondary, #8b949e) !important;
}

.hfg_footer,
.hfg_footer .footer--row {
    background: var(--am-bg-default, #161b22) !important;
    color: var(--am-text-primary, #e6edf3) !important;
}

/* Style the am-footer itself (already inline-styled, but reinforce) */
.am-footer {
    background: var(--am-bg-default, #161b22) !important;
    border-top: 1px solid var(--am-border-default, #30363d) !important;
    color: var(--am-text-muted, #484f58) !important;
}

.am-footer a {
    color: var(--am-text-secondary, #8b949e) !important;
    text-decoration: none !important;
}

.am-footer a:hover {
    color: var(--am-accent, #00d4ff) !important;
}


/* ==========================================================================
   10. MOBILE NAVIGATION
   ========================================================================== */

.menu-mobile-toggle .navbar-toggle {
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 100000;
    position: relative;
    display: flex !important;
    color: var(--am-text-primary, #e6edf3) !important;
    background: transparent !important;
    border: none !important;
    padding: 8px !important;
    pointer-events: auto !important;
}

.menu-mobile-toggle .navbar-toggle .bars {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.menu-mobile-toggle .navbar-toggle .icon-bar {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--am-text-primary, #e6edf3);
    margin: 4px 0;
    transition: 0.3s;
}

.close-sidebar-panel .navbar-toggle {
    cursor: pointer;
    z-index: 1000000;
    display: flex !important;
    color: var(--am-text-primary, #e6edf3) !important;
    background: transparent !important;
    border: none !important;
    pointer-events: auto !important;
}

.close-sidebar-panel .navbar-toggle .icon-bar {
    background: var(--am-text-primary, #e6edf3);
}


/* ==========================================================================
   11. SIDEBAR / MENU PANEL — Dark background
   ========================================================================== */

.header-menu-sidebar-bg {
    --bgcolor: var(--am-bg-canvas, #0d1117) !important;
    --color:   var(--am-text-primary, #e6edf3) !important;
}

.header-menu-sidebar .nav-ul li a {
    color: var(--am-text-primary, #e6edf3) !important;
}

.header-menu-sidebar .nav-ul li a:hover {
    color: var(--am-accent, #00d4ff) !important;
}

#header-menu-sidebar {
    background: var(--am-bg-canvas, #0d1117) !important;
}


/* ==========================================================================
   12. SCROLL-TO-TOP BUTTON
   ========================================================================== */

.scroll-to-top {
    --bgcolor:      var(--am-accent, #00d4ff) !important;
    --color:        var(--am-bg-canvas, #0d1117) !important;
    --hoverbgcolor: var(--am-accent, #00d4ff) !important;
    --hovercolor:   var(--am-bg-canvas, #0d1117) !important;
}


/* ==========================================================================
   13. SEARCH & ARCHIVE PAGES
   ========================================================================== */

.search-form .search-field {
    background: var(--am-bg-default, #161b22) !important;
    color: var(--am-text-primary, #e6edf3) !important;
    border-color: var(--am-border-default, #30363d) !important;
}

.search-form .search-submit {
    background: var(--am-accent, #00d4ff) !important;
    color: var(--am-bg-canvas, #0d1117) !important;
}

/* Archive/category titles */
.nv-page-title-wrap {
    background: var(--am-bg-default, #161b22) !important;
}

.nv-page-title-wrap .nv-page-title,
.nv-page-title-wrap .nv-page-title h1 {
    color: var(--am-text-primary, #e6edf3) !important;
}

/* Pagination */
.page-numbers,
.page-numbers a {
    color: var(--am-text-primary, #e6edf3) !important;
}

.page-numbers.current {
    background: var(--am-accent, #00d4ff) !important;
    color: var(--am-bg-canvas, #0d1117) !important;
}

ul.page-numbers li a:hover {
    background: var(--am-bg-default, #161b22) !important;
    color: var(--am-accent, #00d4ff) !important;
}


/* ==========================================================================
   14. COMMENTS SECTION
   ========================================================================== */

.comments-area,
.comment-respond {
    background: var(--am-bg-default, #161b22) !important;
    color: var(--am-text-primary, #e6edf3) !important;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid var(--am-border-default, #30363d);
}

.comment-author,
.comment-metadata a {
    color: var(--am-text-secondary, #8b949e) !important;
}

.comment-body {
    border-bottom: 1px solid var(--am-border-default, #30363d);
    padding-bottom: 16px;
    margin-bottom: 16px;
}


/* ==========================================================================
   15. PRINT MEDIA — Clean output for printing
   ========================================================================== */

@media print {
    body {
        background: #fff !important;
        color: #000 !important;
    }

    .am-footer,
    footer.site-footer,
    .header,
    .menu-mobile-toggle,
    .scroll-to-top,
    .close-sidebar-panel {
        display: none !important;
    }

    .nv-content-wrap,
    .nv-content-wrap p,
    .nv-content-wrap li,
    .single-post .entry-content,
    .single-post .entry-content p {
        color: #000 !important;
    }

    a {
        color: #000 !important;
        text-decoration: underline !important;
    }
}
