/* ==============================
   Technology Topics - タイル一覧 & 記事ページ
   ============================== */

/* --- キーワード絞り込みバー --- */

#topics_filter {
  position: relative;
  z-index: 10;
  padding: 40px 0 0;
}

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  width: 100%;
  max-width: 1080px;
  padding: 0 24px;
  box-sizing: border-box;
  margin: 0 auto;
}

.filter-chip {
  display: inline-block;
  padding: 8px 18px;
  border: 1px solid #bbb;
  border-radius: 20px;
  background: #fff;
  color: #555;
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
  transition: all 0.2s;
}

/* 選択中チップはホバーで文字色が変わらないようにする（背景#333で文字が消えるのを防ぐ） */
.filter-chip:not(.filter-chip--active):hover {
  border-color: #333;
  color: #333;
}

.filter-chip--active {
  background: #333;
  color: #fff;
  border-color: #333;
}

.topic-tile.is-hidden {
  display: none;
}

.topics__empty {
  width: 100%;
  max-width: 1080px;
  padding: 0 24px;
  box-sizing: border-box;
  margin: 40px auto 0;
  text-align: center;
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-size: 15px;
  color: #888;
}

.topics__empty.is-hidden {
  display: none;
}

/* タイル内：日付＋カテゴリの横並び */
.topic-tile__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* タイル内の対応製品ラベル */
.topic-tile__products {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.topic-tile__product {
  display: inline-block;
  background-color: #333;
  font-family: "Inter", "Noto Sans JP", sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  padding: 3px 10px;
  border-radius: 3px;
  color: #fff;
}


/* --- タイル一覧 --- */

#topics_grid {
  position: relative;
  z-index: 10;
  padding: 60px 0 120px;
}

.topics__container {
  display: grid;
  /* デスクトップ3カラム → タブレット2 → モバイル1 を自動で（小画面でもはみ出さない） */
  grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr));
  gap: 30px;
  width: 100%;
  max-width: 1080px;
  padding: 0 24px;
  box-sizing: border-box;
  margin: 0 auto;
}

.topic-tile {
  background-color: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  overflow: hidden;
  text-decoration: none;
  color: #333;
  display: block;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}

.topic-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.topic-tile__image img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.topic-tile__body {
  padding: 20px;
}

.topic-tile__body time {
  font-family: "Inter", "Noto Sans JP", sans-serif;
  font-size: 14px;
  color: #666;
}

.topic-tile__body h3 {
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-weight: 400;
  font-size: 18px;
  margin: 0 0 10px;
  line-height: 1.4em;
  color: #333;
}

.topic-tile__body p {
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.6em;
  color: #555;
}


/* --- 個別記事ページ --- */

.article__breadcrumb {
  width: 100%;
  max-width: 1080px;
  padding: 0 24px;
  box-sizing: border-box;
  margin: 200px auto 20px;
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-size: 14px;
  font-weight: 400;
  color: #666;
}

.article__breadcrumb a {
  color: #333;
  text-decoration: none;
}

.article__breadcrumb a:hover {
  text-decoration: underline;
}

#article_header {
  width: 100%;
  max-width: 1080px;
  padding: 0 24px;
  box-sizing: border-box;
  margin: 0 auto 60px;
  position: relative;
  z-index: 10;
}

#article_header h1 {
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-size: 32px;
  font-weight: 400;
  color: #333;
  margin-bottom: 20px;
  line-height: 1.6em;
}

#article_header time {
  font-family: "Inter", "Noto Sans JP", sans-serif;
  font-size: 16px;
  color: #666;
  display: block;
  margin-bottom: 15px;
}

.article__tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.article__tag {
  display: inline-block;
  background-color: #dde0d8;
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-size: 12px;
  font-weight: 300;
  padding: 4px 12px;
  border-radius: 3px;
  color: #555;
}

#article_content {
  position: relative;
  z-index: 10;
}

.article__body {
  width: 100%;
  max-width: 1080px;
  padding: 0 24px;
  box-sizing: border-box;
  margin: 0 auto 80px;
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 2em;
  color: #333;
}

.article__body img {
  max-width: 100%;
  height: auto;
  border-radius: 5px;
  margin: 20px 0;
  display: block;
}

.article__body figure {
  margin: 28px 0;
}

.article__body figure img {
  margin: 0 auto;
}

.article__body figcaption {
  margin-top: 8px;
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-size: 13px;
  line-height: 1.6;
  color: #777;
  text-align: center;
}

.article__body h2 {
  font-family: "Inter", "Noto Sans JP", sans-serif;
  font-size: 28px;
  border-bottom: 1px solid #666;
  padding-bottom: 10px;
  margin: 60px 0 30px;
}

