/* スマホ用ナビ（2列） */
@media screen and (max-width: 768px) {
  #navi {
    position: static !important;
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
    background-color: #3cb371 !important;
    padding: 10px !important;
    box-sizing: border-box !important;
    margin: 0 auto !important;
  }

  #navi ul {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    justify-items: center !important;
  }

  #navi li {
    width: 100% !important;
  }

  #navi a {
    display: block !important;
    width: 90% !important;
    padding: 12px !important;
    font-size: 1.1em !important;
    background-color: #ffffff !important;
    border: 1px solid #ccc !important;
    border-radius: 6px !important;
    text-align: center !important;
    color: #333 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
  }

  #navi a:hover {
    background-color: #e6ffe6 !important;
  }
}

/* 現在ページの強調（共通） */
#navi a.current {
  background-color: #ffff99 !important;
  color: #006600 !important;
  font-weight: bold !important;
  border: 2px solid #999 !important;
}

/* PC用ナビ（横並び） */
@media screen and (min-width: 769px) {
  #navi {
    background-color: #f0f0f0;
    padding: 12px 0;
    margin-top: 0;
    width: 100%;
    box-sizing: border-box;
    border-top: 2px solid #ccc;
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
  }

  #navi ul {
    display: flex;
    justify-content: center;
    gap: 1em;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  #navi li a {
    text-decoration: none;
    padding: 8px 12px;
    background-color: #ffffff;
    border-radius: 4px;
    color: #333;
    font-weight: bold;
    transition: background-color 0.3s;
  }

  #navi li a:hover {
    background-color: #e0e0e0;
  }

  #navi li a.current {
    background-color: #ffff99;
    color: #000;
  }
}

/* コンテンツとの間隔 */
#navi {
  height: auto;
  padding-bottom: 12px;
}

@media screen and (max-width: 768px) {
  #navi a {
    width: 75% !important;   /* ← 90% → 75% に変更 */
    padding: 10px !important;
    font-size: 1em !important;
  }
}
#contents {
  margin-top: 16px;
}
/* 全ページ共通：スマホ時のナビ背景を白に統一 */
@media screen and (max-width: 768px) {
  #navi {
    background-color: #ffffff !important;
  }
}
