/*
Theme Name: Grok The Fly Trap
Theme URI: https://lunedev.com
Description: WordPress theme matching the Grok The Fly Trap overlay design system - black background, white borders, monospace typography.
Version: 0.1.1.0
Author: LuneDev
Author URI: https://lunedev.com
*/

/* ============================================
   GROK THE FLY TRAP DESIGN SYSTEM
   Shared styles extracted from overlay_grok.py
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --grok-black: #000000;
    --grok-white: #FFFFFF;
    --grok-gray: #666666;
    --grok-dark-gray: #1a1a1a;
    --grok-green: #00FF00;
    --grok-red: #FF0000;
    --grok-border-width: 3px;
    --grok-font-family: 'JetBrains Mono', 'Roboto Mono', 'Courier New', monospace;
}

body {
    font-family: var(--grok-font-family);
    background: var(--grok-black);
    color: var(--grok-white);
    line-height: 1.6;
}

/* Hide WordPress admin bar elements that might appear as dots */
#wpadminbar,
.ab-item::before,
.ab-icon::before {
    display: none !important;
    visibility: hidden !important;
}

/* ============================================
   HEADER & NAVIGATION
   ============================================ */

.site-header {
    background: var(--grok-black);
    border-bottom: var(--grok-border-width) solid var(--grok-white);
    padding: 20px 40px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
}

/* Hide any WordPress menu walker elements that might appear as dots */
.site-header .menu-item-has-children::after,
.site-header .dropdown-toggle,
.site-header .sub-menu-toggle {
    display: none !important;
    visibility: hidden !important;
}

.header-branding {
    display: flex;
    align-items: center;
    gap: 20px;
}

.site-logo {
    width: 80px;
    height: 80px;
    border: var(--grok-border-width) solid var(--grok-white);
    background: var(--grok-black);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.site-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.site-title-wrapper {
    display: flex;
    align-items: baseline;
    gap: 15px;
    flex-wrap: wrap;
}

.site-title {
    font-size: 38px;
    font-weight: bold;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--grok-white);
    margin: 0;
}

.site-version {
    font-size: 12px;
    color: var(--grok-white);
    letter-spacing: 1px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Hamburger Menu Toggle Button */
/* Note: Button is conditionally rendered via PHP, but kept in DOM for responsive behavior */
.menu-toggle {
    display: none; /* Hidden on desktop by default */
    background: var(--grok-black);
    border: var(--grok-border-width) solid var(--grok-white);
    padding: 12px 10px;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    width: 50px;
    height: 50px;
    position: relative;
    z-index: 1001;
    transition: all 0.3s ease;
}

.menu-toggle:hover,
.menu-toggle:focus {
    background: var(--grok-dark-gray);
    outline: none;
}

.menu-toggle[aria-expanded="true"] {
    background: var(--grok-dark-gray);
}

.hamburger-line {
    width: 28px;
    height: 3px;
    background: var(--grok-white);
    transition: all 0.3s ease;
    transform-origin: center;
    display: block;
    flex-shrink: 0;
}

.menu-toggle[aria-expanded="true"] {
    justify-content: center;
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Navigation Menu */
.main-navigation {
    display: flex;
    align-items: center;
    gap: 0;
}

/* Remove all list markers and pseudo-elements globally */
ul, ol, li {
    list-style: none !important;
}

ul::before, ul::after,
ol::before, ol::after,
li::before, li::after {
    display: none !important;
    content: none !important;
    visibility: hidden !important;
}

.main-navigation ul {
    list-style: none !important; /* Force no bullets */
    display: flex;
    gap: 0;
    margin: 0;
    padding: 0;
}

.main-navigation ul::before,
.main-navigation ul::after {
    display: none !important; /* Remove any pseudo-elements */
    content: none !important;
    visibility: hidden !important;
}

.main-navigation li {
    margin: 0;
    padding: 0;
    list-style: none !important; /* Force no bullets on list items */
}

.main-navigation li::before,
.main-navigation li::after {
    display: none !important; /* Remove any pseudo-elements */
    content: none !important;
    visibility: hidden !important;
}

/* Hide any WordPress-generated menu markers */
.main-navigation .menu-item::before,
.main-navigation .menu-item::after,
.main-navigation .menu-item-has-children::before,
.main-navigation .menu-item-has-children::after {
    display: none !important;
    content: none !important;
    visibility: hidden !important;
}

.main-navigation a {
    display: block;
    padding: 15px 25px;
    color: var(--grok-white);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 14px;
    font-weight: bold;
    border: var(--grok-border-width) solid transparent;
    transition: all 0.3s ease;
}

.main-navigation a:hover,
.main-navigation a:focus {
    background: var(--grok-black);
    border-color: var(--grok-white);
}

.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
    background: var(--grok-black);
    border-color: var(--grok-white);
}

/* ============================================
   MAIN CONTENT AREA
   ============================================ */

.site-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.content-area {
    background: var(--grok-black);
}

/* ============================================
   TYPOGRAPHY
   ============================================ */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--grok-font-family);
    color: var(--grok-white);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

h1 {
    font-size: 48px;
    font-weight: bold;
    border-bottom: var(--grok-border-width) solid var(--grok-white);
    padding-bottom: 15px;
}

