/* =========================================
   編輯女子網站 - 最終修正版 CSS (2025/12/10 v4)
   功能：內文空兩格(排除摘要/網站說明)、摘要樣式同步內文
   ========================================= */

/* 隱藏存檔頁面、分類頁面的文章摘要 */
.entry-summary, 
.post-excerpt, 
.archive-description {
    display: none !important;
}

/* 隱藏單篇文章頁面中可能出現的摘要描述 */
.single .entry-content > .excerpt,
.taxonomy-description {
    display: none !important;
}

/* --- 1. 全站文字基礎設定 --- */
body {
	line-height: 2.5;
	color: #333;
}

article,
.entry-content,
.post-content,
.page-content {
	line-height: 2.5;
	letter-spacing: .08em;
}

/* --- 2. 段落 (Paragraph) 設定 --- */
/* 目標：只有內文段落空兩格 */
p, 
.entry-content p {
	line-height: 2.5 !important;
	margin-bottom: 3em;
	letter-spacing: .08em;
	text-align: justify;
	text-justify: inter-ideograph;
	text-indent: 2em; /* 內文縮排 */
}

/* 【修正】文章摘要 (Excerpt) 設定 */
.entry-summary p,
.entry-summary {
	text-indent: 0 !important;       /* 維持不縮排 */
	font-size: 100% !important;      /* 【新增】大小跟內文一樣 */
	line-height: 2.5 !important;     /* 【新增】行高跟內文一樣 */
	letter-spacing: .08em !important;/* 【新增】字距跟內文一樣 */
}

/* 【修正】網站說明文字 (Tagline) 不需要縮排 */
.site-description,
.taxonomy-description {
	text-indent: 0 !important;
}

/* --- 3. 引用區塊 (Blockquote) --- */
/* 例外：引用內容不縮排 */
blockquote, 
.entry-content blockquote {
	font-size: 100% !important;
	line-height: 2.5 !important;
	letter-spacing: .08em !important;
	font-style: normal !important;
	text-align: justify !important;
	text-indent: 0 !important; /* 強制不縮排 */
	
	margin: 3em 0 !important;
	padding: 2em 1.5em !important;
	border-left: 4px solid #ccc !important;
	background-color: #f9f9f9 !important;
	border-radius: 4px;
	color: #333 !important;
}

/* 確保引用內的段落也被歸零 */
blockquote p, 
.entry-content blockquote p {
	margin: 0 !important;
	line-height: 2.5 !important;
	letter-spacing: .08em !important;
	text-indent: 0 !important;
}

/* --- 4. 表格 (Table) 優化 --- */
.entry-content table {
	width: 100%;
	border-collapse: collapse;
	margin: 2em 0;
	font-size: 16px;
	line-height: 1.8;
}

.entry-content th, 
.entry-content td {
	padding: .75em 1em;
	border: 1px solid #ddd;
	vertical-align: top;
}

/* 表格標題 (維持靠左、不縮排) */
.entry-content th {
	background-color: #f5f5f5;
	font-weight: 700;
	white-space: nowrap;
	color: #333;
	text-align: left; 
	text-indent: 0 !important;
}

/* 表格內容 (分散對齊、不縮排) */
.entry-content td {
	background-color: #fff;
	color: #333;
	text-align: justify; /* 分散對齊 */
	text-justify: inter-ideograph;
	text-indent: 0 !important; /* 強制不縮排 */
}

/* --- 5. 手機版表格響應式設計 --- */
@media screen and (max-width: 600px) {
	.entry-content table, .entry-content thead, .entry-content tbody, 
	.entry-content th, .entry-content td, .entry-content tr {
		display: block;
		width: 100%;
	}
	
	.entry-content tr {
		margin-bottom: 1em;
		border: 1px solid #ccc;
		padding: .5em;
		background: #fff;
	}
	
	.entry-content th {
		background: none;
		border: none;
		font-weight: 700;
		color: #666;
		padding-bottom: 0;
	}
	
	.entry-content td {
		border: none;
		padding: .5em 0;
	}
}

/* --- 6. 標題與其他元素例外處理 --- */
/* 例外：標題、列表、代碼都不縮排 */
h1, .entry-content h1,
h2, .entry-content h2,
h3, .entry-content h3,
h4, .entry-content h4,
h5, .entry-content h5,
h6, .entry-content h6,
li, .entry-content li,
pre, code {
	text-indent: 0 !important;
}

/* --- 7. 其他設定 --- */
.entry-content ul, 
.entry-content ol {
	text-align: justify;
	list-style-position: outside;
	padding-left: 1.5em;
}

