/* ==============================================
   トピックス (topics.html) ページ専用スタイル
   ============================================== */

/* ─── ページヘッダー ─────────────────────────── */

.topics-header {
  padding: 44px 131px 28px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}

.topics-breadcrumb {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: #4a4a4a;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

.topics-breadcrumb a {
  color: #4a4a4a;
  text-decoration: none;
  transition: color 0.15s;
}

.topics-breadcrumb a:hover { color: #000; text-decoration: underline; }
.topics-breadcrumb img { opacity: 0.45; }

.topics-title {
  font-size: 48px;
  font-weight: 500;
  color: #000;
  line-height: 1.1;
  letter-spacing: 0.5px;
}

/* ─── 記事グリッド セクション ────────────────── */

.topics-grid-section {
  padding: 40px 131px 80px;
  background: #fff;
}

/* グリッド本体 */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  column-gap: 46px;
  row-gap: 56px;
  margin-bottom: 60px;
}

/* ─── 記事カード ─────────────────────────────── */

.topics-card {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.topics-card-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #d0d0d0;
  margin-bottom: 14px;
  border-radius: 2px;
  position: relative;
}

/* ホバー時：オーバーレイ */
.topics-card-image::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.3s ease;
  pointer-events: none;
  z-index: 1;
}

.topics-card:hover .topics-card-image::after {
  background: rgba(0,0,0,0.08);
}

.topics-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.topics-card:hover .topics-card-image img {
  transform: scale(1.06);
}

/* メタ情報（日付・タイトル）ラッパー */
.topics-card-meta {
  padding-top: 2px;
}

/* 日付 */
.topics-card-date {
  font-size: 16px;
  font-weight: 400;
  color: #7d7d7d;
  line-height: 1;
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}

/* タイトル */
.topics-card-title {
  font-size: 20px;
  font-weight: 700;
  color: #000;
  line-height: 1.55;
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.topics-card:hover .topics-card-title {
  color: #333;
}

/* タイトル下の下線（hover時のみ表示） */
.topics-card-title-wrap {
  position: relative;
  display: inline-block;
  width: 100%;
}

/* ─── ページネーション ───────────────────────── */

.topics-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.page-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  font-size: 13px;
  font-weight: 400;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
  font-family: inherit;
  line-height: 1;
}

.page-btn:hover:not(.active) {
  background: #f5f5f5;
  border-color: #555;
}

.page-btn.active {
  background: #000;
  color: #fff;
  font-weight: 700;
  border-color: #000;
  cursor: default;
}

.page-prev,
.page-next {
  background: #fff;
}

.page-prev:disabled,
.page-next:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  border-color: #ccc;
}

/* ナビゲーション アクティブ */
.nav-active {
  font-weight: 700 !important;
  border-bottom: 2px solid #000;
  padding-bottom: 2px;
}

/* ─── レスポンシブ ─────────────────────────────── */

@media (max-width: 1280px) {
  .topics-header,
  .topics-grid-section {
    padding-left: 48px;
    padding-right: 48px;
  }

  .topics-grid {
    column-gap: 32px;
    row-gap: 48px;
  }
}

@media (max-width: 960px) {
  .topics-title { font-size: 36px; }

  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 28px;
    row-gap: 44px;
  }
}

@media (max-width: 640px) {
  .topics-header,
  .topics-grid-section {
    padding-left: 20px;
    padding-right: 20px;
  }

  .topics-header { padding-top: 28px; padding-bottom: 20px; }
  .topics-grid-section { padding-top: 28px; padding-bottom: 56px; }

  .topics-grid {
    grid-template-columns: repeat(2, 1fr);
    column-gap: 16px;
    row-gap: 32px;
    margin-bottom: 40px;
  }

  .topics-card-date { font-size: 12px; margin-bottom: 6px; }
  .topics-card-title { font-size: 14px; line-height: 1.5; }
  .topics-title { font-size: 28px; }
}

@media (max-width: 400px) {
  .topics-grid {
    grid-template-columns: 1fr;
    row-gap: 32px;
  }

  .topics-card-title { font-size: 16px; }
  .topics-card-date { font-size: 14px; }
}
