.filters { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.75rem 0 2rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .4rem .9rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text);
  font: 500 .9rem var(--font); cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.chip:hover { background: var(--surface-2); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.chip small { opacity: .65; font-size: .8em; font-weight: 500; }

.group { margin-bottom: 3rem; }
.group[hidden] { display: none; }
.group-head { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.group-head h2 { margin: 0; }
.group-head span { color: var(--muted); font-size: .9rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.1rem; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; } }

.card {
  display: flex; flex-direction: column;
  padding: 0; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface); overflow: hidden; text-align: left; color: inherit; font: inherit; cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s;
  content-visibility: auto; contain-intrinsic-size: 260px 300px;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: transparent; }
.card .ph { aspect-ratio: 4 / 3; background: var(--surface-2); overflow: hidden; }
.card img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity .35s ease; }
.card img.in { opacity: 1; }
.card .cap {
  padding: .7rem .85rem .85rem; font-size: .85rem; line-height: 1.45; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

/* ---------- lightbox / carousel ---------- */
.lb { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1rem; }
.lb[hidden] { display: none; }
.lb-backdrop { position: absolute; inset: 0; background: rgba(8, 9, 11, .92); }
.lb-fig { position: relative; margin: 0; width: min(100%, 1200px); max-height: 100%; display: flex; flex-direction: column; align-items: center; gap: .9rem; pointer-events: none; }
.lb-stage { position: relative; display: flex; align-items: center; justify-content: center; width: 100%; touch-action: pan-y pinch-zoom; pointer-events: auto; }
.lb-stage img {
  max-width: 100%; max-height: 76vh; max-height: 76dvh; width: auto; height: auto; object-fit: contain;
  border-radius: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, .5);
  transition: opacity .2s ease, filter .3s ease;
}
.lb-stage img.loading { filter: blur(10px) saturate(.9); }
.lb-spinner { position: absolute; width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: spin .8s linear infinite; opacity: 0; transition: opacity .2s; }
.lb.busy .lb-spinner { opacity: 1; }
@keyframes spin { to { transform: rotate(360deg); } }
.lb-cap { color: #e9e9ea; font-size: .95rem; text-align: center; max-width: 70ch; pointer-events: auto; line-height: 1.5; }
.lb-tag { display: inline-block; margin-right: .4rem; padding: .05rem .55rem; border-radius: 999px; background: rgba(255, 255, 255, .14); font-size: .78rem; font-weight: 600; vertical-align: 1px; }
.lb-count { display: block; margin-top: .35rem; color: #9b9ea6; font-size: .8rem; }
.lb-btn {
  position: absolute; z-index: 2; width: 46px; height: 46px; display: grid; place-items: center;
  border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff;
  font: 400 30px/1 var(--font); cursor: pointer; transition: background-color .15s;
  -webkit-tap-highlight-color: transparent;
}
.lb-btn:hover { background: rgba(255, 255, 255, .24); }
.lb-close { top: max(1rem, env(safe-area-inset-top)); right: 1rem; font-size: 28px; }
.lb-prev, .lb-next { top: 50%; transform: translateY(-50%); }
.lb-prev { left: 1rem; }
.lb-next { right: 1rem; }
.lb-btn[disabled] { opacity: .3; cursor: default; }
@media (max-width: 700px) {
  .lb { padding: .5rem; }
  .lb-prev, .lb-next { top: auto; bottom: 1rem; transform: none; }
  .lb-prev { left: calc(50% - 56px); }
  .lb-next { right: calc(50% - 56px); }
  .lb-stage img { max-height: 60vh; max-height: 60dvh; }
  .lb-cap { padding-bottom: 3.8rem; }
}
