/* Holy Puzzle: explore page (templates/holypuzzle/explore.html) */

/* search box + category pills stay at the top while scrolling the results */
.filter-bar {
  position: sticky;
  top: 0;
  z-index: 1020;
  background: var(--bs-body-bg);
  margin: 0 calc(var(--bs-gutter-x) * -.5);
  padding: .75rem calc(var(--bs-gutter-x) * .5) .5rem;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.filter-bar.stuck {
  border-bottom-color: var(--bs-border-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
}

.search-box {
  position: relative;
}
.search-box .bi-search {
  position: absolute;
  top: 50%;
  left: 1rem;
  transform: translateY(-50%);
  color: var(--bs-secondary-color);
  pointer-events: none;
}
.search-box .form-control {
  padding-left: 2.75rem;
  border-radius: 999px;
}

/* one scrollable row of pills on phones */
.pills {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding: .75rem 0 .25rem;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.pills::-webkit-scrollbar { display: none; }
@media (min-width: 992px) {
  .pills { flex-wrap: wrap; overflow-x: visible; }      /* wide screens: show every pill */
}
.pills .btn {
  flex: 0 0 auto;
  white-space: nowrap;
  border-radius: 999px;
}
.pills .btn .count {
  margin-left: .35rem;
  font-size: .75em;
  opacity: .7;
  font-variant-numeric: tabular-nums;
}
.pills .btn.empty:not(.active) { opacity: .5; }

/* results */
#results { transition: opacity .15s ease; }
#results.loading { opacity: .45; pointer-events: none; }

.photo-card {
  overflow: hidden;
  border: 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
  transition: box-shadow .2s ease, transform .2s ease;
}
.photo-card:hover {
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  transform: translateY(-2px);
}
.photo-card .thumb {
  aspect-ratio: 4 / 3;
  background: var(--bs-secondary-bg);
  overflow: hidden;
}
.photo-card .thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .3s ease;
}
.photo-card .thumb img.loaded { opacity: 1; }
.photo-card .card-title {
  font-size: .95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo-card .tags {
  min-width: 0;
  font-size: .75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.photo-card .cat-badge {
  flex: 0 0 auto;
  border: 0;
  font-size: .7rem;
}
mark {
  padding: 0 .1em;
  border-radius: .2em;
  background: rgba(var(--bs-warning-rgb), .35);
  color: inherit;
}

/* loading placeholders shown before the first results arrive */
.skeleton {
  aspect-ratio: 4 / 3;
  border-radius: var(--bs-border-radius);
  background: linear-gradient(90deg, var(--bs-secondary-bg) 25%, var(--bs-tertiary-bg) 50%, var(--bs-secondary-bg) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
.skeleton-line {
  height: .8rem;
  margin-top: .6rem;
  border-radius: 999px;
  width: 70%;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}
