﻿body {
    font-family: "Helvetica Neue", Arial, sans-serif;
    text-align: center;
    margin: 0;
    padding: 0;
    background-color: #fff;
}



body, html {
  width: 100%;
  height: 100%;
  font-family: "Hiragino Sans", "Meiryo", sans-serif;
}

/* 背景スライドショー */
.slideshow {
  position: relative;
  width: 100%;
  height: 80vh;
  z-index: -1;
  overflow: hidden;
}

.slide {
  position: absolute;
  top:0;
  left:0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  animation: fade 15s infinite;
}

.slide:nth-child(1) {
  background-image: url('../img/top1.png'); /* 1枚目の画像 */
  animation-delay: 0s;
}
.slide:nth-child(2) {
  background-image: url('../img/top2.png'); /* 2枚目の画像 */
  animation-delay: 5s;
}
.slide:nth-child(3) {
  background-image: url('../img/top3.jpg'); /* 3枚目の画像 */
  animation-delay: 9s;
}

@keyframes fade {
  0% { opacity: 0; }
  10% { opacity: 1; }
  30% { opacity: 1; }
  40% { opacity: 0; }
  100% { opacity: 0; }
}

/* naviボックス */
.navi {
font-family: "Zen Kaku Gothic New", sans-serif;
  font-weight: 400;
  font-style: normal;
 position: absolute;            /* ← 画面全体に対して浮かせる */
  top: 1vw;                      /* 画面上からの距離 */
  left: 50%;
  transform: translateX(-50%);
  width: 55%;
  background: rgba(247, 246, 245, 0.8);
  padding: 0.8em 0.6em;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;       

}

.navi-top {
  width: 100%;
  display: flex;
  justify-content: space-between;
}

.navi h1 {
  font-size: 3vw;
  margin: 0; /* 上下マージンをリセット */
  white-space: nowrap;
  text-align: left;

}

.navi ul {
  display: flex;
  justify-content: space-evenly; /* ← 均等配置 */
  list-style: none;
  width: 100%;  /* 均等配置のために幅を親に合わせる */
  padding: 0;
  margin: 0;
  align-items: center;
}

.navi ul li a {
  text-decoration: none;
  color: #333;
  font-size: 1.5vw;
}


.contact-btn {
  position: absolute;
  top: 1.1em;
  right: 1.1em;
  background: #800000;
  color: #fff;
  padding: 0.8vw 1.6vw;
  border-radius: 4px;
  text-decoration: none;
  font-size: 1.1vw;
  display: flex;
  align-items: center;
  gap: 4px;
}

.contact-btn:hover {
    background-color: #b22222;
}



/* 新着情報ボックス */
.news-box {
  position: relative;
  max-width: 50%;
  margin: 0 auto; /* 背景にかかるように */
  background: #fff;
  border: 1px solid #333;
  padding: 20px;
  box-sizing: border-box;
  overflow: hidden;
  z-index: 10; /* 背景より前に表示 */
  box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.news-wrapper {
  margin-top: -11vh; /* スライドショー高さに応じて調整 */
}

.news-title {
  font-size: 1.5em;
  margin: 0 0 1em 0;
  text-align: left;
  color: #000;
  border-bottom: 1px solid #800000;
  padding-bottom: 0;
}


.slider-container {
  overflow: hidden;
}

.slider {
  display: flex;
  transition: transform 0.5s ease-in-out;
  gap: 20px;
}

.news-item {
  flex: 0 0 calc(50% - 40px); /* 常に2件表示 */
  background: #fff;
  border: 1px solid #ddd;
  padding: 10px;
  text-align: center;
}

.news-item img {
  max-width: 100%;
  max-height: clamp(150px, 25vh, 250px); /* 画面に応じて高さ可変 */
  height: auto;
  object-fit: contain;
  display: block;
  margin: 0 auto 10px;
}

.news-item h3 {
  margin: 10px 0 5px;
  font-size: 18px;
}

.news-item p {
  margin: 5px 0;
  font-size: 14px;
}


/* ナビボタン */
.prev, .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.5);
  color: white;
  border: none;
  padding: 10px;
  cursor: pointer;
  z-index: 20;
}

