/* =============================================
   全属于祢 · 图片、文章与目录页样式
   合并版：2026-11-09
   说明：正文图片保留 Gutenberg 内联 width；专项图片只设 max-width 上限，不强制放大。
   ============================================= */

/* ---------- 1. 正文图片：普通图片最多 300px，保留区块设定宽度 ---------- */
:where(body:not(.page-id-64954)) .entry-content .wp-block-image {
    box-sizing: border-box;
    max-width: 300px !important;
    margin: 0 auto 24px !important;
}
:where(body:not(.page-id-64954)) .entry-content .wp-block-image figure {
    box-sizing: border-box;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
:where(body:not(.page-id-64954)) .entry-content .wp-block-image img {
    display: block;
    height: auto !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* ---------- 1A. 常用徽章与联合图：按媒体 ID 设统一上限 ---------- */
/* 紧裁牧徽（本笃十六世、方济各、圣若望保禄二世）：最多 150px 宽；保留较小的编辑器宽度 */
.single-post .entry-content img.wp-image-61,
.single-post .entry-content img.wp-image-617,
.single-post .entry-content img.wp-image-14952,
.single-post .entry-content img.wp-image-91064 {
    box-sizing: border-box;
    max-width: min(150px, 100%) !important;
    max-height: none !important;
    height: auto !important;
}
/* 全属于祢徽章：目前存在 150 / 200 / 250px 设置，统一限制最大 200px，不放大小图 */
.single-post .entry-content img.wp-image-130455,
.single-post .entry-content img.wp-image-120724 {
    box-sizing: border-box;
    max-width: min(200px, 100%) !important;
    max-height: none !important;
    height: auto !important;
}
/* 良十四世牧徽为 16:9 横画布，徽章居中留白；最多 300px，保持原比例 */
.single-post .entry-content img.wp-image-67470 {
    box-sizing: border-box;
    max-width: min(300px, 100%) !important;
    height: auto !important;
}
/* 梵蒂冈新闻联合图、乐仁社联合图：均以 300px 为上限 */
.single-post .entry-content img.wp-image-121059,
.single-post .entry-content img.wp-image-121061 {
    box-sizing: border-box;
    max-width: min(300px, 100%) !important;
    height: auto !important;
}
/* 乐仁社单独标志：目前内联宽度约 121px，保留并限制最大尺寸 */
.single-post .entry-content img.wp-image-55268 {
    box-sizing: border-box;
    max-width: min(121px, 100%) !important;
    height: auto !important;
}

/* ---------- 1B. 专题横幅与《大众苦路》图片：解除全站 300px 上限 ---------- */
/* 原始标记/CDN 图片宽度为约 760px；不改图片自身 width，也不扩大正文外层 */
body.postid-576 .entry-content .wp-block-image,
body.page-id-6122 .entry-content .wp-block-image,
body.page-id-15223 .entry-content .wp-block-image,
body.page-id-39814 .entry-content .wp-block-image,
body.page-id-58987 .entry-content .wp-block-image,
body.page-id-56122 .entry-content .wp-block-image,
body.page-id-96500 .entry-content .wp-block-image,
body.postid-12053 .entry-content .wp-block-image {
    max-width: min(760px, 100%) !important;
}
/* 2020 年祈祷周横幅单独收窄；保留更小的编辑器内联宽度 */
body.postid-576 .entry-content .wp-block-image {
    max-width: min(500px, 100%) !important;
}

/* 教宗训导中的竖向纹章不再按不同 inline aspect-ratio 单独限高；统一按上方媒体 ID 规则处理 */

/* ---------- 2. 编辑器画布：普通图片最多 300px ---------- */
.editor-styles-wrapper .wp-block-image,
.block-editor-block-list__layout .wp-block-image {
    box-sizing: border-box;
    max-width: 300px !important;
    margin: 0 auto 24px !important;
}
.editor-styles-wrapper .wp-block-image figure,
.block-editor-block-list__layout .wp-block-image figure {
    box-sizing: border-box;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
.editor-styles-wrapper .wp-block-image img,
.block-editor-block-list__layout .wp-block-image img {
    display: block;
    height: auto !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}
/* 编辑器中的竖向图片：通常最高 150px */
.editor-styles-wrapper .wp-block-image img[style*="aspect-ratio:0."],
.block-editor-block-list__layout .wp-block-image img[style*="aspect-ratio:0."] {
    max-height: 150px !important;
}

/* 徽章/联合图在编辑器与前台使用相同的最大尺寸；较小的 inline width 不会被放大 */
.editor-styles-wrapper .wp-block-image img.wp-image-61,
.editor-styles-wrapper .wp-block-image img.wp-image-617,
.editor-styles-wrapper .wp-block-image img.wp-image-14952,
.editor-styles-wrapper .wp-block-image img.wp-image-91064,
.block-editor-block-list__layout .wp-block-image img.wp-image-61,
.block-editor-block-list__layout .wp-block-image img.wp-image-617,
.block-editor-block-list__layout .wp-block-image img.wp-image-14952,
.block-editor-block-list__layout .wp-block-image img.wp-image-91064 {
    max-width: min(150px, 100%) !important;
    max-height: none !important;
    height: auto !important;
}
.editor-styles-wrapper .wp-block-image img.wp-image-130455,
.editor-styles-wrapper .wp-block-image img.wp-image-120724,
.block-editor-block-list__layout .wp-block-image img.wp-image-130455,
.block-editor-block-list__layout .wp-block-image img.wp-image-120724 {
    max-width: min(200px, 100%) !important;
    max-height: none !important;
    height: auto !important;
}
.editor-styles-wrapper .wp-block-image img.wp-image-67470,
.editor-styles-wrapper .wp-block-image img.wp-image-121059,
.editor-styles-wrapper .wp-block-image img.wp-image-121061,
.block-editor-block-list__layout .wp-block-image img.wp-image-67470,
.block-editor-block-list__layout .wp-block-image img.wp-image-121059,
.block-editor-block-list__layout .wp-block-image img.wp-image-121061 {
    max-width: min(300px, 100%) !important;
    height: auto !important;
}
.editor-styles-wrapper .wp-block-image img.wp-image-55268,
.block-editor-block-list__layout .wp-block-image img.wp-image-55268 {
    max-width: min(121px, 100%) !important;
    height: auto !important;
}

/* Gutenberg 编辑器中的专题横幅/苦路图片：仅放宽这些已核对图片所在图块的上限 */
.editor-styles-wrapper .wp-block-image:has(img.wp-image-552),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-6123),
.editor-styles-wrapper .wp-block-image:has(img[src*="ccc_2023_wpcu_webbanner_eng.png"]),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-39816),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-58988),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-56124),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-96501),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-12056),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-12057),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-12058),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-12059),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-12060),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-12061),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-12062),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-12063),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-12064),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-12065),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-12066),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-12067),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-12068),
.editor-styles-wrapper .wp-block-image:has(img.wp-image-12069),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-552),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-6123),
.block-editor-block-list__layout .wp-block-image:has(img[src*="ccc_2023_wpcu_webbanner_eng.png"]),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-39816),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-58988),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-56124),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-96501),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-12056),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-12057),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-12058),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-12059),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-12060),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-12061),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-12062),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-12063),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-12064),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-12065),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-12066),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-12067),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-12068),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-12069) {
    max-width: min(760px, 100%) !important;
}
/* 2020 年祈祷周横幅：编辑器预览同步使用 500px 上限 */
.editor-styles-wrapper .wp-block-image:has(img.wp-image-552),
.block-editor-block-list__layout .wp-block-image:has(img.wp-image-552) {
    max-width: min(500px, 100%) !important;
}

