/*
 Theme Name:   无限核
 Theme URI:    https://wuxianhe.wspia.cn/
 Description:  「无限核」站点子主题，父主题为二〇二五（Twenty Twenty-Five）。视觉风格与封面 space-2.html 统一：深色页头、金色细线、衬线标题、黑体正文、淡冰蓝点缀。
 Author:       无限核
 Author URI:   https://wuxianhe.wspia.cn/
 Template:     twentytwentyfive
 Version:      0.1.0
 License:      GPL-2.0-or-later
 License URI:  https://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  wuxianhe-child
 Tags:         one-column, custom-colors, custom-menu, custom-logo, editor-style, featured-images, full-site-editing, block-patterns
*/

/* ==========================================================
   配色令牌 —— 与封面 space-2.html 保持一致
   ========================================================== */
:root {
  /* 封面原色 */
  --wxh-gold:        #c9973f;   /* 金：页头分隔线、按钮描边、重点标题下划线 */
  --wxh-gold-bright: #f0c96a;   /* 亮金：悬停态、激活态 */
  --wxh-gold-deep:   #8f6b1e;   /* 深金：导航、职业讨论区标题 */
  --wxh-arcane:      #39a7d8;   /* 淡冰蓝：链接、标签、小点缀 */
  --wxh-ink:         #1a2431;   /* 深墨：页头底色、主文字色（亮色模式下的深底区域） */
  --wxh-paper:       #f4edda;   /* 羊皮纸：正文背景 */
  --wxh-paper-dim:   #e7dcc0;   /* 暗羊皮纸：卡片底色、区块分隔 */
  --wxh-card:        #fffaf0;   /* 亮卡白 */
  --wxh-card-line:   #d8c795;   /* 卡片描边 */
  --wxh-section-text: #2b3442;  /* 正文深灰 */
  --wxh-section-sub:  #5d6572;  /* 副文灰 */

  /* 字号基准 */
  --wxh-font-serif: "Noto Serif SC", "Songti SC", "STSong", "Source Han Serif SC", serif;
  --wxh-font-sans:  "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;

  /* 间距 */
  --wxh-gap-xs: 0.5rem;
  --wxh-gap-sm: 1rem;
  --wxh-gap-md: 2rem;
  --wxh-gap-lg: 4rem;
}

/* ==========================================================
   全局排版 —— 正文用黑体（sans），标题用衬线（serif）
   ========================================================== */
body {
  font-family: var(--wxh-font-sans);
  color: var(--wxh-section-text);
  background: var(--wxh-paper);
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6,
.site-title,
.entry-title,
.wp-block-heading {
  font-family: var(--wxh-font-serif);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--wxh-ink);
}

/* ==========================================================
   页头 —— 深色底 + 金色细线
   ========================================================== */
.site-header,
#site-header,
header.site-header,
.wp-block-template-part[area="header"] {
  background: var(--wxh-ink);
  border-bottom: 1px solid var(--wxh-gold);
  box-shadow: 0 1px 0 rgba(201, 151, 63, 0.15);
}

.site-header a,
.site-header .site-title a,
.site-header .site-description {
  color: var(--wxh-paper);
  text-decoration: none;
  transition: color .25s ease;
}

.site-header a:hover,
.site-header .site-title a:hover {
  color: var(--wxh-gold-bright);
}

