/*
Theme Name: Bastards of Linux
Author: The Merchant of the Market
Description: v7.8 + Footer Restoration + Full Header Glitch Suite.
Version: 7.9 (The Final System Seal)
*/

/* --- 1. CORE SYSTEM VARIABLES --- */
:root {
    --bg-dark: #0a0a0c;
    --terminal-green: #00ff41;
    --phosphor-green: #00ff66;
    --blood-red: #8b0000;
    --vein-red: #4b0000;
    --text-gray: #b0b0b0;
    --font-terminal: 'Macondo';
    --font-header: 'Skranji';
    --content-width: 1100px;
    --fluid-body: clamp(0.95rem, 1vw + 0.5rem, 1.25rem);
    --fluid-h1: clamp(2rem, 5vw, 3.5rem);
}

/* --- 2. GLOBAL RESET & CRT SCANLINES --- */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    background-color: var(--bg-dark);
    color: var(--text-gray);
    font-family: var(--font-terminal);
    font-size: 18px;
    line-height: 1.6;
    width: 100%;
    overflow-x: hidden;
}

body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.1) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    z-index: 999999;
    background-size: 100% 4px, 3px 100%;
    pointer-events: none;
}

/* --- 3. THE HARD-EDGE RAIL --- */
#page, .site, #masthead, .site-content, .site-footer {
    width: 95% !important;
    max-width: var(--content-width) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
}

p, .entry-content, .info-text {
    font-size: var(--fluid-body) !important;
    color: var(--text-gray);
    margin-bottom: 1.5rem;
}

/* --- 4. HEADER & LOGO --- */
.site-header {
    border-bottom: 3px solid var(--blood-red);
    background: rgba(5, 5, 5, 0.95);
    padding: 40px 0 20px 0 !important;
    text-align: center !important;
}
.logo-wrapper {
    display: flex;
    justify-content: center !important;
}

.custom-logo-link {
    display: inline-block !important;
    padding: 20px !important;
    border: 2px solid rgba(0, 255, 65, 0.2);
    background: rgba(0, 0, 0, 0.8);
    margin: 0 auto 10px auto !important;
    box-shadow: inset 0 0 15px rgba(0, 255, 65, 0.1);
}

.custom-logo, .band-logo-img { 
    width: 150px !important; 
    height: auto !important; 
}

/* --- 4. NAVIGATION COLOR REINFORCEMENT --- */
/* Top Level Links */
.nav-menu ul li a, 
.main-navigation ul li a,
#site-navigation ul li a {
    color: var(--terminal-green) !important;
    font-family: var(--font-header) !important;
    text-transform: uppercase !important;
    text-decoration: none !important;
    transition: all 0.3s ease;
}

@media (min-width: 769px) {
    /* --- 7. MAIN CONTENT BOX --- */
    #main, main {
        background: rgba(10, 10, 12, 0.98) !important;
        padding: 3rem !important;
        margin-bottom: 4rem !important;
        animation: pulseBody 4s ease-in-out infinite;
    }
    article, .page-content-wrapper {
        background: rgba(10, 10, 12, 0.98) !important;
        padding: 3rem !important;
        margin-bottom: 4rem !important;
        animation: bodyPulse 4s ease-in-out infinite;
    }
    /* --- 5. THE NAV & SUBMENU --- */
