@charset "Shift_JIS";

/*--------------------------------------------------------
  改良版レスポンシブ対応CSS
  - 元のレイアウトを維持
  - ナビゲーション、サイドメニュー、新着情報を特に考慮
--------------------------------------------------------*/

/* タイトル画像のレスポンシブ化 */
#hpb-title img {
  max-width: 100%;
  height: auto;
}

/* ベース設定 - デスクトップレイアウトはそのまま維持 */
@media screen and (min-width: 981px) {
  /* デスクトップ用の設定 - 既存CSSを尊重し最小限の変更 */
  body {
    min-width: 980px; /* 元の設定を維持 */
  }
  
  #hpb-container {
    width: auto; /* コンテナが画面幅に対応 */
  }
  
  #hpb-inner {
    width: 980px; /* 元の幅を維持 */
    margin-left: auto;
    margin-right: auto;
  }
  
  #hpb-main, #hpb-main2, #hpb-main3 {
    width: 700px;
    float: left;
  }
  
  #hpb-aside, #hpb-aside2, #hpb-aside3 {
    width: 268px;
    float: right;
  }
  
  /* 新着情報のスタイルを維持 */
  #toppage-news dt {
    width: 120px !important;
    font-size: 14px;
    float: left;
  }
  
  #toppage-news dd {
    padding-left: 120px;
    font-size: 14px;
  }
}

/* タブレット向け対応 */
@media screen and (min-width: 641px) and (max-width: 980px) {
  body {
    min-width: auto;
  }
  
  #hpb-container {
    width: 100%;
  }
  
  #hpb-inner {
    width: 100%;
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 10px;
    box-sizing: border-box;
  }
  
  .hpb-layoutset-02 #hpb-inner {
    display: flex;
    flex-direction: column;
  }
  
  /* ヘッダー部分 */
  #hpb-header {
    width: 100%;
    box-sizing: border-box;
  }
  
  #hpb-headerLogo {
    width: 60%;
    float: left;
  }
  
  #hpb-headerExtra1 {
    width: 38%;
    float: right;
    margin-top: 15px;
  }
  
  .hpb-layoutset-01 #hpb-title {
    width: 100%;
    position: relative !important;
    top: 0 !important;
    margin-top: 152px !important;
    left: 0;
    height: auto !important;
    min-height: 150px;
    background-size: cover;
  }
  
  .hpb-layoutset-02 #hpb-title {
    width: 100%;
    position: relative;
    top: 0;
    margin-top: 0 !important;
    left: 0;
    height: auto;
    min-height: 98px;
    background-size: cover;
  }
  
  /* ナビゲーション */
  #hpb-nav {
    position: absolute !important;
    top: 72px !important; 
    left: 0 !important;
    width: 100% !important;
    height: auto !important;
    z-index: 1000 !important;
    background: #fff;
    margin: 0 !important;
  }
  
  .hpb-layoutset-02 #hpb-nav {
    position: relative !important;
    top: 0 !important;
    margin: 10px 0 20px 0 !important;
    order: -1;
  }
  
  #hpb-nav ul {
    display: flex !important;
    flex-wrap: wrap !important;
    padding: 10px 0 !important;
    justify-content: center !important;
    list-style: none !important;
    margin: 0 !important;
  }
  
  #hpb-nav li {
    margin: 2px 10px !important;
  }
  
  /* メインコンテンツ */
  #hpb-main, #hpb-main2, #hpb-main3 {
    width: 70%;
    float: left;
    box-sizing: border-box;
    padding-right: 10px;
  }
  
  .hpb-layoutset-01 #hpb-main, 
  .hpb-layoutset-01 #hpb-main3 {
    padding-top: 380px;
  }

  .hpb-layoutset-01 #hpb-main2 {
    padding-top: 650px !important; /* #top-navをよけるための余白 */
  }
  
  /* サイドバー */
  #hpb-aside, #hpb-aside2, #hpb-aside3 {
    width: 30%;
    float: right;
    box-sizing: border-box;
  }
  
  .hpb-layoutset-01 #hpb-aside, 
  .hpb-layoutset-01 #hpb-aside3 {
    padding-top: 380px;
  }
  
  .hpb-layoutset-01 #hpb-aside2 {
    padding-top: 650px !important; /* #top-navをよけるための余白 */
  }
  
  /* トップページのナビゲーション */
  #top-nav {
    position: absolute !important;
    top: 480px !important; /* スライダーの下に配置 */
    width: 100% !important;
    z-index: 50 !important;
    box-sizing: border-box;
    padding-top: 0;
  }
  
  /* 問合せ先テキスト（leafhelp）の重なり解消 */
  #leafhelp {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    margin-top: 20px !important;
    padding: 10px !important;
    width: 100% !important;
    box-sizing: border-box !important;
    text-align: center !important;
  }
  
  /* 新着情報 */
  #toppage-news dt {
    width: 120px !important;
    font-size: 14px;
    float: left;
  }
  
  #toppage-news dd {
    padding-left: 120px;
    font-size: 14px;
  }
  
  /* バナー */
  #banner li a {
    max-width: 100%;
    background-size: contain;
  }
  
  /* フッター */
  #hpb-footerExtra1 ul {
    width: 100%;
    max-width: 980px;
  }

  /* サブページコンテンツ（タブレット用） */
  #hpb-sub-main {
    width: 100%;
    padding-top: 20px !important;
  }
  
  .container {
    width: 95%;
  }
  
  .main-contents,
  .main-contents_moushikomi,
  .main-contents_moushikomi2 {
    width: 65%;
  }
  
  .left-menu,
  .left-menu_moushikomi,
  .left-menu_moushikomi2,
  .right-menu {
    width: 30%;
  }
}

