/**
Theme Name: Jingrui Design Core
Author: Jingrui Design
Author URI: https://ray-shi.jingruidesign.com/
Description: 本專案為 靜睿設計所 (Jingrui Design Studio) 獨家構建的企業級 WordPress 子主題架構，旨在為所有客戶專案奠定堅實的數位地基。作為驅動網站的核心引擎，本系統深度整合了高規格的安全性防護、SEO 結構優化與極致的載入效能。

我們透過標準化的開發邏輯，有效解決父主題更新可能帶來的兼容性風險，確保長期運維的穩定性與擴充彈性。這不僅是一套程式碼，更是靜睿設計所貫徹「慢構」精神，將設計美學與技術工藝完美結合，對每一份交付品質的絕對承諾。
Version: 1.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jingrui-design-core
Template: astra
*/

/*主選單增加樣式*/

/* 針對 Astra 主要標題列增加底圖 */
.ast-primary-header-bar.main-header-bar {
    position: relative; /* 確保內部定位正確 */
    background-image: url('images/header_make.png'); /* 請替換為圖片在媒體庫的連結 */
    background-repeat: no-repeat;
    background-position: left bottom; /* 靠左、靠底對齊 */
    background-size: contain; /* 或者使用 auto，視圖片大小而定 */
    
    /* 避免圖片遮擋導覽列文字，可視情況調整透明度或疊加層級 */
    z-index: 1;
}

/* 確保標題內容在圖片之上 */
.site-primary-header-wrap {
    position: relative;
    z-index: 2;
}

/* 針對行動裝置的優化：若圖片太大影響閱讀，建議隱藏或調整 */
@media (max-width: 921px) {
    .ast-primary-header-bar.main-header-bar {
        background-image: none; /* 手機版通常空間不足，建議隱藏 */
    }
}




/*搜尋結果樣式優化*/


/* 1. 整個無結果區塊的置中與間距優化 */
.no-results.not-found .page-content {
    max-width: 600px;
    margin: 40px auto;
    padding: 30px;
    text-align: center;
}

/* 2. 提示文字的美化 (SEO 跳出率防護) */
.no-results.not-found .page-content p {
    font-size: 1.1rem;
    color: #555555;
    margin-bottom: 25px;
    line-height: 1.6;
}

