/*
Theme Name: 由之中文网 子主题
Theme URI: https://chinayouzhi.cn
Description: twentytwentyfive をベースにした 由之中文网 専用カスタマイズ。ワインレッドのヘッダーナビ、左サイドバー、カテゴリ別パネル(2x2)からなる旧サイト互換のトップページレイアウト。
Author: 由之中文网
Template: twentytwentyfive
Version: 0.4.0
Text Domain: chinayouzhi-child
*/

/* ===== サイト全体のコンテンツ幅 =====
   刊頭画像 (960x245) をピクセル等倍で表示するため、旧サイトと同じ 960px に
   統一する。刊頭を作り直して広げる場合はここを変更する。 */
:root {
  --youzhi-content-width: 960px;
}

/* ===== サイトヘッダー ===== */
.youzhi-site-header {
  border-bottom: 1px solid #e5e5e5;
  background: #ffffff;
  margin: 0;
  padding: 0;
}

.youzhi-site-header__inner {
  max-width: var(--youzhi-content-width);
  margin: 0 auto;
  /* 横paddingは付けない: 刊頭画像(960px)と左右端を揃えるため。
     画面幅が 960px を切ったときだけ下の media query で余白を足す。 */
  padding: 1.25rem 0;
  gap: 2rem;
}

@media (max-width: 990px) {
  .youzhi-site-header__inner { padding: 1.25rem 1rem; }
}

.youzhi-site-title {
  margin: 0;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.2;
}

.youzhi-site-title a {
  color: #1a1a1a;
  text-decoration: none;
}

.youzhi-global-nav .wp-block-navigation__container {
  gap: 1.75rem;
  align-items: center;
}

.youzhi-global-nav .wp-block-navigation-item__content {
  color: #333;
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  padding: 0.25rem 0;
}

.youzhi-global-nav .wp-block-navigation-item__content:hover {
  color: #1f6fb2;
}

@media (max-width: 720px) {
  .youzhi-site-header__inner {
    padding: 1rem;
    gap: 1rem;
  }
  .youzhi-global-nav .wp-block-navigation__container { gap: 1rem; }
}

/* ===== 刊頭 (旧サイト template/images/banner*.jpg 960x245) =====
   トップと灵魂寄存站は banner.jpg、各欄目は functions.php が付与する
   body クラス youzhi-ch-<slug> で banner1〜7.jpg に切り替える。
   画像を差し替える場合は assets/images/ の同名ファイルを上書きする。 */
.youzhi-masthead {
  max-width: var(--youzhi-content-width);
  margin: 0 auto;
  aspect-ratio: 960 / 245;
  background: url(assets/images/banner.jpg) no-repeat center / contain;
}

.youzhi-ch-zilinzhongbao .youzhi-masthead { background-image: url(assets/images/banner1.jpg); }
.youzhi-ch-wenxueyuebao  .youzhi-masthead { background-image: url(assets/images/banner2.jpg); }
.youzhi-ch-yuanhengzhilu .youzhi-masthead { background-image: url(assets/images/banner3.jpg); }
.youzhi-ch-shierwuwei    .youzhi-masthead { background-image: url(assets/images/banner4.jpg); }
.youzhi-ch-game-rensheng .youzhi-masthead { background-image: url(assets/images/banner5.jpg); }
.youzhi-ch-maowuzhuyi    .youzhi-masthead { background-image: url(assets/images/banner6.jpg); }
.youzhi-ch-heixiazi      .youzhi-masthead { background-image: url(assets/images/banner7.jpg); }

/* ===== 首页 3カラムグリッド ===== */
.youzhi-home {
  max-width: var(--youzhi-content-width);
  margin: 1rem auto 2rem;
  /* 横paddingなしで刊頭と左右端を揃える(狭い画面のみ media query で余白) */
  padding: 0;
  display: grid;
  grid-template-columns: 260px 1fr; /* 旧サイトの左カラム幅 (com_left_news 260px) に合わせる */
  gap: 1rem;
  align-items: start;
}

/* WP の is-layout-flow が grid 子要素に追加する margin-block-start を打ち消し、
   グリッド行頭で揃える。 */
.youzhi-home > *,
.youzhi-panels > * {
  margin-block-start: 0;
  margin-top: 0;
}

@media (max-width: 990px) {
  .youzhi-home { padding: 0 1rem; }
}

@media (max-width: 900px) {
  .youzhi-home {
    grid-template-columns: 1fr;
  }
}

/* ===== 左サイドバー ===== */
.youzhi-sidebar > * + * { margin-top: 1rem; }

.youzhi-quote {
  background: #eef1fb;
  border: 1px solid #d6dceb;
  padding: 0.9rem 1rem 1rem;
  border-radius: 2px;
}

.youzhi-quote h3 {
  margin: 0 0 0.6rem;
  font-size: 1.1rem;
  font-weight: 600;
  color: #222;
  border-bottom: 1px solid #d6dceb;
  padding-bottom: 0.4rem;
}

.youzhi-quote p,
.youzhi-quote .wp-block-paragraph {
  color: #c0202a;
  font-size: 1rem;
  line-height: 1.9;
  margin: 0;
  text-indent: 2em;
}

