.anchor_link_sec {
  position: relative;
  padding: 40px 0 30px;
}
.anchor_link_inner {
  max-width: 880px;
  width: 100%;
  margin: auto;
}

/* PC/タブレット：段ごと中央寄せ */
.anchor_link_list {
  --gap: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--gap);
  --col-basis: calc((100% - 2*var(--gap)) / 3); /* デフォルト：3列計算（保険） */
}

/* 列数スイッチ（JS がどちらかを付与） */
.anchor_link_list.cols-3 { --col-basis: calc((100% - 2*var(--gap)) / 3); } /* 3列 */
.anchor_link_list.cols-4 { --col-basis: calc((100% - 3*var(--gap)) / 4); } /* 4列 */

.anchor_link_item {
  /* ← ここが重要：枠線込みで幅計算させる */
  box-sizing: border-box;

  display: block;
  flex: 0 0 var(--col-basis); /* 変数で列幅を制御（枠線込みになる） */
  max-width: 220px;           /* 上限は維持してOK（flex-basisが優先される） */
  width: 100%;
  padding: 14px 0 16px;       /* 横方向のパディングは無いので幅に影響しない */
  border: 1px solid #FE0000;
  background-color: #FE0000;
  color: #fff;
  text-align: center;
  box-shadow: 0 4px 4px rgba(0,0,0,0.25);
  text-decoration: none;
}
.anchor_link_item:hover {
  background-color: #fff;
  color: #FE0000;
}
.his_link-text {
  position: relative;
  padding-bottom: 20px;
  font-family: 'Roboto Flex', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
  font-weight: 700;
  font-size: 20px;
  line-height: 23px;
  word-break: keep-all;     /* 単語途中で改行しない */
  overflow-wrap: normal;    /* ブラウザに単語単位の改行を指示 */
  white-space: normal;      /* 連続空白を通常扱いに戻す（念のため） */
}

/* タブレット */
@media (max-width: 980px) {
  .anchor_link_sec { padding: 40px 0 10px; }
  .anchor_link_inner { padding: 0 40px; }
  .anchor_link_list {
    gap: 10px;  /* ← お好みの値に調整（例: 10〜15px） */
}

/* スマホ：縦積み */
@media (max-width: 680px) {
  .anchor_link_sec { padding: 40px 0 10px; }
  .anchor_link_inner { padding: 0 20px; }
  .anchor_link_list { flex-direction: column; gap: 25px; }
  .anchor_link_item { max-width: 350px; width: 100%; margin: auto; }
}


