/* --- 1. 基礎內文：1200px 置中 (僅針對文字與基礎列表) --- */
/* 排除所有帶有 alignfull (全幅) 或 alignwide (寬幅) 標籤的區塊 */
.single-post .entry-content p:not([class*="align"]), 
.single-post .entry-content ul:not([class*="align"]), 
.single-post .entry-content ol:not([class*="align"]),
.single-post .entry-content .wp-block-buttons:not([class*="align"]) {
    max-width: 1200px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100%;
    box-sizing: border-box;
}

/* --- 2. 標題 H2-H5 漸層 (排除按鈕與 Jetpack) --- */
.single-post .entry-content h2:not([class*="sd-"]):not([id*="jp-"]):not(.sd-title):not(.wp-block-button__link), 
.single-post .entry-content h3:not([class*="sd-"]):not([id*="jp-"]):not(.sd-title):not(.wp-block-button__link), 
.single-post .entry-content h4:not([class*="sd-"]):not([id*="jp-"]):not(.sd-title):not(.wp-block-button__link), 
.single-post .entry-content h5:not([class*="sd-"]):not([id*="jp-"]):not(.sd-title):not(.wp-block-button__link) {
    max-width: 1200px !important;
    margin: 20px auto !important;
    background: linear-gradient(90deg, #8c52ff, #5ce1e6) !important;
    color: #ffffff !important;
    padding: 15px 20px;
    border-radius: 8px;
    display: block;
    clear: both;
}

/* --- 3. 圖片與圖庫保護：維持置中但不強制 1200px (交給主題控制) --- */
.single-post .entry-content figure, 
.single-post .entry-content .wp-block-image, 
.single-post .entry-content .wp-block-gallery {
    margin-left: auto !important;
    margin-right: auto !important;
}



/* 保持按鈕在手機上並排的彈性 */
.wp-block-buttons.is-content-justification-center .wp-block-button,
.wp-block-buttons.is-content-justification-space-between .wp-block-button {
    flex: 1 1 45% !important;
    min-width: 120px !important;
}

/* --- 5. 全網 iframe (Google Maps / 影片) 響應式優化 --- */
.entry-content iframe,
.wp-block-embed iframe,
.wp-block-html iframe {
    max-width: 1200px !important;  /* 電腦版限制最大 1200px */
    width: 100% !important;        /* 手機版強制縮放至螢幕寬度，破解地圖固定尺寸 */
    margin-left: auto !important;  /* 確保置中 */
    margin-right: auto !important; /* 確保置中 */
    display: block !important;
    box-sizing: border-box !important;
    border: none !important;       /* 移除預設邊框使畫面更乾淨 */
}

/* 確保內嵌區塊的容器本身也不會超出版面 */
.entry-content .wp-block-embed,
.entry-content .wp-block-html {
    max-width: 1200px !important;
    width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
    overflow: hidden !important; 
}

/* --- 6. 徹底修復 Jetpack 分享與點讚 --- */
div.sharedaddy, #jp-relatedposts, div.wpl-likebox {
    max-width: 1200px !important;
    margin: 40px auto !important;
    padding: 0 20px !important;
    background: transparent !important;
    clear: both !important;
}
.sd-title, .wpl-likebox h3, #jp-relatedposts h3.jp-relatedposts-headline {
    background: none !important;
    color: inherit !important;
    padding: 0 !important;
    margin: 10px 0 !important;
    display: block !important;
}
.sharedaddy ul {
    display: flex !important;
    flex-wrap: wrap !important;
    list-style: none !important;
    padding: 0 !important;
}

/* --- 7. 全幅群組修正 (允許背景鋪滿) --- */
.entry-content .alignfull {
    width: 100vw !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    max-width: 100vw !important;
}

/* ==========================================================================
   全新整合：全網表格響應式優化 (適用於手機與平板，防止文字擠壓，支援左右滑動)
   ========================================================================== */