.prev { left: 5px; }
.next { right: 5px; }
















/*リンク色なし*/
a{
    text-decoration: none;
    color: #000000; /* 今回は#000000を指定していますが、好きな色を指定できます */
}



#main{
    width:100%;
    margin-left:auto;
    margin-right:auto;
    display:block;
}


.m-box{
    width:60%;
    height:auto;
    margin-left:auto;
    margin-right:auto;
}


.n-box{
    width:60%;
  margin-top: clamp(140px, 22vh, 280px);
    height:auto;
    margin-left:auto;
    margin-right:auto;
}

.nm-box{
    width:60%;
  margin-top: clamp(140px, 22vh, 280px);
    height:auto;
    margin-left:auto;
    margin-right:auto;
    align-items: center;
}


/*h2{
    padding-left:0.2em;
    text-align:left;
    border-left: 0.5em solid #800000;
    border-bottom: 0.08em solid #800000;
}*/

.n-box h2{
    color:#000;
    width:100%;
    font-family: 'smart',Arial, sans-serif;
    line-height:1;
    text-align:left;
    padding-top:0.2em;
    padding-bottom:0.1em;
    padding-left:0.4em;
    border-left: 0.5em solid #800000;
    border-bottom: 0.08em solid #800000;
    margin-top:3vw;
    margin-left:auto;
    margin-right:auto;
    margin-bottom:1em;
    font-weight: normal;
    display:block;
    align-items: center;
    align-items: baseline;
    box-sizing:border-box;
}



.t{
    width:90%;
    text-align:left;
    margin-top:2em;
    margin-left:auto;
    margin-right:auto;
    margin-bottom:2em;
}



/* グリッド全体のスタイル */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); /* 自動調整 */
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    text-align: center;
}

/* 各アイコン要素のスタイル */
.icon-item {
    text-decoration: none;
    color: #000;
}

.icon-item:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease-in-out;
}

/* アイコンの円のスタイル */
.icon-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto 1rem;
    border: 1px solid #800000;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #800000;
}

h3 {
    font-size: 1rem;
    margin: 0.5rem 0;
}

.icon-grid p {
    font-size: 0.875rem;
    color: #666;
}

.copylight{
    margin-top:2vw;
    text-align:center;
    font-size:0.8em;
}

/*ハンバーガーメニュー*/
        .menu-btn {
            position: fixed;
            top: 10px;
            left: 10px;
            background: white;
            border: 1px solid #ccc;
            padding: 10px;
            cursor: pointer;
            z-index: 1000;
            display: none; /* 初期状態では非表示 */
        }
        .menu-btn div {
            width: 25px;
            height: 3px;
            background: black;
            margin: 5px 0;
        }
        .hamburger-menu {
            position: fixed;
            top: 50px; /* ハンバーガーボタンの下に配置 */
            left: -250px;
            width: 200px;
            background: white;
            border: 1px solid #ccc;
            padding: 10px;
            box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
            opacity: 0;
            transform: translateY(-10px);
            transition: opacity 0.3s ease-out, transform 0.3s ease-out, visibility 0.3s ease-out;
            display: none;
            z-index: 99999 !important;
  transition: left 0.3s ease; /* ← アニメーション */
        }


        .hamburger-menu.show {
            opacity: 1;
  left: 0; /* ← 画面内にスライドイン */
            transform: translateY(0);
            display: block !important;
        }
        .hamburger-menu.hide {
            opacity: 0;
            transform: translateY(-10px);
            visibility: hidden;
        }
        .hamburger-menu a {
            display: block;
            padding: 10px;
            text-decoration: none;
            color: black;
            border-bottom: 1px solid #ddd;
        }
        .hamburger-menu a:hover {
            background: #f0f0f0;
        }

/* ハンバーガーメニュー用の背景オーバーレイ */
.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4); /* 半透明の黒 */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 9999; /* メニューより一つ下に来るように調整 */
}

