/*
Theme Name: Twenty Twenty-Five Sungming
Theme URI: https://blog.sungming.pro
Description: Twenty Twenty-Five 的 child block theme，為 blog.sungming.pro 個人讀書筆記與思考整理網站量身設計。內容優先、適合長文閱讀、相容原生區塊編輯器。
Author: sungming
Author URI: https://blog.sungming.pro
Template: twentytwentyfive
Version: 0.1.0
Requires at least: 6.6
Tested up to: 6.7
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: twentytwentyfive-sungming
Tags: blog, block-theme, full-site-editing, one-column, custom-colors, custom-typography
*/

/*
 * 大多數樣式由 theme.json 處理（FSE 推薦做法）。
 * 這裡只放 theme.json 無法表達的細節：閱讀體驗微調、列印樣式。
 */

/* ---- 1. 長文閱讀微調 ---- */
.entry-content {
  word-break: break-word;
  overflow-wrap: break-word;
}

.entry-content p,
.entry-content li {
  text-align: justify;
  text-justify: inter-ideograph;
  hanging-punctuation: allow-end;
}

/* 中英混排間距 */
.entry-content :is(p, li, h1, h2, h3, h4, h5, h6) {
  letter-spacing: 0;
}

/* 引文左側強調線 */
.entry-content blockquote {
  border-inline-start: 3px solid var(--wp--preset--color--accent);
  padding-inline-start: 1.25em;
  font-style: normal;
  color: var(--wp--preset--color--muted);
}

/* 行內 code 與 pre 樣式 */
.entry-content :not(pre) > code {
  background: var(--wp--preset--color--subtle);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  font-size: 0.92em;
}

.entry-content pre {
  background: var(--wp--preset--color--subtle);
  padding: 1em 1.25em;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.92em;
  line-height: 1.6;
}

/* ---- 2. 文章 meta 一致樣式 ---- */
.post-meta {
  font-size: 0.875rem;
  color: var(--wp--preset--color--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75em 1em;
  align-items: center;
}

.post-meta a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.post-meta a:hover {
  color: var(--wp--preset--color--accent);
  border-bottom-color: var(--wp--preset--color--accent);
}

/* ---- 3. 文章卡片（首頁、Archive 列表） ---- */
.post-card {
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--wp--preset--color--subtle);
}

.post-card:last-child {
  border-bottom: none;
}

.post-card .wp-block-post-title a {
  text-decoration: none;
}

.post-card .wp-block-post-title a:hover {
  color: var(--wp--preset--color--accent);
}

/* ---- 4. 文章導覽（上一篇 / 下一篇） ---- */
.post-navigation {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-block-start: 3rem;
  padding-block-start: 2rem;
  border-top: 1px solid var(--wp--preset--color--subtle);
}

.post-navigation .nav-next {
  text-align: end;
}

/* ---- 5. 平滑捲動 + 錨點補償（為未來 TOC 預留） ---- */
html {
  scroll-behavior: smooth;
}

:target {
  scroll-margin-top: 2rem;
}

/* ---- 6. 列印樣式：去掉非內容元素 ---- */
@media print {
  header.wp-block-template-part,
  footer.wp-block-template-part,
  .wp-block-post-navigation-link,
  .post-navigation,
  .social-links {
    display: none !important;
  }

  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
    line-height: 1.6;
  }

  a {
    color: #000 !important;
    text-decoration: underline;
  }
}

/* ---- 7. 無障礙：focus 樣式 ---- */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--wp--preset--color--accent);
  outline-offset: 3px;
  border-radius: 2px;
}