.article__body h3 {
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-size: 22px;
  font-weight: 300;
  margin: 40px 0 20px;
}

.article__body h4 {
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-size: 18px;
  font-weight: 300;
  margin: 30px 0 15px;
}

.article__body p {
  margin-bottom: 1.5em;
}

.article__body ul,
.article__body ol {
  margin: 0 0 1.5em 1.5em;
}

.article__body li {
  margin-bottom: 0.5em;
}

/* 箇条書き（字下げ項目）に中黒（・）を付ける */
.article__body ul {
  list-style: none;
}

.article__body ul > li {
  position: relative;
  padding-left: 1.1em;
}

.article__body ul > li::before {
  content: "・";
  position: absolute;
  left: -0.25em;
  color: #1ebebb;
}

.article__body blockquote {
  border-left: 4px solid #dde0d8;
  padding: 10px 20px;
  margin: 20px 0;
  color: #555;
}

.article__body code {
  background-color: #dde0d8;
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 14px;
}

.article__body pre {
  background-color: #2d2d2d;
  color: #f8f8f2;
  padding: 20px;
  border-radius: 5px;
  overflow-x: auto;
  margin: 20px 0;
}

.article__body pre code {
  background-color: transparent;
  padding: 0;
  color: inherit;
}

.article__body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.article__body th,
.article__body td {
  border: 1px solid #ccc;
  padding: 10px 15px;
  text-align: left;
}

.article__body th {
  background-color: #dde0d8;
  font-weight: 300;
}

#article_nav {
  position: relative;
  z-index: 10;
  text-align: center;
  margin-bottom: 80px;
}

.back-to-topics {
  display: inline-block;
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-weight: 400;
  font-size: 16px;
  color: #333;
  text-decoration: none;
  padding: 15px 40px;
  border: 1px solid #666;
  border-radius: 5px;
  transition: background 0.2s, color 0.2s;
}

.back-to-topics:hover {
  background-color: #333;
  color: #fff;
}


/* --- 記事末尾のお問い合わせCTA --- */

#article_cta {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto 60px;
  padding: 0 24px;
  box-sizing: border-box;
}

.article-cta__inner {
  /* 背景画像・背景色なしのシンプル構成（テキスト＋ボタンのみ） */
  text-align: center;
  padding: 24px 0;
}

.article-cta__text {
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-size: 17px;
  font-weight: 500;
  color: #333;
  margin: 0 0 20px;
  line-height: 1.7;
}

.article-cta__btn {
  display: inline-block;
  font-family: "Noto Sans JP", "Inter", sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #fff;
  background: #1ebebb;
  text-decoration: none;
  padding: 15px 40px;
  border-radius: 4px;
  transition: background 0.2s;
}

.article-cta__btn:hover {
  background: #179c9a;
  color: #fff;
}


/* --- レスポンシブ（768px以下） --- */

@media screen and (max-width: 768px) {
  .topics__container {
    gap: 20px;
  }

  .filter-bar {
    gap: 8px;
  }

  .filter-chip {
    font-size: 13px;
    padding: 6px 14px;
  }

  .topic-tile__image img {
    height: 180px;
  }

  .article__breadcrumb {
    margin-top: 130px;
    padding: 0;
    font-size: 12px;
  }

  .article__body ul,
  .article__body ol {
    padding: 0;
  }

  /* 一覧ページ末尾「AC技術体系」案内文: スマホで左右が画面端に張り付かないよう余白 */
  #topics_more p {
    padding-left: 24px;
    padding-right: 24px;
  }

  .article-cta__text {
    font-size: 16px;
  }

  .article-cta__btn {
    display: block;
    padding: 14px 24px;
  }

  #article_header h1 {
    font-size: 24px;
  }

  .article__body h2 {
    font-size: 22px;
    margin: 40px 0 20px;
  }

  .article__body h3 {
    font-size: 18px;
    margin: 30px 0 15px;
  }
}

/* ===== 一覧ページネーション（9件/ページ） ===== */
.topics-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 48px auto 0;
  position: relative;
  z-index: 10;
}

.topics-pagination.is-hidden {
  display: none;
}

.topics-page {
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #bbb;
  background: #fff;
  color: #555;
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.topics-page:hover:not(:disabled):not(.is-active) {
  border-color: #333;
  color: #333;
}

.topics-page.is-active {
  background: #333;
  border-color: #333;
  color: #fff;
  font-weight: 700;
  cursor: default;
}

.topics-page:disabled {
  opacity: 0.4;
  cursor: default;
}

.topics-page--nav {
  padding: 0 16px;
}

@media (max-width: 768px) {
  .topics-page {
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    font-size: 14px;
  }

  /* 列数の多い表はページ全体を押し広げず、表の中だけ横スクロールさせる */
  .article__body table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
  }
}
