@layer reset, base, layout, components, utilities;
/* ========================================================================== */
@layer layout {
.l-gallery-one-column {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center; /* 中身の要素をすべて横方向の中央に寄せる */
}

}

@layer components {

/* ==========================================================================
   モーダル（ポップアップ）専用スタイル
   ========================================================================== */

/* ポップアップの背景（画面全体を覆う黒マスク） */
.modal {
  display: none; /* 初期状態は非表示 */
  position: fixed;
  z-index: 20000; /* 既存のどの要素よりも手前に来るように大きな数値を設定 */
  left: 0; 
  top: 0; 
  width: 100%; 
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  align-items: center;
  justify-content: center;
}

/* コンテンツエリア（画像＋解説文の外枠） */
.modal-content {
  max-width: 80%;
  max-height: 80%;
  text-align: center;
  color: #fff;
  animation: modalFadeIn 0.3s;
}

/* ポップアップ内の画像 */
.modal-content img {
  max-width: 100%;
  max-height: 70vh; /* 画面からはみ出さない高さ設定 */
  object-fit: contain;
  border-radius: 4px;
}

/* 画像の下の説明文 */
#modal-caption { 
  margin-top: 15px; 
  font-size: 1rem; 
  padding: 0 10px; 
  line-height: 1.5;
}

/* 閉じるボタン（右上） */
.modal-close {
  position: absolute;
  top: 15px; 
  right: 25px;
  color: #fff; 
  font-size: 40px; 
  font-weight: bold;
  cursor: pointer; 
  z-index: 20020;
}

/* 左右のナビゲーション矢印ボタン（共通） */
.modal-prev, .modal-next {
  position: absolute;
  top: 50%; 
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  color: white; 
  border: none; 
  font-size: 30px;
  padding: 15px 20px; 
  cursor: pointer; 
  border-radius: 4px;
  transition: background 0.2s; 
  z-index: 20010;
}
.modal-prev:hover, .modal-next:hover { 
  background: rgba(255,255,255,0.3); 
}
.modal-prev { left: 10px; }
.modal-next { right: 10px; }


/* 既存の共通レイアウトに影響しないよう、名前を限定して上書きを防ぐ */
.modal-gallery-grid {
  display: grid !important; /* 他のdisplay: blockなどを強制クリア */
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); /* 幅を少しコンパクトに */
  gap: 15px;
  width: 100%; /* 親の2カラムの枠いっぱいに広げる */
  margin: 0 auto;
}

/* --- スマートフォン用のレスポンシブ調整 --- */
@media (max-width: 768px) {
  .modal-content { 
    max-width: 95%; 
  }
  .modal-prev, .modal-next { 
    padding: 10px 15px; 
    font-size: 24px; 
    background: rgba(0,0,0,0.5); /* スマホでは矢印を見えやすく黒背景に */
  }
}

/* ふわっと表示させるアニメーション（既存の animation 名と被らないように命名） */
@keyframes modalFadeIn { 
  from { opacity: 0; } 
  to { opacity: 1; } 
}




.c-gallery-card {
    width: 100%;
    max-width: 640px;    
    display: flex;
    flex-direction: column;
    align-items: stretch; 
    margin-bottom: var(--sp-4); 
  }

  .c-gallery-card__title {
    align-self: flex-start; 
    text-align: left;        
    width: 100%;             
  }

  .c-gallery-card__img {
    margin-inline: auto; 
  }

  .c-gallery-card__desc {
    text-align: center;
  }







/* ポップアップの中にあるタイトルだけ、左の縦線と余白をリセットする */
.modal-content h3 {
  border-left: none;
  padding: 0;
  margin-bottom: 5px;
}

}