.youzhi-search {
  background: #ffffff;
  border: 1px solid #dcdcdc;
  padding: 0.6rem 0.7rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.youzhi-search .wp-block-search__label {
  margin: 0;
  font-size: 1rem;
  color: #333;
}

.youzhi-search .wp-block-search__input {
  border: 1px solid #c8c8c8;
  height: 1.8rem;
  padding: 0 0.3rem;
  flex: 1;
}

.youzhi-search .wp-block-search__button {
  background: #f3f3f3;
  border: 1px solid #c8c8c8;
  color: #333;
  padding: 0.2rem 0.7rem;
  cursor: pointer;
}

.youzhi-recent ul {
  list-style: none;
  margin: 0;
  padding: 0.4rem 0 0;
}

.youzhi-recent li {
  padding: 0.35rem 0 0.35rem 1.1rem;
  position: relative;
  border-bottom: 1px dotted #e0e0e0;
  font-size: 1rem;
}

.youzhi-recent li::before {
  content: "»";
  position: absolute;
  left: 0;
  color: #888;
}

.youzhi-recent li a {
  color: #222;
  text-decoration: none;
}

.youzhi-recent li a:hover {
  color: #8b1d24;
}

/* ===== 右側: 2x2 カテゴリパネルグリッド ===== */
.youzhi-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  align-items: start;
}

@media (max-width: 720px) {
  .youzhi-panels { grid-template-columns: 1fr; }
}

.youzhi-panel {
  border: 1px solid #dcdcdc;
  background: #ffffff;
}

.youzhi-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.5rem 0.9rem;
  background: linear-gradient(to bottom, #f8f8f8 0%, #ececec 100%);
  border-bottom: 1px solid #dcdcdc;
}

.youzhi-panel-head .youzhi-panel-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: #222;
  margin: 0;
}

.youzhi-panel-count {
  font-size: 0.9rem;
  font-weight: 400;
  color: #888;
  margin-left: 0.25rem;
}

.youzhi-panel-head .youzhi-panel-more a {
  color: #555;
  font-size: 0.9rem;
  text-decoration: none;
}

.youzhi-panel-head .youzhi-panel-more a:hover { color: #8b1d24; }

.youzhi-panel-body {
  padding: 0.6rem 0.9rem 0.9rem;
}

/* パネル内 query / post-template */
.youzhi-panel-body .wp-block-post-template {
  list-style: none;
  margin: 0;
  padding: 0;
}

.youzhi-panel-body .wp-block-post-template > li {
  padding: 0.5rem 0;
  border-bottom: 1px dotted transparent;
}

.youzhi-panel-body .wp-block-post-template > li + li {
  border-top: 1px solid #f0f0f0;
}

.youzhi-panel-body .wp-block-post-title {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.youzhi-panel-body .wp-block-post-title a {
  color: #1f6fb2;
  text-decoration: none;
}

.youzhi-panel-body .wp-block-post-title a:hover {
  text-decoration: underline;
}

.youzhi-panel-body .wp-block-post-excerpt {
  margin: 0;
  font-size: 0.95rem;
  color: #333;
  line-height: 1.8;
  text-indent: 2em;
}

.youzhi-panel-body .wp-block-post-excerpt__excerpt {
  margin: 0;
}

.youzhi-panel-body .wp-block-post-excerpt__more-link { display: none; }

/* ===== カテゴリページ: 右側メインカラム ===== */
.youzhi-main {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.youzhi-breadcrumb {
  border: 1px solid #dcdcdc;
  background: #fafafa;
  padding: 0.5rem 0.9rem;
  font-size: 0.95rem;
}

.youzhi-breadcrumb-label {
  color: #1f6fb2;
  font-weight: 600;
  margin-right: 0.25rem;
}

.youzhi-breadcrumb a {
  color: #333;
  text-decoration: none;
}

.youzhi-breadcrumb a:hover { color: #1f6fb2; }

.youzhi-breadcrumb-current { color: #555; }

/* 子カテゴリパネル群: 縦積み */
.youzhi-child-panels {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* 日付+タイトルリスト */
.youzhi-panel-body--list { padding: 0.4rem 0.9rem 0.6rem; }

.youzhi-date-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.youzhi-date-list li {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 0.4rem 0;
  border-bottom: 1px dotted #eee;
  font-size: 1rem;
}

.youzhi-date-list li:last-child { border-bottom: 0; }

.youzhi-date {
  flex: 0 0 auto;
  color: #1f6fb2;
  font-variant-numeric: tabular-nums;
  min-width: 6.5rem;
}

.youzhi-title {
  color: #222;
  text-decoration: none;
}

.youzhi-title:hover { color: #1f6fb2; }

.youzhi-empty {
  margin: 0;
  padding: 0.3rem 0;
  color: #888;
}

/* ===== フッター ===== */
.youzhi-footer {
  margin-top: 2rem;
  font-size: 0.85rem;
  color: #888;
}

.youzhi-footer p {
  font-size: inherit;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
}

/* ICP 備案番号 (全ページ共通フッター) */
.youzhi-footer .youzhi-icp {
  font-size: 0.8rem;
  color: #888;
}

.youzhi-footer .youzhi-icp a {
  color: #888;
  text-decoration: none;
}

.youzhi-footer .youzhi-icp a:hover {
  text-decoration: underline;
}

/* ===== 記事ページ (single.html / 旧 content.asp 相当) ===== */
.youzhi-article {
  border: 1px solid #dcdcdc;
  background: #fff;
  padding: 1rem 1.4rem 1.5rem;
  margin-top: 1rem;
}

.youzhi-article-title {
  margin: 0.4rem 0 0.6rem;
  font-size: 1.5rem;
  line-height: 1.4;
  text-align: center;
  color: #1a1a1a;
}

/* 旧: 来源：… 浏览：…次 发布时间：… の情報行 */
.youzhi-post-meta {
  text-align: center;
  color: #888;
  font-size: 0.9rem;
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
  border-bottom: 1px dotted #ddd;
}

.youzhi-article-body {
  font-size: 1.05rem;
  line-height: 1.9;
}

.youzhi-article-body img {
  max-width: 100%;
  height: auto;
}

/* コメント欄 (Z-Blog から移行したコメントの表示) */
.youzhi-main .wp-block-comments {
  margin-top: 1.5rem;
  font-size: 0.95rem;
}
