body {
    text-align: center;
    background:linear-gradient(90deg, rgb(228, 204, 160),rgb(234, 198, 131),rgb(228, 204, 160));;
    color: #410303;
    font-family: "Hiragino Mincho ProN", "游明朝", "Yu Mincho", serif;
    margin: 0;
    padding: 0;
}
header {
    z-index: 1000; /* 高めの値で前面に */
    display: flex;
    width: 100%;
    height: auto;
    background-color: rgba(236, 190, 151, 0.9);
    align-items: center;
    position: fixed;
    flex-wrap: wrap; /* ナビ部分を折り返せるように */
}
.nav {
  display: flex;
  margin-left: auto; 
}
.menu-group {
  display: flex;
  justify-content: flex-end;
  list-style: none;
  padding: 0;
  margin: 0;
}
.menu-item {
  flex: 1;
  width: 110px;
  min-width: 110px;
  color: #410303;
  background-image: linear-gradient(#fbe0b8 0%,#eeea9f  100%);
  border-radius: 0;
  text-align: center;
  padding: 1em 0;
  border: none;
  font-weight: bold;
}
.menu-item a {
  color: white;
  text-decoration: none;
  
}
.menu-item:hover {
  color: rgb(255, 209, 125);
  box-shadow: 0 12px 30px rgba(115, 61, 11, 0.8); /* ← 強めの影 */
  background-image: linear-gradient( rgb(57, 39, 2) 0%, rgb(57, 39, 2) 100%);
  transform: scale(1.2) ; /* 1.1倍に拡大 */
  transition: 0.5s ease;
  border-radius: 20%;
} 
.btn-gradient {
  display: inline-block;
  text-decoration: none;
  font-weight: bold;
  color: #410303;
  background-image: linear-gradient(#fdd292 0%,#e4de5f  100%);
  flex: 1;
  width: 100px;
  min-width: 100px;
  border-radius: 0%;
  text-align: center;
  padding: 1em 0;
}
.btn-gradient:active {
  -webkit-transform: translateY(4px);
  transform: translateY(4px);
  box-shadow: 0px 0px 1px rgba(0, 0, 0, 0.2);
  border-bottom: none;
}
.btn-gradient:hover {
  color: rgb(255, 209, 125);
  box-shadow: 0 12px 30px rgba(115, 61, 11, 0.8); /* ← 強めの影 */
  background-image: linear-gradient(rgb(112, 77, 6) 0%, rgb(117, 80, 4) 100%);
  transform: scale(1.2) ; /* 1.1倍に拡大 */
  transition: 0.5s ease;
  border-radius: 20%;
}
section {
  scroll-margin-top: 120px; /* ヘッダーの高さ + 少し余裕 */
  z-index: 15;
}
.syoutangen{
    z-index: 15;
    padding: 0.2em 0.5em;
    width: 60%;
    margin: 2em auto;
    background: #fff1d6;
    box-shadow: 0px 0px 0px 10px #fff1d6;
    border: dashed 2px rgb(255, 115, 0,0.8);
}
.syoutangen p {
  margin: 0; 
  padding: 0;
}
.syoutangen:hover {
  box-shadow: 0 12px 30px rgba(115, 61, 11, 0.8); /* ← 強めの影 */
  transform: scale(1.075) ; /* 1.1倍に拡大 */
  transition: 0.8s ease;
  border-radius: 10%;
}
.fade-in0 {
  animation-name: fadeInAnimation;
  animation-duration: 1.5s;
  animation-fill-mode: forwards;
  opacity: 0;
  animation-timing-function: ease;
}
.fade-in1 {
  animation-name: fadeInAnimation;
  animation-duration: 2.5s;
  animation-fill-mode: forwards;
  opacity: 0;
  animation-timing-function: ease;
}
.fade-in2 {
  animation-name: fadeInAnimation;
  animation-duration: 4s;
  animation-fill-mode: forwards;
  opacity: 0;
  animation-timing-function: ease;
}
@keyframes fadeInAnimation {
  0% {
    opacity: 0;
  }
  
  100% {
    opacity: 1;
  }
}
.matubi{
  background: rgba(236, 190, 151, 0.9);/*背景色*/
}
#teacherimg{
    height: 500px;
    width:auto;
}
#topimg{
    height: auto;
    width:100%;
}
.yokonarabi {
    display: flex;
    flex-direction: row; /* 画像とテキストブロックを横並びに */
    align-items: center; /* 縦方向の中央揃え */
    flex-wrap: nowrap; /* 折り返しを防ぐ */
}

