/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Use this child theme to extend Bricks.
 Author:       Bricks
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.1
 Text Domain:  bricks
*/


/* ==========================================================================
   關鍵要點樣式 (最終完美修正版)
   ========================================================================== */

/* 1. 大框框設定 */
body .kp-box {
    background-color: #f2f4f8 !important; /* 底色：淺灰藍 */
    border-radius: 8px !important;
    padding: 25px !important;
    margin: 30px 0 !important;
    border: 1px solid #e1e4e8 !important;
}

/* 2. 標題設定 */
body .kp-title {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #333 !important;
    display: flex !important;
    align-items: center !important;
    border-bottom: none !important;
}

/* ★ 重點修正：製作「藍色閃爍星星」 */
body .kp-title::before {
    content: "✨" !important;  /* 使用閃爍星星符號 */
    font-size: 24px !important;
    margin-right: 8px !important;
    line-height: 1 !important;
    
    /* ▼ 變色魔術：將原本黃色的 Emoji 強制變成藍色 */
    color: transparent !important;
    text-shadow: 0 0 0 #2355ff !important; 
}

/* 3. 內文列表設定 */
body .kp-content ul {
    list-style: none !important;
    margin: 0 !important;
    padding-left: 0 !important;
}

body .kp-content li {
    position: relative !important;
    padding-left: 30px !important;
    margin-bottom: 12px !important;
    font-size: 16px !important;
    line-height: 1.6 !important;
    list-style: none !important;
}

/* 4. 勾勾設定 (修正透紫色問題) */
body .kp-content li::before {
    content: "✔" !important;
    
    /* ▼ 強制指定字體，避免變成彩色 Emoji */
    font-family: Verdana, Arial, sans-serif !important; 
    
    position: absolute !important;
    left: 0 !important;
    top: 4px !important;
    width: 18px !important;
    height: 18px !important;
    background-color: #2355ff !important; /* 圓底：藍色 */
    
    /* ▼ 勾勾顏色：強制白色 (利用文字陰影蓋過原本顏色) */
    color: transparent !important;
    text-shadow: 0 0 0 #f2f4f8 !important;
    
    border-radius: 50% !important;
    text-align: center !important;
    font-size: 11px !important;
    line-height: 18px !important;
    font-weight: bold !important;
    display: block !important;
}

/* ==========================================================================
   Geniushub 自定義工具類別 (Utility Classes) 漸層標題
   ========================================================================== */
/* --- 藍色漸層標題修復 --- */
.u-text-gradient {
    /* 核心地基：強制繼承父層（P或H標籤）的大小 */
    font-size: inherit !important; 
    line-height: inherit !important;

    /* 漸層色設定 */
    background: var(--clr-gradient-text) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;

    /* 佈局設定 */
    display: inline-block;
    padding-bottom: 0.15em;  
    margin-bottom: -0.15em;  
    vertical-align: top;     
}

/* --- 黃色漸層標題修復 --- */
.u-text-gradient-yellow {
    /* 連結你的風格管理器變數 */
    background: var(--clr-yellow-text) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;

    /* 關鍵地基：防止下方被切掉 */
    display: inline-block;
    padding-bottom: 0.15em;
    margin-bottom: -0.15em;
    vertical-align: top;
}

/* --- 藍色標題修復 --- */
.u-text-gradient-blue {
    /* 連結你的風格管理器變數 */
    background: var(--clr-blue-text) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;

    /* 關鍵地基：防止下方被切掉 */
    display: inline-block;
    padding-bottom: 0.15em;
    margin-bottom: -0.15em;
    vertical-align: top;
}) !important;
    -webkit-background-clip: text !important;
    background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    color: transparent !important;

    /* 關鍵地基：防止下方被切掉 */
    display: inline-block;
    padding-bottom: 0.15em;
    margin-bottom: -0.15em;
    vertical-align: top;
}




/* ==========================================================================
   文章表格
   ========================================================================== */

/* --- 最終暴力破解版：絕對不溢出 + 呼吸感 --- */
:root {
    --table-blue: #007bff; /* 原本的藍色 */
    --table-gray: #f8f9fa;
    --table-border: #eeeeee;
}

