* {
  box-sizing: border-box;
}
@media screen and (max-width: 640px) {
  /* ページ全体をフル幅に */
  body,
  #bg_wrap,
  #header_wrap,
  #header,
  #content_wrap,
  #content_body,
  #content,
  #footer_wrap,
  .wrap {
    width: 100% !important;
    max-width: 100% !important;
    float: none;
  }

  /* コンテンツ内の右側エリア */
  #right_content,
  #left_title,
  #left_box,
  #left_menu {
    width: 100% !important;
    float: none !important;
    margin: 0 auto !important;
  }
  
  #header h1 img{
	  width: 100% !important;
    float: none !important;
	height:auto;
}

  /* 表組みなども可変化 */
  .bg_table,
  .bg_subtable {
    width: 100% !important;
    float: none !important;
  }

  /* 画像やコンテンツを画面幅で縮める */
  img {
    max-width: 100% !important;
    height: auto !important;
  }

  /* トップの横並び要素を縦積みに */
  #top_news,
  #top_message {
    width: 100% !important;
    float: none !important;
    margin: 10px 0 !important;
  }

  /* トップページのメニューなど */
  #top_menu {
    width: 100% !important;
    height: auto !important;
  }

  #top_menu li {
    width: 48%;
    margin: 1% 1%;
  }
  
  #header_line1{display:none;}
  
   #menu_toggle,
  #menu_toggle * {
    pointer-events: auto !important;
  }
  
  #left_title{width:100%;
  }


  /* 繝倥ャ繝繝ｼ蜈ｨ菴� */
  #header {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    background: #fff;
    text-align: left;
    overflow: hidden;
    z-index: 100;
  }
  
    #menu_toggle.active span {
    background: #ffffff;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
  }

  #menu_toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

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

  #menu_toggle.active span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }
  
   #menu_toggle {
    display: block;
    position: absolute;
    bottom: 8px;
    right: 10px;
    width: 32px;
    height: 24px;
    cursor: pointer;
    z-index: 9999; /* 竊� 繧ｪ繝ｼ繝舌�繝ｬ繧､繧�Γ繝九Η繝ｼ繧医ｊ譛蜑埼擇 */
  }

  #menu_toggle span {
    display: block;
    height: 3px;
    width: 100%;
    background: #5a3e2b;
    margin: 5px 0;
    border-radius: 2px;
    transition: all 0.3s ease;
  }

  /* 繧｢繧ｯ繝�ぅ繝匁凾�暗励�繧ｿ繝ｳ�� */
  #menu_toggle.active span {
    background: #ffffff;
    box-shadow: 0 0 4px rgba(0,0,0,0.3);
  }

  #menu_toggle.active span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

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

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


  /* 閭梧勹繧ｪ繝ｼ繝舌�繝ｬ繧､ */
  #menu_overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1500; /* 竊� 閭梧勹 */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease;
  }

  #menu_overlay.active {
    display: block;
    opacity: 1;
    visibility: visible;
  }
  
    #sp_menu {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -40%) scale(0.95);
    width: 80%;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 6px 25px rgba(0,0,0,0.25);
    z-index: 2001; /* 竊� 繧ｪ繝ｼ繝舌�繝ｬ繧､縺ｮ荳翫√ヨ繧ｰ繝ｫ縺ｮ荳� */
    padding: 40px 20px;
    flex-direction: column;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
  }

  #sp_menu.open {
    display: flex;
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
    visibility: visible;
  }

  #sp_menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
    text-align: center;
  }

  #sp_menu li {
    margin: 14px 0;
  }

  #sp_menu a {
    color: #4c2f21;
    text-decoration: none;
    font-size: 18px;
    font-weight: 600;
    transition: color 0.3s ease;
  }

  #sp_menu a:hover {
    color: #c46b2a;
  }
  
  #footer_wrap {
    position: relative !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 0 30px;
  }

  #footer_body {
    margin: 0 auto !important;
    padding: 0 !important;
  }

  #footer {
    margin: 0 !important;
    padding: 10px 0 0!important;
  }

  #gotop {
    margin-bottom: 0 !important;
  }

  body::after {
    content: "";
    display: block;
    height: 0 !important;
  }
  /* ロゴがハンバーガーを覆う問題を解消 */
  #header h1,
  #header h1 a,
  #header h1 img {
    pointer-events: none !important;
  }


  
}

/* ===================================
   スマホ時限定（480px以下）
=================================== */
@media screen and (max-width: 480px) {
.mb_displaynone{
	display:none;
}

.pc_displaynone{
	display:block;
}

	#navi_list {
    margin: 0;
    width: 100%;
}

    #header h1 {
        position: relative;
        width: 100%;
        margin: 0;
	}

  #content_body, #content, #top_news, .top_news_content, #top_message {
    width: 100%;
  }

  #content {
    padding: 10px;
  }
  
  .bg_subtable .content {
    width: 100%;
  }

  #top_image { display: none; }
  #top_image_sp { display: block; }

  .sp_flex {
    display: flex;
    flex-direction: column-reverse;
  }

  #top_news { margin: 0; }

  #top_news img, #top_message img {
    width: 100%;
    height: auto;
  }

  #top_message {
    float: none;
    margin: 10px 0;
  }

  #top_menu {
    width: 100%;
	height:auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    float: none;
    margin: 10px 0;
    padding: 10px 0;
  }

  #top_menu li {
    float: none;
    margin: 5px 10px;
    width: 100%;
  }

  #top_menu img {
    width: 100%;
    height: auto;
  }

  /* バナー画像を中央トリミング */
  .sp_box {
    position: relative;
    width: 100%;
    aspect-ratio: 31 / 6;
    overflow: hidden;
    height: 100px;
  }

  .sp_box img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 110%;
    height: auto;
    min-height: 100%;
    object-fit: cover;
    transform: translate(-50%, -50%);
    transition: object-position 0.4s ease, transform 0.4s ease;
  }

  #banner_challenge { margin: 0; }

  /* フッター調整 */
  #footer_body {
    width: 100%;
    text-align: center;
  }

  #footer_body ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  #footer_body ul li {
    float: none;
  }
  
  
  .bg_subtable td.pd1{
	  padding:6px 20px;
	  margin-top:10px;
  }


  .bx-wrapper {
    margin-bottom: 0 !important;
  }
  
  .bg_table {
        position: relative;
        background-color: #fff;
        background-image: url(../img/sp/sp_table_bgi2.jpg), url(../img/sp/sp_table_bgi2.jpg), url(../img/sp/sp_table_bgi2.jpg), url(../img/sp/sp_table_bgi2.jpg);
        background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
        background-position: top center, bottom center, left top, right top;
        background-size: 12px auto, 12px auto, auto 12px, auto 12px;
        padding: 20px 15px;
        overflow: visible;
  }
	
  #content_wrap{
    padding-bottom:30px;
  }
  
  .left_title{
	  margin-bottom:10px;
  }
  
  .title-wrap{
    display: block;
    margin-top: 50px;
	  }
	
  .title-img {
    display: none; /* 画像は非表示 */
  }

  .title-wrap::before {
    content: attr(data-title);  /* ← ここで文字を出す */
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: #3F2414;
    text-align: left;
    padding: 12px 0;
    margin: 10PX auto;
    border-bottom: 2px solid #ccc;
    letter-spacing: 0.05em;
  }
  

}

