body {
  font-family: "Helvetica", "Arial", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  background-color: #fdfdfd;
  color: #333;
}

header {
  align-items: center;
  justify-content: space-between; /* 左にロゴ、右にボタン */
  background-color: #004080; /* ヘッダー背景色例 */
  color: white;
  padding: 8px 16px;
}

h1 a {
  color: inherit;         /* 親要素の色を引き継ぐ */
  text-decoration: none;  /* 下線を消す */
}

nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  margin: 0;
  padding: 0;
}

/* ナビゲーションのリンク */
nav ul li a {
  color: #ffffff; /* 白文字でコントラストを確保 */
  text-decoration: none;
  padding: 8px 12px;
  transition: background-color 0.3s, color 0.3s;
}

nav ul li a:hover {
  color: #99ccff; /* ホバー時に明るい青に変化 */
}

section {
  padding: 40px 20px;
}

footer {
  background-color: #f0f4f8;
  color: #003366;
  padding: 40px 20px;
  text-align: center;
}

form {
  max-width: 600px;
  margin: 0 auto;
  background-color: #f5f5f5;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 40px; /* ← フッターとの間に余白を入れる */
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 auto 40px;
}

form label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #333;
}

form input[type="text"],
form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 16px;
  box-sizing: border-box;
  margin-bottom: 20px;
  resize: none; /* ← これでサイズ変更を禁止 */
}

form input[type="email"],
form select,
form textarea {
  padding: 8px;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 4px;
}



.sections {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  padding: 20px;
}

.sections article {
  background-color: #ffffff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s, box-shadow 0.2s;
}

.sections article:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sections article h4 {
  margin-top: 0;
  color: #003366;
  font-size: 1.1em;
}

.sections article p {
  margin-bottom: 0;
  line-height: 1.6;
}

.hero {
  background-size: cover;
  background-position: center;
  color: white;
  padding: 160px 20px;
  text-align: center;
  transition: background-image 1s ease-in-out;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

.footer-nav a {
  color: #003366;
  text-decoration: none;
  font-size: 14px;
  transition: color 0.3s;
}

.footer-nav a:hover {
  color: #99ccff;
}

footer .copyright {
  font-size: 12px;
  color: #003366;
}

.sns-links {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

.sns-links a img {
  transition: opacity 0.3s;
}

.sns-links a:hover img {
  opacity: 0.7;
}

header h1 {
  margin: 0 0 10px 0;
  font-size: 1.5em;
  display: flex;
  align-items: center;       /* ← 上下中央寄せ */
  justify-content: space-between; /* 左にロゴ＋文字、右に☰ */
  height: 80px;              /* ← 縦幅を大きく（調整可能） */
  padding: 0 16px;
  background-color: #004080; /* 任意 */
}

.nav-sns {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}

.sns-links img {
  transition: opacity 0.3s;
}

.member-count {
  font-weight: bold;
  color: #003366;
  margin-bottom: 8px;
}

.instrument-table table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.instrument-table td {
  border: 1px solid #ccc;
  padding: 12px;
  text-align: left;
}

.instrument-table th {
  background-color: #003366;
  color: white;
}

.instrument-table tr:nth-child(even) {
  background-color: #f9f9f9;
}

.instrument-breakdown {
  width: 100%;
  margin-top: 10px;
  border-collapse: collapse;
  font-size: 0.9em;
}

.instrument-breakdown th,
.instrument-breakdown td {
  padding: 4px 8px;
  border: 1px solid #ccc;
  text-align: left;
}

h1, h2, h3, h4 {
  margin-top: 1em;
  margin-bottom: 0.5em;
  line-height: 1.3;
}

a {
  color: #003366;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

header a:hover,
footer a:hover {
  text-decoration: none;
}

.concert-records details {
  margin-bottom: 20px;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px;
  background-color: #f9f9f9;
}

.concert-records summary {
  font-weight: bold;
  font-size: 1.1em;
  cursor: pointer;
}

.concert-records table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
}

.concert-records th,
.concert-records td {
  border: 1px solid #ccc;
  padding: 8px;
  text-align: left;
}

.concert-records th {
  background-color: #003366;
  color: white;
}

#toggle-all {
  margin-bottom: 20px; /* ← お好みで 30px や 40px に調整可能 */
}

select {
  margin-bottom: 16px; /* ← 下に余白を追加 */
}

.member-table {
  max-width: 800px;
  margin: 0 0 40px 0; /* ← auto を外して左寄せに */
  padding: 20px;
  background-color: #fdfdfd;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0,0,0,0.05);
}

.member-table h2 {
  font-size: 1.5em;
  margin-bottom: 0.2em;
}

.member-table p {
  margin-bottom: 1em;
  font-size: 0.95em;
  color: #555;
}

.member-table table {
  width: 100%;
  border-collapse: collapse;
}

.member-table th,
.member-table td {
  border: 1px solid #ccc;
  padding: 8px 12px;
  text-align: center;
}

.member-table th {
  background-color: #003366;
  color: white;
}

.hero-carousel {
  overflow: hidden;
  position: relative;
  width: 100%;
  max-width: 100vw; /* ← 画面幅を超えないように制限 */
  box-sizing: border-box; /* ← paddingが幅に含まれるように */
  max-height: 600px; /* ← 例：400px → 600px に拡大 */
  height: 60vh;       /* ← 画面の60%の高さにするのもおすすめ */
}

.carousel-track {
  display: flex;
  transition: transform 1s ease-in-out;
  height: 100%; /* ← 親の高さに合わせる */
}

.carousel-track a {
  flex: 0 0 100%;
}

.carousel-track img {
  width: 100%;
  height: auto;
  display: block;
}

.slide {
  flex: 0 0 100%;
  height: 100%; /* ← スライドの高さを統一 */
  position: relative;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* ← 画像をスライド枠にぴったり収める */
  display: block;
  z-index: 1;
}

.caption {
  bottom: 20px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  text-align: center;
  padding: 0; /* 背景がないので余白も最小限に */
  background: none;
  border-radius: 0;
  z-index: 2;
}

.arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0,0,0,0.5);
  color: white;
  border: none;
  font-size: 2rem;
  padding: 8px 12px;
  cursor: pointer;
  z-index: 1;
}

