/* ==========================================================================
   WordPress 整合样式 · 辰江沧溟
   仅处理 WP 特有结构与后台栏偏移；主设计在 main.css / cosmos.css。
   ========================================================================== */

/* 后台登录栏 */
body.admin-bar .topbar { top: 32px; }
body.admin-bar .mobile-menu { top: 32px; }
@media (max-width: 782px) {
  body.admin-bar .topbar { top: 46px; }
  body.admin-bar .mobile-menu { top: 46px; }
}

/* 表单元素在 WP 中的默认外观 */
form.search-field { margin: 0; }
.search-field input[type="search"] { -webkit-appearance: none; appearance: none; }
.chip-btn { text-decoration: none; }

/* 正文中的 WP 内容块 */
.post-body img,
.post-body iframe,
.post-body video { max-width: 100%; height: auto; }
.post-body .wp-block-image,
.post-body figure.wp-block-image { margin: 28px 0; }
.post-body .wp-block-image img { width: 100%; }
.post-body .wp-element-caption,
.post-body figcaption.wp-element-caption {
  font-family: var(--sans);
  font-size: 13px;
  color: var(--muted);
  margin-top: 10px;
  text-align: center;
  letter-spacing: .02em;
}
.post-body .wp-block-quote {
  margin: 30px 0;
  padding: 6px 0 6px 22px;
  border-left: 3px solid var(--accent);
}
.post-body .wp-block-quote p { font-family: var(--serif); font-size: 1.1em; }
.post-body .wp-block-separator { border: 0; border-top: 1.5px solid var(--line); margin: 34px 0; }
.post-body .alignleft { float: left; margin: 6px 24px 18px 0; max-width: 50%; }
.post-body .alignright { float: right; margin: 6px 0 18px 24px; max-width: 50%; }
.post-body .aligncenter { display: block; margin-left: auto; margin-right: auto; }
.post-body .alignwide { width: min(1100px, 100%); max-width: none; }
.post-body .alignfull { width: 100vw; max-width: none; margin-left: calc(50% - 50vw); }
.post-body .wp-caption { max-width: 100%; }
.post-body .wp-caption-text { font-size: 13px; color: var(--muted); text-align: center; margin-top: 8px; }
.post-body .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin: 26px 0; }
.post-body .gallery-item { margin: 0; }
.post-body .gallery img { width: 100%; height: auto; border-radius: 4px; }

/* WP 分页与链接页 */
.post-pager .post-page-numbers {
  display: inline-block;
  padding: 4px 10px;
  margin-right: 6px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
}
.post-pager .post-page-numbers.current { background: var(--ink); color: var(--cream); }
.nav-links { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; margin: 40px 0; }
.nav-links a,
.nav-links span.current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 14px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
}
.nav-links span.current { background: var(--ink); color: var(--cream); }

/* 文章页码（分页） */
.page-links { margin: 28px 0; font-family: var(--sans); }

/* 屏幕阅读器 */
.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  width: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute !important;
  word-wrap: normal !important;
}
.screen-reader-text:focus {
  background-color: var(--cream);
  clip: auto !important;
  clip-path: none;
  color: var(--ink);
  display: block;
  font-size: 14px;
  height: auto;
  left: 12px;
  line-height: normal;
  padding: 12px 18px;
  text-decoration: none;
  top: 12px;
  width: auto;
  z-index: 100000;
}

/* 页脚备案 */
.foot-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 24px;
  max-width: 1420px;
  margin: 16px auto 0;
  padding-top: 12px;
  border-top: 1px solid rgba(246, 241, 229, .1);
  font-size: 12px;
  letter-spacing: .04em;
  color: rgba(246, 241, 229, .46);
}
.foot-legal a {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
  transition: color .3s;
}
.foot-legal a:hover { color: var(--cream); }
.foot-legal img { display: block; margin-right: 7px; opacity: .9; }
.foot-legal .foot-legal-empty {
  text-decoration: underline;
  text-decoration-style: dashed;
  text-underline-offset: 4px;
  opacity: .8;
}

/* 后台编辑内容时，嵌套在 .post-body 里的摘要/说明保持一致 */
.post-body p.has-text-align-center { text-align: center; }
.post-body p.has-text-align-right { text-align: right; }

/* 密码保护表单 */
.post-password-form input[type="password"] {
  font: inherit;
  padding: 8px 12px;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--paper);
}
.post-password-form input[type="submit"] {
  font: inherit;
  padding: 8px 16px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--cream);
  cursor: pointer;
}
