/* =============================================
   全属于祢 · 文章图片、正文与目录页样式
   ============================================= */


/* ---------- 1. 正文图片：最多 300px，保持比例 ---------- */

/* 前台文章与页面 */
.entry-content .wp-block-image {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 300px !important;
    margin: 0 auto 24px !important;
}

.entry-content .wp-block-image figure {
    box-sizing: border-box;
    width: auto !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.entry-content .wp-block-image img {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* 教宗训导中的竖向纹章：最多 150px 高，不放大小图 */
article.category-785732741 .entry-content .wp-block-image img[style*="aspect-ratio:0."] {
    max-width: 100% !important;
    max-height: 150px !important;
}


/* ---------- 2. 编辑器画布：图片最多 300px ---------- */

.editor-styles-wrapper .wp-block-image,
.block-editor-block-list__layout .wp-block-image {
    box-sizing: border-box;
    width: 100% !important;
    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;
    width: auto !important;
    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;
    width: auto !important;
    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;
}


/* ---------- 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: left;
}


/* ---------- 4. “与主叹啡”与“每日圣言”目录页 ---------- */

/* 页面标题 */
body.page-id-23906 article.page > .entry-header,
body.page-id-64954 article.page > .entry-header {
    text-align: center;
    margin-bottom: 1.5em;
}

body.page-id-23906 article.page > .entry-header .entry-title,
body.page-id-64954 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 img {
    max-width: 300px !important;
    max-height: none !important;
}

/* “每日圣言”页顶部图片：最多 160px */
body.page-id-64954 article.page .entry-content > .wp-block-image {
    max-width: 160px !important;
}

body.page-id-64954 article.page .entry-content > .wp-block-image img {
    max-width: 100% !important;
    max-height: 160px !important;
}


/* ---------- 5. 目录页文章列表卡片 ---------- */

/* 桌面端两列 */
body.page-id-23906 .wp-block-newspack-blocks-homepage-articles > div[data-posts],
body.page-id-64954 .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,
body.page-id-64954 .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,
body.page-id-64954 .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,
body.page-id-64954 .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,
body.page-id-64954 .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,
body.page-id-64954 .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,
body.page-id-64954 .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),
body.page-id-64954 .wp-block-newspack-blocks-homepage-articles time.updated:not(.entry-date) {
    display: none;
}


/* ---------- 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],
    body.page-id-64954 .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,
    body.page-id-64954 .wp-block-newspack-blocks-homepage-articles article {
        padding: 15px 16px;
    }
}
