/* Package 07: category tiles above gallery filter */
.gallery-browse-hero {
  background: linear-gradient(135deg, #111827, #1f2937 58%, #2563eb);
  color: #fff;
  border-radius: 30px;
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: 0 20px 50px rgba(15, 23, 42, .16);
}
.gallery-browse-hero .hero-kicker {
  color: #dbeafe;
  background: rgba(255,255,255,.14);
}
.category-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 1rem;
}
.category-tile {
  position: relative;
  display: block;
  overflow: hidden;
  min-height: 170px;
  border-radius: 22px;
  background: #dbeafe;
  text-decoration: none;
  box-shadow: 0 12px 30px rgba(15, 23, 42, .10);
  border: 1px solid rgba(148,163,184,.28);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.category-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 42px rgba(15, 23, 42, .14);
}
.category-tile.is-active {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.18), 0 18px 42px rgba(15, 23, 42, .14);
}
.category-tile img {
  width: 100%;
  height: 100%;
  min-height: 170px;
  object-fit: cover;
  display: block;
}
.category-tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15,23,42,.08), rgba(15,23,42,.75));
}
.category-tile-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  color: #fff;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .2rem;
}
.category-tile-content strong {
  font-size: 1rem;
  line-height: 1.2;
}
.category-tile-content small {
  color: rgba(255,255,255,.88);
  font-size: .85rem;
}
.gallery-card-link {
  display: block;
  position: relative;
}
.gallery-card-badge {
  position: absolute;
  left: .75rem;
  top: .75rem;
  right: auto !important;
  bottom: auto !important;
  z-index: 2;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: auto !important;
  max-width: calc(100% - 1.5rem);
  min-width: 0 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: .35rem .65rem;
  border-radius: 999px;
  background: rgba(17,24,39,.82);
  color: #fff;
  font-size: .8rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .01em;
  flex: 0 0 auto !important;
  align-self: flex-start !important;
}
.gallery-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .85rem;
}
body.theme-dark .category-tile {
  border-color: #334155;
}
body.theme-dark .gallery-browse-hero {
  background: linear-gradient(135deg, #0f172a, #111827 58%, #1d4ed8);
}
@media (max-width: 575px) {
  .category-tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .category-tile,
  .category-tile img {
    min-height: 140px;
  }
}