h2 {
    font-size: 36px;
    font-weight: bold;
    border-bottom: 2px solid var(--grok-white);
    padding-bottom: 10px;
}

h3 {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 1px;
}

p {
    margin-bottom: 20px;
    color: var(--grok-white);
    font-size: 14px;
    line-height: 1.8;
}

a {
    color: var(--grok-white);
    text-decoration: underline;
    transition: color 0.3s ease;
}

a:hover,
a:focus {
    color: var(--grok-gray);
}

/* ============================================
   CONTENT BOXES
   ============================================ */

.content-box {
    border: var(--grok-border-width) solid var(--grok-white);
    padding: 25px;
    background: var(--grok-black);
    margin-bottom: 30px;
}

.content-box-title {
    font-size: 24px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--grok-white);
    font-weight: bold;
    margin-bottom: 15px;
}

/* ============================================
   FOOTER
   ============================================ */

.site-footer {
    background: var(--grok-black);
    border-top: var(--grok-border-width) solid var(--grok-white);
    padding: 30px 40px;
    text-align: center;
    color: var(--grok-gray);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .site-header {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: space-between !important;
        padding: 12px 15px !important;
        position: relative;
        border: var(--grok-border-width) solid var(--grok-white) !important;
        border-bottom: var(--grok-border-width) solid var(--grok-white) !important; /* Override desktop border-bottom */
        border-radius: 4px !important;
        margin: 10px !important;
        box-sizing: border-box !important;
        width: calc(100% - 20px) !important;
        overflow: visible !important;
        background: var(--grok-black) !important;
        flex-wrap: nowrap !important; /* Override desktop flex-wrap */
    }

    /* Header Branding - Logo and Title Container */
    .header-branding {
        flex: 1;
        gap: 8px;
        min-width: 0; /* Allow flex items to shrink */
        max-width: calc(100% - 70px); /* Reserve space for hamburger menu */
        display: flex;
        align-items: center;
        overflow: visible; /* Allow version to be visible */
    }

    /* Site Title Wrapper - Title and Version Container */
    .site-title-wrapper {
        display: flex !important;
        flex-direction: column !important; /* Stack title and version vertically */
        align-items: flex-start !important; /* Align to left */
        gap: 4px !important; /* Small gap between title and version */
        min-width: 0; /* Allow flex items to shrink */
        overflow: visible; /* Allow version to be visible */
        flex-shrink: 1; /* Allow to shrink if needed */
    }
    
    /* Site Title */
    .site-title {
        font-size: 19px !important;
        letter-spacing: 0.5px !important;
        white-space: nowrap !important;
        line-height: 1 !important;
        flex-shrink: 1; /* Allow to shrink if needed */
        min-width: 0; /* Allow text truncation if absolutely necessary */
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
    }
    
    /* Site Version */
    .site-version {
        font-size: 9px !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important; /* Never shrink version */
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1 !important;
        display: block !important;
        color: var(--grok-white) !important; /* White color */
    }

    /* Show hamburger button on mobile */
    .menu-toggle {
        display: flex !important;
        order: 3;
        flex-shrink: 0; /* Never shrink hamburger */
        width: 50px;
        height: 50px;
    }
    
    /* Ensure hamburger lines are visible and properly spaced on mobile */
    .menu-toggle .hamburger-line {
        width: 28px;
        height: 3px;
        background: var(--grok-white);
    }

    /* Hide navigation by default on mobile */
    .main-navigation {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--grok-black);
        border: none !important;
        border-top: none !important;
        border-bottom: none !important;
        border-left: none !important;
        border-right: none !important;
        margin: 0;
        padding: 0;
        box-shadow: none;
        outline: none;
        z-index: 1000;
        width: 100%;
        display: none !important; /* Completely hidden when closed */
    }

    /* Show navigation when menu is open */
    .main-navigation.menu-open {
        display: flex !important; /* Show as flex when open */
        flex-direction: column;
        max-height: 500px;
        padding: 0;
        border-top: var(--grok-border-width) solid var(--grok-white) !important;
        border-bottom: var(--grok-border-width) solid var(--grok-white) !important;
        transition: max-height 0.3s ease, border-top 0s linear, border-bottom 0s linear;
    }

    .main-navigation ul {
        flex-direction: column;
        width: 100%;
        margin: 0;
        padding: 0;
    }

    .main-navigation li {
        border-bottom: 1px solid var(--grok-dark-gray);
    }

    .main-navigation li:last-child {
        border-bottom: none;
    }

    .main-navigation a {
        width: 100%;
        text-align: left;
        padding: 20px 25px;
        border: none;
        border-left: var(--grok-border-width) solid transparent;
    }

    .main-navigation a:hover,
    .main-navigation a:focus {
        border-left-color: var(--grok-white);
        background: var(--grok-dark-gray);
    }

    .site-logo {
        width: 60px;
        height: 60px;
        flex-shrink: 0;
    }

    h1 {
        font-size: 36px;
    }

    h2 {
        font-size: 28px;
    }
    
    .site-main {
        padding: 20px 15px;
    }
    
    .content-box {
        padding: 20px 15px;
    }
}