/* 1. 強制鎖定：所有在文章內的表格絕對不准超過 100% */
.brxe-post-content table, 
.entry-content table {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important; /* 核心：鎖死這道牆，側邊欄就安全了 */
    table-layout: auto !important;
    
    /* 上下呼吸感：強制推開與文章的距離 */
    margin-top: 48px !important;
    margin-bottom: 48px !important; /* 下方加大，解決貼字 */
    
    border-collapse: separate !important;
    border-spacing: 0 !important;
    border: 1px solid var(--table-border) !important;
    border-radius: 12px !important;
    overflow: hidden !important;
    clear: both !important;
}

/* 2. 解決「雙重變色」：精準定位第一列 */
/* 邏輯：先把所有 tr 的顏色重置為白色，再單獨漆第一列 */
.brxe-post-content table tr td,
.brxe-post-content table tr th {
    background-color: #ffffff !important;
    color: #444444 !important;
    padding: 16px 20px !important;
    border-bottom: 1px solid var(--table-border) !important;
    border-right: 1px solid var(--table-border) !important;
    vertical-align: middle !important;
}

/* 只讓「整個表格」真正的第一列變色 */
.brxe-post-content table thead tr:first-child th,
.brxe-post-content table thead tr:first-child td,
.brxe-post-content table:not(:has(thead)) tr:first-child td,
.brxe-post-content table:not(:has(thead)) tr:first-child th {
    background-color: var(--table-blue) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    text-align: center !important;
}

/* 3. 斑馬紋 (避開第一列) */
.brxe-post-content table tbody tr:nth-child(even) td,
.brxe-post-content table tr:nth-child(even):not(:first-child) td {
    background-color: var(--table-gray) !important;
}

/* 4. 手機版強制：讓文章內容區可以滑動，防止表格撐破網頁 */
@media (max-width: 991px) {
    .brxe-post-content {
        overflow-x: auto !important;
        padding-bottom: 20px;
    }
    .brxe-post-content table {
        min-width: 850px !important; /* 手機版撐開以防貼邊，但會變滾輪 */
    }
}

/* 5. 暴力推開下方文字：解決 HTML 表格貼字 */
.brxe-post-content table + * {
    margin-top: 48px !important;
    display: block !important;
}

/* 移除贅邊 */
.brxe-post-content table td:last-child { border-right: none !important; }
.brxe-post-content table tr:last-child td { border-bottom: none !important; }




/* ==========================================================================
   文章表格：淡灰色外框現代版 (無內線)
   ========================================================================== */
:root {
    --table-blue: #007bff;
    --table-gray: #f8f9fa;
    --table-border: #eeeeee; /* 定義淡灰色地基 */
}

/* 1. 桌機版核心：保留外框，移除內線 */
.brxe-post-content table, 
.entry-content table {
    display: table !important;
    width: 100% !important;
    max-width: 100% !important;
    table-layout: auto !important;
    
    /* 統一呼吸感：移除重複推開邏輯，改用單一 margin 穩定地基 */
    margin-top: 20px !important;
    margin-bottom: 40px !important; 
    
    border-collapse: separate !important;
    border-spacing: 0 !important;
    
    /* 核心修改：只要外框線 */
    border: 1px solid var(--table-border) !important; 
    border-radius: 12px !important;
    overflow: hidden !important;
    clear: both !important;
    
    /* 輕微投影，增加層次感 */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03) !important;
}

/* 2. 內部單元格：徹底移除內部分隔線 */
.brxe-post-content table tr td,
.brxe-post-content table tr th {
    background-color: #ffffff !important;
    color: #444444 !important;
    padding: 18px 24px !important;
    border: none !important; /* 確保內部沒有橫線與直線 */
    vertical-align: middle !important;
}

/* 標題列：維持藍色地基 */
.brxe-post-content table thead tr:first-child th,
.brxe-post-content table thead tr:first-child td,
.brxe-post-content table:not(:has(thead)) tr:first-child td {
    background-color: var(--table-blue) !important;
    color: #ffffff !important;
    font-weight: 600 !important;
    text-align: center !important;
}

/* 3. 斑馬紋 (無內線時，斑馬紋是閱讀的救星) */
.brxe-post-content table tr:nth-child(even):not(:first-child) td {
    background-color: var(--table-gray) !important;
}

/* 4. 手機版：保持滑動與滾輪 */
@media (max-width: 991px) {
    .brxe-post-content figure.wp-block-table,
    .brxe-post-content .ghtable-overflow {
        overflow-x: auto !important;
        display: block !important;
        padding-bottom: 15px !important;
        -webkit-overflow-scrolling: touch;
    }

    .brxe-post-content table {
        min-width: 850px !important; 
        display: table !important;
    }

    .brxe-post-content figure.wp-block-table::-webkit-scrollbar {
        height: 6px !important;
        display: block !important;
    }
    .brxe-post-content figure.wp-block-table::-webkit-scrollbar-thumb {
        background: #cccccc !important;
        border-radius: 10px !important;
    }
}