@media screen and (max-width: 1024px) {
    /* 1. 表格外層容器：設定為區塊並開啟水平滾動 */
    .entry-content .wp-block-table,
    .wp-block-table {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important; /* 強制開啟左右滑動 */
        -webkit-overflow-scrolling: touch; /* iOS 順暢滑動體驗 */
        margin: 20px 0 !important;
        border: 1px solid #eeeeee;
    }

    /* 2. 表格主體：鎖定最小寬度，防止內容在小螢幕被壓縮 */
    .entry-content .wp-block-table table,
    .wp-block-table table {
        display: table !important;
        width: 100% !important;
        min-width: 650px !important; /* 保障表格不低於此寬度，低於即觸發左右滑動 */
        table-layout: auto !important; /* 讓欄位根據文字內容自動分配合理寬度 */
        border-collapse: collapse !important;
    }

    /* 3. 儲存格通用設定：防止字體過度折行與擠壓 */
    .entry-content .wp-block-table th,
    .entry-content .wp-block-table td,
    .wp-block-table th,
    .wp-block-table td {
        padding: 10px 12px !important;
        border: 1px solid #dddddd !important;
        vertical-align: middle !important;
        line-height: 1.5 !important;
        white-space: normal !important; /* 允許適度換行，不強制單行擠爆 */
        word-break: break-word !important; /* 長英文或網址自動斷行 */
        min-width: 80px; /* 單一格子最低寬度 */
    }

    /* 4. 表頭加強顯眼度 */
    .entry-content .wp-block-table th,
    .wp-block-table th {
        background-color: #f8f9fa !important;
        font-weight: bold !important;
        text-align: center !important;
    }
}

/* --- 10. Yoast 麵包屑基礎置中 (獨立設定) --- */
.yoast-breadcrumb {
    max-width: 1200px !important;
    margin: 10px auto !important;
}
/* --- 11. 針對「分頁 (Pages)」手機版標題尺寸優化 --- */
/* 
   策略：
   1. 僅作用於 .page (分頁)，不影響文章或其他頁面。
   2. 使用直接子代選擇器 (>) 確保只影響內容區的標準標題，
      絕對避開外掛（外掛標題通常嵌套在多層 div 內）。
*/

@media screen and (max-width: 767px) {
    /* 縮小標題尺寸以迎合手機螢幕，並確保置中或留白正確 */
    .page .entry-content h1,
    .page .entry-content h2,
    .page .entry-content h3,
    .page .entry-content h4,
    .page .entry-content h5,
    .page .entry-content h6 {
        width: 100% !important;
        max-width: 1200px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        word-wrap: break-word !important; /* 確保長標題不衝出螢幕 */
        box-sizing: border-box !important;
    }

    /* 具體尺寸調整 (可根據視覺喜好微調數值) */
    .page .entry-content h1 { font-size: 28px !important; line-height: 1.2 !important; margin: 20px 0 !important; }
    .page .entry-content h2 { font-size: 24px !important; line-height: 1.3 !important; margin: 18px 0 !important; }
    .page .entry-content h3 { font-size: 20px !important; line-height: 1.4 !important; margin: 15px 0 !important; }
    .page .entry-content h4 { font-size: 18px !important; line-height: 1.4 !important; }
    .page .entry-content h5 { font-size: 16px !important; line-height: 1.4 !important; }
    .page .entry-content h6 { font-size: 14px !important; line-height: 1.4 !important; }

    /* 如果您分頁的 H2-H5 也有套用之前的漸層背景，確保 padding 在手機上不會太擠 */
    .page .entry-content h2, 
    .page .entry-content h3, 
    .page .entry-content h4, 
    .page .entry-content h5 {
        padding: 12px 15px !important;
    }
}

/* --- 12. 外部外掛強制保護隔離帶 --- */
/* 
   再次明確宣告：禁止上述規則干擾特定外掛標題 
*/
.jet-form-builder h1, .jet-form-builder h2, .jet-form-builder h3,
.glsr h1, .glsr h2, .glsr h3,
.yoast-breadcrumb,
.ow-weather-widget h1, .ow-weather-widget h2 {
    font-size: inherit !important;
    margin: inherit !important;
    padding: inherit !important;
    background: inherit !important;
    width: auto !important;
}
/* 浮動按鈕組總容器 */
#floating-buttons-group {
    position: fixed;
    bottom: 50px;
    right: 20px;
    display: none; /* 初始隱藏，由 JS 控制顯示 */
    flex-direction: column;
    gap: 10px; /* 統一按鈕之間的距離 */
    z-index: 10000;
}

