@font-face {
  font-family: 'kantei';
  src: url("../../../fonts/kantei.woff2") format("woff2");
}

body {
  font-family: "Noto Sans JP", sans-serif;
  margin: 0 auto;
  max-width: 1200px;
  width: 100%;
}

.sidebar {
  position: fixed;
  top: 0;
  left: -250px;
  background-color: rgb(75, 48, 17);
  width: 250px;
  height: 420px;
  transition: all 0.3s;
  z-index: 1000;
}

.sidebar h2 {
  font-size: 18px;
  color: #fff;
  text-align: left;
  line-height: 45px;
  background: rgb(138, 90, 36);
  user-select: none;
  padding-left: 35px;
}

.sidebar img {
  width: 9%;
  margin: 5px 16px 11px 0;
}

.sidebar ul a {
  display: block;
  height: 100%;
  width: 100%;
  line-height: 40px;
  font-size: 16px;
  color: #fff;
  padding-left: 35px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid black;
  transition: 0.4s;
}

ul li:hover a {
  padding-left: 80px;
}

#check {
  display: none;
}

label #btn,
label #cancel {
  position: fixed;
  cursor: pointer;
  background: #b66f2d;
  border-radius: 3px;
  z-index: 1100;
}

label #btn {
  left: 18px;
  top: 13px;
  font-size: 15px;
  color: #fff;
  padding: 6px 12px;
  transition: all 0.5s;
}

label #cancel {
  left: -250px;
  top: 13px;
  color: #fff;
  padding: 4px 9px;
  transition: all 0.5s;
}

#check:checked~.sidebar {
  left: 0;
}

#check:checked~label #btn {
  left: -250px;
  opacity: 0;
  pointer-events: none;
}

#check:checked~label #cancel {
  left: 200px;
}


.section-1 {
  height: 50vh;
  background-image: url("../images/image11.jpg");
  background-size: cover;
  background-position: center 30%;
  transition: all 0.5s;
  position: relative;
}

.section-1 .midasi {
  position: absolute;
  top: 35px;
  left: 380px;
}

.section-1 h2 {
    text-align: center;
  font-size: 50px;
  font-weight: 700;
  color: #863434;
  -webkit-text-stroke: 1px #5140ce;
}

.section-1 ul {
  display: flex;
  justify-content: center;
  gap: 25px;
}

.section-1 ul li {
  color: rgb(19, 23, 160);
  margin-top: 25px;
  font-size: 25px;
}

.gallery-title {
   font-family: "kantei";
  text-align: center;
  font-size: 36px;
  margin: 30px 0;
color: blue;
}

/* 🧱 横4列のグリッド配置（縦は枚数に応じて自動） */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  /* 横4列 */
  gap: 16px;
  /* 画像同士のすき間 */
  max-width: 1200px;
  margin: 0 auto 100px;
}


/* 画像を囲む枠のスタイル */
.gallery-item {
  position: relative;
  cursor: pointer;
  background-color: #ddd;
  aspect-ratio: 4 / 3;
  /* 画像の比率を4:3に統一 */
}

/* 画像自体の基本スタイル */
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* 枠線に合わせて綺麗にトリミング */
  transition: transform 0.5s ease;
  border-radius: 16px;
}

/* 🔍 クリックされて拡大（activeクラス付与）した時のスタイル */
/* 黒い背景は使わず、画像だけを画面の「真ん中」に固定配置します */
.gallery-item.active {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 0;
  /* 枠の幅をゼロにして、余計な白いエリアを完全に消去 */
  height: 0;
  /* 枠の高さもゼロにする */
  z-index: 9999;
  aspect-ratio: auto;
  background-color: transparent;
  /* 背景を完全に透明化 */
 
}

/* 拡大されたときの中の画像スタイル */
.gallery-item.active img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  /* 枠の中心に画像を合わせる */

  /* 🛠️ ここで「写真本体」の拡大サイズを決定します（自由に変えてOKです） */
  width: 80vw;
  /* 画面幅の80% */
  height: auto;
  /* 縦幅は写真の比率に合わせて自動計算 */

  /* ⚠️ 縦長写真が画面上下からはみ出るのを防ぐ安全ブレーキ */
  max-height: 85vh;
  max-width: 95vw;

  object-fit: contain;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
  /* 画像だけに綺麗な影をつける */

}
/* 📱 レスポンシブ対応：画面が狭いスマホ等は横2列にする */
@media (max-width: 768px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }

  /* スマホでの写真本体の拡大サイズ */
  .gallery-item.active img {
    width: 90vw;
    max-height: 80vh;
  }
}

footer {
  padding: 30px;
  text-align: center;
  font-size: 18px;
  font-family: "kantei";
}