/* ==========================================================================
   文字都會變空心
   ========================================================================== */
/* 這樣寫，只要掛上這個名字的文字都會變空心 */
.c-svc-flow__num {
  /* 1. 核心空心效果 */
  color: transparent !important;
  -webkit-text-fill-color: transparent !important;
  -webkit-text-stroke: 2px #2462EC !important;
  
  /* 2. 關鍵地基修復：改變繪製順序 */
  /* 這行會讓邊框在文字內容之後繪製，有助於減少某些字體的重疊感 */
  paint-order: stroke fill;
  
  /* 3. 佈局調整 */
  display: inline-block;
  text-shadow: none !important;
}



/* ==========================================================================
   針對手機版 (766px 以下) 的特別樣式 選單按鈕 - 更細長漸層版
   ========================================================================== */
@media (max-width: 766px) {
  li.menu-btn {
    padding: 5px 20px !important; 
    display: block !important;
  }

  li.menu-btn > a {
    /* 漸層色保持不變 */
    background: linear-gradient(135deg, #0047FF 0%, #00D1FF 100%) !important;
    color: #ffffff !important;
    text-align: center !important;
    border-radius: 10px !important;

    /* --- 調整細長感的關鍵區域 --- */
    padding: 4px 25px !important;  /* 第一個數值 8px 決定高度（越小越細） */
      /* 增加最大寬度限制，讓按鈕看起來更長 */
    width: 100% !important;         /* 賦予一個基礎寬度比例 */
    /* -------------------------- */

    margin: 8px auto !important; 
    display: block !important;
    font-weight: 600 !important;
    letter-spacing: 1.5px !important; /* 稍微拉開字距，視覺上會顯得更橫向延伸 */
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(0, 71, 255, 0.2) !important;
    box-sizing: border-box !important;
  }
}

/* ==========================================================================
   全域樣式：懸浮漸層引號 (自動套用於所有 blockquote)
   ========================================================================== */
blockquote {
    position: relative;
    padding: 20px 30px 20px 45px;
    margin: 40px 0;
    background: linear-gradient(100deg, #e0f2fe 0%, #dbeafe 100%);
    border-radius: 0 12px 12px 0;
    font-style: normal;
    line-height: 1.8;
    /* 輕微投影，讓卡片有懸浮感 */
    box-shadow: 10px 10px 30px rgba(59, 130, 246, 0.05);
    border: none; /* 移除瀏覽器預設邊框 */
}

/* 左側漸層裝飾條 */
blockquote::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, #3b82f6, #06b6d4);
    border-radius: 4px;
}

/* 漸層引言符號 */
blockquote::before {
    content: "“";
    position: absolute;
    top: -15px;
    left: 15px;
    font-size: 54px;
    font-family: Georgia, serif;
    /* 讓引號帶有漸層色 */
    background: linear-gradient(to bottom, #3b82f6, #06b6d4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0.25;
}

/* 內部的文字樣式 */
blockquote p {
    font-size: 18px !important;
    margin: 0 !important;
    color: #475569;
}

/* 安全過濾器：只有當引言裡面「完全沒有文字」且「也沒有任何子標籤」時才隱藏 */
/* 這能避免誤殺直接放文字（沒放P）的正常引言 */
blockquote:not(:has(*)):not(:has(text)) {
    display: none !important;
}

/* 針對 Gutenberg 常見的空標籤組合 */
/* 只有當 blockquote 裡面只有一個空的 P 時，才整塊隱藏 */
blockquote:has(> p:empty):not(:has(text)) {
    display: none !important;
}



/* ==========================================================================
   全域粗體加強：螢光筆畫重點效果 (已暫時註解)
   ========================================================================== */

 strong, b {
    font-weight: bold;
    background: linear-gradient(to bottom, transparent 60%, rgba(253, 209, 60, 0.7) 40%);
    padding: 0 2px; 
    border-radius: 2px;
}

strong:hover, b:hover {
    background: linear-gradient(to bottom, transparent 50%, rgba(253, 209, 60, 0.7) 50%);
    transition: background 0.3s ease;
}






