/*
Theme Name: Twenty Twenty-Five Child
Theme URI: https://www.biojx.com/
Author: biojx
Author URI: https://www.biojx.com/
Description: Child theme for Twenty Twenty-Five, used to customize styles and functionality without modifying the parent theme.
Template: twentytwentyfive
Version: 1.0.0
Text Domain: twentytwentyfive-child
*/

/* ============= 头部搜索框样式开始 ============= */
/* 调整搜索框高度和按钮宽度 + 按钮图标居中 */
.wp-block-search .wp-block-search__input {
    height: 36px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

.wp-block-search .wp-block-search__button {
    height: 36px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    min-width: 40px !important;
    
    /* 图标居中关键代码 */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wp-block-search .wp-block-search__input:focus {
    background-color: #e0f2e9 !important;
}


/* ============= 头部搜索框字符限制提示样式 ============= */
/* 调整搜索框高度和按钮宽度 + 按钮图标居中 */
.wp-block-search .wp-block-search__input {
    height: 36px !important;
    padding-top: 4px !important;
    padding-bottom: 4px !important;
}

.wp-block-search .wp-block-search__button {
    height: 36px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    min-width: 40px !important;
    
    /* 图标居中关键代码 */
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.wp-block-search .wp-block-search__input:focus {
    background-color: #e0f2e9 !important;
}

/* ============= 搜索框错误状态 ============= */
.wp-block-search__input.biojx-input-invalid,
.search-form input[name="s"].biojx-input-invalid,
.wp-block-search__input.biojx-input-invalid:focus,
.search-form input[name="s"].biojx-input-invalid:focus {
    background-color: #ffe6e6 !important;
    border-color: #e74c3c !important;
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.5) !important;
}

/* ============= 搜索框内提示标签 ============= */
.biojx-search-warning {
    position: absolute;
    left: 40%;
    top: 50%;
    transform: translate(-50%, -50%);
    font-size: 18px;
    color: #e74d3ce7;
    background: transparent;
    pointer-events: none;
    white-space: nowrap;
    z-index: 2;
    animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* ============= 头部搜索框样式结束 ============= */


/* ============= 头部置顶（跟随滚动）开始 ============= */
/* 头部固定定位 */
header.wp-block-group {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 10000 !important;
    background-color: #ffffff !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 管理员工具栏补偿 */
.admin-bar header.wp-block-group {
    top: 32px !important;
}

/* ========== 无管理员栏时的 body 内边距 ========== */
/* 大屏 (≥1139px)：头部高度 75px */
body {
    padding-top: 75px !important;
}

/* 中等屏幕 (444px ~ 1138px)：头部高度 136px */
@media screen and (max-width: 1138px) and (min-width: 444px) {
    body {
        padding-top: 136px !important;
    }
}

/* 小屏 (≤443px)：头部高度 182px */
@media screen and (max-width: 443px) {
    body {
        padding-top: 182px !important;
    }
}

/* ========== 有管理员栏时的 body 内边距（头部高度 + 管理栏高度） ========== */
/* 大屏 + 管理栏：75px + 32px = 107px */
.admin-bar body {
    padding-top: 107px !important;
}

/* 中等屏幕 + 管理栏：136px + 32px = 168px */
@media screen and (max-width: 1138px) and (min-width: 444px) {
    .admin-bar body {
        padding-top: 168px !important;
    }
}

/* 小屏 + 管理栏：182px + 46px (移动端工具栏高度) = 228px */
@media screen and (max-width: 443px) {
    .admin-bar body {
        padding-top: 228px !important;
    }
}

/* 移动端工具栏高度修正（当屏幕宽度 ≤782px 时，管理栏变为 46px） */
@media screen and (max-width: 782px) {
    .admin-bar header.wp-block-group {
        top: 46px !important;
    }
}
/* ============= 头部置顶（跟随滚动）结束 ============= */

/* ============= 头部导航栏选中和鼠标悬停背景设置开始 ============= */
/* 仅作用于头部区域的导航菜单 */
header.wp-block-group .wp-block-navigation .wp-block-navigation-item__content {
    /* 基础样式 */
    padding: 5px 5px;
    border-radius: 6px;
    background-color: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
}

/* 鼠标悬停状态 */
header.wp-block-group .wp-block-navigation .wp-block-navigation-item__content:hover {
    background-color: #f0f5f0;  /* 浅绿色背景 */
    color: #178b30;             /* 主题绿色文字 */
}

/* 当前选中页面 + 选中页面的所有祖先菜单项 */
header.wp-block-group .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content,
header.wp-block-group .wp-block-navigation .current-menu-ancestor > .wp-block-navigation-item__content {
    background-color: #178b30;
    color: #ffffff;
}

/* ============= 头部导航栏选中和鼠标悬停背景设置结束 ============= */


/* 全局美观优化：移除鼠标点击时的焦点轮廓，保留键盘焦点 */
*:focus:not(:focus-visible) {
    outline: none;
}



/* ============= 页脚美化设置开始 ============= */
/* 页脚所有链接悬停变色 */
footer a:hover {
    color: #178b30 !important;   /* 主题绿色，可换成其他颜色 */
}

/* 页脚导航栏不换行，并设置最小宽度 */
footer .wp-block-navigation {
    white-space: nowrap;
    min-width: 130px;           /* 最小宽度，可根据内容长度微调 */
}

/* 如果导航内部有容器，也保障最小宽度 */
footer .wp-block-navigation__container {
    min-width: 130px;
}

/* 页脚特定标题链接字体放大一倍 */
footer a[href*="%e5%85%b3%e4%ba%8e%e6%88%91%e4%bb%ac"],
footer a[href*="%e4%ba%a7%e5%93%81%e4%b8%ad%e5%bf%83"],
footer a[href*="cro%e6%8a%80%e6%9c%af%e6%9c%8d%e5%8a%a1"] {
    font-size: 150%;
}

@media (max-width: 768px) {
    footer .wp-block-navigation {
        white-space: normal;
        min-width: 0;
    }
}

/* ============= 页脚美化设置结束 ============= */


/* ============= ACF通用字段容器宽度设置开始 ============= */
/* 通用页面内容page_extra_content值的[biojx_acf_editor]短代码，优化：添加了容器包裹，防止超出布局宽度 */

.biojx-acf-editor-wrapper {
    max-width: 100%;
    overflow: hidden;      /* 防止超大元素撑破布局 */
}
.biojx-acf-editor-wrapper img {
    max-width: 100%;
    height: auto;           /* 保持图片比例 */
}
.biojx-acf-editor-wrapper table,
.biojx-acf-editor-wrapper iframe,
.biojx-acf-editor-wrapper video {
    max-width: 100%;
}

/* ============= ACF通用字段容器宽度设置结束 ============= */




