/*
Theme Name: AFFINGER Temp Child
Template: affinger-temp
Description: カテゴリーページ 2 カラム（左ナビ＋右ランキング）美観改良 v3 – heading fix
Version: 20240604
*/

/* ================================================================
   ベースレイアウト
================================================================ */
.category-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1rem;
}
.category-header {
  margin-bottom: 2rem;
  text-align: center;
}
.category-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}
.category-description {
  font-size: 0.95rem;
  color: #555;
}
.category-body {
  display: flex;
  gap: 2rem;
}

/* ================================================================
   見出しスタイル（左カラム・右カラム）
================================================================ */
.sidebar-heading,
.content-heading,
.category-page h2 {
  margin: 0 0 1.5rem !important;
  padding: 1rem 1.25rem;
  border-top: 2px solid #333;
  background: #f7f7f7;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.3;
  box-sizing: border-box;
}

/* コンテナ余計なマージンリセット */
.category-sidebar,
.category-content {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* ================================================================
   左カラム：カテゴリ一覧
================================================================ */
.category-sidebar {
  flex: 0 0 260px;
}
.category-list,
.cat-sub {
  list-style: none;
  margin: 0;
  padding: 0;
}
.category-list li,
.cat-sub li {
  margin-bottom: 0.5rem;
}
.category-list li.current-cat a {
  font-weight: 300;
}
.category-list a {
  color: #333;
  text-decoration: none;
}
.category-list a:hover {
  text-decoration: underline;
}
.cat-toggle {
  margin-left: 0.25rem;
  background: none;
  border: none;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.cat-sub {
  margin: 0.5rem 0 0.5rem 1rem;
}
.cat-sub.hidden {
  display: none;
}

/* ================================================================
   右カラム：記事カードグリッド
================================================================ */
.category-content {
  flex: 1 1 auto;
}
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}
.category-post {
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  padding: 1rem;
  transition: box-shadow .2s;
}
.category-post:hover {
  box-shadow: 0 4px 10px rgba(0, 0, 0, .07);
}
.post-thumbnail img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  filter: none !important;
  opacity: 1 !important;
}
.category-post .post-thumbnail::before {
  display: none !important;
}
.post-title {
  font-size: 1rem;
  margin-top: .75rem;
  background: transparent !important;
  color: #333 !important;
  padding: .5em 0 !important;
}
.category-post:hover .post-thumbnail img {
  filter: none !important;
  opacity: 1 !important;
}

/* ================================================================
   ページネーション
================================================================ */
.pagination {
  margin-top: 2rem;
  text-align: center;
}
.page-numbers {
  display: inline-block;
  margin: 0 .25rem;
  padding: .5rem .75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
}
.page-numbers.current,
.page-numbers:hover {
  background: #333;
  color: #fff;
  border-color: #333;
}

/* ================================================================
   レスポンシブ
================================================================ */
@media (max-width: 768px) {
  .category-body {
    flex-direction: column;
  }
  .category-sidebar {
    flex: none;
  }
}

/* ================================================================
   子カテゴリ内投稿リスト
================================================================ */
.cat-posts {
  list-style: none;
  margin: .5rem 0 .5rem 1.75rem;
  padding: 0;
  font-size: .92rem;
}
.cat-posts li {
  margin-bottom: .4rem;
}
.cat-posts.hidden {
  display: none;
}

/* ================================================================
   全コンテンツボタン
================================================================ */
.all-contents-wrap {
  text-align: center;
  margin: 40px 0;
}
.all-contents-btn {
  padding: .9em 2.5em;
  font-weight: 700;
}

/* ================================================================
   バッジ付きランキングスタイル
================================================================ */
.daily-ranking-title {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}
.daily-ranking-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.daily-ranking-item {
  display: flex;
  align-items: flex-start;
}
.daily-ranking-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.25rem;
  font-weight: bold;
  border-radius: 50%;
  margin-right: 1rem;
  background: #ddd;
  color: #333;
}
.daily-ranking-item.rank-1 .daily-ranking-badge { background: #FFD700; color: #000; }
.daily-ranking-item.rank-2 .daily-ranking-badge { background: #C0C0C0; color: #000; }
.daily-ranking-item.rank-3 .daily-ranking-badge { background: #CD7F32; color: #000; }
.daily-ranking-card {
  flex: 1;
}
