/************************************
 *  記事一覧（articles/index）
 ************************************/

/* 見出し */
.articles-title {
  font-size: 1.8em;
  margin: 20px 15px;
  font-weight: 700;
}

/* =========================
   新着記事グリッド
========================= */

/* スマホ：1カラム */
.articles-grid {
  display: grid;
  grid-template-columns: 1fr;      /* ← ここを1frに */
  gap: 14px;
  padding: 0 12px 30px;
}

/* PC：2カラム */
@media (min-width: 768px) {
  .articles-grid {
    grid-template-columns: repeat(2, 1fr);  /* ← 元の2列 */
    gap: 20px;                              /* PCは少し広め */
  }
}

/* =========================
   トップページ：新着記事
========================= */

/* スマホ：縦1カラム */
.articles-grid--top {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 0 12px 24px;
}

/* PC：3カラム（2行想定） */
@media (min-width: 1024px) {
  .articles-grid--top {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

.top-title {
  margin-top: 3px;
  font-size:1.1em;
  font-weight:600;
}

/* =========================
   記事一覧グリッド
========================= */
.articles-grid-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  padding: 0 12px 30px;
}

/* PC */
@media (min-width: 768px) {
  .articles-grid-list {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* もっと広いPCなら3カラムにしてもOK（任意） */
@media (min-width: 1100px) {
  .articles-grid-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* =========================
   おすすめ記事グリッド
========================= */
.recommend-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 767px) {
  .recommend-grid {
    grid-template-columns: 1fr;
  }

  /* 2件目以降を非表示 */
  .recommend-grid .articles-card:nth-child(n+2) {
    display: none;
  }
}

/* 記事内区切り線 */
.articles-view hr {
  border: none;
  height: 1px;
  background-color: var(--accent);
  margin-top: 30px;
}

/* 記事内見出しh2 */
.articles-view h2 {
  margin-top: 0px;
  margin-bottom: 5px;
  padding: 6px;
  color: var(--accent);
  background-color: var(--accent-soft);
}

/* 記事内見出しh3 */
.articles-view h3 {
  margin-top: 0px;
  margin-bottom: 5px;
}

/* 記事内箇条書きul */
.articles-view ul {
  margin-top: 0px;
  margin-bottom: 5px;
}

/* 記事内画像 */
.articles-body img {
  height: auto;
  margin: 24px auto;
  border-radius: 18px;
}

/* カード本体 → 共通.cardを継承 */
.articles-card {
  overflow: hidden;
}

.articles-card a {
  color: inherit;
}

.articles-card.card {
  padding: 0; /* カード共通のpaddingを打ち消す */
}

/* サムネ */
.articles-thumb-wrap {
  width: 100%;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--bg-sub); /* #eee → テーマ変数 */
}

.articles-thumb-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}



/* カード情報部分 */
.articles-info {
  padding: 10px 12px 40px;
}

.articles-info .date {
  font-size: 0.76em;
  color: var(--text-sub);
  margin-bottom: 4px;
}

.articles-info .title {
  font-size: 1em;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.3;
}

.articles-info .excerpt {
  font-size: 0.85em;
  color: var(--text-sub);
}


/************************************
 *  記事詳細（articles/view）
 ************************************/

.articles-view {
  margin-bottom: 24px;
}

.articles-view .articles-title {
  font-size: 1.6rem;
  margin: 20px 0 10px;
}

.articles-date {
  font-size: 0.9rem;
  color: var(--text-sub);
  margin-bottom: 10px;
}

.articles-thumb {
  width: 100%;
  border-radius: var(--radius);
  margin: 20px 0;
}

.article-body {
  line-height: 1.8;
  font-size: 1rem;
  color: var(--text);
}


/************************************
 *  前後記事ナビ（Prev / Next）
 ************************************/

.articles-nav-wrap {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

/* カード → 共通.card継承 */
.articles-nav-card {
  flex: 1;
  padding: 12px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  transition: opacity 0.2s ease;
}

.articles-nav-card:hover {
  opacity: .85;
}

/* 空枠 */
.articles-nav-card.empty {
  background: transparent;
  border: none;
  box-shadow: none;
}

.nav-label {
  font-size: 13px;
  color: var(--text-sub);
}

.nav-label.right {
  text-align: right;
}

.nav-thumb img {
  width: 100%;
  border-radius: var(--radius);
}

.nav-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  padding-bottom: 24px;
}

.nav-date {
  position: absolute;
  bottom: 12px;
  right: 16px;
  font-size: 13px;
  color: var(--text-sub);
}


/************************************
 *  関連記事
 ************************************/
.related-title {
  margin-top: 28px;
  margin-bottom: 2px;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.related-item {
  display: flex;
  gap: 12px;
  padding: 10px;
  min-height: 90px;
  position: relative;
}

.related-thumb-small {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-sub); /* #ccc → 変数 */
}

.related-thumb-small img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.related-text-box {
  flex: 1;
  padding-bottom: 22px;
}

.related-item-title {
  font-size: 15px;
  line-height: 1.4;
  font-weight: 500;
  color: var(--text);
  margin: 0;
}

.related-item-date {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 13px;
  color: var(--text-sub);
}

/*****************************************
 * ページネーション（articles）
 *****************************************/

.pagination {
    text-align: center;
    margin: 25px 0 40px;
    font-size: 1rem;
}

/* 共通リンクボタン */
.pagination a,
.pagination .page-number-link {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    background: var(--accent-soft);
    color: var(--link);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    border: 1px solid var(--accent);
    transition: 0.2s ease;
}

/* ホバー */
.pagination a:hover,
.pagination .page-number-link:hover {
    background: var(--accent);
    color: #fff;
}

/* << 前へ / 次へ >> ボタン */
.pagination .page-btn {
    font-size: 0.95rem;
}

/* 現在ページ */
.pagination .page-number-current {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 4px;
    background: var(--accent);
    color: var(--text);
    border-radius: 8px;
    font-weight: 700;
}

/* 数字の間のスラッシュ */
.pagination .page-number-sep {
    margin: 0 2px;
    opacity: 0.6;
}

/************************************
 *  タグ（※ → style.css に移動推奨）
 ************************************/
.tag-articles-title {
  margin-bottom: 2px;
}

.tag-btn {
  display: inline-block;
  padding: 6px 14px;
  margin: 3px 3px 12px;
  border-radius: 16px;
  font-size: 14px;
  text-decoration: none;
  color: #222; /* #1f2937 → 統合 */
  border: 1px solid var(--border);
  background: var(--card);
  box-shadow: var(--shadow);
  transition: .2s ease;
}

.tag-btn:hover {
  transform: translateY(-2px);
  opacity: .95;
}

.tag-btn.active {
  border-color: var(--accent);
}

.tag-title {
  text-align: center;
  color: var(--accent);
  font-size: 1.5em;
  font-weight: 700;
  margin: 0 0 15px;
}

.tags-search-box {
  margin: 16px 0 24px;
}

.tags-search-box a {
  display: inline-block;
  padding: 10px 16px;
  background: var(--accent-soft);
  color: var(--link);
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.tags-search-box a:hover {
  background: var(--accent);
  color: #fff;
}

@media (min-width: 1024px) {
  .article-content {
    max-width: 900px;
    margin: 0 auto 32px;
  }

  .article-content img {
    max-height: 480px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 24px;
    object-fit: contain;
  }
}


/* 誘導ボタン全体の枠組み */
.bbs-cta-container {
    margin: 5px auto;
    padding: 1px;
    text-align: center;
    background-color: var(--card);
    border-radius: 20px;
    border: 1px solid var(--border);
}

/* ボタン上のテキスト */
.bbs-cta-text {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 15px;
    font-weight: bold;
}

/* ボタン本体のデザイン */
.bbs-cta-button {
    display: inline-block;
    padding: 15px 30px;
    margin-bottom: 10px;
    background-color: var(--accent);
    color: #ffffff !important;
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    border-radius: 50px; /* 丸みのあるデザイン */
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 4px 10px rgba(160, 132, 255, 0.3);
}

/* ホバー（マウスを乗せた時）の動き */
.bbs-cta-button:hover {
    background-color: var(--link);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(160, 132, 255, 0.4);
}