/* --- 0. GLOBAL TYPOGRAPHY & BACKGROUND SYNC --- */
html, body {
    background-color: #ffffff !important;
    margin: 0;
    padding: 0;
}

body,
.pkp_structure_head,
.pkp_navigation_primary,
.pkp_navigation_user {
    font-family: 'Open Sans', "Lucida Grande", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
}

/* 
   THE "INFINITE BLACK FOOTER" FIX (FLEXBOX VERSION)
   This pushes the footer to the bottom of the viewport and 
   makes it expand to fill any empty space, ensuring a solid 
   black background below your content.
*/
.pkp_structure_page {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100vh !important;
}

.pkp_structure_content {
    flex: 0 0 auto !important; /* Take only needed space */
    background-color: #ffffff !important;
}

/* --- 1. FORCE TITLE VISIBILITY NEXT TO LOGO --- */
.pkp_site_name_wrapper {
    display: flex !important;
    align-items: center !important;
    gap: 20px !important;
}

/* Ensure the text is visible even with a logo */
.pkp_site_name .is_text {
    display: inline-block !important;
    visibility: visible !important;
    color: #1A1F2B !important;
    font-size: 1.8em !important;
    font-weight: 700 !important;
    text-decoration: none !important;
}

/* Add the abbreviation styling */
.pkp_site_name .is_text::after {
    content: " (NExAIE)";
    color: #8B6E38 !important;
    font-weight: 400;
    font-size: 0.7em;
}

/* --- 2. THE TOTAL WHITE HEADER TRANSFORMATION --- */
.pkp_structure_head,
.pkp_navigation_user_wrapper,
.pkp_navigation_primary_row {
    background-color: #ffffff !important;
    border-bottom: 1px solid #DDE1E7 !important;
}

.pkp_structure_head {
    box-shadow: 0 1px 12px rgba(0, 0, 0, 0.08) !important;
}

/* Fix Nav Link colors */
.pkp_navigation_primary>li>a,
.pkp_navigation_user>li>a,
.pkp_navigation_search a {
    color: #1A1F2B !important;
    font-weight: 500 !important;
}

.pkp_navigation_primary>li>a:hover,
.pkp_navigation_user>li>a:hover {
    color: #A0823F !important;
}

/* --- 3. INDUSTRIAL BUTTONS --- */
.pkp_button,
button,
.pkp_controllers_linkAction,
.pkp_linkaction_button,
input[type="submit"] {
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    border-radius: 4px !important;
    padding: 8px 16px !important;
    font-size: 13px !important;
    transition: all 0.2s ease !important;
    border: 1px solid transparent !important;
    cursor: pointer !important;
}

.pkp_button.primary,
.pkp_linkaction_button.primary,
input[type="submit"] {
    background-color: #4F7155 !important;
    border-color: #4F7155 !important;
    color: #ffffff !important;
}

.pkp_button:not(.primary),
.pkp_linkaction_button:not(.primary),
.pkp_controllers_linkAction {
    background-color: #8B6E38 !important;
    border-color: #8B6E38 !important;
    color: #ffffff !important;
}

.pkp_button:hover,
button:hover,
input[type="submit"]:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* --- 4. FORM ELEMENTS --- */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="search"],
textarea,
select {
    background-color: #F0F2F5 !important;
    color: #1A1F2B !important;
    border: 1px solid #DDE1E7 !important;
    border-radius: 4px !important;
    padding: 0.5rem 0.75rem !important;
    font-size: 14px !important;
    transition: all 0.2s ease !important;
}

input:focus,
textarea:focus,
select:focus {
    outline: none !important;
    border-color: #3D6480 !important;
    box-shadow: 0 0 0 2px rgba(61, 100, 128, 0.15) !important;
}

/* --- 5. BLOCKS & CARDS --- */
.pkp_block,
.pkp_structure_main>.content {
    background-color: #FFFFFF !important;
    border: 1px solid #DDE1E7 !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    padding: 1.5rem !important;
    margin-bottom: 1.5rem !important;
    transition: all 0.2s ease !important;
}

.pkp_block:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14) !important;
    transform: translateY(-2px) !important;
}

/* --- 6. BLACK SCHOLARLY FOOTER --- */
.pkp_structure_footer_wrapper {
    flex-grow: 1 !important;
    background-color: #000000 !important;
    color: #FFFFFF !important;
    padding: 3rem 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1) !important;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.pkp_footer_content {
    color: #E0E0E0 !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    text-align: center !important;
}

.pkp_footer_content p {
    margin-bottom: 0.5rem !important;
}

.pkp_footer_content a {
    color: #8B6E38 !important; /* Force Deep Gold over any inline styles */
    text-decoration: none !important;
    transition: color 0.2s ease !important;
    font-weight: 600;
}

.pkp_footer_content a:hover {
    color: #FFFFFF !important;
    text-decoration: underline !important;
}