/* 导航菜单项 */
.site-header .menu a,
.site-header .primary-menu a,
.site-header nav a {
  color: var(--wxh-paper);
  font-family: var(--wxh-font-sans);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-header .menu a:hover,
.site-header .primary-menu a:hover,
.site-header nav a:hover {
  color: var(--wxh-gold-bright);
  border-bottom-color: var(--wxh-gold);
}

/* 导航（区块主题 header/footer 导航区块）——与职业讨论区标题统一：衬线深金 */
.wp-block-navigation a,
.wp-block-navigation .wp-block-navigation-item__content {
  font-family: var(--wxh-font-serif);
  font-weight: 700;
  color: var(--wxh-gold-deep);
  letter-spacing: 0.06em;
}
.wp-block-navigation a:hover,
.wp-block-navigation .wp-block-navigation-item__content:hover {
  color: var(--wxh-gold);
}

/* ==========================================================
   链接与点缀色 —— 淡冰蓝
   ========================================================== */
a {
  color: var(--wxh-arcane);
  transition: color .2s ease;
}

a:hover {
  color: var(--wxh-gold-bright);
}

/* 标签、分类、小徽章 */
.tag-cloud-link,
.wp-block-post-terms a,
.cat-links a {
  color: var(--wxh-arcane);
  border: 1px solid var(--wxh-arcane);
  padding: 0.15em 0.6em;
  border-radius: 2px;
  font-size: 0.8rem;
}

.tag-cloud-link:hover,
.wp-block-post-terms a:hover,
.cat-links a:hover {
  color: var(--wxh-paper);
  background: var(--wxh-arcane);
  border-color: var(--wxh-arcane);
}

/* ==========================================================
   内容卡片 —— 羊皮纸底 + 金色描边
   ========================================================== */
article.post,
article.page,
.wp-block-post {
  background: var(--wxh-card);
  border: 1px solid var(--wxh-card-line);
  border-radius: 2px;
  padding: var(--wxh-gap-md);
  margin-bottom: var(--wxh-gap-md);
  box-shadow: 0 1px 2px rgba(26, 36, 49, 0.06);
}

article.post h2 a,
article.page h2 a {
  color: var(--wxh-ink);
  text-decoration: none;
  border-bottom: 2px solid var(--wxh-gold);
  padding-bottom: 0.15em;
}

article.post h2 a:hover,
article.page h2 a:hover {
  color: var(--wxh-gold);
}

/* ==========================================================
   分隔线 —— 金色细线
   ========================================================== */
hr,
.wp-block-separator {
  border: none;
  border-top: 1px solid var(--wxh-gold);
  margin: var(--wxh-gap-md) 0;
  opacity: 0.6;
}

/* ==========================================================
   按钮 —— 金底深文字，悬停亮金
   ========================================================== */
.wp-block-button__link,
input[type="submit"],
button,
.btn {
  background: var(--wxh-gold);
  color: var(--wxh-ink);
  border: 1px solid var(--wxh-gold);
  font-family: var(--wxh-font-serif);
  letter-spacing: 0.1em;
  padding: 0.6em 1.6em;
  border-radius: 2px;
  cursor: pointer;
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}

.wp-block-button__link:hover,
input[type="submit"]:hover,
button:hover,
.btn:hover {
  background: var(--wxh-gold-bright);
  border-color: var(--wxh-gold-bright);
  color: var(--wxh-ink);
}

/* ==========================================================
   页脚 —— 沿用页头深底 + 金线
   ========================================================== */
.site-footer,
#site-footer,
footer.site-footer,
.wp-block-template-part[area="footer"] {
  background: var(--wxh-ink);
  color: var(--wxh-section-sub);
  border-top: 1px solid var(--wxh-gold);
  padding: var(--wxh-gap-md) var(--wxh-gap-sm);
}

.site-footer a {
  color: var(--wxh-paper);
}

.site-footer a:hover {
  color: var(--wxh-gold-bright);
}

/* ==========================================================
   评论区 —— 默认关闭，留作兜底（万一父主题模板带出）
   ========================================================== */
.comments-area,
#comments,
.comment-respond {
  display: none;
}

/* ==========================================================
   页头固定 —— 下滚不走；补米底金线防与正文叠字
   ========================================================== */
.wp-site-blocks > header.wp-block-template-part {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--wxh-paper);
  border-bottom: 1px solid var(--wxh-gold);
}
/* 登录状态有 WP 管理栏时下移避让 */
body.admin-bar .wp-site-blocks > header.wp-block-template-part {
  top: 32px;
}
@media (max-width: 782px) {
  body.admin-bar .wp-site-blocks > header.wp-block-template-part {
    top: 46px;
  }
}

