/* archive-post.css - 投稿一覧ページ（統一デザイン版） */

:root {
  --ny-accent: #4C9D81;
  --text: #473c34;
  --muted: #8e8a86;
  --badge-color: #fb8498;
  --button-color: #70B3B1;
  --link-color: #FFC509;
}

body.archive,
body.category,
body.tag {
  background: #F9F8F5;
}

/* =====================
   アーカイブコンテナ
===================== */

.posts-archive {
  background: #fff;
  padding: 3rem;
  margin: 2rem auto;
  max-width: 1400px;
  border-radius: 12px;
}

.posts-archive h2 {
  font-size: 2rem;
  color: var(--ny-accent);
  text-align: left;
  margin-bottom: 3rem;
  font-weight: 600;
  margin-top: 0;
}

/* =====================
   グリッドレイアウト
===================== */

.posts-archive .container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin: 0;
  padding: 0;
}

/* =====================
   カード全体リンク化
===================== */

.post-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #f0f0f0;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  cursor: pointer;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.post-card:focus {
  outline: none;
}

.post-card:focus-visible {
  outline: 2px solid var(--ny-accent);
  outline-offset: 2px;
}

.post-card:hover {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

/* =====================
   カード画像部分（6:4）
===================== */

.card-inner {
  position: relative;
  width: 100%;
  aspect-ratio: 6 / 4;
  overflow: hidden;
  background: #f5f5f5;
}

.box {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.imgBox {
  position: relative;
  width: 100%;
  height: 100%;
}

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

.post-card:hover .imgBox img {
  transform: scale(1.05);
}

/* 画像がない場合のプレースホルダー */
.imgBox .no-image {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8e8e8;
  color: var(--muted);
  font-size: 0.9rem;
}

/* =====================
   タグバッジ（画像左上オーバーレイ）
===================== */

.badge-overlay {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  z-index: 5;
}

.badge-tag {
  display: inline-block;
  background: rgba(255, 255, 255, 0.95);
  color: #473c34;
  padding: 0.375rem 0.75rem;
  border-radius: 3px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  backdrop-filter: blur(4px);
}

.badge-tag.news {
  background: rgba(76, 157, 129, 0.9);
  color: #fff;
}

.badge-tag.event {
  background: rgba(255, 197, 9, 0.9);
  color: #fff;
}

/* 右下の凹み装飾 */
.card-inner::before {
  content: "";
  position: absolute;
  bottom: -0.375rem;
  right: -0.375rem;
  width: 3.4rem;
  height: 3.4rem;
  background: #fff;
  border-top-left-radius: 50%;
  z-index: 1;
}

.card-inner::after {
  content: "";
  position: absolute;
  bottom: -0.375rem;
  right: -0.375rem;
  width: 3.4rem;
  height: 3.4rem;
  background: transparent;
  border-top-left-radius: 50%;
  box-shadow: inset 0.313rem 0.313rem 0 0.313rem #fff;
  z-index: 2;
}

/* =====================
   ボタン
===================== */

.icon {
  position: absolute;
  bottom: 0.3rem;
  right: 0.3rem;
  z-index: 3;
}

.iconBox {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: var(--button-color);
  border-radius: 50%;
  color: #fff;
  text-decoration: none;
  border: none;
  transition: all 0.3s ease;
  box-shadow: 0 3px 10px rgba(112, 179, 177, 0.3);
}

.iconBox:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(112, 179, 177, 0.4);
}

.iconBox .material-symbols-outlined {
  font-size: 1.2rem;
  transition: transform 0.3s ease;
  outline: none;
  border: none;
}

.post-card:hover .iconBox .material-symbols-outlined {
  transform: translateX(2px);
}

/* =====================
   カード下の情報
===================== */

.content {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.post-date {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
  margin: 0;
}

.content h3 {
  font-size: 1rem;
  color: var(--text);
  margin: 0;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content p {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* =====================
   カテゴリ情報（ピンアイコン + テキスト）
===================== */

.category-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text);
  margin-top: 0.25rem;
}

.category-info i {
  color: var(--button-color);
  font-size: 0.9rem;
}

/* =====================
   タグセクション
===================== */

.tags-section {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid #e0e0e0;
}

.tags-label {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-item {
  display: inline-block;
  background: var(--link-color);
  color: #fff;
  padding: 0.375rem 0.75rem;
  border-radius: 16px;
  font-size: 0.7rem;
  font-weight: 600;
  white-space: nowrap;
}

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

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e0e0e0;
}

.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.75rem;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.pagination .page-numbers:hover {
  background: var(--ny-accent);
  color: #fff;
  border-color: var(--ny-accent);
}

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

.pagination .page-numbers.dots {
  border: none;
  background: transparent;
}

/* =====================
   レスポンシブ：タブレット
===================== */

@media (max-width: 900px) {
  .posts-archive {
    padding: 2rem;
    margin: 2rem 1.5rem;
  }

  .posts-archive .container {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}

/* =====================
   レスポンシブ：スマートフォン
===================== */

@media (max-width: 480px) {
  .posts-archive {
    background: transparent;
    padding: 0;
    margin: 2rem 0;
    border-radius: 0;
  }

  .posts-archive h2 {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    margin-left: 1.5rem;
    margin-right: 1.5rem;
    max-width: 90vw;
  }

  .posts-archive .container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 1.5rem;
    margin: 0;
    margin-bottom: 2rem;
  }

  .post-card {
    flex: 1 1 auto;
  }

  .card-inner {
    aspect-ratio: 6 / 4;
  }

  .content {
    padding: 1rem;
  }

  .content h3 {
    font-size: 0.95rem;
  }

  .content p {
    font-size: 0.8rem;
  }
}