

/* メニューオープン時のbodyスクロール無効化 */
body.nav-open {
  overflow: hidden;
}

/* ==========================================
   共通スタイル
   ========================================== */
#header {
  background: none;
  height: auto;
  border: none;
  display: block;
}

header {
  background: transparent;
  border: none;
  line-height: 1;
  text-align: center;
  padding: 1rem 0;
}

header h1 {
  border: none;
  background: transparent;
  margin-bottom: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

header h1 figure {
  margin: 0;
  padding: 0;
}

header h1 img,
.mainlogo_item {
  max-width: 120px;
  margin: 0 auto;
  display: block;
  float: none !important; /* type.css の float: left を上書き */
}

.maintitle {
  text-align: center;
  margin: .5rem 0 0;
  font-weight: bold;
  font-size: 1rem;
  color: #900;
}

/* ==========================================
   ハンバーガーメニューボタン（スマホ用）
   ========================================== */
.openbtn {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 9999;
  cursor: pointer;
  width: 50px;
  height: 50px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.openbtn span {
  display: block;
  width: 25px;
  height: 2px;
  background-color: #333;
  margin: 3px 0;
  transition: all 0.3s ease;
}

.openbtn .menu-text {
  font-size: 10px;
  color: #900;
  margin-top: 2px;
}

/* ハンバーガー → × 変形 */
.openbtn.active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.openbtn.active span:nth-child(2) {
  opacity: 0;
}

.openbtn.active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ==========================================
   ナビゲーション（PC用）
   ========================================== */
#g-nav {
  background: #700;
  width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
}

#g-nav-list {
  max-width: 1000px;
  margin: 0 auto;
}

#g-nav-list .pc-nav {
  display: flex;
  justify-content: space-between;
  list-style: none;
  padding: 0;
  margin: 0;
}

#g-nav-list .pc-nav li {
  width: calc(100%/6);
}

#g-nav-list .pc-nav li a {
  display: block;
  padding: 10px 8px;
  color: #fff;
  text-align: center;
  font-size: .85rem;
  text-decoration: none;
}

#g-nav-list .pc-nav li a:hover {
  text-decoration: none;
  background: rgba(255, 255, 255, .3);
}

/* スマホ用ナビは非表示 */
.mbnav {
  display: none;
}

/* ==========================================
   スマホ用スタイル（660px以下）
   ========================================== */
@media screen and (max-width: 660px) {
  /* ヘッダー調整 - 中央配置・縦並び */
  header {
    display: block;
    text-align: center;
    padding: 15px 15px 10px;
  }

  header h1 {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  header h1 figure {
    margin: 0;
  }

  header h1 img,
  .mainlogo_item {
    max-width: 80px;
    margin: 0 auto;
    float: none !important;
  }

  .maintitle {
    margin: 5px 0 0;
    font-size: 0.85rem;
  }

  /* ハンバーガーボタン表示 */
  .openbtn {
    display: flex;
  }

  /* PC用ナビ非表示 */
  #g-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    background: rgba(255, 255, 255, .95);
    transition: right 0.3s ease;
    z-index: 9998;
    overflow-y: auto;
    margin-left: 0;
    margin-right: 0;
    left: auto;
  }

  #g-nav.open {
    right: 0;
  }

  #g-nav-list {
    padding: 30px 15px 30px;
  }

  #g-nav-list .pc-nav {
    display: none;
  }

  /* スマホ用ナビ表示 */
  .mbnav {
    display: block;
    padding:0 2rem;
  }

  /* 初めての方・入会案内ボタン */
  .mb-nav-header {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
  }

  .mb-nav-header .button {
    flex: 1;
    display: block;
    padding: 0.5rem;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 0.85rem;
    font-family:'Noto Sans JP', sans-serif;
    background: #fff;
  }

  .mb-nav-header .button i {
    color: #f44336;
    margin-right: 5px;
  }

  /* 事業アイコングリッド */
  .jigyoicon_mb {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    list-style: none;
    padding: 0;
    margin: 0 0 25px;
  }

  .jigyoicon_mb li {
    text-align: center;
  }

  .jigyoicon_mb li a {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-size: 0.7rem;
    line-height: 1.3;
  }

  .jigyoicon_mb li a img.nav_item {
    width: 40px;
    height: 40px;
    margin-bottom: 5px;
    object-fit: contain;
  }

  /* メインリンク */
  .nav_mb_mainlink {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    list-style: none;
    padding: 0.5rem;
    margin: 0;
    border-top: 1px solid #eee;
    padding-top: 20px;
  }

  .nav_mb_mainlink li a {
    display: block;
    padding: 0.3rem;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    font-size: 0.85rem;
    background: #fff;
  }

  /* オーバーレイ */
  .nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9997;
  }

  .nav-overlay.active {
    display: block;
  }
}

/* ==========================================
   PC用スタイル（661px以上）
   ========================================== */
@media screen and (min-width: 661px) {
  /* ハンバーガーボタン非表示 */
  .openbtn {
    display: none;
  }

  /* ヘッダーをセンタリング */
  header {
    text-align: center;
  }

  .mainlogo_item {
    max-width: 150px;
    margin: 0 auto;
  }

  .maintitle {
    font-size: 1.25rem;
    margin: .5rem 0 1rem;
  }
}
