#tj-gallery-root{
  padding-top: 48px; /* filterbarの高さ＋paddingに合わせて調整 */
}

#tj-gallery-grid {
  position: relative;
}

.tj-gallery-item {
  position: absolute;
  overflow: hidden;
  border-radius: 0;
}

.tj-gallery-item img {
  width: 100%;
  height: auto;
  display: block;
}

/* ===== Filter bar ===== */
.tj-gallery-filters{
  display:flex;
  gap:8px;
  align-items:center;
  overflow-x:auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 0 14px;
  margin: 0 0 6px;
}
.tj-gallery-filters::-webkit-scrollbar{ height:6px; }
.tj-gallery-filter{
  appearance:none;
  border:1px solid rgba(255,255,255,.25);
  background: rgba(0,0,0,.35);
  color:#fff;
  padding:6px 10px;
  border-radius:999px;
  font-size:13px;
  line-height:1;
  cursor:pointer;
  white-space:nowrap;
}
.tj-gallery-filter.is-active{
  border-color: rgba(255,255,255,.85);
  background: rgba(255,255,255,.12);
}
.tj-gallery-error{
  color:#fff;
  opacity:.85;
  padding: 10px 0;
}

/* =====================================================
   Filter bar (sticky, compact, classy)
   ===================================================== */

/* ギャラリー上部に居座るバー */
.tj-gallery-filterbar{
  position: fixed;
  top:116px;               /* ヘッダーがあるなら 60px などに調整 */
  z-index: 20;
  display: flex;
  gap: 8px;
  align-items: center;

  padding: 6px;
  margin: 0 0 10px 0;

  /* 画像の上に載るので塗り＆透過 */
  background: rgba(10,10,12,0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);

  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;

  /* スマホで右が切れない：横スクロール */
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;

    /* iOSの慣性スクロール */
  -webkit-overflow-scrolling: touch;

    /* 横スクロールバーを目立たせない */
  scrollbar-width: none;         /* Firefox */

}
.tj-gallery-filterbar::-webkit-scrollbar{ display:none; }

/* ボタン（小さめ・上品・主張しすぎない） */
.tj-gallery-filterbar .tj-filter-btn{
  appearance: none;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.88);

  font-size: 13px;
  line-height: 1;
  padding: 8px 10px;
  border-radius: 999px;

  cursor: pointer;
  white-space: nowrap;

  transition: transform .12s ease, background-color .12s ease, border-color .12s ease, opacity .12s ease;
}

.tj-gallery-filterbar .tj-filter-btn:hover{
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.28);
  transform: translateY(-1px);
}

.tj-gallery-filterbar .tj-filter-btn:active{
  transform: translateY(0);
  opacity: .92;
}

/* 選択中（主役は画像なので、強すぎないアクセント） */
.tj-gallery-filterbar .tj-filter-btn.is-active{
  background: rgba(255,255,255,0.16);
  border-color: rgba(255,255,255,0.40);
  color: rgba(255,255,255,0.98);
}

/* スマホはさらに省スペース */
@media (max-width: 600px){
  .tj-gallery-filterbar{
    padding: 8px 10px;
    border-radius: 10px;
    top: 122px;
    width: 100%;
  }
  .tj-gallery-filterbar .tj-filter-btn{
    font-size: 12px;
    padding: 7px 9px;
  }
}

.tj-gallery-filterbar {
  height: 48px; /* 実寸に合わせる */
}

