/* =======================================================================
   共通ユーティリティ
   ======================================================================= */

/* 画面リーダーのみが読む不可視テキスト  -------------------------------- */
.sr-only {
  position: absolute;
  width: 1px; /* レンダリング領域を 1px に圧縮           */
  height: 1px;
  margin: -1px; /* レイアウトから取り除く                    */
  padding: 0;
  overflow: hidden; /* 画面外に押し出す                          */
  clip: rect(0 0 0 0); /* 古い UA 互換                               */
  white-space: nowrap;
  border: 0;
}

/* 中央寄せフレックスコンテナ（横並び＋折返し） -------------------------- */
.flex-center {
  display: flex;
  max-width: 1000px;
  margin: 0 auto;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

/* CLS 対策：幅だけ決めて高さは自動調整する汎用レスポンシブ画像 ---------- */
img.responsive {
  max-width: 100%;
  height: auto;
}

/*----------------------------------------------------
  MainVisual
----------------------------------------------------*/
#mainVisualArea {
  position: relative;
  display: table; /* h1 を中央寄せするためのテーブルレイアウト */
  width: 100%;
  height: 150px;
  margin: 0;
  /* 45° グラデーション背景 – 主要ブラウザは現在 prefix 不要           */
  background: linear-gradient(
    45deg,
    #f3f5f7 0%,
    #f3f5f7 50%,
    #e8ebed 50%,
    #f0f3f5 70%,
    #f0f3f5 100%
  );
}
#mainVisualArea h1 {
  font-size: 28px;
  text-align: center;
  font-weight: 600;
  position: relative;
  z-index: 1;
  height: 100%;
  display: table-cell;
  vertical-align: middle;
}

/* =======================================================================
   タイポグラフィ & 共通レイアウト
   ======================================================================= */

h2 {
  width: auto;
  margin: 0 0 1.5rem;
  padding: 10px;
  color: #12519b;
  border-bottom: 1px solid currentColor;
}

.main-inner {
  max-width: 1100px;
  margin: 50px auto 0;
}

/* =======================================================================
   ページ内ナビゲーション（.page-nav）
   ======================================================================= */

.page-nav {
  margin: 20px 0;
  padding: 0 10px;
  text-align: center;
}
.page-nav-line {
  display: flex;
  flex-wrap: wrap; /* 折り返し許可 */
  justify-content: center; /* 横方向センター */
  list-style: none;
  row-gap: 10px;
  margin: 0;
  padding: 0;
}
.page-nav-line li {
  flex: 0 0 calc(90% / 6); /* 幅 16.666…% → 1 行で 6 枚 */
  text-align: center;
  border-left: 1px solid #12519b;
}
.page-nav-line li:last-child {
  border-right: 1px solid #12519b;
}

.page-nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: #333;
  background: #fff;
  padding: 10px 0;
  font-size: 18px;
  font-weight: 600;
  transition: box-shadow 0.25s ease, transform 0.2s ease;
}
.page-nav-link:hover {
  background: #eee;
}

.dimmer-link:hover {
  background-color: #eee;
}

/* =======================================================================
   セクション内汎用ラッパー
   ======================================================================= */

.section-inner {
  max-width: 1000px;
  margin-inline: auto;
}

/* =======================================================================
   メーカー一覧（.maker-list）
   ======================================================================= */

.maker-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
  margin: 0 0 30px;
}

.maker-list > li {
  width: 150px;
  height: 92px;
  display: flex;
  flex-direction: column; /* 1行目：ロゴ、2行目：安全規格 */
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  border: 1px solid #ccc;
}
.maker-list > li img:first-child {
  margin-bottom: 0.5rem;
}

/* =======================================================================
   ページトップボタン
   ======================================================================= */

#pageTop {
  position: fixed;
  right: 20px;
  bottom: 20px;
  padding: 10px;
  font-size: 12px;
  color: #fff;
  background: #999;
  border-radius: 5px;
}
#pageTop:hover {
  background: #333;
}

/* =======================================================================
   関連製品カードグリッド（.buttonWrap）
   ======================================================================= */

.products-ttl {
  text-align: center;
  margin: 0;
  color: #333;
  border-bottom: 1px solid #12519b;
}
.sub_ttl {
  text-align: center;
  margin-bottom: 30px;
  font-size: 12px;
  color: #12519b;
  line-height: 0;
}

.buttonWrap {
  --card-w: 240px; /* 変数で幅管理すると後から楽 */
  display: grid;
  grid-template-columns: repeat(auto-fill, var(--card-w));
  justify-content: space-evenly; /* Grid でも同じ値が使える */
  gap: 26px 0; /* 行ギャップのみ 26px、列は 0 で均等 */
  list-style: none;
  margin: 30px 0;
  padding: 0;
}

.buttonWrap li {
  background: #fff;
  box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
  transition: filter 0.3s;
  text-align: center;
}

.buttonWrap li:hover {
  filter: brightness(0.8);
}
.buttonWrap li a {
  display: block;
  width: 100%;
  height: 100%;
}
.buttonWrap li a img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-bottom: 1px solid #ccc;
}
.buttonWrap li a p {
  margin: 10px 0;
  font-weight: 600;
  text-align: center;
}

/* =======================================================================
   レスポンシブ調整
   ======================================================================= */
/* ---------- Laptop & 下位デスクトップ（～1024px） -------------------- */
@media (max-width: 1024px) {
  .main-inner,
  .section-inner {
    width: 96%; /* サイド余白確保 */
    max-width: 96%;
  }
}

/* ---------- Tablet（～768px） --------------------------------------- */
@media (max-width: 768px) {
  #mainVisualArea h1 {
    font-size: 24px;
  }
  h2 {
    font-size: 22px;
  }

  /* ページ内ナビ：2列 */
  .page-nav-line li {
    flex: 0 0 calc(90% / 3); /* 幅 30% → 自動で 2 行 */
  }
  .page-nav-line li:nth-child(3n) {
    border-right: 1px solid #12519b;
  }
}

/* ---------- Mobile 標準（～600px） ----------------------------------- */
@media (max-width: 600px) {
  #mainVisualArea {
    height: 120px;
  }
  .buttonWrap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 26px; /* 行・列どちらも 26 px の間隔 */
    list-style: none;
    margin: 30px;
    padding: 0;
  }
}

/* ---------- Mobile Small（～450px） ---------------------------------- */
@media (max-width: 450px) {
  #mainArea {
    padding: 20px 10px;
    box-sizing: border-box;
  }
  #contentsArea {
    margin: 20px auto 0;
    padding-bottom: 80px;
    font-size: 12px;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 20px;
  }

  /* ページ内ナビ：縦一列 */
  .page-nav-link {
    font-size: 12px;
  }

  /* インナーセクション：画像 */
  .section-inner div figure {
    max-width: 450px;
  }

  .buttonWrap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 26px; /* 行・列どちらも 26 px の間隔 */
    list-style: none;
    margin: 30px;
    padding: 0;
  }
  .buttonWrap li a p {
    font-size: 14px;
  }
}
