/* =============== Universal hardening =============== */
*,*::before,*::after { box-sizing: border-box; }
img, video, iframe { max-width: 100%; height: auto; }

/* Flexの最小サイズ（はみ出し防止：Edge/Firefox差吸収） */
.flex > * { min-width: 0; min-height: 0; }

/* =============== Header / Menu 修正 =============== */
/* display:table + 固定幅は崩れやすいので、メニュー内だけ上書き */
#menu .wrapper {
  display: flex !important;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  width: 100% !important;
  max-width: 960px;     /* section と合わせる */
  margin: 0 auto;
}

/* メニュー本体は高さ固定しない（フォント差・OS差に強く） */
#menu {
  height: auto !important;
}

/* UL をフレックス化して横並びを安定化（float撤去） */
#menu ul {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;               /* 等間隔は li の padding に任せる */
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 旧floatの解除＋高さ自動＋タップ領域の確保 */
#menu ul li {
  float: none !important;
  position: relative;
  height: auto !important;
  padding: 0;           /* a に移譲 */
  border-left: 1px solid #fff;
}

/* 右端の罫線（元CSSのtypoを正しく上書き） */
#menu ul li:last-child {
  border-right: 1px solid #fff;
}

/* クリック領域を a に集約（行間差異の影響を排除） */
#menu ul li > a {
  display: block;
  padding: .6rem 1.2rem;    /* 45px 相当の触りやすさを維持 */
  line-height: 1.2;
  color: #fff;
  text-decoration: none;
}

/* アクティブ/ホバーの視認性（既存色を尊重しつつ） */
#menu ul li.current-menu-item,
#menu ul li:hover {
  background-color: #004000;   /* 既存の強調色に合わせる */
}

/* モバイルの @media で #menu を display:none にしているが、
   タイポの全角スペース混入を吸収（念のため） */
@media (max-width: 959px) {
  #menu { display: none !important; }
}

/* =============== 細かな差異吸収 =============== */
/* 見出しやボックスの固定高さを避ける（文字拡大で崩れない） */
header, footer, section { min-height: 0; }

/* テーブルが親幅を越えないように */
.table_1, table { width: 100%; border-collapse: collapse; }

/* 旧 reset が text-align:justify を全体に当てているため、
   ナビや表、箇条書きなど「均等割り付け」しない方が良い領域を中立化 */
#menu, #footer_menu, .menu, nav, table, dl, ol, ul { text-align: initial; }
