/* ============================================================
   イラストギャラリー専用スタイル  /css/gallery.css
   ============================================================ */

.gallery-page-root {
  display: block;
  flex: 1;               /* 親のmainから高さを受け継いで下に伸ばす */
  width: 100%;           /* 横幅いっぱいに広げる */
  min-height: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding-top: 80px;   /* 固定ヘッダーの下に配置 */
  padding-left: 2em;   /* 一番下のイラストとフッターとの距離 */
  padding-right: 2em;
  padding-bottom: 40px;
  text-align: center;
  box-sizing: border-box;
}

.gallery-page-root h1 {
  margin-top: 0;
  margin-bottom: 1.5em;
}

/* ===== タグリスト ===== */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: 2em;
}

.tag-item {
  background: linear-gradient(90deg, #ff9999, #c9a0dc);
  color: #fff;
  padding: 6px 12px;
  border-radius: 20px;
  text-decoration: none;
  font-size: 1em;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.tag-item:hover {
  transform: scale(1.1);
  background: linear-gradient(90deg, #c9a0dc, #ff9999);
}

.tag-item.active {
  border: 2px solid #fff;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.4);
}

/* ===== ギャラリーグリッド ===== */
.gallery-grid {
  display: grid;
  /*
    auto-fill : コンテナ幅に収まるだけ列を作る（幅が狭まれば列を減らす）
    auto-fit  : アイテムを引き伸ばして列を埋める → 列が減らない原因になる
    box-sizing: content-box で main.css の * {border-box} の干渉を遮断
  */
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  box-sizing: content-box;
  gap: 15px;
  max-width: 1200px;
  margin: 0 auto;
}

.gallery-item {
  text-align: center;
}

.gallery-img {
  width: 100%;
  max-width: 400px;
  height: 400px;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  transition: transform 0.3s;
  margin: 0 auto;
  display: block;
}

.gallery-img:hover {
  transform: scale(1.05);
}

/* ===== モーダル（ライトボックス） ===== */
.modal {
  display: none;
  position: fixed;
  z-index: 6000; /* ナビボタン(5000)より前面 */
  padding-top: 80px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
}

.modal-content {
  margin: auto;
  display: block;
  max-width: 95%;
  max-height: 70%;
  border-radius: 8px;
  object-fit: contain;
}

#close {
  position: absolute;
  top: 15px;
  right: 25px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  text-shadow: 0 0 5px rgba(0, 0, 0, 0.5);
}

/* ===== ダウンロードボタン ===== */
.download-btn {
  display: block;
  width: fit-content;
  margin: 20px auto 10px auto;
  padding: 8px 16px;
  background: linear-gradient(90deg, #ff9999, #c9a0dc);
  color: #fff;
  text-decoration: none;
  border-radius: 20px;
  font-weight: bold;
  font-size: 0.85em;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, opacity 0.2s;
}

.download-btn:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

/* ===== 利用規約リンク ===== */
.policy-link {
  display: block;
  width: fit-content;
  margin: 0 auto 20px auto;
  color: #3498db;
  text-decoration: underline;
  font-size: 0.75em;
  transition: opacity 0.2s;
}

.policy-link:hover {
  opacity: 0.7;
}
