/* ===== DORSO Fabric Gallery (scoped) ===== */
#dl-fabric-gallery { --dlfg-gap:12px; --dlfg-overlay:rgba(0,0,0,.9); --dlfg-drawer-w:340px; color:inherit; }
#dl-fabric-gallery * { box-sizing: border-box; }
#dl-fabric-gallery .dlfg-container { max-width:1160px; margin:0 auto; padding:20px; }
#dl-fabric-gallery .dlfg-heading { margin:0 0 14px; font-size:clamp(18px,2vw,24px); }

/* Category Nav (5 types) */
#dl-fabric-gallery .dlfg-catnav { display:flex; flex-wrap:wrap; gap:10px; margin:6px 0 18px; }
#dl-fabric-gallery .dlfg-catbtn {
  display:inline-flex; align-items:center; justify-content:center;
  padding:8px 14px; font-size:14px; line-height:1; text-decoration:none;
  border:1px solid #d8d8d8; border-radius:6px; background:#f7f7f7; color:#111;
}
#dl-fabric-gallery .dlfg-catbtn:hover,
#dl-fabric-gallery .dlfg-catbtn:focus-visible { outline:2px solid #111; outline-offset:2px; }
#dl-fabric-gallery .dlfg-catbtn[aria-current="page"] { background:#111; color:#fff; border-color:#111; }

/* Grid / Thumbs */
#dl-fabric-gallery .dlfg-grid {
  display:grid; grid-template-columns:repeat(auto-fill, minmax(260px,1fr));
  gap:var(--dlfg-gap);
}
#dl-fabric-gallery .dlfg-thumb { margin:0; }
#dl-fabric-gallery .dlfg-thumb a {
  display:block; position:relative; overflow:hidden;
  /* 角丸→角あり（0） */
  border-radius:0; background:#f2f2f2; box-shadow:0 0 0 1px #eee inset;
}
#dl-fabric-gallery .dlfg-thumb img {
  width:100%; height:220px; object-fit:cover; display:block; transition:transform .3s ease;
}
#dl-fabric-gallery .dlfg-thumb a:hover img,
#dl-fabric-gallery .dlfg-thumb a:focus-visible img { transform:scale(1.03); }

/* captions under thumbs */
#dl-fabric-gallery .dlfg-thumb-meta { padding:10px 2px 0; }
#dl-fabric-gallery .dlfg-thumb-title { margin:0 0 6px; font-size:16px; line-height:1.45; font-weight:600; }
#dl-fabric-gallery .dlfg-thumb-desc { margin:0; font-size:14px; line-height:1.7; color:#444; }
#dl-fabric-gallery .dlfg-thumb-desc {
  display:-webkit-box; -webkit-line-clamp:3; -webkit-box-orient:vertical; overflow:hidden;
}

/* Lightbox */
#dl-fabric-gallery .dlfg-lightbox {
  position:fixed; inset:0; background:var(--dlfg-overlay);
  display:grid; grid-template-rows:1fr auto; opacity:0; visibility:hidden; transition:opacity .2s ease;
  z-index:9999;
}
#dl-fabric-gallery .dlfg-lightbox.is-open { opacity:1; visibility:visible; }
#dl-fabric-gallery .dlfg-lightbox__stage { position:relative; display:flex; align-items:center; justify-content:center; min-height:0; }
#dl-fabric-gallery .dlfg-lightbox__img-wrap {
  position:relative; max-width:min(92vw,1400px); max-height:82vh;
  display:flex; align-items:center; justify-content:center; transition:padding-right .2s ease;
}
#dl-fabric-gallery .dlfg-lightbox__img { max-width:100%; max-height:82vh; object-fit:contain; user-select:none; }

/* Controls */
#dl-fabric-gallery .dlfg-lb-btn {
  position:absolute; top:50%; transform:translateY(-50%);
  background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.25);
  color:#fff; width:44px; height:44px; border-radius:999px; display:grid; place-items:center; cursor:pointer; backdrop-filter:blur(2px);
}
#dl-fabric-gallery .dlfg-lb-prev { left:16px; }
#dl-fabric-gallery .dlfg-lb-next { right:16px; }
#dl-fabric-gallery .dlfg-lb-close,
#dl-fabric-gallery .dlfg-lb-grid {
  position:absolute; top:16px; right:16px; width:42px; height:42px; border-radius:999px;
  display:grid; place-items:center; background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.25); color:#fff; cursor:pointer;
}
#dl-fabric-gallery .dlfg-lb-grid { right:66px; }
#dl-fabric-gallery .dlfg-lb-grid svg rect { fill:#fff; opacity:.9; }

/* footer */
#dl-fabric-gallery .dlfg-lightbox__footer {
  color:#fff; display:flex; align-items:flex-start; justify-content:center; gap:16px; padding:12px 14px 16px; font-size:14px; flex-wrap:wrap;
}
#dl-fabric-gallery .dlfg-lightbox__counter { opacity:.9; min-width:64px; text-align:center; }
#dl-fabric-gallery .dlfg-lightbox__caption { max-width:min(92vw,1200px); }
#dl-fabric-gallery .dlfg-lb-title { font-weight:700; margin-bottom:6px; font-size:16px; }
#dl-fabric-gallery .dlfg-lb-desc  { opacity:.95; line-height:1.7; }

