/* ==========================================================================
   cpt-pages.css — 7 个 CPT 统一样式
   News / Events / Magazines / Publications / Programmes / Research / Person

   版本：v6.0


/* ══════════════════════════════════════════════════════════════
   1. 列表页（归档页）— 7 个 CPT 统一 hover 效果
      其余全部由 Blocksy 面板控制
   ══════════════════════════════════════════════════════════════ */

/* 卡片 hover 阴影 */
body.post-type-archive-news article.entry-card,
body.post-type-archive-event article.entry-card,
body.post-type-archive-magazine article.entry-card,
body.post-type-archive-publication article.entry-card,
body.post-type-archive-programme article.entry-card,
body.post-type-archive-research article.entry-card,
body.post-type-archive-person article.entry-card {
    transition: box-shadow 0.2s;
}

body.post-type-archive-news article.entry-card:hover,
body.post-type-archive-event article.entry-card:hover,
body.post-type-archive-magazine article.entry-card:hover,
body.post-type-archive-publication article.entry-card:hover,
body.post-type-archive-programme article.entry-card:hover,
body.post-type-archive-research article.entry-card:hover,
body.post-type-archive-person article.entry-card:hover {
    box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

/* 图片 hover 缩放 */
body.post-type-archive-news article.entry-card .ct-media-container,
body.post-type-archive-event article.entry-card .ct-media-container,
body.post-type-archive-magazine article.entry-card .ct-media-container,
body.post-type-archive-publication article.entry-card .ct-media-container,
body.post-type-archive-programme article.entry-card .ct-media-container,
body.post-type-archive-research article.entry-card .ct-media-container,
body.post-type-archive-person article.entry-card .ct-media-container {
    overflow: hidden;
}

body.post-type-archive-news article.entry-card .ct-media-container img,
body.post-type-archive-event article.entry-card .ct-media-container img,
body.post-type-archive-magazine article.entry-card .ct-media-container img,
body.post-type-archive-publication article.entry-card .ct-media-container img,
body.post-type-archive-programme article.entry-card .ct-media-container img,
body.post-type-archive-research article.entry-card .ct-media-container img,
body.post-type-archive-person article.entry-card .ct-media-container img {
    transition: transform 0.3s ease;
}

body.post-type-archive-news article.entry-card:hover .ct-media-container img,
body.post-type-archive-event article.entry-card:hover .ct-media-container img,
body.post-type-archive-magazine article.entry-card:hover .ct-media-container img,
body.post-type-archive-publication article.entry-card:hover .ct-media-container img,
body.post-type-archive-programme article.entry-card:hover .ct-media-container img,
body.post-type-archive-research article.entry-card:hover .ct-media-container img,
body.post-type-archive-person article.entry-card:hover .ct-media-container img {
    transform: scale(1.03);
}

/* 标题 hover 变色 — 由 Blocksy 面板 Title Font Color 的 hover 色控制 */

/* Magazine 卡片边框（特有） */
body.post-type-archive-magazine article.entry-card {
    border: 1px solid #e6e6e1;
}


/* ══════════════════════════════════════════════════════════════
/* ══════════════════════════════════════════════════════════════
   2. 详情页（单篇）— 按 sidebar 分组
   ══════════════════════════════════════════════════════════════
   原则：
     • 字体 / 颜色 / 排版样式 → 共用（不区分 sidebar）
     • 布局 / 宽度 / padding   → 按 sidebar 分组（has-sidebar / no-sidebar）

   样式只针对 body.single.has-sidebar 或 body.single.no-sidebar 配合详情页 main 内的元素。
   通过限定 main 来避免影响 header / footer / sidebar。
   ══════════════════════════════════════════════════════════════ */


/* --- 2.1 共用规则：字体、颜色、排版 ----------------------------------- */

/* 标题 H1 */
body.single.has-sidebar main h1.page-title,
body.single.no-sidebar main h1.page-title {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    font-size: 2rem;
    font-weight: 400;
    color: #002147;
    line-height: 1.3;
    margin: 0 !important;
    text-transform: none;
}

/* 标题区 entry-header */
body.single.has-sidebar main .entry-header,
body.single.no-sidebar main .entry-header {
    border-bottom: 1px solid #e6e6e1;
    padding-bottom: 20px;
    margin-bottom: 0;
}

/* 内容区段落 */
body.single.has-sidebar main .entry-content p,
body.single.no-sidebar main .entry-content p {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    font-size: 16px;
    line-height: 1.8;
    color: #444;
    margin-bottom: 20px;
}

/* 内容区 H2 */
body.single.has-sidebar main .entry-content h2,
body.single.no-sidebar main .entry-content h2 {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 400;
    color: #002147;
    margin: 32px 0 16px;
}

/* 内容区 H3 */
body.single.has-sidebar main .entry-content h3,
body.single.no-sidebar main .entry-content h3 {
    font-family: 'Lora', Georgia, 'Times New Roman', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: #002147;
    margin: 24px 0 12px;
}

/* 内容区链接 */
body.single.has-sidebar main .entry-content a,
body.single.no-sidebar main .entry-content a {
    color: #862433;
    text-decoration: underline;
}
body.single.has-sidebar main .entry-content a:hover,
body.single.no-sidebar main .entry-content a:hover {
    color: #002147;
}


/* --- 2.2 has-sidebar：标题 + 内容布局（贴左、padding 0）-------------- */

body.single.has-sidebar main .entry-header,
body.single.has-sidebar main .hero-section,
body.single.has-sidebar main .hero-section .entry-header,
body.single.has-sidebar main .entry-content {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: left !important;
    box-sizing: border-box;
}


/* --- 2.3 no-sidebar：标题 + 内容布局（贴左、padding 0）-------------- */

body.single.no-sidebar main .entry-header,
body.single.no-sidebar main .hero-section,
body.single.no-sidebar main .hero-section .entry-header,
body.single.no-sidebar main .entry-content {
    max-width: 100% !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: left !important;
    box-sizing: border-box;
}

/* --- 2.3.1 entry-content 内的所有子元素强制贴左全宽（突破 WP is-layout-constrained 居中）--- */
body.single.has-sidebar main .entry-content > *,
body.single.no-sidebar main .entry-content > *,
body.single.has-sidebar main .entry-content.is-layout-constrained > *,
body.single.no-sidebar main .entry-content.is-layout-constrained > *,
body.single.has-sidebar main .entry-content.is-layout-flow > *,
body.single.no-sidebar main .entry-content.is-layout-flow > * {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* 例外：alignleft / alignright / aligncenter 保留对齐方式 */
body.single.has-sidebar main .entry-content > .alignleft,
body.single.no-sidebar main .entry-content > .alignleft,
body.single.has-sidebar main .entry-content > .alignright,
body.single.no-sidebar main .entry-content > .alignright,
body.single.has-sidebar main .entry-content > .aligncenter,
body.single.no-sidebar main .entry-content > .aligncenter {
    width: auto !important;
    max-width: 100% !important;
}


/* --- 2.4 隐藏不需要的元素（共用）------------------------------------- */

body.single.has-sidebar main .entry-footer,
body.single.has-sidebar main .post-navigation,
body.single.no-sidebar main .entry-footer,
body.single.no-sidebar main .post-navigation {
    display: none;
}


/* ══════════════════════════════════════════════════════════════
   3. Footer 在详情页全屏（不挤到内容区中间）
   ══════════════════════════════════════════════════════════════ */

body.single.has-sidebar .ct-footer,
body.single.no-sidebar .ct-footer {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

body.single.has-sidebar .ct-footer [data-row],
body.single.no-sidebar .ct-footer [data-row] {
    width: 100% !important;
    max-width: 100% !important;
}

/* Content Block footer 全屏突破容器 */
body.single.has-sidebar .opgdi-footer-main,
body.single.no-sidebar .opgdi-footer-main {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    box-sizing: border-box !important;
}


/* ══════════════════════════════════════════════════════════════
   4. 移动端响应式
   ══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    body.single.has-sidebar main h1.page-title,
    body.single.no-sidebar main h1.page-title {
        font-size: 1.6rem;
    }

    body.single.has-sidebar main .entry-content,
    body.single.no-sidebar main .entry-content {
        padding: 20px 20px 40px;
    }

    body.single.has-sidebar main .hero-section .entry-header,
    body.single.no-sidebar main .hero-section .entry-header {
        padding-left: 20px;
        padding-right: 20px;
    }
}

@media (max-width: 600px) {
    body.single.has-sidebar main .entry-content img,
    body.single.no-sidebar main .entry-content img {
        max-width: 100%;
    }
}


/* ══════════════════════════════════════════════════════════════
   5. no-sidebar 单页 article 强制在 Maximum Site Width 内居中
   （跟 Header menu 对齐）
   ══════════════════════════════════════════════════════════════ */

body.single.no-sidebar #main > div.ct-container-full > article,
body.single.no-sidebar main > div.ct-container-full > article,
body.single.no-sidebar div.ct-container-full > article {
    max-width: var(--theme-normal-container-max-width, 1600px) !important;
    width: var(--theme-container-width, 90vw) !important;
    margin-left: auto !important;
    margin-right: auto !important;
    --theme-block-max-width: var(--theme-normal-container-max-width, 1600px) !important;
    --theme-block-width: var(--theme-container-width, 90vw) !important;
}
