footer {
  background-color: #333;
  color: #fff;
  text-align: center;
  padding: 20px 0; /* 背景を小さく */
  margin-top: 40px;
  font-size: 12px;
  position: relative; /* 相対位置指定 */
  bottom: 0;
  width: 100%;
  min-height: 100px; /* フッターの最小高さを指定して黒背景を小さく */
}

.footer-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 60%;
  margin: 0 auto 5px; /* 下部の余白を縮める */
}

.footer-links a {
  color: #fff;
  text-decoration: none;
  text-align: center;
  flex: 1; /* 各リンクに均等なスペースを割り当て */
  padding: 0 5px; /* 必要に応じて余白をさらに縮小 */
}

.footer-links a:nth-child(2) {
  text-align: center; /* お問い合わせフォームを中央に配置 */
}

.footer-links a:hover {
  text-decoration: underline;
}

/* フォーム中央揃え */
.center-link {
  position: absolute;
  left: 50%;
  transform: translateX(-50%); /* お問い合わせフォームを中央に固定 */
}

/* フッター内のパラグラフのマージンをリセット */
footer p {
  margin: 0;
  padding: 0;
  position: absolute; /* 絶対配置にして、フッターの下部に固定 */
  bottom: 5px; /* リンクと「© 2024...」の間を縮める */
  left: 50%;
  transform: translateX(-50%); /* 中央寄せ */
}

@media (max-width: 768px) {
  .footer-links {
    flex-direction: column; /* フッターのリンクを縦に並べる */
    align-items: center;
  }
  footer {
    padding: 15px;
    width: 100%; /* フッターがビューポートの幅を占める */
  }
}