/* ---------- 3. 单篇文章正文与版权信息 ---------- */
.single-post .entry-content {
    text-align: justify;
    word-break: break-word;
    overflow-wrap: break-word;
}
.single-post .entry-content p {
    line-height: 1.9;
    margin-bottom: 1.2em;
}
/* 版权段落：融入正文样式，并始终居中 */
.single-post .entry-content > p.has-text-align-center.wp-block-paragraph:last-of-type {
    font-size: inherit;
    color: inherit;
    line-height: inherit;
    border: 0;
    padding: 0;
    margin: 1.2em 0 0;
    text-align: center !important;
}

/* ---------- 4. “与主叹啡”目录页 ---------- */
/* 页面标题 */
body.page-id-23906 article.page > .entry-header {
    text-align: center;
    margin-bottom: 1.5em;
}
body.page-id-23906 article.page > .entry-header .entry-title {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    line-height: 1.3;
}
/* “与主叹啡”页顶部图片：最多 300px */
body.page-id-23906 article.page .entry-content > .wp-block-image {
    max-width: 300px !important;
}
body.page-id-23906 article.page .entry-content > .wp-block-image img {
    max-width: 100% !important;
    max-height: none !important;
}

/* ---------- 5. “与主叹啡”目录页文章列表卡片 ---------- */
/* 桌面端两列 */
body.page-id-23906 .wp-block-newspack-blocks-homepage-articles > div[data-posts] {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
/* 隐藏“与主叹啡”列表中的空白分区标题 */
body.page-id-23906 .wp-block-newspack-blocks-homepage-articles h2.article-section-title {
    display: none;
}
/* 卡片外观 */
body.page-id-23906 .wp-block-newspack-blocks-homepage-articles article {
    box-sizing: border-box;
    min-width: 0;
    margin: 0 !important;
    padding: 18px 20px;
    border: 1px solid #e7e4df !important;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(35, 45, 55, 0.06);
    text-align: left;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}
body.page-id-23906 .wp-block-newspack-blocks-homepage-articles article:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(35, 45, 55, 0.12);
}
/* 卡片标题 */
body.page-id-23906 .wp-block-newspack-blocks-homepage-articles .entry-title {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.65;
}
body.page-id-23906 .wp-block-newspack-blocks-homepage-articles .entry-title a {
    color: #334b5c;
    text-decoration: none;
}
body.page-id-23906 .wp-block-newspack-blocks-homepage-articles .entry-title a:hover {
    color: #8b5e3c;
    text-decoration: underline;
    text-underline-offset: 3px;
}
/* 日期 */
body.page-id-23906 .wp-block-newspack-blocks-homepage-articles .entry-meta {
    margin-top: 8px;
    color: #7a7a7a;
    font-size: 0.85rem;
}
/* 隐藏单独显示的更新日期，保留发布日期 */
body.page-id-23906 .wp-block-newspack-blocks-homepage-articles time.updated:not(.entry-date) {
    display: none;
}

