/* ==========================================================================
   アーカイブ・検索結果 共通スタイル
   ========================================================================== */

/* --------------------------------------------------------------------------
   アーカイブヘッダー
   -------------------------------------------------------------------------- */

.archive-hero {
  background-color: var(--color-primary);
  padding: 3rem 0 2.5rem;
  margin-top: calc(-1 * var(--header-h));
  padding-top: calc(var(--header-h) + 2.5rem);
}

.archive-hero__inner {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.archive-hero__label {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
}

.archive-hero__title {
  font-size: clamp(1.25rem, 3vw, 2rem);
  font-weight: 700;
  color: #fff;
  margin: 0;
  line-height: 1.3;
}

.archive-hero__desc {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.85);
  margin: 0.25rem 0 0;
  line-height: 1.7;
}

/* --------------------------------------------------------------------------
   レイアウト
   -------------------------------------------------------------------------- */

.archive-layout {
  background-color: var(--color-bg-soft);
  padding: 3rem 0 4rem;
}

/* --------------------------------------------------------------------------
   投稿グリッド
   -------------------------------------------------------------------------- */

.post-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .post-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
}

/* --------------------------------------------------------------------------
   投稿カード
   -------------------------------------------------------------------------- */

.post-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  list-style: none;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.post-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.post-card__link:hover {
  color: inherit;
}

/* サムネイル */
.post-card__thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background-color: var(--color-bg-soft);
}

.post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.post-card:hover .post-card__thumb img {
  transform: scale(1.04);
}

/* No Image プレースホルダー */
.post-card__no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #e8e8e8;
}

.post-card__no-image span {
  font-size: 0.75rem;
  color: #aaa;
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* カテゴリーバッジ（共通） */
.post-card__cat {
  position: absolute;
  top: 8px;
  left: 8px;
  background-color: var(--color-primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  line-height: 1.6;
  white-space: nowrap;
  max-width: calc(100% - 16px);
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* 固定ページ（PAGE） */
.post-card__cat--page {
  background-color: #3a7bd5;
}

/* その他カスタム投稿タイプ */
.post-card__cat--custom {
  background-color: #999;
  color: #fff;
}

/* 本文エリア */
.post-card__body {
  padding: 0.875rem 1rem 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.post-card__date {
  font-size: 0.75rem;
  color: var(--color-text-light, #888);
}

.post-card__title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
  margin: 0;
  color: var(--color-text);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 640px) {
  .post-card__title {
    font-size: 14px;
  }

  .post-card__body {
    padding: 0.625rem 0.75rem 0.875rem;
  }
}

/* --------------------------------------------------------------------------
   ページネーション
   -------------------------------------------------------------------------- */

.archive-pagination {
  margin-top: 3rem;
  display: flex;
  justify-content: center;
}

.archive-pagination .page-numbers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  list-style: none;
  padding: 0;
  margin: 0;
  align-items: center;
}

.archive-pagination .page-numbers li {
  display: flex;
}

.archive-pagination .page-numbers a,
.archive-pagination .page-numbers span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  height: 2.25rem;
  padding: 0 0.5rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #ddd;
  background: #fff;
  color: var(--color-text);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.archive-pagination .page-numbers a:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.archive-pagination .page-numbers .current {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.archive-pagination .page-numbers .dots {
  border: none;
  background: none;
  color: #aaa;
}

/* --------------------------------------------------------------------------
   記事なし
   -------------------------------------------------------------------------- */

.archive-no-posts {
  text-align: center;
  padding: 3rem 0;
  color: var(--color-text-light, #888);
  line-height: 1.8;
}
