/*
Theme Name: CAUS Channel
Theme URI: https://caus.com/
Author: CAUS
Author URI: https://caus.com/
Description: 加美财经的轻量模块化新闻主题，提供清晰频道导航、每页十条文章、明显分页以及可编辑推广与关于我们区域。
Version: 1.1.9
Requires at least: 6.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: caus-channel
Tags: news, two-columns, custom-logo, custom-menu, featured-images, translation-ready
*/

:root {
  --caus-brand: #fdbe28;
  --caus-ink: #151515;
  --caus-muted: #6d6d6d;
  --caus-line: #e8e8e8;
  --caus-page: #f3f3f3;
  --caus-surface: #fff;
  --caus-container: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--caus-ink);
  background: var(--caus-page);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; }
button, input { font: inherit; }

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.screen-reader-text:focus {
  top: 8px;
  left: 8px;
  z-index: 99999;
  width: auto;
  height: auto;
  padding: 12px 16px;
  clip: auto;
  background: #fff;
  color: #000;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 86px;
  background: var(--caus-brand);
  border-bottom: 1px solid rgba(0, 0, 0, .08);
}

.admin-bar .site-header { top: 32px; }

.header-inner {
  width: min(calc(100% - 40px), var(--caus-container));
  min-height: 86px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 160px minmax(430px, 1fr) auto;
  align-items: center;
  gap: 24px;
}

.site-branding { min-width: 0; }
.custom-logo-link, .text-logo { display: inline-flex; align-items: center; }
.custom-logo { width: auto; max-width: 140px; max-height: 42px; }
.text-logo { gap: 9px; }
.text-logo-mark {
  width: 34px;
  height: 24px;
  border: 7px solid var(--caus-ink);
  border-top: 0;
  border-radius: 0 0 22px 22px;
  transform: rotate(-8deg);
}
.text-logo-copy { display: flex; flex-direction: column; line-height: 1; }
.text-logo-copy strong { font-size: 18px; letter-spacing: .02em; }
.text-logo-copy small { margin-top: 4px; font-size: 8px; letter-spacing: .28em; }

.primary-navigation { min-width: 0; overflow: hidden; }
.primary-menu {
  margin: 0;
  padding: 0;
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 6px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
}
.primary-menu::-webkit-scrollbar { display: none; }
.primary-menu li { flex: 0 0 auto; }
.primary-menu a {
  min-height: 86px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  font-size: 16px;
  white-space: nowrap;
}
.primary-menu a:hover { text-decoration: underline; text-underline-offset: 5px; }
.primary-menu .current-menu-item > a,
.primary-menu .current-menu-ancestor > a,
.primary-menu .current-cat > a,
.primary-menu a[aria-current="page"] {
  background: var(--caus-ink);
  color: var(--caus-brand);
  font-weight: 700;
  text-decoration: none;
}

