/* ==========================================================================
   1. GLOBAL PAGE & CONTENT BODY COLORS
   ========================================================================== */
body, 
.pkp_structure_page, 
.pkp_structure_content.container {
    background-color: #FAF9F6 !important; 
    color: #444545 !important;            
}

main, p, h1, h2, h3, h4, h5, h6, .issue_toc, .item {
    color: #444545 !important;
}

a {
    color: #444545 !important;
    text-decoration: underline;
}
a:hover, a:focus {
    color: rgba(21, 23, 22, 0.8) !important;
}

/* ==========================================================================
   2. CUSTOM HEADER (Layout and Element Controls)
   ========================================================================== */
.custom-academic-header {
    background-color: #CED0CF !important; 
    width: 100%;
    font-family: sans-serif;
}

/* Tier 1: Utility Ribbon modifications */
.tier-one-utility-bar {
    background-color: rgba(0, 0, 0, 0.05); 
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    padding: 10px 0;
}
.tier-one-utility-bar .tier-flex-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row; /* Direct flow: Left items stay left, Right stay right */
}

/* Left side positioning container grouping social links and languages together */
.utility-left-group {
    display: flex;
    align-items: center;
    gap: 15px; 
}

/* User Admin/Editor Profile Droplist Links (Now safely pinned to the Right side) */
.user-nav-wrapper {
    margin-left: auto;
}
.user-nav-wrapper ul.nav-pills > li > a {
    color: #444545 !important; 
    background: transparent !important;
    font-size: 13px;
    padding: 0;
    text-transform: capitalize;
    text-decoration: none !important;
}

/* Administrative dropdown positioning fixes */
.user-nav-wrapper .dropdown-menu {
    right: 0 !important;
    left: auto !important; /* Forces dropdown lists to expand inwards toward left */
    background-color: #CED0CF !important;
}
.user-nav-wrapper .dropdown-menu > li > a {
    color: #444545 !important;
    text-decoration: none !important;
}

/* Social Media Box Icons Formatting */
.header-social-links {
    display: flex;
    gap: 8px; 
}
.header-social-links a {
    background-color: #444545 !important; 
    color: #CED0CF !important;            
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px; 
    font-size: 12px;
    text-decoration: none !important;
    transition: opacity 0.2s ease;
}
.header-social-links a:hover {
    opacity: 0.85;
}

/* Inline Language Switcher Buttons Style */
.header-lang-switcher {
    display: flex;
    gap: 6px;
    border-left: 1px solid rgba(21, 23, 22, 0.2);
    padding-left: 12px;
}
.header-lang-switcher a.lang-btn {
    font-size: 11px;
    font-weight: bold;
    color: #444545 !important;
    background-color: rgba(255, 255, 255, 0.4);
    padding: 4px 8px;
    border-radius: 3px;
    text-decoration: none !important;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
}
.header-lang-switcher a.lang-btn:hover {
    background-color: #444545;
    color: #CED0CF !important;
}

/* Tier 2: Center-Stacked Branding Elements */
.tier-two-branding-bar .tier-flex-wrapper {
    display: flex;
    flex-direction: column; 
    align-items: center;    
    justify-content: center;
    padding: 25px 0 20px 0;
    gap: 12px;              
}

/* Scaled down brand logo height constraint */
.custom-brand-logo img {
    max-height: 70px; 
    width: auto;
    display: block;
    margin: 0 auto;
}
.custom-brand-text {
    color: #444545 !important;
    font-size: 32px;
    font-weight: bold;
    text-decoration: none !important;
    text-align: center;
}

/* Academic Slogan Layout Formatting Block */
.academic-slogan-box {
    text-align: center;
    width: 100%;
    margin-bottom: 4px;
    text-transform: uppercase; /* Adapts clean uppercase look from reference image */
    letter-spacing: 0.5px;
}
.slogan-line-primary {
    color: #444545 !important;
    font-size: 15px; /* Bigger first line */
    font-weight: bold;
    margin-bottom: 2px;
}
.slogan-line-secondary {
    color: rgba(21, 23, 22, 0.75) !important;
    font-size: 11px; /* Smaller secondary baseline line */
    font-weight: 600;
}

/* Integrated Centered Search Container */
.header-isolated-search {
    width: 100%;
    max-width: 450px; 
    margin: 0 auto;
}
.header-isolated-search form.navbar-form {
    display: flex !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
}
.header-isolated-search .form-group {
    margin-bottom: 0 !important;
    flex-grow: 1; 
}
.header-isolated-search input.form-control {
    width: 100% !important;
    border-radius: 4px 0 0 4px !important; 
    border: 1px solid rgba(21, 23, 22, 0.3) !important;
    background-color: #FAF9F6 !important; 
    color: #444545 !important;
    height: 38px;
    padding-left: 12px;
}
.header-isolated-search input.form-control::placeholder {
    color: rgba(21, 23, 22, 0.6);
}
.header-isolated-search button.btn {
    background-color: #444545 !important; 
    color: #CED0CF !important;            
    border-radius: 0 4px 4px 0 !important; 
    border: none !important;
    font-weight: bold;
    padding: 0 20px;
    height: 38px;
}

/* Tier 3: Undernav Menu Strip & Dropdown Fixes */
.tier-three-navigation-bar {
    background-color: rgba(0, 0, 0, 0.03);
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}
.tier-three-navigation-bar .container-fluid {
    display: flex;
    justify-content: center; 
}
.tier-three-navigation-bar .navbar-nav {
    margin: 0;
}
.tier-three-navigation-bar .navbar-nav > li > a {
    color: #444545 !important;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 13px;
    letter-spacing: 0.5px;
    padding: 14px 20px !important;
    background: transparent !important;
    text-decoration: none !important;
}
.tier-three-navigation-bar .navbar-nav > li > a:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
}

/* Main Navigation Dropdown Container Styling */
.tier-three-navigation-bar .dropdown-menu {
    background-color: #CED0CF !important; 
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    box-shadow: 0 6px 12px rgba(0,0,0,0.1) !important;
    padding: 5px 0;
}
.tier-three-navigation-bar .dropdown-menu > li > a {
    color: #444545 !important; 
    font-weight: 500;
    font-size: 13px;
    padding: 8px 20px;
    text-decoration: none !important;
    display: block;
    background: transparent !important;
}
.tier-three-navigation-bar .dropdown-menu > li > a:hover {
    background-color: rgba(0, 0, 0, 0.06) !important;
    color: #444545 !important;
}

/* ==========================================================================
   3. FOOTER STYLING OVERRIDES
   ========================================================================== */
.pkp_structure_footer, 
footer, 
#pkp_structure_footerContainer {
    background-color: #CED0CF !important; 
    color: #444545 !important;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding: 30px 0;
}
.pkp_structure_footer a,
footer a {
    color: #444545 !important;
    text-decoration: underline;
}