/* ==========================================================
   JCCAS Custom Styles (Pragma Theme)
   优化与易维护版 (Optimized & Maintainable Version)
   ========================================================== */

/* ----------------------------------------------------------
   1. 顶部栏 (Header): 布局简化与 Login/后台入口定位
   ---------------------------------------------------------- */
#pragma_content_header {
    position: relative; 
}

/* 精准隐藏多余的语言菜单容器，放过登录后的后台下拉菜单 */
.main-header__admin > div.dropdown { display: none !important; }
.main-header__admin {
    padding: 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    border: none !important;
}

/* 登录按钮/后台入口绝对定位，悬浮于右上角 */
#navigationUser {
    position: absolute;
    top: 25px; 
    right: 20px; 
    z-index: 1000;
    margin: 0 !important;
}

/* 确保登录后的后台菜单向左下方展开，防止超出屏幕右边缘 */
#navigationUser .dropdown-menu {
    right: 0 !important;
    left: auto !important;
    margin-top: 10px; 
}

/* 顶部期刊标题容器布局 */
.main-menu__title {
    flex: 0 0 100% !important; 
    width: 100% !important;
    margin-top: 15px !important; 
    margin-bottom: 15px !important; 
}

.main-menu__title a {
    display: flex !important;
    align-items: center;
    gap: 15px;
    text-decoration: none !important;
}

.main-menu__title img {
    max-height: 60px !important; 
    width: auto;
}

/* CSS 注入的期刊名称 (纯黑, 衬线字体) */
.main-menu__title a::after {
    content: "Journal of Contemporary Chinese and Asian Studies";
    font-family: "Merriweather", "Georgia", "Times New Roman", serif; 
    font-size: 22px; 
    font-weight: 700;
    line-height: 1.2;
    color: #000 !important; 
    letter-spacing: .5px; 
}

/* ----------------------------------------------------------
   2. 首页介绍版块 (Homepage Description)
   ---------------------------------------------------------- */
/* 隐藏系统重复输出的标题 */
.journal-desc h2.metadata { display: none !important; }

/* 减小外边距，使内容自然上移 */
.journal-desc {
    padding-top: 0 !important;
    margin-top: 10px !important; 
}
.journal-desc article {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

/* "About the Journal" 副标题 (纯白) */
.journal-desc__title {
    margin-top: 0 !important; 
    margin-bottom: 15px; 
    font-size: 24px; 
    color: #fff !important; 
}

/* ----------------------------------------------------------
   3. 底栏 (Footer): 横向排版与索引 Logo 预留
   ---------------------------------------------------------- */
/* 隐藏 OJS 默认插入的底栏品牌标识 */
.pkp_brand_footer { display: none !important; }

/* 强制使用横向 Flex 布局，禁止换行 */
.custom-footer-container {
    display: flex !important;
    flex-direction: row !important; 
    flex-wrap: nowrap !important; 
    justify-content: space-between !important; 
    align-items: center !important; 
    width: 100%;
}

/* 左侧文本信息区 */
.footer-text {
    flex: 1; 
    text-align: left !important; 
    padding-right: 15px; /* 【已优化】减小右侧保护间距，为文字释放空间 */
}
.footer-text p {
    margin-bottom: 5px;
    font-size: 13px !important;
    line-height: 1.5;
    color: #ccc; 
    white-space: nowrap !important; /* 【核心优化】桌面端强制所有文字不换行 */
}
.footer-text p:last-child { margin-bottom: 0; }
.footer-text a {
    color: #fff;
    text-decoration: underline;
}

/* 右侧 Logo 矩阵区 (为未来的 DOAJ/Scopus 预留空间) */
.footer-logos {
    display: flex;
    flex: 0 0 auto; 
    align-items: center; 
    justify-content: flex-end; 
    gap: 20px; 
    min-width: 120px; 
    margin-right: -10%; /* 【核心优化】利用负边距将整体 Logo 向右移动 10%，把宽度让给左侧文字 */
}
.indexing-logos {
    display: flex;
    align-items: center;
    gap: 15px; 
}
.indexing-logos img {
    max-height: 40px; 
    width: auto;
}

/* OJS Logo (进一步缩小并黑底反色) */
.ojs-logo-inverted {
    display: block;
    max-width: 80px !important; 
    height: auto;
    filter: brightness(0) invert(1); 
    opacity: .85;
}

/* ----------------------------------------------------------
   4. 移动端适配 (Mobile Responsive, < 768px)
   ---------------------------------------------------------- */
@media (max-width: 768px) {
    /* Login 按钮向左移，避免遮挡移动端折叠菜单 */
    #navigationUser { top: 20px; right: 70px; }
    
    .main-menu__title { margin-top: 10px !important; margin-bottom: 10px !important; }
    .main-menu__title img { max-height: 45px !important; }
    .main-menu__title a::after { font-size: 16px; }

    /* 屏幕过窄时底栏改为上下堆叠居中 */
    .custom-footer-container { flex-direction: column !important; }
    
    .footer-text {
        margin-bottom: 20px;
        padding-right: 0;
        text-align: center !important; 
    }
    
    /* 【核心恢复】手机端屏幕窄，必须允许文字换行，否则会撑破屏幕 */
    .footer-text p {
        white-space: normal !important; 
    }
    
    /* 【核心恢复】手机端取消 Logo 的负边距偏移，居中显示 */
    .footer-logos { 
        justify-content: center; 
        min-width: auto; 
        margin-right: 0 !important; 
    }
}