/* ============================ */
/* トップページ専用 main.css     */
/* ============================ */

/* メインビジュアル */
.main-visual {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 1;
    overflow: hidden;
  }
  .main-visual img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
    z-index: 0;
  }
  .main-visual img.active {
    opacity: 1;
    z-index: 1;
  }
  
  /* 紹介テキスト */
  .intro {
    text-align: center;
    max-width: 700px;
    margin: 4em auto;
    padding: 0 1em;
    font-size: 1em;
  }

  /* ボタンコンテナ（中央揃え） */
.buttons {
  display: flex;
  flex-direction: column;
  align-items: center;  /* ← 中央揃え！ */
  gap: 1em;
  margin: 3em 0;
}

  /* ギャラリー */
  .gallery-container {
    max-width: 900px;
    margin: 0 auto;
  }
  .gallery h2 {
    text-align: center;
    font-size: 1.8em;
    margin: 3em 0 1em;
  }
  .gallery .grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    grid-auto-rows: auto;
    gap: 16px;
  }
  .gallery .grid img {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
  }
  .gallery .grid img:hover {
    transform: scale(1.2);
  }
  
  /* お知らせ（カルーセル） */
  #news h2 {
    text-align: center;
    font-size: 1.8em;
    margin: 3em 0 1em;
  }
  .carousel-frame {
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 1080px;
    margin: 2em auto;
    position: relative;
  }
  .carousel-wrapper {
    overflow: hidden;
    flex: 1;
  }
  .carousel-track {
    display: flex;
    gap: 1em;
    scroll-behavior: smooth;
    padding: 1em 0;
    transition: transform 0.3s ease;
  }
  .news-card {
    min-width: 320px;
    max-width: 320px;
    background: #fff;
    border: 2px solid #008080;
    border-radius: 10px;
    padding: 1.2em;
    box-shadow: 2px 2px 10px rgba(0,0,0,0.1);
    text-align: center;
    flex-shrink: 0;
  }
  .carousel-btn.outer {
    background: #fcfbfa;
    color: #ff0000;
    border: none;
    padding: 0.5em 1em;
    font-size: 1.6em;
    cursor: pointer;
    border-radius: 5px;
    transition: background-color 0.3s ease;
  }
  .carousel-btn.outer:hover {
    background-color: #006666;
  }

  /* 年代別ボタン */

  #yearSelect {
    /* 基本の大きさ */
    width: 180px;
    padding: 0.6em 1.2em;
    font-size: 1rem;
    line-height: 1.2;

    margin-bottom: 1.5rem;  /* ← ここで下にスペースを入れる */
    
    /* 枠まわり */
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    
    /* 矢印（ネイティブ矢印を消して自前で描く） */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='7' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0l5 7 5-7z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.8em center;
    background-size: 0.6em;
    
    /* ホバー／フォーカス時の色 */
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  #yearSelect:hover {
    border-color: #999;
  }
  #yearSelect:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(217, 124, 0, 0.3);
  }
  
  /* デフォルト option の余白を調整（見た目はブラウザ依存ですが） */
  #yearSelect option {
    padding: 0.5em;
  }
  

  
  /* ============================ */
  /* レスポンシブ対応              */
  /* ============================ */
  
  @media (max-width: 768px) {
    .gallery .grid {
      grid-template-columns: repeat(2, 1fr);
      gap: 1.5em;
    }
  
    .gallery .grid img {
      width: 100%;
      aspect-ratio: 1 / 1;
      display: block;
    }
    
    .gallery .grid img:active {
      transform: scale(0.95);
      filter: brightness(0.8);
      opacity: 0.7;
      transition: none;
    }
    
    .carousel-btn {
      display: none;
    }
  
    .news-card {
      flex: 0 0 260px;
    }
  
    .intro {
      font-size: 0.9em;
      line-height: 1.6;
      padding: 0 1em;
    }

    .carousel-wrapper {
      overflow-x: auto;
      -webkit-overflow-scrolling: touch; /* スマホでの慣性スクロール対応 */
      touch-action: pan-x; /* ← 横スクロールを明示 */
    }
  
    .carousel-track {
      display: flex;
      gap: 1em;
      padding-bottom: 1em;
      transition: none; /* ← モバイルは滑らかにするためアニメを制限してもOK */
    }
  
    .news-card {
      scroll-snap-align: start;
      flex: 0 0 auto;
    }
  }
  
  @media (max-width: 480px) {
    .gallery .grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 1em;
      padding: 0 1em;
    }
    
  
    .gallery .grid img {
      width: 80%;               /* ← 小さく表示するポイント！ */
      aspect-ratio: 1 / 1;
      height: auto;
      object-fit: cover;
      border-radius: 8px;
      display: block;
      margin: 0 auto;           /* ← 中央揃え */
    }

    .gallery .grid img:active {
      transform: scale(0.95);
      filter: brightness(0.8);
      font-size: 0.9em;
      opacity: 0.7;
      transition: none;
    }
    .news-card h3 {
      font-size: 1em;
    }
  
    .news-card .date,
    .news-card .place {
      font-size: 0.85em;
    }

    .news-card {
    min-width: 90%;
    flex: 0 0 auto;
      flex: 0 0 100%;
      padding: 1em;
      margin: 0;
    }
  
    .main-visual {
      height: 260px;
      border-radius: 10px;
    }
  
    .main-visual img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    #yearSelect {
      width: 100%;
      max-width: 150px;
      font-size: 0.9rem;
    }
  }
  