/* ============================================================
   Archive / Search Pages
   ============================================================ */

.site-main {
  padding-top: calc(var(--header-h) + var(--space-12));
  padding-bottom: var(--space-16);
}

.page-header {
  margin-bottom: var(--space-12);
}

.page-header .eyebrow {
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.page-header .eyebrow::before {
  content: "";
  width: 24px;
  height: 1px;
  background: var(--blue);
}

/* ============================================================
   コンテナ
   ============================================================ */
.site-main .container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 40px;
}

/* ============================================================
   CATEGORY SWITCHER (他のカテゴリへのリンク)
   ============================================================ */
.cat-switcher {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line-2);
}
.cat-switcher-eyebrow {
  font-family: "Archivo", sans-serif;
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .24em;
  color: var(--blue);
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.cat-switcher-eyebrow::before {
  content: "";
  width: 28px;
  height: 1px;
  background: var(--blue);
}
.cat-switcher-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.cat-chip {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 16px;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  text-decoration: none;
  transition: all .25s var(--ease-out);
  min-width: 110px;
}
.cat-chip:hover {
  border-color: var(--line);
  background: var(--bg-3);
  transform: translateY(-2px);
}
.cat-chip.is-active {
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 8px 24px -10px var(--blue-glow);
}
.cat-chip-no {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: .12em;
  color: var(--blue);
  text-transform: uppercase;
}
.cat-chip.is-active .cat-chip-no {
  color: rgba(255, 255, 255, .85);
}
.cat-chip-name {
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-weight: 700;
  font-size: 13px;
  color: var(--fg);
  letter-spacing: .02em;
}
.cat-chip.is-active .cat-chip-name {
  color: #fff;
}

/* ALL チップは小さめ＆別カラー */
.cat-chip-all {
  background: transparent;
}
.cat-chip-all .cat-chip-no { color: var(--fg-dim); }
.cat-chip-all .cat-chip-name { color: var(--fg-dim); }
.cat-chip-all:hover {
  border-color: var(--fg-dim);
  background: var(--bg-2);
}
.cat-chip-all:hover .cat-chip-no,
.cat-chip-all:hover .cat-chip-name {
  color: #fff;
}

@media (max-width: 768px) {
  .cat-switcher { margin-bottom: 32px; padding-bottom: 24px; }
  .cat-chip {
    min-width: 0;
    padding: 8px 12px;
  }
  .cat-chip-name { font-size: 12px; }
}

/* ============================================================
   ARTICLES GRID (3列、カード間に余白)
   ============================================================ */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
  position: relative;
}

@media (max-width: 1100px) {
  .articles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
}
@media (max-width: 768px) {
  .articles-grid { grid-template-columns: 1fr; gap: 20px; }
}

/* ============================================================
   ARTICLE CARD (縦型レイアウト)
   template-parts/article-card.php の構造に対応
   ============================================================ */
.articles-grid .article-card {
  position: relative;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  cursor: pointer;
  overflow: hidden;
  transition: all .35s var(--ease-out);
  display: flex;
  flex-direction: column;
}
.articles-grid .article-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--blue);
  transform: scaleY(0);
  transform-origin: bottom;
  transition: transform .35s var(--ease-out);
  z-index: 3;
}
.articles-grid .article-card:hover {
  border-color: var(--line);
  transform: translateY(-3px);
}
.articles-grid .article-card:hover::before { transform: scaleY(1); }

.articles-grid .article-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.articles-grid .article-card-thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-3);
}
.articles-grid .article-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease-out);
}
.articles-grid .article-card:hover .article-card-thumb img {
  transform: scale(1.06);
}
.articles-grid .article-card-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,0,0,0) 50%, rgba(0,0,0,.4) 100%);
  pointer-events: none;
}

.articles-grid .article-card-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.articles-grid .article-card-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--fg-dim);
  letter-spacing: .04em;
  flex-wrap: wrap;
}
.articles-grid .article-card-meta .trade-tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  color: var(--blue);
  letter-spacing: .08em;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.articles-grid .article-card-meta .trade-tag::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--blue);
  box-shadow: 0 0 6px var(--blue-glow);
}

.articles-grid .article-card-title {
  font-family: "Zen Kaku Gothic New", sans-serif;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.5;
  color: #fff;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color .25s;
}
.articles-grid .article-card:hover .article-card-title { color: #e0e0e0; }

.articles-grid .article-card-excerpt {
  font-size: 12.5px;
  line-height: 1.7;
  color: #999;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ページヘッダーとグリッドの間隔 */
.site-main .articles-grid + .pagination,
.site-main .articles-grid + nav.pagination {
  margin-top: 48px;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination,
nav.pagination,
.wp-pagenavi {
  margin-top: var(--space-12);
  display: flex;
  justify-content: center;
  gap: 8px;
}

.pagination .page-numbers,
.wp-pagenavi a,
.wp-pagenavi span {
  font-family: var(--font-mono);
  font-size: 13px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  color: var(--fg-dim);
  background: var(--bg-2);
  transition: all var(--t-fast) var(--ease-out);
}

.pagination .page-numbers.current,
.pagination .page-numbers:hover,
.wp-pagenavi span.current,
.wp-pagenavi a:hover {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* ============================================================
   SEARCH FORM
   ============================================================ */
.search-form {
  display: flex;
  align-items: stretch;
  max-width: 600px;
  margin: 0 auto;
  border: 1px solid var(--line);
  background: var(--bg-2);
}

.search-input {
  flex: 1;
  padding: 16px 20px;
  font-size: 15px;
  color: var(--fg);
  background: transparent;
}

.search-submit {
  padding: 0 24px;
  background: var(--blue);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 11px;
  letter-spacing: .14em;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background var(--t-base) var(--ease-out);
}

.search-submit:hover {
  background: var(--blue-2);
}
