body {
  position: relative;
  min-height: 100vh;
  background-image: url("https://rakutano-school.com/img/school/kanazawa_izumigaoka_hs01.jpg");
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
  background-attachment: fixed;
}

body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 0;
}
.bg {
  position: relative; /* 必須 */
  border-radius: 16px;
  width: 95%;
  margin: 30px auto;
  background-color: rgba(255, 255, 255, 0.7);
  z-index: 1; /* ::before より前面 */
  padding: 10px 0 10px 0;
}

.title {
  text-align: center;
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: bold;
}

/* コンテナ全体 */

h3,
p {
  white-space: pre-line; /* 改行文字 \n を表示 */
}

.items {
  display: grid;
  gap: 16px;
  width: 95%;
  margin: 10px auto;
}
.items {
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 250px) {
  .items {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

.item {
  background-color: rgba(255, 255, 255, 0.9);
  border-radius: 16px;
  padding: 12px;
  margin: 0px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.item img {
  max-height: 200px; /* 画像の最大高さ */
  width: auto; /* 横幅は自動調整 */
  margin-right: 12px; /* テキストとの間隔 */
  flex: 0 0 auto; /* 横幅は固定 */
  overflow: hidden; /* はみ出た画像を隠す */
  border-radius: 8px; /* 枠の角を丸く */
  display: flex; /* 中央配置 */
  justify-content: center;
  align-items: center;
}

.item p {
  display: none;
}

h3,
p {
  margin: 0;
}

/* モーダル表示 */
.zoomable {
  cursor: pointer;
  transition: transform 0.2s;
  max-width: 100%;
  height: auto;
}

.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  padding: 16px;
  box-sizing: border-box;
  overflow: hidden; /* はみ出し防止 */
}

.modal-content-wrapper {
  position: relative;
  max-width: 85vw; /* 少し小さく */
  max-height: 85vh; /* 少し小さく */
  width: auto;
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden; /* はみ出し防止 */
}

.modal-content-wrapper img,
.modal-content-wrapper video {
  max-width: 100%;
  max-height: 85vh; /* 高さも制限 */
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
}

.close {
  position: absolute;
  top: 20px;
  right: 20px;
  color: white;
  font-size: 30px;
  cursor: pointer;
  user-select: none;
}

.filterdiv {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 10px;
  margin-bottom: 20px;
}

.filter-button {
  background-color: transparent;
  border: 2px solid #ffffffff;
  padding: 10px 20px;
  font-size: 16px;
  cursor: pointer;
  border-radius: 12px;
  transition: all 0.3s ease;
  white-space: nowrap;
  min-width: 100px; /* 追加: ボタンの最小幅 */
}

.filter-button[data-type="all"] {
  --border-color: #005f96ff;
  border: 2px solid var(--border-color);
}

.filter-button[data-type="催事"] {
  --border-color: rgba(91, 255, 99, 1);
  border: 2px solid var(--border-color);
}

.filter-button[data-type="模擬店"] {
  --border-color: rgba(123, 121, 255, 1);
  border: 2px solid var(--border-color);
}

.filter-button[data-type="野外劇"] {
  --border-color: rgba(255, 91, 91, 1);
  border: 2px solid var(--border-color);
}

.filter-button[data-type="有志発表"] {
  --border-color: rgba(117, 255, 248, 1);
  border: 2px solid var(--border-color);
}

.filter-button[data-type="その他"] {
  --border-color: #ffffffff;
  border: 2px solid var(--border-color);
}

.filter-button:hover,
.filter-button.active {
  background-color: var(--border-color);
  color: white;
}

.filter-button:hover:is([data-type="催事"], [data-type="有志発表"], [data-type="その他"]),
.filter-button.active:is([data-type="催事"], [data-type="有志発表"], [data-type="その他"]) {
  color: black;
}