/* 核心樣式：確保全部尺寸一致 */
.float-btn {
    width: 45px !important;
    height: 45px !important;
    border-radius: 5px;
    cursor: pointer;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 2px 4px 12px rgba(0,0,0,0.15);
    text-decoration: none !important;
    padding: 0 !important;
}

/* 統一控制按鈕內圖示的大小 */
.float-btn svg, .float-btn img {
    width: 24px;
    height: 24px;
    fill: white;
    color: white;
}

.float-btn:hover {
    transform: scale(1.1);
    filter: brightness(1.05);
}

/* Facebook 漸變藍 */
.fb-btn {
    background: linear-gradient(to right, #0052D4, #4364F7, #6FB1FC) !important;
}

/* IG 經典漸變 */
.ig-btn {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%) !important;
}

/* LINE 漸變綠 */
.line-btn {
    background: linear-gradient(to bottom, #00c300 0%, #008f00 100%) !important;
}

/* WhatsApp 漸變綠 (新加入) */
.wa-btn {
    background: linear-gradient(to bottom, #25D366 0%, #128C7E 100%) !important;
}

/* 處理圖示+文字垂直居中 (適用於 LINE/WA 若需加字) */
.line-btn-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.line-text {
    color: white;
    font-size: 8px;
    font-weight: bold;
    margin-top: 1px;
    font-family: Arial, sans-serif;
}

/* 回到頂部：採用漸變青色 */
.top-btn {
    background: linear-gradient(to right, #E0F2F1, #B2DFDB, #4DB6AC, #00897B) !important;
}

/* 手機版同步一致尺寸 */
@media screen and (max-width: 767px) {
    #floating-buttons-group {
        bottom: 40px;
        right: 15px;
        gap: 8px;
    }
    .float-btn {
        width: 42px !important;
        height: 42px !important;
    }
}


/* 手機版同步一致尺寸 */
@media screen and (max-width: 767px) {
    #floating-buttons-group {
        bottom: 40px;
        right: 15px;
        gap: 8px;
    }
    .float-btn {
        width: 42px !important;
        height: 42px !important;
    }
}
/* 設定 CF7 表單最大寬度為 1200px 並置中 */
.wpcf7 {
    max-width: 1200px !important;
    margin: 0 auto !important;
    width: 100% !important;
}

/* 確保所有輸入框、文字區域與按鈕自動填滿寬度 */
.wpcf7-form input[type="text"],
.wpcf7-form input[type="email"],
.wpcf7-form input[type="tel"],
.wpcf7-form select,
.wpcf7-form textarea {
    width: 100% !important;
    box-sizing: border-box !important;
    margin-bottom: 15px !important;
}

/* 響應式手機優化：當螢幕小於 1200px 時，自動適應寬度 */
@media screen and (max-width: 1200px) {
    .wpcf7 {
        padding-left: 20px !important;
        padding-right: 20px !important;
        box-sizing: border-box !important;
    }
}

/* yoast FAQ 整體容器：增加格線與間距 */
.schema-faq-section {
    border-bottom: 1px solid #ddd; /* 問題之間的底部分隔線 */
    padding: 20px 0;
    margin-bottom: 0;
}

/* 針對最後一個問題去掉底線 */
.schema-faq-section:last-child {
    border-bottom: none;
}

/* 問題 (Question) 的顏色與字體設定 */
.schema-faq-question {
    color: #0056b3 !important; /* 設定你想要的顏色，例如藍色 */
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 10px;
    display: block;
}

/* 答案 (Answer) 的顏色與背景設定 */
.schema-faq-answer {
    color: #333 !important; /* 答案顏色，通常用深灰色較易閱讀 */
    background-color: #f9f9f9; /* 加上淺灰色背景，區分感更強 */
    padding: 15px;
    border-left: 4px solid #0056b3; /* 在答案左側加一條色線，更專業 */
    border-radius: 4px;
}