/* ---------- 5A. 全站“继续阅读/加载更多文章”触屏点击优化 ---------- */
/* 全站这类 Newspack 按钮使用同一 data-next AJAX 结构；给手机保留清晰、稳定的点击目标 */
:where(body:not(.page-id-64954)) .wp-block-newspack-blocks-homepage-articles button[data-next] {
    position: relative;
    z-index: 2;
    min-width: 44px;
    min-height: 48px;
    touch-action: manipulation;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(51, 75, 92, 0.16);
}
/* 标签和旋转加载图是按钮内部装饰，不让它们成为独立触摸命中目标 */
:where(body:not(.page-id-64954)) .wp-block-newspack-blocks-homepage-articles button[data-next] > span {
    pointer-events: none;
}
/* 文章标题链接采用直接触屏操作，保留浏览器默认链接行为 */
:where(body:not(.page-id-64954)) .wp-block-newspack-blocks-homepage-articles .entry-title a {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(51, 75, 92, 0.12);
}
/* 手机端停用所有 Newspack 文章卡片的悬停位移，避免触摸时点击目标移动 */
@media (max-width: 700px) {
    :where(body:not(.page-id-64954)) .wp-block-newspack-blocks-homepage-articles article:hover {
        transform: none !important;
    }
    :where(body:not(.page-id-64954)) .wp-block-newspack-blocks-homepage-articles button[data-next]:active {
        filter: brightness(0.94);
    }
}

/* ---------- 6. 手机端适配 ---------- */
@media (max-width: 700px) {
    .single-post .entry-content {
        text-align: left;
    }
    body.page-id-23906 .wp-block-newspack-blocks-homepage-articles > div[data-posts] {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    body.page-id-23906 .wp-block-newspack-blocks-homepage-articles article {
        padding: 15px 16px;
    }
}