/* =========================================================
   end9.0：古腾堡区块前台样式（当前仅「按钮」区块）
   ---------------------------------------------------------
   背景：主题原先完全没有针对 .wp-block-* 的样式，按钮区块直接沿用
   WordPress 核心默认外观 —— 深灰底 #32373c + 9999px 全圆角，
   与日记本主题「白字绿底」的既有按钮基线完全冲突
   （基线见 book-skin.css 的 .mx_download_action：background:#099; color:#fff）。

   ── 生效范围 ──────────────────────────────────────────
   仅 #post_box 内的 .post-content / .entry-content（文章页 / 页面页）。
   首页摘要、归档、搜索、小工具区不受影响，保持 WordPress 默认。

   ── 为什么只覆盖「没单独设色的按钮」 ──────────────────
   若文章作者在编辑器右侧给按钮单独设过背景色，WordPress 会把颜色写成
   内联样式或 has-background 工具类，优先级高于本文件，因此不受影响。
   本文件只负责「未单独设色按钮」的主题化默认值。

   ── 为什么用独立文件而不是写进 main.css ───────────────
   main.css / post.css 用的是「普通文件名 + ?ver=」，而阿里云 ESA CDN
   忽略 ?ver=，改这两个文件可能最长 30 天不生效（主题注释已记录该坑）。
   本文件是新路径，CDN 必定回源，改动立即生效。

   ── 与 ext-link.css 的关系 ────────────────────────────
   正文内链统一为橙色 + 虚下划线后，按钮（本质也是 <a>）必须排除，
   否则会出现「绿底 + 橙色虚线」的冲突。ext-link.css 已用
   :not(.wp-block-button__link) 显式排除，两侧互不干扰。
   ========================================================= */

/* 默认（填充）样式：白字绿底 —— 与主题其它按钮同一套颜色 */
#post_box .post-content .wp-block-button__link,
#post_box .entry-content .wp-block-button__link {
    background-color: #099;
    color: #fff;
    border: 1px solid #099;
    border-radius: 6px;
    padding: 8px 20px;
    box-shadow: none;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.6;
    text-decoration: none;
    transition: background-color .18s ease, border-color .18s ease;
}

/* hover / focus / active 三态一并覆盖：
   核心 CSS 对 :hover 也设了深灰背景，只写基础态会出现「一悬停变回深灰」。 */
#post_box .post-content .wp-block-button__link:hover,
#post_box .post-content .wp-block-button__link:focus,
#post_box .post-content .wp-block-button__link:active,
#post_box .entry-content .wp-block-button__link:hover,
#post_box .entry-content .wp-block-button__link:focus,
#post_box .entry-content .wp-block-button__link:active {
    background-color: #077;
    border-color: #077;
    color: #fff;
    /* 与主题其它按钮统一：hover 只补一条虚线下划线 */
    text-decoration: underline;
    text-decoration-style: dashed;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
}

/* 「轮廓」样式（编辑器右侧 → 样式 → 轮廓）：透明底 + 绿字绿框 */
#post_box .post-content .is-style-outline > .wp-block-button__link,
#post_box .entry-content .is-style-outline > .wp-block-button__link {
    background-color: transparent;
    color: #099;
    border-color: #099;
}

#post_box .post-content .is-style-outline > .wp-block-button__link:hover,
#post_box .post-content .is-style-outline > .wp-block-button__link:focus,
#post_box .entry-content .is-style-outline > .wp-block-button__link:hover,
#post_box .entry-content .is-style-outline > .wp-block-button__link:focus {
    background-color: #099;
    color: #fff;
    border-color: #099;
}

/* 多个按钮横排时的间距：核心默认值偏大，收一收更贴合日记本版面 */
#post_box .post-content .wp-block-buttons,
#post_box .entry-content .wp-block-buttons {
    gap: 10px;
}