/* 当前页状态：深金 + 下划线（与职业讨论区页导航同款） */
.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content,
.wp-block-navigation .wp-block-navigation-item__content[aria-current="page"] {
  color: var(--wxh-gold-deep);
  text-decoration: underline;
  text-decoration-color: var(--wxh-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}
.wp-block-navigation .current-menu-item > .wp-block-navigation-item__content:hover,
.wp-block-navigation .wp-block-navigation-item__content[aria-current="page"]:hover {
  color: var(--wxh-gold-deep);
}

/* 悬停去下划线：亮金只变色；当前项悬停保持下划线 */
.wp-site-blocks .wp-block-navigation .wp-block-navigation-item__content:hover {
  text-decoration: none;
}
.wp-site-blocks .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content:hover,
.wp-site-blocks .wp-block-navigation .wp-block-navigation-item__content[aria-current="page"]:hover {
  text-decoration: underline;
  text-decoration-color: var(--wxh-gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 6px;
}

/* ===== 全站阵营水印（2026-10-31） ===== */
body:not(.page-template-page-class-forum-php)::before,
body:not(.page-template-page-class-forum-php)::after {
  content: "";
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 400px;
  height: 500px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
  z-index: 0;
}
body:not(.page-template-page-class-forum-php)::before {
  left: -70px;
  background-image: url("images/alliance-icon-watermark.png");
}
body:not(.page-template-page-class-forum-php)::after {
  right: -70px;
  background-image: url("images/horde-icon-watermark.png");
}
.wp-site-blocks { position: relative; z-index: 1; }
@media (max-width: 1180px) {
  body::before, body::after { display: none; }
}

/* ===== 全站字体：衬线规格（2026-10-31） ===== */
.entry-content,
.wp-block-post-content {
  font-family: Georgia, "Songti SC", "Songti TC", "STSong", "SimSun", serif;
}
.entry-content h1,
.entry-content h2,
.entry-content h3,
.wp-block-post-content h1,
.wp-block-post-content h2,
.wp-block-post-content h3 {
  font-family: Georgia, "Songti SC", "Songti TC", "STSong", "SimSun", serif;
}
/* ===== 全站正文链接：深金（2026-10-31） ===== */
.entry-content a,
.wp-block-post-content a { color: #8f6b1e; }
.entry-content h2 a,
.wp-block-post-content h2 a { color: #1a2431; }
.entry-content h2 a:hover,
.wp-block-post-content h2 a:hover { color: #8f6b1e; }

/* B3. 焦点框：金色替代默认黑框 */
.wp-block-post-content a:focus,
.wp-block-post-content a:focus-visible,
.entry-content a:focus,
.entry-content a:focus-visible {
  outline: 2px solid #c9973f;
  outline-offset: 2px;
}

/* D. 查询循环卡片（首页最新动态） */
.wp-block-query .wp-block-post-template { gap: 12px; }
.wp-block-query .wp-block-post-template > li { background: #fffaf0; border: 1px solid #d8c795; border-radius: 10px; padding: 14px 16px; margin: 0; }
.wp-block-query .wp-block-post-terms a { display: inline-block; font-size: 12px; color: #8f6b1e; background: rgba(201,151,63,0.16); border: 1px solid #d8c795; border-radius: 4px; padding: 2px 8px; text-decoration: none; }
.wp-block-query .wp-block-post-title { font-size: 16px; line-height: 1.5; margin: 8px 0 6px; }
.wp-block-query .wp-block-post-title a { color: #1a2431; text-decoration: none; }
.wp-block-query .wp-block-post-date { font-size: 12px; color: #8f6b1e; }

/* D 补充（Qoder 加，非简报原文）：后台查询循环是纵向流式布局（is-layout-flow），
   自身列数设置达不成一行四张，故按原手工卡同款 auto-fit minmax(230px,1fr) 补网格。 */
.wp-block-query .wp-block-post-template { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

/* v8: card hover breathing zoom (site-wide content cards) */
.wp-block-post-content a[style*="border-radius"],
.entry-content a[style*="border-radius"],
.wp-block-query .wp-block-post-template > li {
  transition: transform .28s ease, box-shadow .28s ease;
}
.wp-block-post-content a[style*="border-radius"]:hover,
.entry-content a[style*="border-radius"]:hover,
.wp-block-query .wp-block-post-template > li:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 24px rgba(26,36,49,.14);
}
@media (prefers-reduced-motion: reduce) {
  .wp-block-post-content a[style*="border-radius"],
  .entry-content a[style*="border-radius"],
  .wp-block-query .wp-block-post-template > li {
    transition: none;
  }
  .wp-block-post-content a[style*="border-radius"]:hover,
  .entry-content a[style*="border-radius"]:hover,
  .wp-block-query .wp-block-post-template > li:hover {
    transform: none;
    box-shadow: none;
  }
}

/* v8-4: query grid fixed columns, capped at 1340 */
.wp-block-query .wp-block-post-template {
  grid-template-columns: repeat(4, 1fr);
  max-width: 1340px;
  margin-left: auto;
  margin-right: auto;
}
@media (max-width: 1100px) {
  .wp-block-query .wp-block-post-template {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 820px) {
  .wp-block-query .wp-block-post-template {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 520px) {
  .wp-block-query .wp-block-post-template {
    grid-template-columns: 1fr;
  }
}

/* v8-5: focus outline inside query loops (archives included) */
.wp-block-query a:focus,
.wp-block-query a:focus-visible {
  outline: 2px solid #c9973f;
  outline-offset: 2px;
}