.arrow.left {
  left: 10px;
}

.arrow.right {
  right: 10px;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 10px;
}

.carousel-dots .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: #003366;
  border: 2px solid white;
  cursor: pointer;
  transition: background-color 0.3s;
}

.carousel-dots .dot.active {
  background-color: #99ccff;
}

.underline-link {
  text-decoration: underline; /* 常に下線を表示 */
}

.concert-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 20px 0;
  /*border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);*/
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  text-decoration: none;
}

.logo-icon {
  width: 60px;
  height: 60px;
  margin-right: 12px;
}

.table-wrapper {
  overflow-x: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.records-page table {
  min-width: 600px;
  border-collapse: collapse;
  table-layout: fixed;   /* 固定レイアウト */
  width: 100%;           /* 全体幅を固定 */
}

details {
  overflow: visible;
}

.menu-toggle {
  flex-direction: column;
  justify-content: center;
  width: 40px;
  height: 40px;
  gap: 6px;
  font-size: 28px;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;       /* ボタン内も中央寄せ */
}

.bar {
  display: block;
  width: 28px;
  height: 3px;
  background-color: white;
  transition: all 0.3s ease;
  border-radius: 2px;
}

/* 開いた状態（✕） */
.menu-toggle.open .top {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.open .middle {
  opacity: 0;
}

.menu-toggle.open .bottom {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* records.htmlのtable幅固定 */
.records-page th:nth-child(1),
.records-page td:nth-child(1) { width: 80px; } /* 日付 */
.records-page th:nth-child(2),
.records-page td:nth-child(2) { width: 120px; } /* 演奏会名 */
.records-page th:nth-child(3),
.records-page td:nth-child(3) { width: 150px; } /* 会場 */
.records-page th:nth-child(4),
.records-page td:nth-child(4) { width: 80px; } /* 指揮 */
.records-page th:nth-child(5),
.records-page td:nth-child(5) { width: 400px; } /* 演目 */

@media screen and (max-width: 768px) {
  body {
    font-size: 15px;
    padding: 10px;
  }

  header, nav, footer {
    padding: 10px;
  }
  
  footer {
    padding-top: 1.5rem; /* 内側の余白も調整可能 */
  }


  nav ul {
    flex-direction: column;
    gap: 10px;
  }

  .sections {
    grid-template-columns: 1fr;
  }

  .sns-links {
    margin-top: 12px;
    flex-direction: row;
    display: flex;
    justify-content: center;     /* ← 中央寄せ */
    align-items: center;
    gap: 12px;
    width: 100%;                 /* ← 幅を広げて中央寄せが効くように */
  }

  .instrument-table table,
  .instrument-table th,
  .instrument-table td {
    font-size: 14px;
  }

  .member-table table,
  .member-table th,
  .member-table td {
    font-size: 0.9em;
    padding: 6px 8px;
  }

  .caption {
    top: auto;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 1rem;
  }

  .carousel-dots {
    display: flex; /* ← 明示的に表示 */
  }

  .menu-toggle {
    margin-left: auto; /* 右寄せ */
    display: block;
    font-size: 28px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
  }

  

  .main-nav ul {
    align-items: flex-end; /* 右寄せ */
    display: flex;
    flex-direction: row;       /* 横並び */
    flex-wrap: wrap;           /* 折り返しを許可 */
    gap: 12px;
    list-style: none;
    padding: 0;
    margin: 0;
    justify-content: flex-end; /* 右寄せ（必要なら） */
  }

  .main-nav ul li a {
    color: white;
    text-decoration: none;
    padding: 8px;
    display: block;
    text-align: center;
    white-space: nowrap;       /* 折り返し防止（必要なら） */
  }

  /* ヘッダー全体を縦並びに */
  header {
    flex-direction: column;
    padding: 8px 16px;
    background-color: #004080;
    display: flex;
    align-items: center;
    justify-content: space-between; /* 左にロゴ、右にボタン */
  }

  /* ロゴと☰を横並びに */
  header h1 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
  }

  .logo-icon {
    width: 60px;
    height: 60px;
  }

  .main-nav ul li {
    flex: 1 1 auto;            /* 幅を自動調整して折り返しやすくする */
    min-width: 100px;          /* 最小幅を設定（調整可能） */
  }

  .records-page th:nth-child(2),
  .records-page td:nth-child(2) { width: 150px; } /* 演奏会名 */
  .records-page th:nth-child(3),
  .records-page td:nth-child(3) { width: 160px; } /* 会場 */
  .records-page th:nth-child(5),
  .records-page td:nth-child(5) { width: 300px; } /* 演目 */

  /* 初期状態（閉じている） */
  .nav-sns {
    display: flex;                /* 常にflexでレイアウトは維持 */
    flex-direction: row;          /* メニューとSNSを横並びに */
    justify-content: center;    /* 中央寄せ */
    align-items: flex-start;
    gap: 24px;                    /* メニューとSNSの間隔 */
    background-color: #004080;
    margin-top: 8px;
    width: 100%;
    flex-wrap: wrap;              /* 幅が足りないときに折り返し */

    max-height: 0;                /* 高さゼロで非表示 */
    overflow: hidden;             /* はみ出しを隠す */
    opacity: 0;                   /* 透明にして非表示 */
    padding: 0 12px;              /* 閉じているときは上下の余白をゼロに */
    will-change: max-height, opacity,padding;
    transition: max-height 0.3s ease,opacity 0.2s ease,padding 0.3s ease;
  }

  /* 開いた状態 */
  .nav-sns.open {
    max-height: 400px;            /* 十分大きな値にする（内容に合わせて調整） */
    opacity: 1;                   /* 不透明に */
    padding: 12px;                /* 開いたときの余白 */
  }

}

/* PCやタブレットは既存のスタイルを維持 */

/* スマホ用: 画面幅が768px以下のとき */
@media (max-width: 768px) {
  .nav-sns .main-nav {
    display: flex;
    flex-wrap: wrap;        /* 折り返しを許可 */
    justify-content: center;
    gap: 12px;              /* アイテム間の余白を少し狭める */
    width: 100%;
  }

  .nav-sns .main-nav li {
    flex: 1 0 30%;          /* 1行に3つ並ぶように幅を約30%に */
    text-align: center;     /* 中央寄せ */
    font-size: 14px;        /* 文字サイズをスマホ用に調整 */
  }

  /* SNSアイコン部分も調整したい場合 */
  .nav-sns .sns-icons {
    flex-basis: 100%;       /* 下に回り込むように */
    justify-content: center;
    margin-top: 8px;
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;   /* 横並びにする */
    align-items: center;   /* 縦位置を揃える */
    justify-content: center;
    gap: 0.4em;            /* アイコンと文字の間隔 */
    font-size: 1rem;
    padding: 8px 12px;
    cursor: pointer;
  }

  .menu-toggle {
    transform: translateY(4px); /* 全体を少し下にずらす */
  }

  .menu-toggle i {
    font-size: 1.5em;      /* アイコンを少し大きめに */
  }

  .menu-text {
    font-size: 0.8em;           /* 文字だけ小さくする */
    letter-spacing: 1px;
    text-transform: uppercase;
  }

}

/* PC（769px以上）では☰ボタン非表示 */
@media screen and (min-width: 769px) {
  .menu-toggle {
    display: none;
  }
}

.news h2 {
  font-size: 1.17em; /* h3 と同じサイズにする */
  font-weight: bold; /* 必要なら太字を維持 */
  margin: 1em 0;     /* h3 と同じ余白に調整 */
}

section h2 {
  margin-bottom: 2em; /* 見出しの下に余白を追加 */
}

section h3 {
  margin-top: 2em; /* 見出しの下に余白を追加 */
}

ul {
  padding-left: 1em; /* デフォルトより狭くする */
}

.about {
  padding-bottom: 0.5em; /* 内側の余白を狭くする */
}

.form-group {
  margin-bottom: 1em;
}

.form-group label {
  display: block;
  margin-bottom: 0.3em;
  font-weight: bold;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.5em;
  font-size: 1em;
  box-sizing: border-box;
}

.popup {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  justify-content: center;
  align-items: center;
}

.popup-content {
  background: #fff;
  padding: 2em;
  border-radius: 8px;
  width: 90%;
  max-width: 500px;
}

.hidden {
  display: none;
}

#contactForm button{
  align-self: center;
  padding: 10px 20px;
  background-color: #003366;
  color: white;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
}

#contactForm button:hover {
  background-color: #0055aa;
}

/* 送信ボタン */
.popup-content form button {
  align-self: center;
  color: black;
  border: none;
  padding: 12px 24px;
  font-size: 16px;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  border: 1px solid black;
}

.popup-content form button:hover {
  background-color: #e0e0e0;
}

/* 戻るボタン */
.popup-content button[type="button"] {
  cursor: pointer;
}

.popup-content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;  /* 子要素を中央寄せ */
}

.popup-content p:last-of-type {
  margin-bottom: 3em;
}