body {
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f8f9fa;
  color: #333;
}

header {
  background-color: #4f46e5;
  color: white;
  padding: 1rem;
  text-align: center;
}

nav ul {
  list-style: none;
  padding: 0;
  display: flex;
  justify-content: center;
  margin-top: 1rem;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

nav li {
  margin: 0;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

main {
  padding: 2rem;
}

section {
  margin-bottom: 2rem;
}

footer {
  text-align: center;
  background-color: #ddd;
  padding: 1rem;
}

/* ブログ全体のセクション */
.blog-section {
  background-color: #ffffff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
  max-width: 800px;
  margin: 0 auto 2rem;
}

/* 各ブログ記事のブロック */
.blog-entry {
  line-height: 1.8;
  font-size: 1rem;
}

/* ブログタイトル */
.blog-entry h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: #333;
}

/* 日付 */
.blog-entry em {
  color: #888;
  font-size: 0.9rem;
}

/* ブログ本文 */
.blog-entry p {
  margin: 1rem 0;
}

/* リンク表示（Markdown対策） */
.blog-entry a {
  color: #4f46e5;
  text-decoration: underline;
}

.blog-container {
  display: flex;
  gap: 2rem;
  max-width: 1500px;
  margin: 0 auto 2rem;
  padding: 1rem;
}

/* 左カラム（ナビ） */
.blog-nav {
  width: 200px;
  flex-shrink: 0;
  background: #ffffff;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.05);
}

.blog-nav h3 {
  margin-top: 0;
}

.blog-nav ul {
  list-style: none;
  padding: 0;
}

.blog-nav li {
  margin-bottom: 0.5rem;
}

.blog-nav a {
  text-decoration: none;
  color: #4f46e5;
  font-weight: bold;
}

/* 中央カラム（本文） */
.blog-section {
  flex: 1;
  background: #ffffff;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
}

/* 右カラム（チャット） */
.chat-column {
  width: 250px;
  flex-shrink: 0;
  background: #f9fafb;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 0 6px rgba(0, 0, 0, 0.05);
}

.chat-column form {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.chat-column input {
  padding: 0.5rem;
  font-size: 1rem;
}

.chat-column button {
  padding: 0.5rem;
  font-weight: bold;
  background-color: #4f46e5;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#messages-list {
  max-height: 300px;
  overflow-y: auto;
  list-style: none;
  padding: 0;
}

#messages-list li {
  margin-bottom: 0.5rem;
  background: #ffffff;
  padding: 0.5rem;
  border-radius: 4px;
  box-shadow: 0 0 2px rgba(0,0,0,0.1);
}


.divider-title {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 20rem 0;
}

.divider-title::before,
.divider-title::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #ccc;
}

.divider-title:not(:empty)::before {
  margin-right: .75em;
}

.divider-title:not(:empty)::after {
  margin-left: .75em;
}

.search-box {
  margin-bottom: 1rem;
}

.search-box input {
  padding: 0.5rem;
  font-size: 1rem;
  width: 250px;
  max-width: 300px;
}

.search-box button {
  padding: 0.5rem 1rem;
  margin-left: 0.5rem;
  font-size: 1rem;
  background-color: #4f46e5;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.search-results {
  margin-top: 1rem;
  padding: 1rem;
  background: #f3f4f6;
  border-radius: 8px;
  max-width: 400px;
}

.gallery-container {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap; /* 小画面で折り返し可能 */
  margin: 2rem 0;
}

/* モーダルの背景 */
.modal {
  display: none; /* デフォルト非表示 */
  position: fixed;
  z-index: 1000;
  padding: 60px 1rem 1rem;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.8);
  align-items: flex-start;
  justify-content: center;
  box-sizing: border-box;
}

.modal-panel { width: min(900px, 100%); color: #fff; text-align: center; }
.modal-panel h3 { margin-bottom: 0.25rem; }
.modal-panel p { margin-top: 0.25rem; }
.modal-open { overflow: hidden; }

/* モーダル画像 */
.modal-content {
  display: block;
  margin: auto;
  max-width: 80%;
  max-height: 80%;
  border-radius: 8px;
  box-shadow: 0 0 12px rgba(0,0,0,0.5);
}

video.modal-content { width: min(900px, 100%); height: auto; }
audio.modal-content { width: min(640px, 90%); box-shadow: none; }

/* 閉じるボタン */
.close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  border: 0;
  background: transparent;
  line-height: 1;
}

.gallery-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  margin: 1.5rem 0;
}

.gallery-item:hover,
.gallery-item:focus-visible {
  transform: scale(1.08);
  z-index: 10;
  position: relative;
}

.gallery-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .75rem;
  margin: 1.5rem 0;
}

/* 見える窓。はみ出しを隠す */
.gallery-viewport {
  overflow: hidden;
}

/* 横並びの“トラック”。これをtranslateXで動かす */
.gallery-track {
  display: flex;
  gap: 1rem;               /* JSで読み取るので数値指定推奨 */
  will-change: transform;
}

/* 作品カード（画像・音楽・動画共通） */
.gallery-item {
  width: 200px;
  height: 200px;
  flex: 0 0 200px;
  border-radius: 12px;
  box-shadow: 0 0 4px rgba(0,0,0,0.1);
  transition: transform 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 0;
  background: linear-gradient(135deg, #312e81, #6366f1);
  color: #fff;
  font: inherit;
}

.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item--audio,
.gallery-item--video { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.4rem; }
.gallery-type-icon { font-size: 3rem; line-height: 1; }
.gallery-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 0.55rem 0.65rem;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.82));
  color: #fff;
  font-size: 0.9rem;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ナビボタン（任意） */
.gallery-nav {
  border: none; width: 36px; height: 36px;
  border-radius: 50%; font-size: 20px; line-height: 36px;
  background: #e5e7eb; color:#111827; cursor: pointer;
}
.gallery-nav:hover { background: #d1d5db; }
.gallery-nav:disabled { opacity: .5; cursor: default; }

@media (max-width: 480px) {
  main { padding: 1rem; }
  .gallery-wrapper { gap: 0.35rem; }
  .gallery-track { gap: 0.5rem; }
  .gallery-item { width: 88px; height: 88px; flex-basis: 88px; }
  .gallery-caption { font-size: 0.72rem; padding: 0.4rem; }
  .gallery-nav { width: 30px; height: 30px; line-height: 30px; flex: 0 0 30px; }
}
