/**
 * Parwatt 基础排版兜底（Mobile-first）
 *
 * 作用：为 H1–H6 与正文 p 提供统一、层次分明的默认排版。
 * 优先级：低于各页面/组件专用样式；关键属性不使用 !important，
 *         以便主题区块、Elementor 等构建器样式可以按需覆盖。
 */

:root {
    --pw-base-font-heading: 'MontserratMedium', sans-serif;
    --pw-base-font-body: 'LatoRegular', sans-serif;

    /* 移动端字号（基准 16px） */
    --pw-base-h1-size: 1.75rem;   /* 28px */
    --pw-base-h1-line: 1.25;
    --pw-base-h2-size: 1.5rem;    /* 24px */
    --pw-base-h2-line: 1.3;
    --pw-base-h3-size: 1.25rem;   /* 20px */
    --pw-base-h3-line: 1.35;
    --pw-base-h4-size: 1.125rem;  /* 18px */
    --pw-base-h4-line: 1.4;
    --pw-base-h5-size: 1rem;      /* 16px */
    --pw-base-h5-line: 1.45;
    --pw-base-h6-size: 0.875rem;  /* 14px */
    --pw-base-h6-line: 1.5;

    --pw-base-body-size: 0.9375rem; /* 15px */
    --pw-base-body-line: 1.625;
}

@media (min-width: 768px) {
    :root {
        /* 桌面端字号放大 */
        --pw-base-h1-size: 2.75rem;   /* 44px */
        --pw-base-h1-line: 1.2;
        --pw-base-h2-size: 2.25rem;   /* 36px */
        --pw-base-h2-line: 1.25;
        --pw-base-h3-size: 1.875rem;  /* 30px */
        --pw-base-h3-line: 1.33;
        --pw-base-h4-size: 1.5rem;    /* 24px */
        --pw-base-h4-line: 1.35;
        --pw-base-h5-size: 1.125rem;  /* 18px */
        --pw-base-h5-line: 1.4;
        --pw-base-h6-size: 1rem;      /* 16px */
        --pw-base-h6-line: 1.45;

        --pw-base-body-size: 1rem;    /* 16px */
        --pw-base-body-line: 1.625;
    }
}

/* 作用域：主内容区 + 经典编辑器/区块编辑器正文 */
#page .site-main h1,
#page .site-main h2,
#page .site-main h3,
#page .site-main h4,
#page .site-main h5,
#page .site-main h6,
.entry-content h1,
.entry-content h2,
.entry-content h3,
.entry-content h4,
.entry-content h5,
.entry-content h6,
.wp-block-post-content h1,
.wp-block-post-content h2,
.wp-block-post-content h3,
.wp-block-post-content h4,
.wp-block-post-content h5,
.wp-block-post-content h6 {
    font-family: var(--pw-base-font-heading);
    font-weight: 700;
    margin-top: 0;
    letter-spacing: -0.01em;
}

#page .site-main h1,
.entry-content h1,
.wp-block-post-content h1 {
    font-size: var(--pw-base-h1-size);
    line-height: var(--pw-base-h1-line);
    margin-bottom: 0.75em;
}

#page .site-main h2,
.entry-content h2,
.wp-block-post-content h2 {
    font-size: var(--pw-base-h2-size);
    line-height: var(--pw-base-h2-line);
    margin-bottom: 0.65em;
}

#page .site-main h3,
.entry-content h3,
.wp-block-post-content h3 {
    font-size: var(--pw-base-h3-size);
    line-height: var(--pw-base-h3-line);
    margin-bottom: 0.6em;
}

#page .site-main h4,
.entry-content h4,
.wp-block-post-content h4 {
    font-size: var(--pw-base-h4-size);
    line-height: var(--pw-base-h4-line);
    font-weight: 600;
    margin-bottom: 0.55em;
}

#page .site-main h5,
.entry-content h5,
.wp-block-post-content h5 {
    font-size: var(--pw-base-h5-size);
    line-height: var(--pw-base-h5-line);
    font-weight: 600;
    margin-bottom: 0.5em;
}

#page .site-main h6,
.entry-content h6,
.wp-block-post-content h6 {
    font-size: var(--pw-base-h6-size);
    line-height: var(--pw-base-h6-line);
    font-weight: 600;
    margin-bottom: 0.5em;
    text-transform: none;
    letter-spacing: 0.02em;
}

#page .site-main p,
.entry-content p,
.wp-block-post-content p {
    font-family: var(--pw-base-font-body);
    font-size: var(--pw-base-body-size);
    line-height: var(--pw-base-body-line);
    font-weight: 400;
    margin-top: 0;
    margin-bottom: 1em;
}

#page .site-main p:last-child,
.entry-content p:last-child,
.wp-block-post-content p:last-child {
    margin-bottom: 0;
}

/* 标题紧随段落时，保持舒适的上间距 */
#page .site-main p + h1,
#page .site-main p + h2,
#page .site-main p + h3,
#page .site-main p + h4,
#page .site-main p + h5,
#page .site-main p + h6,
.entry-content p + h1,
.entry-content p + h2,
.entry-content p + h3,
.entry-content p + h4,
.entry-content p + h5,
.entry-content p + h6,
.wp-block-post-content p + h1,
.wp-block-post-content p + h2,
.wp-block-post-content p + h3,
.wp-block-post-content p + h4,
.wp-block-post-content p + h5,
.wp-block-post-content p + h6 {
    margin-top: 1.5em;
}

/* 连续标题之间收紧间距 */
#page .site-main h1 + h2,
#page .site-main h2 + h3,
#page .site-main h3 + h4,
.entry-content h1 + h2,
.entry-content h2 + h3,
.entry-content h3 + h4,
.wp-block-post-content h1 + h2,
.wp-block-post-content h2 + h3,
.wp-block-post-content h3 + h4 {
    margin-top: 0.35em;
}