.pkp_footer_content strong {
    color: #FFFFFF !important;
    font-weight: 700;
}

.pkp_footer_content em {
    color: #A0823F !important; /* Muted Gold for emphasis */
    font-style: italic;
}

.pkp_structure_footer_wrapper p,
.pkp_structure_footer_wrapper span,
.pkp_structure_footer_wrapper div {
    color: #E0E0E0 !important;
}

.pkp_brand_footer {
    display: none !important;
}

/* --- 7. CONTENT AREA & SIDEBAR LINKS --- */
.pkp_structure_main a,
.pkp_structure_sidebar a,
.pkp_listing a,
.pkp_block a {
    color: #8B6E38 !important; /* Deep Gold */
    text-decoration: none !important;
    transition: color 0.2s ease !important;
}

.pkp_structure_main a:hover,
.pkp_structure_sidebar a:hover,
.pkp_listing a:hover,
.pkp_block a:hover {
    color: #A0823F !important; /* Gold Hover */
    text-decoration: underline !important;
}

/* --- 8. ALERT & QUOTE BOXES --- */
.pkp_notification,
blockquote,
.pkp_no_current_issue,
[class*="notification"],
[class*="no_current_issue"] {
    border-left: 4px solid #4F7155 !important; /* Sage Green */
    background-color: #F0F2F5 !important; /* Technical Gray background */
    padding: 1.5rem !important;
    margin: 1.5rem 0 !important;
    border-radius: 0 4px 4px 0 !important;
    color: #1A1F2B !important;
}

/* --- 9. DROPDOWN MENUS --- */
.pkp_navigation_user ul,
.pkp_navigation_primary ul {
    background-color: #ffffff !important;
    border: 1px solid #DDE1E7 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.pkp_navigation_user ul li a,
.pkp_navigation_primary ul li a {
    color: #1A1F2B !important;
    border-left: 3px solid transparent !important;
}

.pkp_navigation_user ul li a:hover,
.pkp_navigation_primary ul li a:hover {
    background-color: #F0F2F5 !important;
    color: #A0823F !important;
    border-left-color: #8B6E38 !important; /* Gold bar instead of blue */
}

/* Force override of any remaining blue highlights in the top bar dropdowns */
.pkp_navigation_user_wrapper [class*="active"] > a,
.pkp_navigation_user_wrapper a:hover {
    background-color: #F0F2F5 !important;
    color: #A0823F !important;
}

/* --- 10. MOBILE NAVIGATION OVERRIDES --- */
/* Fix mobile menu toggle button visibility (hamburger icon) */
.pkp_site_nav_toggle {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.pkp_site_nav_toggle:focus {
    outline: 1px dotted #1A1F2B !important;
}

.pkp_site_nav_toggle > span {
    border-bottom-color: #1A1F2B !important;
}

.pkp_site_nav_toggle > span:before,
.pkp_site_nav_toggle > span:after {
    background-color: #1A1F2B !important;
}

/* Ensure mobile menu links and background are consistent with light theme */
.pkp_site_nav_menu {
    background-color: #ffffff !important;
    border-top: 1px solid #DDE1E7 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}

.pkp_site_nav_menu a {
    color: #1A1F2B !important;
}

.pkp_site_nav_menu a:hover,
.pkp_site_nav_menu a:focus {
    color: #A0823F !important;
    background-color: #F0F2F5 !important;
}

/* --- 11. MOBILE VIEW SPECIFIC REFINEMENTS --- */
@media (max-width: 991px) {
    /* Move toggle button (hamburger) to the right */
    .pkp_site_nav_toggle {
        left: auto !important;
        right: 0 !important;
    }

    /* Adjust site name to align left properly */
    .pkp_site_name {
        left: 0 !important;
        right: 56px !important; /* Leave room for the right-side toggle */
        padding-left: 14px !important;
    }

    /* Use flexbox on mobile menu to reorder sections */
    .pkp_site_nav_menu.pkp_site_nav_menu--isOpen,
    body.navIsOpen .pkp_site_nav_menu {
        display: flex !important;
        flex-direction: column !important;
    }

    /* Move User Menu (Register/Login) to top with divider */
    .pkp_navigation_user_wrapper {
        order: -1 !important; /* Moves this block to the very top */
        border-top: none !important;
        border-bottom: 2px solid #DDE1E7 !important;
        margin-top: 0 !important;
        padding-top: 5px !important;
        margin-bottom: 10px !important;
        padding-bottom: 15px !important;
    }

    /* Make Register and Login highly visible (Bold & Green) */
    .pkp_navigation_user > li > a {
        color: #4F7155 !important; /* Industrial Green */
        font-weight: 700 !important;
        font-size: 1.15em !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }

    .pkp_navigation_user > li > a:hover,
    .pkp_navigation_user > li > a:focus {
        color: #A0823F !important; /* Gold hover */
        background-color: transparent !important;
    }
}