.bb-gallery-shell {
  background:
    radial-gradient(circle at top left, hsl(0 78% 52% / 0.10), transparent 32rem),
    radial-gradient(circle at 85% 12%, hsl(0 78% 52% / 0.06), transparent 24rem),
    linear-gradient(180deg, #fff 0%, hsl(30 30% 98%) 42%, #fff 100%);
  padding: 72px max(18px, calc((100vw - 1180px) / 2)) 92px;
}

.bb-gallery-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 28px;
  margin: 0 auto 30px;
  max-width: 1180px;
}

.bb-gallery-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  border: 1px solid hsl(0 78% 52% / 0.16);
  border-radius: 999px;
  background: #fff;
  padding: 8px 14px;
  color: hsl(0 78% 42%);
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 12px 35px -28px hsl(0 78% 42%);
}

.bb-gallery-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: hsl(0 78% 52%);
  box-shadow: 0 0 0 6px hsl(0 78% 52% / 0.12);
}

.bb-gallery-title {
  max-width: 840px;
  color: hsl(220 20% 10%);
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  font-size: clamp(34px, 5vw, 62px);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: 0;
}

.bb-gallery-copy {
  max-width: 680px;
  margin-top: 16px;
  color: hsl(220 10% 42%);
  font-size: 17px;
  line-height: 1.75;
}

.bb-gallery-count {
  border-radius: 20px;
  background: hsl(0 78% 52%);
  padding: 18px 22px;
  color: #fff;
  text-align: center;
  box-shadow: 0 18px 42px -24px hsl(0 78% 42%);
}

.bb-gallery-count strong {
  display: block;
  font-size: 38px;
  line-height: 1;
}

.bb-gallery-count span {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bb-gallery-toolbar {
  position: sticky;
  top: 0;
  z-index: 15;
  max-width: 1180px;
  margin: 0 auto 22px;
  border: 1px solid hsl(220 13% 91% / 0.9);
  border-radius: 18px;
  background: rgb(255 255 255 / 0.88);
  padding: 12px;
  box-shadow: 0 18px 46px -38px hsl(220 20% 10%);
  backdrop-filter: blur(16px);
}

.bb-gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.bb-gallery-filter {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid hsl(220 13% 91%);
  border-radius: 999px;
  background: #fff;
  padding: 10px 15px;
  color: hsl(220 20% 10%);
  font-weight: 800;
  font-size: 14px;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.bb-gallery-filter span {
  min-width: 22px;
  border-radius: 999px;
  background: hsl(0 60% 96%);
  padding: 2px 7px;
  color: hsl(0 78% 42%);
  font-size: 12px;
}

.bb-gallery-filter:hover,
.bb-gallery-filter.is-active {
  transform: translateY(-1px);
  border-color: hsl(0 78% 52%);
  background: hsl(0 78% 52%);
  color: #fff;
}

.bb-gallery-filter:hover span,
.bb-gallery-filter.is-active span {
  background: rgb(255 255 255 / 0.2);
  color: #fff;
}

.bb-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  max-width: 1180px;
  margin: 0 auto;
  align-items: start;
}

.bb-gallery-column {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 20px;
}

.bb-gallery-card {
  position: relative;
  display: block;
  width: 100%;
  margin: 0;
  overflow: hidden;
  border: 1px solid hsl(220 13% 91%);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 20px 52px -40px hsl(220 20% 10%);
  cursor: zoom-in;
  isolation: isolate;
  transform: translateZ(0);
}

.bb-gallery-card img {
  width: 100%;
  height: auto;
  aspect-ratio: var(--image-ratio, auto);
  object-fit: contain;
  background: hsl(30 30% 98%);
  transition: transform 500ms ease, filter 500ms ease;
}

.bb-gallery-card:hover img {
  transform: scale(1.025);
  filter: saturate(1.06);
}

.bb-gallery-card figcaption {
  position: absolute;
  inset: auto 14px 14px;
  border: 1px solid rgb(255 255 255 / 0.24);
  border-radius: 14px;
  background: rgb(0 0 0 / 0.58);
  padding: 11px 13px;
  color: #fff;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 220ms ease, transform 220ms ease;
  backdrop-filter: blur(12px);
}

.bb-gallery-card:hover figcaption,
.bb-gallery-card:focus-visible figcaption {
  opacity: 1;
  transform: translateY(0);
}

.bb-gallery-card figcaption span {
  display: inline-block;
  margin-bottom: 5px;
  color: rgb(255 255 255 / 0.74);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bb-gallery-card h3 {
  margin: 0;
  font-size: 15px;
  line-height: 1.24;
  letter-spacing: 0;
}

.bb-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgb(0 0 0 / 0.88);
  padding: 24px;
}

.bb-lightbox.is-open {
  display: flex;
}

.bb-lightbox-panel {
  position: relative;
  width: min(1180px, 100%);
}

.bb-lightbox img {
  max-height: 82vh;
  width: 100%;
  object-fit: contain;
  border-radius: 18px;
  background: #111;
}

.bb-lightbox-caption {
  margin-top: 12px;
  color: #fff;
  font-weight: 800;
  text-align: center;
}

.bb-lightbox-close,
.bb-lightbox-nav {
  position: absolute;
  border: 1px solid rgb(255 255 255 / 0.2);
  background: rgb(255 255 255 / 0.14);
  color: #fff;
  backdrop-filter: blur(10px);
}

.bb-lightbox-close {
  top: -16px;
  right: -16px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  font-size: 24px;
}

.bb-lightbox-nav {
  top: 50%;
  width: 44px;
  height: 54px;
  border-radius: 14px;
  transform: translateY(-50%);
  font-size: 28px;
}

.bb-lightbox-prev {
  left: -18px;
}

.bb-lightbox-next {
  right: -18px;
}

@media (max-width: 980px) {
  .bb-gallery-shell {
    padding-top: 54px;
  }

  .bb-gallery-hero {
    grid-template-columns: 1fr;
  }

  .bb-gallery-count {
    width: max-content;
  }

  .bb-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .bb-gallery-shell {
    padding: 40px 12px 72px;
  }

  .bb-gallery-title {
    font-size: 34px;
  }

  .bb-gallery-copy {
    font-size: 15px;
  }

  .bb-gallery-toolbar {
    position: static;
    border-radius: 16px;
    padding: 10px;
  }

  .bb-gallery-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .bb-gallery-filter {
    flex: 0 0 auto;
  }

  .bb-gallery-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .bb-gallery-column {
    gap: 16px;
  }

  .bb-gallery-card {
    border-radius: 16px;
  }

  .bb-gallery-card figcaption {
    opacity: 1;
    transform: none;
  }

  .bb-lightbox {
    padding: 12px;
  }

  .bb-lightbox-close {
    top: 8px;
    right: 8px;
  }

  .bb-lightbox-prev {
    left: 8px;
  }

  .bb-lightbox-next {
    right: 8px;
  }
}