.nav-menu ul {
        display: flex !important;
        justify-content: center !important;
        list-style: none !important;
        gap: 3.5rem !important;
        padding: 5px 0 !important;
        position: relative !important;
    }

    .nav-menu ul li { 
        position: relative !important; /* Reverted to relative for stable anchoring */
    }

    /* THE SUBMENU - 800px RESTORATION */
    .nav-menu ul li ul {
        display: none !important;
        position: absolute !important;
        top: 100% !important;
        left: 50% !important;
        /* Negative margin-left is half of the width (400px) to force-center it */
        margin-left: -400px !important; 
        width: 800px !important;
        min-width: 800px !important;
        max-width: 800px !important;
        background: #000 !important;
        border: 2px solid var(--terminal-green) !important;
        z-index: 1000000 !important;
        padding: 0 !important;
        flex-direction: column !important;
        box-shadow: 0 20px 60px rgba(0,0,0,1);
    }

    .nav-menu ul li ul::before {
        content: "BASTARD_OS:/sys/root/protected_files$ ls -lh";
        display: block !important;
        background: var(--phosphor-green) !important;
        color: #000 !important;
        padding: 8px 20px !important;
        font-family: monospace; font-size: 12px; font-weight: bold;
    }

    /* Sub-menu Link Styling */
    .nav-menu ul li ul li {
        width: 100% !important;
        display: block !important;
    }

    .nav-menu ul li ul li a {
        display: flex !important;
        padding: 16px 25px !important;
        color: var(--terminal-green) !important;
        font-family: monospace !important;
        text-transform: none !important;
        border-bottom: 1px solid rgba(0, 255, 65, 0.1);
    }

    .nav-menu ul li ul li a::before {
        content: "-rw------- 1 root root 666 ";
        margin-right: 20px;
        opacity: 0.7;
    }

    /* EXECUTE PROTOCOL */
    .nav-menu ul li ul li a:hover {
        background: var(--blood-red) !important;
        color: #fff !important;
        padding-left: 35px !important; /* More pronounced slide */
    }

    .nav-menu ul li ul li a:hover::after {
        content: "[ STATUS: EXECUTE ]";
        margin-left: auto;
        font-size: 0.75rem;
        color: var(--terminal-green);
        text-shadow: 0 0 10px var(--terminal-green);
    }

    .nav-menu ul li:hover > ul { 
        display: flex !important; 
    }

    /* --- 6. UNIVERSAL GLITCH TYPOGRAPHY (H1-H4) --- */
    h1, h2, h3, h4, .entry-title, .page-title {
        font-family: var(--font-header) !important;
        text-transform: uppercase !important;
        position: relative;
        animation: glitchText 5s infinite;
    }

    h1, .entry-title, .page-title {
        font-size: clamp(2.8rem, 1vw, 3rem) !important;
        color: #fff !important;
        border-left: 8px solid var(--blood-red) !important;
        padding-left: 15px !important;
        text-shadow: 2px 0 var(--blood-red), -2px 0 var(--terminal-green);
    }

    h2 { font-size: clamp(2.0rem, 1vw, 2.2rem) !important; color: var(--terminal-green) !important; animation: glitchText 3s infinite; }
    h3 { font-size: clamp(1.6rem, 1vw, 1.8rem) !important; color: var(--phosphor-green) !important; animation: glitchText 2s infinite; }
    h4 { font-size: clamp(1.2rem, 1vw, 1.4rem) !important; color: var(--terminal-green) !important; letter-spacing: 2px; }

    h1::after, .entry-title::after {
        content: "_";
        color: var(--terminal-green);
        animation: blink 1s steps(2, start) infinite;
    }

    /* Apply Glitch to Bold Elements */
    b, strong {
        color: var(--phosphor-green) !important;
        display: inline-block; /* Essential for animation to trigger */
        animation: glitchText 1s infinite;
    }

    /* --- 7. TERMINAL BREADCRUMBS (AGGRESSIVE SELECTORS) --- */
    /* Targetting multiple possible theme classes */
    .breadcrumbs, 
    .rank-math-breadcrumb, 
    .woocommerce-breadcrumb, 
    .breadcrumb-trail, 
    .site-breadcrumbs, 
    #breadcrumbs {
        font-family: 'Courier New', monospace !important;
        font-size: 0.85rem !important;
        color: var(--text-gray) !important;
        background: rgba(0, 0, 0, 0.85) !important;
        padding: 12px 20px !important;
        border-left: 4px solid var(--blood-red) !important;
        margin: 10px 0 2rem 0 !important;
        display: inline-block !important;
        text-transform: uppercase !important;
    }

    /* Prefixing with LOCATION */
    .breadcrumbs::before, .rank-math-breadcrumb::before, .breadcrumb-trail::before { 
        content: "SYS_PATH: "; 
        color: var(--blood-red); 
        font-weight: bold; 
    }

    /* Links */
    .breadcrumbs a, .breadcrumb-trail a, .rank-math-breadcrumb a { 
        color: var(--terminal-green) !important; 
        text-decoration: none !important; 
    }

    /* The separators (slashes or arrows) */
    .breadcrumbs span, .breadcrumb-trail .sep { 
        color: var(--vein-red) !important; 
        padding: 0 8px !important; 
    }

    /* Current Page (Active File) with Glitch */
    .breadcrumbs .current, 
    .breadcrumbs span:last-child, 
    .rank-math-breadcrumb .last, 
    .breadcrumb-trail .trail-end {
        color: var(--phosphor-green) !important;
        display: inline-block !important;
        animation: glitchText 1.5s infinite !important;
        font-weight: bold !important;
    }
}

/* --- 8. MEDIA CONTAINMENT UNIT (Suno Player) --- */
.media-containment-unit {
    margin: 3rem 0;
    border: 2px solid var(--vein-red);
    background: #000;
    animation: bodyPulse 4s ease-in-out infinite;
}

.unit-header {
    background: var(--blood-red);
    color: #fff;
    padding: 6px 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
}

.terminal-prompt {
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    color: var(--terminal-green);
    padding: 20px;
    background: rgba(0, 255, 65, 0.02);
}

.media-containment-unit iframe {
    margin-top: 15px;
    filter: grayscale(0.8) brightness(0.8) contrast(1.2);
    border: 1px solid var(--vein-red) !important;
    transition: all 0.5s ease;
}

.media-containment-unit:hover iframe {
    filter: grayscale(0) brightness(1);
    border-color: var(--terminal-green) !important;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.1);
}

