/* =========================================
   TOPページ専用 検索バー & フィルター
========================================= */
.search-bar { background: #f9f9f9; border-top: 1px solid #eee; padding: 16px; }
.search-inner { max-width: 600px; margin: 0 auto; position: relative; }
.search-input {
  width: 100%; padding: 10px 40px 10px 16px;
  border: 1px solid #ddd; border-radius: 30px;
  font-family: inherit; font-size: 16px;
}
.search-clear {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 20px; height: 20px; opacity: 0.5;
}

.main-content { max-width: 960px; margin: 0 auto; padding: 24px 16px; overflow-x: hidden; }

.category-filter {
  display: flex; justify-content: center; align-items: center;
  gap: 2px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid #ddd;
}
.filter-btn {
  font-family: inherit; font-size: 13px; font-weight: bold; color: #888;
  padding: 0 2px 4px; letter-spacing: -0.2px;
  border-bottom: 2px solid transparent; white-space: nowrap; transition: all 0.2s;
}
.filter-btn.active { color: #e67a88; border-bottom-color: #e67a88; }
.filter-divider { color: #ccc; font-size: 10px; margin: 0 1px; }

.tag-filter-wrapper { margin-bottom: 12px; padding-bottom: 8px; }
.tag-filter-container {
  display: flex; flex-wrap: wrap; gap: 10px;
  max-height: 72px; overflow: hidden; transition: max-height 0.3s ease;
}
.tag-filter-container.is-expanded { max-height: 800px; }
.tag-filter-btn {
  background: #fff; border: 1px solid #eaeaea; border-radius: 20px;
  padding: 6px 14px; font-size: 12px; color: #555; font-family: inherit;
  cursor: pointer; transition: all 0.2s;
}
.tag-filter-btn:hover { border-color: #ccc; }
.tag-filter-btn.active { background: #fceaeb; border-color: #e67a88; color: #e67a88; font-weight: bold; }
.tag-count { font-size: 10px; color: #888; margin-left: 4px; font-weight: normal; }
.tag-filter-btn.active .tag-count { color: #e67a88; }

.tag-toggle-btn {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  width: 100%; margin-top: 12px; background: none; border: none;
  color: #888; font-size: 12px; font-weight: bold; font-family: inherit; cursor: pointer;
}
.tag-toggle-btn.hidden { display: none; }
.toggle-icon { width: 14px; height: 14px; transition: transform 0.3s; }
.tag-filter-container.is-expanded + .tag-toggle-btn .toggle-icon { transform: rotate(180deg); }

/* 状態メッセージ */
.no-results, .loading-spinner { text-align: center; padding: 12px 0 24px; color: #666; }
.btn-reset {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 12px; padding: 10px 24px; background: #fff; color: #e67a88;
  border: 1px solid #e67a88; border-radius: 30px; font-size: 13px;
  font-weight: bold; font-family: inherit; transition: all 0.3s;
  box-shadow: 0 2px 6px rgba(230, 122, 136, 0.15);
}
.btn-reset:hover { background: #e67a88; color: #fff; }
.btn-reset svg { width: 16px; height: 16px; }

/* =========================================
   TOP記事一覧用 グリッドレイアウト
========================================= */
.article-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

@media (min-width: 768px) {
  .category-filter { gap: 16px; margin-bottom: 16px; }
  .filter-btn { font-size: 14px; padding: 0 8px 4px; letter-spacing: normal; }
  .filter-divider { font-size: 12px; }
  .tag-filter-wrapper { padding-bottom: 16px; }
  .tag-filter-btn { font-size: 14px; padding: 6px 16px; }
  .article-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}