/* Drawer (2 columns, right) */
#dl-fabric-gallery .dlfg-lb-drawer {
  position:absolute; top:0; right:0; bottom:0; width:var(--dlfg-drawer-w); max-width:92vw;
  background:rgba(8,8,8,.96); border-left:1px solid rgba(255,255,255,.15);
  transform:translateX(100%); transition:transform .22s ease; display:flex; flex-direction:column;
}
#dl-fabric-gallery .dlfg-lb-drawer[aria-hidden="false"] { transform:translateX(0); }
#dl-fabric-gallery .dlfg-lb-drawer__head {
  display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; color:#fff;
  border-bottom:1px solid rgba(255,255,255,.12);
}
#dl-fabric-gallery .dlfg-lb-drawer__close {
  background:rgba(255,255,255,.12); border:1px solid rgba(255,255,255,.25); color:#fff; width:34px; height:34px; border-radius:999px; cursor:pointer;
}
#dl-fabric-gallery .dlfg-lb-drawer__grid { padding:10px; overflow:auto; display:grid; gap:8px; grid-template-columns:1fr 1fr; }

/* 角あり（一覧サムネ & ON枠も角丸なし） */
#dl-fabric-gallery .dlfg-lb-drawer__item {
  position:relative; background:#1a1a1a; border:1px solid rgba(255,255,255,.18); border-radius:0; overflow:hidden; cursor:pointer;
}
#dl-fabric-gallery .dlfg-lb-drawer__item img { width:100%; height:100px; object-fit:cover; display:block; border-radius:0; }
#dl-fabric-gallery .dlfg-lb-drawer__item .title {
  position:absolute; left:0; right:0; bottom:0; padding:4px 6px; font-size:12px; line-height:1.35; color:#fff;
  background:linear-gradient(transparent, rgba(0,0,0,.7)); max-height:3.1em; overflow:hidden;
}
/* ON枠：角ありでクッキリ */
#dl-fabric-gallery .dlfg-lb-drawer__item.is-active {
  outline:2px solid #fff; outline-offset:-2px; border-color:#fff; box-shadow:inset 0 0 0 2px #fff; border-radius:0;
}

/* Drawer opened: keep main image visible on wide screens */
@media (min-width:920px){
  #dl-fabric-gallery .dlfg-lightbox.drawer-open .dlfg-lightbox__img-wrap { padding-right:calc(var(--dlfg-drawer-w) + 12px); }
}

/* SR only */
#dl-fabric-gallery .dlfg-sr-only {
  position:absolute !important; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0;
}
/* ========= 追加: サムネ用 SOLD OUT バッジ（角あり） ========= */
#dl-fabric-gallery a[data-sold="1"]::after,
#dl-fabric-gallery a[data-sold="true"]::after {
  content: "SOLD OUT";
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #fff;
  background: #000;
  border: 1px solid #fff;
  border-radius: 0;            /* 角あり */
  z-index: 2;
}

/* 角ありサムネ（既に角あり実装済みでも安全） */
#gallery .thumb a,
#gallery .thumb img { border-radius: 0 !important; }

/* ========= 追加: ライトボックス内 SOLD OUT バッジ（角あり） ========= */
.lightbox .lightbox__img-wrap.is-sold::before {
  content: "SOLD OUT";
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: #000;
  border: 1px solid #fff;
  border-radius: 0;            /* 角あり */
  z-index: 3;
}

/* ========= 追加: 記事リンク表示（説明文の前） ========= */
.lightbox .lb-article {
  min-width: 220px;
  max-width: min(92vw, 1200px);
}
.lightbox .lb-article a.lb-article__link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.6);
  background: rgba(255,255,255,.08);
  border-radius: 0;            /* 角あり */
}
.lightbox .lb-article a.lb-article__link:hover,
.lightbox .lb-article a.lb-article__link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ========= 角あり：ドロワ一覧の選択枠を“角あり”で強調 ========= */
.lightbox .lb-drawer__item { border-radius: 0; }
.lightbox .lb-drawer__item img { border-radius: 0; }
.lightbox .lb-drawer__item.is-active {
  outline: 2px solid #fff;
  outline-offset: -2px;
  border-color: #fff;
  box-shadow: inset 0 0 0 2px #fff;
  border-radius: 0;
}

.dl-lb-sold { position: relative; } /* 疑似要素の基準 */
.dl-lb-sold::before {
  content: "SOLD OUT";
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: #000;
  border: 1px solid #fff;
  border-radius: 0; /* 角あり */
  z-index: 3;
}

/* 以前のオーバーレイ表示（.dl-lb-sold::before）を使っている場合は無効化 */
.dl-lb-sold::before { content: none !important; }

/* タイトルの左に出す小さなバッジ（角あり） */
.dl-lb-sold-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  color: #fff;
  background: #000;
  border: 1px solid #fff;
  border-radius: 0; /* 角あり */
  vertical-align: baseline;
  line-height: 1;
}

/* スクリーンリーダー向け（必要なら） */
.dl-sr-only {
  position:absolute !important; width:1px; height:1px; padding:0; margin:-1px;
  overflow:hidden; clip:rect(0,0,0,0); border:0;
}

/* 拡大時：タイトルの直前に挿入される記事リンク（角ありボタン風） */
.dl-article-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 6px 0;      /* タイトルとの縦間隔 */
  padding: 6px 10px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,.6);
  background: rgba(255,255,255,.08);
  border-radius: 0;       /* 角あり */
  line-height: 1.2;
}
.dl-article-link:hover,
.dl-article-link:focus-visible {
  color: #fff;
  outline: 2px solid #fff;
  outline-offset: 2px;
}
