/* ============================================================
   gallery.css
   朝倉トレイルラン フォトギャラリー
   ============================================================ */

/* ----------------------------------------------------------
   ページ全体
---------------------------------------------------------- */
.gallery-page {
  background: #0e0c09;
  min-height: 60vh;
  padding-bottom: 80px;
}

/* ----------------------------------------------------------
   ヘッダー
---------------------------------------------------------- */
.gallery-header {
  text-align: center;
  padding: 60px 20px 0;
}

.gallery-header__en {
  font-size: 11px;
  letter-spacing: 5px;
  color: #b8963e;
  text-transform: uppercase;
  margin: 0;
}

.gallery-header__title {
  font-family: 'Noto Serif JP', serif;
  font-size: 28px;
  font-weight: 400;
  color: #f0ead8;
  letter-spacing: 3px;
  margin: 12px 0 0;
}

.gallery-header__line {
  width: 40px;
  height: 1px;
  background: #b8963e;
  margin: 20px auto 36px;
}

/* ----------------------------------------------------------
   フィルターボタン
---------------------------------------------------------- */
.gallery-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 0 20px 36px;
}

.gallery-filters__btn {
  background: transparent;
  border: 1px solid #2e2820;
  color: #7a6a4a;
  font-family: 'Noto Serif JP', serif;
  font-size: 12px;
  letter-spacing: 3px;
  padding: 8px 22px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.gallery-filters__btn:hover {
  border-color: #b8963e;
  color: #b8963e;
}

.gallery-filters__btn.is-active {
  background: #b8963e;
  border-color: #b8963e;
  color: #0e0c09;
}

/* ----------------------------------------------------------
   マソンリーグリッド
   CSS columns を使うシンプルな実装
---------------------------------------------------------- */
.gallery-grid {
  columns: 3;
  column-gap: 6px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (max-width: 900px) {
  .gallery-grid { columns: 2; }
}
@media (max-width: 500px) {
  .gallery-grid { columns: 1; }
}

/* ----------------------------------------------------------
   写真アイテム
---------------------------------------------------------- */
.gallery-item {
  break-inside: avoid;
  margin-bottom: 6px;
  display: block;
  transition: opacity 0.35s, transform 0.35s;
}

/* フィルターで非表示にするとき */
.gallery-item.is-hidden {
  display: none;
}

.gallery-item__inner {
  position: relative;
  overflow: hidden;
  display: block;
  cursor: pointer;
}

.gallery-item__img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.45s ease;
}

.gallery-item__inner:hover .gallery-item__img {
  transform: scale(1.06);
}

/* ホバーオーバーレイ */
.gallery-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(14, 12, 9, 0.82) 0%,
    rgba(14, 12, 9, 0.0) 50%
  );
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 16px;
}

.gallery-item__inner:hover .gallery-item__overlay {
  opacity: 1;
}

.gallery-item__tag {
  font-size: 10px;
  letter-spacing: 3px;
  color: #b8963e;
  text-transform: uppercase;
  display: block;
  margin-bottom: 5px;
}

.gallery-item__caption {
  font-family: 'Noto Serif JP', serif;
  font-size: 13px;
  color: #f0ead8;
  line-height: 1.5;
  margin: 0;
}

/* ズームボタン */
.gallery-item__zoom {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: rgba(14, 12, 9, 0.5);
  border: 1px solid rgba(184, 150, 62, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s, background 0.2s;
}

.gallery-item__zoom:hover {
  background: rgba(184, 150, 62, 0.18);
  border-color: #b8963e;
}

.gallery-item__zoom svg {
  width: 14px;
  height: 14px;
  stroke: #b8963e;
  fill: none;
  display: block;
}

/* ----------------------------------------------------------
   補足テキスト
---------------------------------------------------------- */
.gallery-hint {
  text-align: center;
  font-size: 12px;
  letter-spacing: 1px;
  color: #3a3226;
  margin: 24px 0 0;
}

.gallery-empty {
  text-align: center;
  color: #5a5040;
  padding: 60px 20px;
  font-size: 14px;
}

/* ----------------------------------------------------------
   ライトボックス
---------------------------------------------------------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox[hidden] { display: none; }

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 4, 3, 0.93);
  cursor: pointer;
}

.lightbox__container {
  position: relative;
  max-width: 900px;
  width: 100%;
  z-index: 1;
}

.lightbox__close {
  position: absolute;
  top: -16px;
  right: 0;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid #2e2820;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s;
  z-index: 2;
}

.lightbox__close:hover {
  border-color: #b8963e;
}

.lightbox__close svg {
  width: 14px;
  height: 14px;
  stroke: #b8963e;
  fill: none;
  display: block;
}

.lightbox__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
}

.lightbox__info {
  padding: 14px 0 0;
  display: flex;
  align-items: center;
  gap: 14px;
}

.lightbox__tag {
  font-size: 11px;
  letter-spacing: 3px;
  color: #b8963e;
  text-transform: uppercase;
  white-space: nowrap;
}

.lightbox__caption {
  font-family: 'Noto Serif JP', serif;
  font-size: 14px;
  color: #b0a080;
  line-height: 1.5;
  margin: 0;
}

/* キーボードフォーカス可視化 */
.gallery-filters__btn:focus-visible,
.gallery-item__zoom:focus-visible,
.lightbox__close:focus-visible {
  outline: 2px solid #b8963e;
  outline-offset: 2px;
}