/* 3. 搜尋表單容器改用 Flexbox 排版 */
.no-results.not-found .search-form {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* 4. 處理 Label 以填滿空間 */
.no-results.not-found .search-form label {
    width: 100%;
    margin: 0;
    position: relative;
    display: flex;
}

/* 5. 隱藏不必要的螢幕閱讀器文字，但不影響無障礙訪問 */
.no-results.not-found .search-form .screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* 6. 搜尋輸入框美化 (Mac Safari 視覺優化) */
.no-results.not-found .search-field {
    width: 100%;
    padding: 15px 50px 15px 20px; /* 右側留空間給 SVG 按鈕 */
    font-size: 1rem;
    color: #333;
    background-color: #ffffff;
    border: 2px solid #eaeaea;
    border-radius: 30px;
    outline: none;
    transition: all 0.3s ease;
    -webkit-appearance: none; /* 移除 Safari 預設樣式 */
}

/* 延伸技術：使用 :focus-within 提升互動感 */
.no-results.not-found .search-field:focus {
    border-color: #4facfe;
    box-shadow: 0 0 0 3px rgba(79, 172, 254, 0.2);
}

/* 7. 內建 SVG 放大鏡按鈕美化 (絕對定位至右側) */
.no-results.not-found .search-form button.search-submit.ast-search-submit {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    padding: 10px;
    cursor: pointer;
    color: #888;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: none;
}

.no-results.not-found .search-form button.search-submit:hover {
    color: #4facfe;
}

.no-results.not-found .search-form button.search-submit svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* 8. 隱藏 WP 預設多餘的醜陋 Submit 按鈕 */
.no-results.not-found .search-form > input[type="submit"] {
    display: none; /* 隱藏它，我們已經有 SVG 按鈕了 */
}










/**
 * ==============================================================================
 * Project: 邦盛開發集團組織架構圖 - WP萬用樣版優化版 (WP Org Chart Template)
 * Author: Ray Shih (施睿皇) - Jingrui Design Studio
 * Email: n8822314n@gmail.com
 * Contact: services@jingruidesign.com
 * Created: 2026-05-28 23:30
 * Version: 1.0.2
 * Company: 靜睿設計所 × 慢構
 * Website: https://jingruidesign.com
 * Copyright (c) 2026 Jingrui Design Studio. All rights reserved.
 * ==============================================================================
 */
/* 1. 操作流程：自動橋接 WP 官方全站主題色彩變數 -> 2. 透過 max-content 與 overflow 解鎖桌機橫向捲軸 -> 3. 渲染美化版精細滾動條(Scrollbar) */
#wp-custom-org-chart {
    /* 核心變數直接對齊 WordPress 官方標準全域配色預設值 (具備原生 Fallback 機制) */
    --primary-color: var(--wp--preset--color--primary, #7b0107);
    --secondary-color: var(--wp--preset--color--secondary, #200002);
    --accent-color: var(--wp--preset--color--theme-palette-1, #af4247);
    --node-bg: var(--wp--preset--color--base, #ffffff);
    --text-color: var(--wp--preset--color--contrast, #333333);
    --line-color: var(--wp--preset--color--subtle, #edf0f7);
    
    width: 100%;
    overflow-x: auto; /* 桌機與手機版皆強制開啟溢出檢測 */
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    box-sizing: border-box;
    display: block;
}

#wp-custom-org-chart * { box-sizing: border-box; }
#wp-custom-org-chart .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* 項目：桌機版滾動核心；說明：利用 max-content 強迫內層撐開，防止 flex 收縮導致捲軸消失；Author: Ray Shih */
#wp-custom-org-chart .tree {
    width: max-content;
    min-width: 100%;
    margin: 0 auto;
    padding-bottom: 15px;
}

#wp-custom-org-chart .tree ul { padding-top: 20px; position: relative; transition: all 0.5s; display: flex; justify-content: center; padding-left: 0; margin: 0; }
#wp-custom-org-chart .tree li { float: left; text-align: center; list-style-type: none; position: relative; padding: 20px 4px 0 4px; transition: all 0.5s; }

/* 繪製桌機版連線 */
#wp-custom-org-chart .tree li::before, #wp-custom-org-chart .tree li::after { content: ''; position: absolute; top: 0; right: 50%; border-top: 2px solid var(--line-color); width: 50%; height: 20px; z-index: 1; }
#wp-custom-org-chart .tree li::after { right: auto; left: 50%; border-left: 2px solid var(--line-color); }
#wp-custom-org-chart .tree li:only-child::after, #wp-custom-org-chart .tree li:only-child::before { display: none; }
#wp-custom-org-chart .tree li:only-child { padding-top: 0; }
#wp-custom-org-chart .tree li:first-child::before, #wp-custom-org-chart .tree li:last-child::after { border: 0 none; }
#wp-custom-org-chart .tree li:first-child::after { border-radius: 5px 0 0 0; }
#wp-custom-org-chart .tree li:last-child::before { border-right: 2px solid var(--line-color); border-radius: 0 5px 0 0; }
#wp-custom-org-chart .tree ul ul::before { content: ''; position: absolute; top: 0; left: 50%; border-left: 2px solid var(--line-color); width: 0; height: 20px; }

/* 卡片主體設定 */
#wp-custom-org-chart .tree li a { border: 1px solid var(--line-color); padding: 12px 18px; text-decoration: none; color: var(--text-color); font-size: 14px; font-weight: 600; display: inline-block; border-radius: 6px; background-color: var(--node-bg); box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: all 0.3s ease; position: relative; z-index: 2; white-space: nowrap; }

/* 高階節點特化 */
#wp-custom-org-chart .tree li a.node-level-1 { background-color: var(--primary-color); color: var(--node-bg); font-size: 18px; border: none; }
#wp-custom-org-chart .tree li a.node-level-2 { background-color: var(--secondary-color); color: var(--node-bg); font-size: 16px; border: none; }
#wp-custom-org-chart .tree li a.node-level-3 { background-color: var(--accent-color); color: var(--node-bg); border: none; }

/* 懸停路徑高亮 */
#wp-custom-org-chart .tree li a:hover, #wp-custom-org-chart .tree li a:hover+ul li a { background: var(--accent-color); color: var(--node-bg); border-color: var(--accent-color); transform: translateY(-2px); box-shadow: 0 5px 15px rgba(230,126,34,0.2); }
#wp-custom-org-chart .tree li:has(a:hover) > a { background-color: var(--accent-color); color: var(--node-bg); border-color: var(--accent-color); }

/* 載入動畫 */
/* ==========================================================================
   效能優化：GPU 硬體加速與平滑載入動畫
   ========================================================================== */
#wp-custom-org-chart .animate-node {
    /* 1. 防閃爍：確保動畫開始前絕對透明 */
    opacity: 0; 
    
    /* 2. 觸發 GPU 硬體加速，將該節點提升至獨立圖層 (Compositor Layer) */
    will-change: opacity, transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    perspective: 1000px;
    
    /* 3. 套用平滑貝茲曲線 (cubic-bezier) 取代生硬的 ease-out */
    animation: fadeInUp 0.7s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    
    /* 4. 保留延遲變數 */
    animation-delay: var(--delay, 0s);
}

/* 5. 使用 translate3d 強制啟動 3D 運算，進一步釋放 CPU 壓力 */
@keyframes fadeInUp { 
    from { 
        opacity: 0; 
        transform: translate3d(0, 20px, 0); 
    } 
    to { 
        opacity: 1; 
        transform: translate3d(0, 0, 0); 
    } 
}

/* 項目：精細化自訂滾動條；說明：優化桌機版捲軸外觀，使其符合網站整體設計感；Author: Ray Shih */
#wp-custom-org-chart::-webkit-scrollbar { height: 6px; }
#wp-custom-org-chart::-webkit-scrollbar-track { background: rgba(0,0,0,0.03); border-radius: 10px; }
#wp-custom-org-chart::-webkit-scrollbar-thumb { background: var(--line-color); border-radius: 10px; }
#wp-custom-org-chart::-webkit-scrollbar-thumb:hover { background: var(--secondary-color); }

/* ==========================================================================
   手機與平板版：垂直資料夾樹狀圖 (Mobile View < 992px)
   ========================================================================== */
@media screen and (max-width: 992px) {
    #wp-custom-org-chart .tree { width: 100%; } /* 行動版解鎖 max-content限制 */
    #wp-custom-org-chart .tree ul { display: block; padding-top: 10px; padding-left: 20px; }
    #wp-custom-org-chart .tree > ul { padding-left: 0; }
    #wp-custom-org-chart .tree li { float: none; text-align: left; padding: 10px 0 0 20px; position: relative; }
    #wp-custom-org-chart .tree li::before, #wp-custom-org-chart .tree li::after, #wp-custom-org-chart .tree ul ul::before { display: none; }
    #wp-custom-org-chart .tree ul ul { border-left: 2px solid var(--line-color); margin-left: 15px; }
    #wp-custom-org-chart .tree ul ul > li::before { content: ''; display: block; position: absolute; top: 28px; left: 0; width: 15px; border-top: 2px solid var(--line-color); z-index: 0; }
    #wp-custom-org-chart .tree li a { display: block; width: 100%; max-width: 250px; margin-bottom: 2px; white-space: normal; }
    #wp-custom-org-chart .tree ul ul:last-child { padding-bottom: 0; }
}