/* 隱藏首頁導覽標記 */
.home #breadcrumbs, 
.blog #breadcrumbs,
.home .yoast-breadcrumbs, 
.blog .yoast-breadcrumbs {
	display: none !important;
}

/* --- 8. 詩句 (Verse) 樣式同步修正 (含邊距與左右對齊) --- */
.wp-block-verse,
.entry-content .wp-block-verse {
	line-height: 2.5 !important;           /* 同步本文行高 */
	letter-spacing: .08em !important;      /* 同步本文字距 */
	margin-bottom: 3em !important;         /* 同步段落下邊距 */
	font-family: inherit !important;       /* 強制繼承本文字體 */
	text-indent: 0 !important;             /* 詩句不縮排 */
	white-space: pre-wrap !important;      /* 確保自動換行 */
	
	/* --- 修正：增加文字與外框的間距 --- */
	padding: 1.5em !important;             /* 增加上下左右的內邊距 */
	background-color: #fcfcfc !important;  /* 稍微給予淺色背景，突顯區塊感（選填） */
	border: 1px solid #eeeeee !important;  /* 若需外框可保留此行，若不需要可刪除 */
	border-radius: 4px;                    /* 邊框圓角 */

	/* --- 左右對齊設定 --- */
	text-align: justify !important;        
	text-justify: inter-ideograph !important;
}

/* --- 9. 特殊段落樣式 (Info, Success, Warning, error) 排除縮排 --- */
p.is-style-info,
p.is-style-success,
p.is-style-warning,
p.is-style-error,
.entry-content p.is-style-info,
.entry-content p.is-style-success,
.entry-content p.is-style-warning,
.entry-content p.is-style-error {
	text-indent: 0 !important; /* 強制取消空兩格 */
}

/* --- 11. 標題 (H1-H6) 行距與對齊最終修正 --- */
h1, h2, h3, h4, h5, h6,
.entry-content h1, 
.entry-content h2, 
.entry-content h3, 
.entry-content h4, 
.entry-content h5, 
.entry-content h6 {
    /* 1. 修正行與行的間隔 (與內文 2.5 相同) */
    line-height: 2.5 !important; 
    
    /* 2. 標題左右對齊 (同內文效果) */
    text-align: justify !important;
    text-justify: inter-ideograph !important;
    
    /* 3. 同步字距 */
    letter-spacing: .08em !important;
    
    /* 4. 確保多行標題在 Apple/Android 上的渲染一致 */
    word-break: break-all;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- 12. 手機版與跨系統優化 (Android & Apple) --- */
@media screen and (max-width: 768px) {
    h1, h2, h3, h4, h5, h6 {
        /* 手機版標題字體較大時，若 2.5 顯得太鬆散，可於此處微調為 2.0-2.2 */
        line-height: 2.5 !important; 
        margin-bottom: 1.5em !important;
    }
    
    /* 針對 iOS Safari 瀏覽器優化對齊 */
    h1, h2, h3, h4, h5, h6 {
        -webkit-text-align-last: left; /* 確保最後一行不被強行拉散 */
    }
}
/* 修正 Easy Table of Contents 對齊與浮動問題 */
#ez-toc-container {
    width: 100% !important;           /* 強制寬度為 100% */
    max-width: 100% !important;       /* 確保不超過容器 */
    float: none !important;           /* 解除靠左或靠右浮動，解決文字擠到右邊的問題 */
    clear: both !important;           /* 確保上下方都不會有其他元素擠在一起 */
    box-sizing: border-box !important; /* 確保邊框與內距不會撐開總寬度 */
    margin-left: 0 !important;        /* 重置左邊距 */
    margin-right: 0 !important;       /* 重置右邊距 */
    margin-top: 10px !important;      /* 與上方標題保持距離 */
    margin-bottom: 25px !important;   /* 與下方內文保持距離 */
    display: block !important;        /* 強制以區塊模式顯示 */
}

/* 如果目錄內部的標題也想微調，可以加上這個（選用） */
#ez-toc-container .ez-toc-title {
    text-align: left !important;      /* 確保目錄標題也是靠左對齊 */
}

.single .sd-block::before {
  content: "本文僅撰文當下之實務判決分享，非具體個案之法律意見；也請留心法規均有修正可能。";
  display: block;
  border: 1.5px dashed #c8c0b5;
  border-radius: 6px;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.9;
  color: #555;
  letter-spacing: .06em;
  text-indent: 0;
  text-align: justify;
  text-justify: inter-ideograph;
  margin: 0 0 1.5em 0;
}