/* メニューが表示される時はオーバーレイも有効化 */
.hamburger-menu.show ~ .menu-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* 閉じアニメ中も残してフェードアウト */
.hamburger-menu.show.closing ~ .menu-backdrop {
  opacity: 0;
  visibility: visible;   /* すぐ消さずに残す */
  pointer-events: none;
}


/* ===== ハンバーガーのスムーズ表示 ===== */
/* 既存の left / show はそのままでOK。表示/非表示は transform と opacity に任せる */
.hamburger-menu{
  display: block !important;           /* ← display:none を上書きしてアニメ可能に */
  will-change: transform, opacity;     /* パフォーマンスヒント */
  transform: translate3d(-104%,0,0);   /* 画面外から */
  opacity: 0;
  pointer-events: none;                /* 非表示時のクリック無効 */
  transition:
    transform .36s cubic-bezier(.22,.61,.36,1),
    opacity   .28s ease;
}

.hamburger-menu.show{
  transform: translate3d(0,0,0);       /* 画面内へ */
  opacity: 1;
  pointer-events: auto;
}

/* メニュー内のリンクをちょいディレイ（お好みで） */
.hamburger-menu a{ transition: transform .28s ease, opacity .28s ease; opacity: .001; transform: translateY(6px); }
.hamburger-menu.show a{ opacity: 1; transform: translateY(0); }
.hamburger-menu.show a:nth-child(1){ transition-delay: .03s; }
.hamburger-menu.show a:nth-child(2){ transition-delay: .06s; }
.hamburger-menu.show a:nth-child(3){ transition-delay: .09s; }
.hamburger-menu.show a:nth-child(4){ transition-delay: .12s; }
.hamburger-menu.show a:nth-child(5){ transition-delay: .15s; }
.hamburger-menu.show a:nth-child(6){ transition-delay: .18s; }
.hamburger-menu.show a:nth-child(7){ transition-delay: .21s; } /* 項目数に合わせて増減 */

/* 閉じアニメ用 */
.hamburger-menu.closing {
  animation: fadeOutMenu 0.3s forwards;
}

@keyframes fadeOutMenu {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-20px);
  }
}



/* 動きを控えたい設定の人へ配慮 */
@media (prefers-reduced-motion: reduce){
  .hamburger-menu,
  .hamburger-menu a{ transition: none !important; }
}




/*-----------------------------------------------------------------------------------------
  スマホ対応CSS
-----------------------------------------------------------------------------------------*/
@media only screen and (max-width: 800px) {

  .slideshow .slide{
    background-size: 100% auto !important;   /* 横幅を必ず収める */
    background-position: top center !important;
    background-repeat: no-repeat !important;
  }


  /* ===== ナビゲーション ===== */
.navi {
    top: 0;
    left: 0;
    transform: none;     /* 中央寄せ解除 */
    width: 100%;         /* 画面幅にフィット */
    margin: 0;
    border-radius: 0;
    box-sizing: border-box;
    padding: 0.5em 1em;
  }

  .navi h1 {
    font-size: 1.5em;
    text-align: center; /* 中央寄せにしたい場合 */
  }
  /* PC用メニューは非表示 */
  .navi ul,
  .contact-btn {
    display: none;
  }

  /* ハンバーガーメニュー表示 */
  .menu-btn {
    display: block;
  }

  /* ===== 背景スライドショー ===== */
  .slideshow {
    height: 40vh; /* 高さを縮めてスマホで収まり良く */
  }

  .slide {
    background-size: cover;
    background-position: center;
  }

  /* ===== 新着情報ボックス ===== */
  .news-box {
    max-width: 90%;
    padding: 10px;
  }

  .slider {
    gap: 10; /* スマホでは隙間をなくす */
  }

  .news-item {
    flex: 0 0 90%; /* 1枚ごと全幅表示 */
  }

  .news-item h3 {
    font-size: 16px;
  }
  .news-item p {
    font-size: 13px;
  }

  /* ナビボタンも少し小さく */
  .prev, .next {
    padding: 6px;
    font-size: 18px;
  }

  /* ===== 本文ボックス ===== */
  .m-box {
    width: 90%;
  }

  .n-box {
    width: 90%;
  }
  .icon-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
  }

  .icon-circle {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
  }
}




