/*
 Theme Name:   Puock Child (puock-child)
 Theme URI:    https://github.com/Licoy/wordpress-theme-puock
 Description:  Puock 主题子主题 - 自定义文章 H2/H3 标题样式
 Author:       Your Name
 Author URI:   https://yourwebsite.com
 Template:     wordpress-theme-puock-2.9.2
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Tags:         custom-styles
 Text Domain:  puock-child
*/

/* 注意：样式加载顺序在 functions.php 中控制，子主题样式最后加载以确保覆盖父主题 */

/* ===================== 代码样式覆盖（最高优先级 - 覆盖所有 code） ===================== */
/* 最简单直接的选择器，确保覆盖所有 code 元素 */
code {
    font-family: inherit !important;
    margin: 2px 4px !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
    background-color: #f1f5f9 !important;
    display: inline !important;
    color: #065f46 !important;
    border: none !important;
    box-shadow: none !important;
    line-height: 1.6 !important;
    text-indent: initial !important;
}

/* pre 内的 code 保持透明背景 */
pre code {
    background-color: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    color: inherit !important;
}

/* 暗黑模式代码样式 */
@media (prefers-color-scheme: dark) {
    code {
        background-color: #1e293b !important;
        color: #a7f3d0 !important;
    }
    pre code {
        background-color: transparent !important;
    }
}

/* 父主题用 ::after 伪元素生成蓝色横线，必须完全禁用（H2::after 用于换行，单独处理） */
.entry-content h3::after,
.entry-content h4::after,
#page .entry-content h3::after,
#page .entry-content h4::after,
.block-content .entry-content h3::after,
.block-content .entry-content h4::after,
#post .entry-content-box h3::after,
#post .entry-content-box h4::after,
article .entry-content h3::after,
article .entry-content h4::after,
.post-content h3::after,
.post-content h4::after,
.pk-content h3::after,
.pk-content h4::after {
    content: none !important;
    display: none !important;
    border: none !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    background: none !important;
    box-shadow: none !important;
}

/* ===================== H2 标题样式（覆盖父主题） ===================== */
.entry-content h2,
#page .entry-content h2,
.block-content .entry-content h2,
#post .entry-content-box h2,
article .entry-content h2,
.post-content h2,
.pk-content h2 {
    position: static !important;
    display: block !important;
    width: fit-content !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #065f46 !important;
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%) !important;
    padding: 12px 20px 12px 18px !important;
    border-radius: 10px !important;
    border-left: 5px solid #34d399 !important;
    border-right: none !important;
    border-top: none !important;
    border-bottom: none !important;
    box-shadow: 0 4px 14px rgba(52, 211, 153, 0.15) !important;
    line-height: 1.5 !important;
    margin: 28px 0 16px 0 !important;
}

.entry-content h2::before,
#page .entry-content h2::before,
.block-content .entry-content h2::before,
#post .entry-content-box h2::before,
article .entry-content h2::before,
.post-content h2::before,
.pk-content h2::before {
    display: none !important;
    content: none !important;
}

/* H2::after 禁用（改用 display:block 自然换行） */
.entry-content h2::after,
#page .entry-content h2::after,
.block-content .entry-content h2::after,
#post .entry-content-box h2::after,
article .entry-content h2::after,
.post-content h2::after,
.pk-content h2::after {
    content: none !important;
    display: none !important;
}

/* ===================== H3 标题样式（覆盖父主题） ===================== */
.entry-content h3,
#page .entry-content h3,
.block-content .entry-content h3,
#post .entry-content-box h3,
article .entry-content h3,
.post-content h3,
.pk-content h3 {
    position: static !important;
    display: inline-flex !important;
    align-items: center !important;
    font-size: 22px !important;
    font-weight: 700 !important;
    color: #374151 !important;
    gap: 8px !important;
    line-height: 1.5 !important;
    margin: 24px 0 12px 4px !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.entry-content h3::before,
#page .entry-content h3::before,
.block-content .entry-content h3::before,
#post .entry-content-box h3::before,
article .entry-content h3::before,
.post-content h3::before,
.pk-content h3::before {
    content: attr(data-num) '/' !important;
    color: #10b981 !important;
    font-size: 24px !important;
    font-weight: 700 !important;
    letter-spacing: -1px !important;
    flex-shrink: 0 !important;
}

/* ===================== H4 样式（覆盖父主题） ===================== */
.entry-content h4,
#page .entry-content h4,
.block-content .entry-content h4,
#post .entry-content-box h4,
article .entry-content h4,
.post-content h4,
.pk-content h4 {
    position: static !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    margin: 20px 0 12px 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.entry-content h4::before,
.entry-content h4::after,
#page .entry-content h4::before,
#page .entry-content h4::after,
.block-content .entry-content h4::before,
.block-content .entry-content h4::after {
    display: none !important;
    content: none !important;
}

/* ===================== 暗黑模式支持 ===================== */
@media (prefers-color-scheme: dark) {
    .entry-content h2,
    #page .entry-content h2,
    .block-content .entry-content h2,
    #post .entry-content-box h2,
    article .entry-content h2,
    .post-content h2,
    .pk-content h2 {
        color: #a7f3d0 !important;
        background: linear-gradient(135deg, #064e3b 0%, #065f46 100%) !important;
        border-left-color: #34d399 !important;
        box-shadow: 0 4px 14px rgba(52, 211, 153, 0.2) !important;
    }

    .entry-content h3,
    #page .entry-content h3,
    .block-content .entry-content h3,
    #post .entry-content-box h3,
    article .entry-content h3,
    .post-content h3,
    .pk-content h3 {
        color: #d1d5db !important;
    }

    .entry-content h3::before,
    #page .entry-content h3::before,
    .block-content .entry-content h3::before,
    #post .entry-content-box h3::before,
    article .entry-content h3::before,
    .post-content h3::before,
    .pk-content h3::before {
        color: #34d399 !important;
    }

    .entry-content h4,
    #page .entry-content h4,
    .block-content .entry-content h4,
    #post .entry-content-box h4,
    article .entry-content h4,
    .post-content h4,
    .pk-content h4 {
        color: #9ca3af !important;
    }
}