.unit-footer {
    background: #0a0a0c;
    color: var(--terminal-green);
    padding: 5px 15px;
    font-family: 'Courier New', monospace;
    font-size: 0.65rem;
    border-top: 1px solid var(--vein-red);
}

/* --- 8. FOOTER --- */
.site-footer, footer, #colophon {
    /* border-top: 3px solid var(--blood-red) !important; */
    background: #050505 !important;
    padding: 60px 0 !important;
    margin-top: 80px !important;
    text-align: center !important;
    color: var(--terminal-green) !important;
    font-family: monospace;
    display: block !important;
    clear: both !important;
}

.site-footer a {
    color: var(--blood-red);
    text-decoration: none;
    font-weight: bold;
}

.site-footer a:hover {
    color: var(--terminal-green);
    text-shadow: 0 0 10px var(--terminal-green);
}

/* --- 9. KEYFRAMES --- */
@keyframes blink { to { visibility: hidden; } }
@keyframes pulseBody { 
    0%, 100% { border-color: var(--vein-red); } 
    50% { border-color: var(--terminal-green); } 
}
@keyframes bodyPulse { 
    0%, 100% { border-color: var(--terminal-green); } 
    50% { border-color: var(--vein-red); } 
}
@keyframes glitchText {
    0% { transform: translate(0); text-shadow: 2px 0 var(--blood-red), -2px 0 var(--terminal-green); }
    1% { transform: translate(-2px, 1px); }
    2% { transform: translate(2px, -1px); }
    3% { transform: translate(0); }
    98% { transform: translate(0); text-shadow: 2px 0 var(--blood-red), -2px 0 var(--terminal-green); }
    99% { transform: translate(-5px, -2px); text-shadow: -5px 0 var(--blood-red), 5px 0 var(--terminal-green); }
    100% { transform: translate(0); }
}

/* CORE Mobile */
@media (max-width: 768px) {
    /* --- 6. UNIVERSAL GLITCH TYPOGRAPHY (H1-H4) --- */
    h1, h2, h3, h4, .entry-title, .page-title {
        font-family: var(--font-header) !important;
        text-transform: uppercase !important;
        position: relative;
        animation: glitchText 5s infinite;
    }

    h1, .entry-title, .page-title {
        font-size: clamp(1rem, 1vw, 1.2rem) !important;
        color: #fff !important;
        border-left: 2px solid var(--blood-red) !important;
        padding-left: 5px !important;
        text-shadow: 2px 0 var(--blood-red), -2px 0 var(--terminal-green);
    }

    h2 { font-size: clamp(0.8rem, 1vw, 1rem) !important; color: var(--terminal-green) !important; animation: glitchText 3s infinite; }
    h3 { font-size: clamp(0.6rem, 1vw, 0.8rem) !important; color: var(--phosphor-green) !important; animation: glitchText 2s infinite; }
    h4 { font-size: clamp(0.4rem, 1vw, 0.6rem) !important; color: var(--terminal-green) !important; letter-spacing: 2px; }
    }


    h1::after, .entry-title::after {
        content: "_";
        color: var(--terminal-green);
        animation: blink 1s steps(2, start) infinite;
    }

    /* Apply Glitch to Bold Elements */
    b, strong {
        color: var(--phosphor-green) !important;
        display: inline-block; /* Essential for animation to trigger */
        animation: glitchText 1s infinite;
    }
    p {
        color: var(--terminal-green) !important;
        font-size: clamp(0.6rem, 1vw, 0.8rem) !important;
    }
    /* --- 7. MAIN CONTENT BOX --- */
    #main, main {
        background: rgba(10, 10, 12, 0.98) !important;
        padding: 0.2rem !important;
        margin-bottom: 0.4rem !important;
    }
    article, .page-content-wrapper {
        background: rgba(10, 10, 12, 0.98) !important;
        padding: 0.1rem !important;
        margin-bottom: 0.4rem !important;
    }
    html, body {
        overflow-x: hidden; /* Prevents horizontal scroll from bleeding effects */
        width: 100%;
        position: relative;
    }

    * {
        box-sizing: border-box; /* Ensures borders don't add to element width */
        max-width: 100%;
    }

    /* 3. RESPONSIVE CONTAINERS */
    .container {
        width: 95%; /* More breathing room on small screens */
        margin: 0 auto;
        padding: 0 15px;
    }

    .page-content-wrapper, article {
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        padding: 1.5rem; /* Reduced padding for mobile */
        word-wrap: break-word; /* Prevents long code/text from breaking layout */
    }

    /* 4. IMAGE OPTIMIZATION */
    /* This makes images fill the width of their container on mobile */
    img {
        height: auto;
        display: block;
        width: 100% !important; /* Force images to be large and visible */
        max-width: 100%;
        margin: 1rem 0;
    }

}