/* スマートフォン向け対応 */
@media screen and (max-width: 640px) {
  body {
    min-width: auto;
  }
  
  #hpb-container {
    width: 100%;
  }
  
  #hpb-inner {
    width: 100%;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 10px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
  }
  
  /* ヘッダー部分 */
  #hpb-header {
    width: 100%;
    box-sizing: border-box;
    padding: 10px;
  }
  
  #hpb-headerLogo {
    width: 100%;
    float: none;
    text-align: center;
  }
  
  #hpb-headerLogo a {
    display: block;
    background-position: center;
    margin: 0 auto;
  }
  
  #hpb-headerExtra1 {
    width: 100%;
    float: none;
    margin-top: 10px;
    text-align: center;
  }
  
  #hpb-headerExtra1 p.tel,
  #hpb-headerExtra1 p.address {
    text-align: center;
  }
  
  /* タイトル画像 */
  .hpb-layoutset-01 #hpb-title,
  .hpb-layoutset-02 #hpb-title {
    width: 100%;
    position: relative;
    top: 0;
    left: 0;
    height: auto;
    min-height: 150px;
    background-size: cover;
    background-position: center;
  }
  
  /* ナビゲーション - ハンバーガーメニュー化 */
  #hpb-nav {
    width: 100%;
    position: relative;
    top: 0;
    left: 0;
    z-index: 100;
    border-top: 1px solid #ccc;
    border-bottom: 1px solid #ccc;
    margin-bottom: 10px;
    order: -1;
  }
  
  #hpb-nav h3.hpb-c-index {
    width: 36px !important;
    height: 36px !important;
    background-color: #330099 !important;
    background-image: none !important;
    margin: 5px !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: white !important;
    font-size: 24px !important;
    text-indent: -9999px !important;
    overflow: hidden !important;
    position: relative;
  }
  
  #hpb-nav h3.hpb-c-index::after {
    content: "\2630";
    text-indent: 0px !important;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 28px;
  }
  
  #hpb-nav ul {
    display: none;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  
  #hpb-nav ul.toggled-on {
    display: block;
  }
  
  #hpb-nav li {
    display: block;
    margin: 0;
    padding: 0;
    border-bottom: 1px solid #eee;
  }
  
  #hpb-nav li:last-child {
    border-bottom: none;
  }
  
  #hpb-nav li a {
    display: block;
    padding: 10px 15px;
    text-align: left;
    border-bottom: none;
  }
  
  /* メインコンテンツ */
  #hpb-main, #hpb-main2, #hpb-main3 {
    width: 100%;
    float: none;
    box-sizing: border-box;
    padding-right: 0;
  }
  
  .hpb-layoutset-01 #hpb-main, 
  .hpb-layoutset-01 #hpb-main2, 
  .hpb-layoutset-01 #hpb-main3 {
    padding-top: 20px;
  }
  
  .hpb-layoutset-02 #hpb-main, 
  .hpb-layoutset-02 #hpb-main2, 
  .hpb-layoutset-02 #hpb-main3 {
    padding-top: 20px;
  }

  /* サブページコンテンツ（スマートフォン用） */
  #hpb-sub-main {
    width: 96%;
    padding: 20px 0 !important;
    margin: 0 auto;
    float: none;
  }
  
  .container {
    display: block;
    width: 100%;
  }

  .main-contents,
  .main-contents_moushikomi,
  .main-contents_moushikomi2,
  .left-menu,
  .left-menu_moushikomi,
  .left-menu_moushikomi2,
  .right-menu {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 2%;
    float: none;
  }

  .main-contents img,
  .main-contents_moushikomi img,
  .main-contents_moushikomi2 img {
    max-width: 100%;
    height: auto;
  }

  
  /* サイドバー */
  #hpb-aside, #hpb-aside2, #hpb-aside3 {
    width: 100%;
    float: none;
    box-sizing: border-box;
    padding-top: 20px !important;
  }
  
  /* トップページのナビゲーション */
  #top-nav {
    width: 100%;
    position: static;
    padding-top: 5px !important;
    box-sizing: border-box;
  }
  
  #leafhelp {
    width: 100%;
    position: static;
    margin: 5px 0 10px 0;
    padding: 0 10px;
    font-size: 13px;
    box-sizing: border-box;
  }
  
  /* 新着情報 */
  #hpb-main #toppage-news dl,
  #hpb-main2 #toppage-news dl,
  #hpb-main3 #toppage-news dl,
  #toppage-news dl {
    margin-left: 0;
    margin-right: 0;
    padding-left: 0;
  }
  
  #hpb-main #toppage-news dt,
  #hpb-main2 #toppage-news dt,
  #hpb-main3 #toppage-news dt,
  #toppage-news dt {
    width: auto !important;
    float: none;
    padding-bottom: 4px;
    font-weight: 600;
    color: #333333;
    margin-top: 12px;
  }
  
  
  #hpb-main #toppage-news dd,
  #hpb-main2 #toppage-news dd,
  #hpb-main3 #toppage-news dd,
  #toppage-news dd {
    padding-left: 0px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eeeeee;
    line-height: 1.5;
  }
  
  /* ページトップとアクセスカウンター */
  #pagetop {
    text-align: center;
    margin-top: 30px;
    padding-bottom: 20px;
  }
  
  #pagetop .counter-box {
    display: inline-block;
    text-align: center;
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  }
  
  /* バナー */
  #banner {
    text-align: center;
  }
  
  #banner ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }
  
  #banner li {
    padding-bottom: 8px;
    width: 100%;
  }
  
  #banner li a {
    margin: 0 auto;
    background-size: contain;
    background-position: center;
  }
  
  /* フッター */
  #hpb-footerMain p {
    padding: 0 10px;
  }
  
  #hpb-footerExtra1 ul {
    width: 100%;
    display: block;
    text-align: center;
  }
  
  #hpb-footerExtra1 li {
    display: inline-block;
    margin: 5px;
  }
  
  /* テーブル */
  table {
    width: 100%;
    box-sizing: border-box;
  }
  
  /* 画像 */
  img.left, img.right {
    float: none;
    display: block;
    margin: 10px auto;
  }
  
  /* グリッドシステム */
  .cssgrid_joho, .cssgrid, .cssgrid_kensyutop {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    grid-gap: 10px;
  }
  
  .cssgrid_r06 {
    display: grid;
    grid-template-columns: 1fr;
    grid-gap: 16px;
    margin-bottom: 8px;
    padding: 0;
    border: none;
  }
  
  .cssgrid_r06 .img_wrap2 {
    background: transparent;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transition: transform 0.2s ease-out;
  }
  
  .cssgrid_r06 .img_wrap2:active {
    transform: scale(0.97);
  }
  
  .cssgrid_r06 .img_wrap2 img {
    border-radius: 12px;
    display: block;
    width: 100%;
  }
  
  /* スライダー */
  .slider {
    width: 100%;
  }
  
  .slider img {
    width: 100%;
    height: auto;
  }
}