.header-tools { display: flex; align-items: center; gap: 10px; }
.language-link,
.account-link {
  width: 46px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, .72);
  font-size: 14px;
}
.account-link svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.search-form { position: relative; width: 230px; height: 42px; background: #fff; }
.search-form label { display: block; height: 100%; }
.search-field {
  width: 100%;
  height: 100%;
  padding: 0 42px 0 14px;
  border: 1px solid rgba(0, 0, 0, .1);
  border-radius: 0;
  outline: 0;
  font-size: 14px;
}
.search-field:focus { border-color: var(--caus-ink); }
.search-submit {
  position: absolute;
  top: 0;
  right: 0;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.search-submit svg { width: 20px; height: 20px; fill: none; stroke: #707070; stroke-width: 1.8; }

.main-layout {
  width: min(calc(100% - 40px), var(--caus-container));
  margin: 20px auto 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 240px;
  align-items: start;
  background: var(--caus-surface);
}
.feed-column { min-width: 0; }
.channel-heading {
  min-height: 62px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--caus-line);
}
.channel-heading span { color: var(--caus-muted); font-size: 12px; }
.channel-heading h1 { margin: 0; font-size: 21px; line-height: 1.35; }

.post-list-item {
  min-height: 154px;
  padding: 18px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 44px;
  border-bottom: 1px solid var(--caus-line);
}
.post-list-copy { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; }
.post-list-title { margin: 0; font-size: 19px; line-height: 1.42; font-weight: 600; letter-spacing: -.01em; }
.post-list-title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.post-list-meta {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--caus-muted);
  font-size: 12.5px;
}
.post-list-tags a { margin-right: 10px; }
.post-list-thumbnail,
.post-list-placeholder {
  width: 190px;
  height: 112px;
  align-self: center;
  display: block;
  overflow: hidden;
  background: #ececec;
}
.post-list-thumbnail img { width: 100%; height: 100%; display: block; object-fit: cover; transition: transform .24s ease; }
.post-list-item:hover .post-list-thumbnail img { transform: scale(1.025); }
.post-list-placeholder { display: grid; place-items: center; color: #888; font-size: 12px; letter-spacing: .18em; }

.navigation.pagination {
  margin: 0;
  padding: 26px 20px;
  border-top: 1px solid var(--caus-line);
}
.pagination .nav-links { display: flex; align-items: center; justify-content: center; gap: 10px; }
.pagination .page-numbers {
  min-width: 44px;
  height: 44px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #a9a9a9;
  background: #fff;
  color: var(--caus-ink);
  font-size: 15px;
  font-weight: 600;
}
.pagination .page-numbers.current { border: 2px solid var(--caus-ink); background: var(--caus-ink); color: #fff; }
.pagination .prev,
.pagination .next {
  min-width: 132px;
  height: 52px;
  border: 2px solid var(--caus-ink);
  background: var(--caus-brand);
  font-size: 16px;
  font-weight: 700;
}
.pagination .prev:hover,
.pagination .next:hover { background: var(--caus-ink); color: #fff; }

.sidebar { min-height: 100%; padding: 0 22px 40px; border-left: 1px solid var(--caus-line); }
.sidebar-module { padding: 24px 0 30px; }
.sidebar-module + .sidebar-module { border-top: 1px solid var(--caus-line); }
.sidebar-title,
.sidebar-module h2 { margin: 0 0 22px; padding-bottom: 15px; border-bottom: 1px solid var(--caus-line); font-size: 18px; }
.sidebar-module, .sidebar-module p { color: #4e4e4e; font-size: 14px; line-height: 1.9; }
.sidebar-module a { text-decoration: underline; text-underline-offset: 3px; }

.site-footer { background: #fff; border-top: 1px solid var(--caus-line); }
.footer-inner { width: min(calc(100% - 40px), var(--caus-container)); min-height: 120px; margin: 0 auto; padding: 28px 0; color: var(--caus-muted); font-size: 12.5px; }
.footer-menu { margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 24px; list-style: none; }
.footer-inner p { margin: 18px 0 0; }

.single-layout {
  width: min(calc(100% - 40px), 1100px);
  grid-template-columns: minmax(0, 760px) 220px;
  justify-content: center;
  gap: 36px;
}
.single-feed-column { min-width: 0; }
.single-layout .singular-content { padding: 44px 0 48px; }
.singular-content h1 { margin: 0 0 18px; font-size: clamp(26px, 2.45vw, 34px); line-height: 1.34; letter-spacing: -.012em; font-weight: 700; }
.single-layout .article-header { margin-bottom: 10px; }
.single-layout .post-list-meta { margin-top: 0; padding-top: 0; }
.entry-content { font-size: 17px; line-height: 1.95; }
.entry-content a { text-decoration: underline; }
.entry-content img { max-width: 100%; height: auto; }
.entry-content p { margin: 0 0 1.55em; }

.single-layout .sidebar-single {
  position: sticky;
  top: 110px;
  align-self: start;
  min-height: 0;
  padding: 30px 0 40px 26px;
  border-left: 1px solid var(--caus-line);
}
.admin-bar .single-layout .sidebar-single { top: 142px; }
.single-layout .sidebar-promotion-card {
  margin: 0;
  padding: 20px 18px 22px;
  border: 1px solid #efdca9;
  background: #fff8e8;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .03);
}
.single-layout .sidebar-promotion-card .sidebar-title {
  margin: 0 0 14px;
  padding-bottom: 11px;
  border-bottom: 1px solid #ead49b;
  font-size: 16px;
  line-height: 1.35;
}
.sidebar-promotion-content {
  color: #4c4c4c;
  font-size: 14px;
  line-height: 1.8;
}
.sidebar-promotion-content .widget {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.sidebar-promotion-content .widget + .widget { margin-top: 16px; padding-top: 16px; border-top: 1px solid #ead49b; }
.sidebar-promotion-content .widget .sidebar-title,
.sidebar-promotion-content .widget h2 {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  font-size: 14px;
  line-height: 1.45;
}
.sidebar-promotion-content p { margin: 0 0 1em; }
.sidebar-promotion-content p:last-child { margin-bottom: 0; }
.sidebar-promotion-content a { text-decoration: underline; text-underline-offset: 3px; }
.sidebar-widget-title { margin: 0 0 10px; font-size: 14px; line-height: 1.45; }

.article-bottom-promotion-area { margin-top: 48px; }
.article-bottom-promotion {
  padding: 28px 8px 30px;
  border-top: 1px solid #bfc3c7;
  border-bottom: 1px solid #bfc3c7;
  color: #333;
}
.article-bottom-promotion .promotion-title {
  margin: 0 0 12px;
  font-size: 19px;
  line-height: 1.4;
}
.article-bottom-promotion p {
  max-width: 600px;
  margin: 0 0 16px;
  font-size: 15px;
  line-height: 1.75;
}
.article-bottom-promotion .promotion-cta,
.article-bottom-promotion .wp-block-button__link {
  min-width: 145px;
  min-height: 44px;
  padding: 0 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d9a000;
  border-radius: 0;
  background: var(--caus-brand);
  color: var(--caus-ink);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}
.article-bottom-promotion .promotion-cta:hover,
.article-bottom-promotion .wp-block-button__link:hover {
  background: var(--caus-ink);
  color: #fff;
}
.no-results { min-height: 320px; padding: 70px 20px; text-align: center; color: var(--caus-muted); }

@media (max-width: 1080px) {
  .header-inner { grid-template-columns: 145px minmax(0, 1fr) auto; gap: 16px; }
  .primary-menu a { padding-inline: 10px; }
  .search-form { width: 170px; }
  .post-list-item { grid-template-columns: minmax(0, 1fr) 176px; gap: 34px; }
  .post-list-thumbnail, .post-list-placeholder { width: 176px; height: 108px; }
  .single-layout { grid-template-columns: minmax(0, 720px) 210px; gap: 28px; }
  .single-layout .sidebar-single { padding-left: 26px; }
}

@media (max-width: 900px) {
  .site-header { position: static; }
  .admin-bar .site-header { top: 0; }
  .header-inner {
    padding-top: 14px;
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand tools" "nav nav";
    gap: 12px 16px;
  }
  .site-branding { grid-area: brand; }
  .primary-navigation { grid-area: nav; }
  .header-tools { grid-area: tools; }
  .primary-menu { justify-content: flex-start; }
  .primary-menu a { min-height: 51px; padding: 0 12px; }
  .main-layout { grid-template-columns: 1fr; }
  .single-layout { grid-template-columns: minmax(0, 760px); justify-content: center; }
  .sidebar { min-height: 0; padding: 0 20px 20px; border-left: 0; border-top: 1px solid var(--caus-line); display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
  .single-layout .sidebar-single { position: static; padding: 24px 20px 28px; border-left: 0; border-top: 1px solid var(--caus-line); display: block; }
  .sidebar-module + .sidebar-module { border-top: 0; }
}

@media (max-width: 640px) {
  .header-inner, .main-layout, .footer-inner { width: min(calc(100% - 28px), var(--caus-container)); }
  .text-logo-copy strong { font-size: 15px; }
  .language-link { display: none; }
  .account-link { width: 38px; height: 38px; }
  .search-form { width: 40px; height: 38px; background: transparent; }
  .search-form label { position: absolute; width: 1px; height: 1px; overflow: hidden; }
  .search-submit { width: 40px; height: 38px; }
  .main-layout { margin-top: 14px; }
  .channel-heading { min-height: 54px; padding: 0 10px; }
  .channel-heading h1 { font-size: 19px; }
  .post-list-item { min-height: 120px; padding: 15px 10px; grid-template-columns: minmax(0, 1fr) 112px; gap: 14px; }
  .post-list-title { font-size: 16px; line-height: 1.45; }
  .post-list-meta { width: 100%; padding-top: 9px; font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .post-list-thumbnail, .post-list-placeholder { width: 112px; height: 82px; }
  .navigation.pagination { padding: 22px 10px; }
  .pagination .nav-links { gap: 8px; }
  .pagination .page-numbers { min-width: 40px; height: 44px; padding: 0 10px; }
  .pagination .prev, .pagination .next { min-width: 104px; height: 50px; font-size: 15px; }
  .sidebar { padding: 0 10px 10px; grid-template-columns: 1fr; gap: 0; }
  .sidebar-module + .sidebar-module { border-top: 1px solid var(--caus-line); }
  .single-layout { width: min(calc(100% - 28px), var(--caus-container)); }
  .single-layout .singular-content { padding: 32px 10px 36px; }
  .singular-content h1 { font-size: 25px; line-height: 1.32; }
  .entry-content { font-size: 16px; line-height: 1.9; }
  .article-bottom-promotion-area { margin-top: 38px; }
  .article-bottom-promotion { padding: 24px 0 26px; }
  .single-layout .sidebar-single { padding-inline: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; }
}