.yokonarabi img {
    width: 15%; /* 画像サイズ調整 */
    margin-right: 10px; /* 画像とテキストの間隔調整 */
}
.text_wrapper{
    display: flex;
    flex-direction: column; /* 段落を縦並びに */
    align-items: center; /* 子要素を中央揃え */
}
.page-container {
    display: flex;
    justify-content: center; /* 水平方向の中央揃え */
    align-items: center; /* 垂直方向の中央揃え */
    margin: auto;
}
a {
    color: #410303;
    text-decoration: none; /* 下線を消す */
}
a:hover {
  color: #ac4b21; /* マウスを載せたときだけオレンジ色に */
}
.shr{
    width: 60%;
    
}
.singimg{
    width:50%;
    height: auto;    
}
iframe{
    text-align: center;
}
hr{
    border: none;
    border-top: dashed 2px rgb(255, 115, 0);
}


@media screen and (max-width: 768px) {
  header {
    flex-direction: column;
    align-items: flex-start;
  }

  .nav {
    flex-direction: column;
    width: 100%;
    margin-left: 0;
  }

  .menu-group {
    flex-direction: column;
    width: 100%;
  }

  .menu-item {
    width: 100%;
    min-width: auto;
    padding: 0.8em 0;
    font-size: 1rem;
  }

  .btn-gradient {
    width: 100%;
    margin: 0.3em 0;
  }

  #teacherimg {
    width: 100%;
    height: auto;
    max-height: 300px;
    margin-bottom: 1em;
  }

  .yokonarabi {
    flex-direction: column;
    align-items: center;
  }

  .syoutangen {
    width: 90%;
  }

  .shr {
    width: 90%;
  }

  .singimg {
    width: 90%;
  }

  iframe {
    width: 100% !important;
  }
}



/* --- Override: Compact mobile navigation --- */
@media screen and (max-width: 768px) {
  /* Arrange menu items in two columns */
  .menu-group {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
  }

  .menu-item {
    width: 48%;
    min-width: auto;
    margin: 1% 1%;
    padding: 0.5em 0;
    font-size: 0.9rem;
  }

  /* Ensure the extra buttons align nicely too */
  .btn-gradient {
    width: 48%;
    margin: 1% 1%;
    padding: 0.6em 0;
  }
}



/* --- Enhanced Compact Header for Mobile --- */
@media screen and (max-width: 768px) {
  header {
    padding: 0.5em 1em;
  }

  header h2 {
    font-size: 1.1rem;
    margin: 0.2em 0;
  }

  .nav {
    width: 100%;
    margin-top: 0.5em;
  }

  .menu-group {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0;
  }

  .menu-item {
    width: 48%;
    margin: 1%;
    padding: 0.4em 0.2em;
    font-size: 0.8rem;
  }

  .btn-gradient {
    width: 48%;
    margin: 1%;
    padding: 0.5em 0;
    font-size: 0.8rem;
  }
}



/* --- Keep aspect ratio for #teacherimg --- */
@media screen and (max-width: 768px) {
  #teacherimg {
    width: 100%;
    height: auto;
    aspect-ratio: 2/3; /* 任意の比率に合わせて変更可。ここでは縦長を想定 */
    object-fit: cover;
  }
}