/* 印刷時のスタイル */
@media print {
  body {
    min-width: 980px;
  }
  
  #hpb-container {
    width: 980px;
  }
  
  #hpb-inner {
    width: 980px;
  }
  
  #hpb-main, #hpb-main2, #hpb-main3 {
    width: 700px;
    float: left;
  }
  
  #hpb-aside, #hpb-aside2, #hpb-aside3 {
    width: 268px;
    float: right;
  }
}

/* ナビゲーション表示修正のためのJS対応 */
@media screen and (min-width: 641px) {
  #hpb-nav ul {
    display: flex !important;
  }
  
  #hpb-nav h3.hpb-c-index {
    display: none !important;
  }
}
/* フッターグリッドレイアウト（各ページ共通化のためuser.cssから移植） */
.grid-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  max-width: 980px;
  box-sizing: border-box;
}

.footer {
  padding: 1rem;
  font-size: 13px;
  color: #4b5564;
  background: #fff;
}

.footer__navi-heading {
  font-weight: 600;
}

.footer__logo {
  display: inline-block;
  margin-bottom: 2rem;
}

.footer__navi li {
  margin-bottom: 0.2rem;
  margin-left: 0.5rem;
  text-align: left;
}

@media (min-width: 568px) {
  .md-flex {
    display: flex;
  }

  .md-justify-between {
    justify-content: center;
  }

  .grid-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .md-flex {
    display: flex;
  }

  .md-justify-between {
    justify-content: center;
  }

  .grid-nav {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

/* ---- 研修関連ページ特有のレイアウト修正（スマホ表示時の潰れ防止） ---- */
@media screen and (max-width: 640px) {
  /* 11_shihyo_res.html のExcel/PDF左右分割レイアウトを縦積みに */
  .checksheet-container {
    flex-direction: column !important;
  }
  .checksheet-excel-side,
  .checksheet-pdf-side {
    width: 100% !important;
    border-right: none !important;
  }
  .checksheet-excel-side {
    border-bottom: 1px solid #ddd;
  }
  
  /* 31_tebiki_res.html 等の大きなガイドカード（画像左・テキスト右）を縦積みに */
  .guide-card-large {
    flex-direction: column !important;
    align-items: stretch !important;
  }
  .large-img-container {
    border-right: none !important;
    border-bottom: 1px solid #eee;
    width: 100%;
    display: flex;
    justify-content: center;
  }

  /* その他のフレックスボックス要素の調整 */
  .entry-example-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px;
  }
}
