/* ═══════════════════════════════════════════════
   BL Gallery — home + service pages
═══════════════════════════════════════════════ */

.bld-gallery {
  margin-bottom: 40px;
}

.bld-gallery--service,
.bld-gallery--type {
  margin-top: 8px;
}

.bld-gallery--home {
  margin: 0;
}

.bld-gallery-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 8px;
  margin: 0 0 20px;
  padding: 0 4px 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.bld-gallery-tabs::-webkit-scrollbar {
  display: none;
}

.bld-gallery-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  padding: 10px 18px;
  border: 1px solid rgba(245, 163, 19, 0.35);
  border-radius: 999px;
  background: #fffaf2;
  color: #111;
  font-family: var(--font-body, sans-serif);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.bld-gallery-tab__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.bld-gallery-tab:hover {
  border-color: rgba(245, 163, 19, 0.55);
  transform: translateY(-1px);
}

.bld-gallery-tab.is-active {
  background: #111;
  border-color: #111;
  color: #fff;
  font-weight: 700;
}

.bld-gallery-panels {
  position: relative;
}

.bld-gallery-panel[hidden] {
  display: none !important;
}

.bld-gallery-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  grid-auto-rows: 180px;
  gap: 14px;
}

.bld-gallery-card {
  margin: 0;
  min-height: 0;
}

.bld-gallery-card--featured {
  grid-column: span 2;
  grid-row: span 2;
}

.bld-gallery-card__link {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  min-height: 180px;
  border-radius: 20px;
  overflow: hidden;
  border: 1.5px solid rgba(249, 169, 29, 0.22);
  box-shadow: var(--shadow-sm, 0 2px 12px rgba(0, 0, 0, 0.07));
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.bld-gallery-card--featured .bld-gallery-card__link {
  min-height: 100%;
}

.bld-gallery-card__link::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(17, 17, 17, 0.08) 0%, rgba(17, 17, 17, 0.15) 45%, rgba(17, 17, 17, 0.72) 100%);
  z-index: 1;
  transition: opacity 0.25s ease;
}

.bld-gallery-card__link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md, 0 8px 28px rgba(0, 0, 0, 0.12));
}

.bld-gallery-card__link:hover::before {
  opacity: 0.92;
}

.bld-gallery-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.bld-gallery-card__caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  margin: 0;
}

.bld-gallery-card__label {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.72);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  backdrop-filter: blur(4px);
}

.bld-gallery-card__arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.25s ease, transform 0.25s ease, background 0.25s ease;
  flex-shrink: 0;
}

.bld-gallery-card__arrow::before {
  content: '';
  display: block;
  width: 8px;
  height: 8px;
  margin: 13px 0 0 12px;
  border-top: 2px solid #fff;
  border-right: 2px solid #fff;
  transform: rotate(45deg);
}

.bld-gallery-card__link:hover .bld-gallery-card__arrow {
  opacity: 1;
  transform: translateX(0);
  background: var(--gold, #f5a313);
}

.bld-gallery-card__link:hover .bld-gallery-card__arrow::before {
  border-color: #111;
}

.bld-gallery-grid--count-1 {
  grid-template-columns: 1fr;
  grid-auto-rows: auto;
}

.bld-gallery-grid--count-1 .bld-gallery-card__link {
  min-height: 280px;
}

.bld-gallery-grid--count-2 {
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 200px;
}

.bld-gallery-grid--count-3 {
  grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 180px;
}

.bld-gallery-grid--count-1 .bld-gallery-card--featured,
.bld-gallery-grid--count-2 .bld-gallery-card--featured,
.bld-gallery-grid--count-3 .bld-gallery-card--featured {
  grid-column: auto;
  grid-row: auto;
}

@media (max-width: 900px) {
  .bld-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 170px;
  }

  .bld-gallery-card--featured {
    grid-column: span 2;
    grid-row: span 2;
  }

  .bld-gallery-tabs {
    justify-content: flex-start;
  }

  .bld-gallery-grid--count-3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .bld-gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 12px;
  }

  .bld-gallery-card--featured {
    grid-column: auto;
    grid-row: auto;
  }

  .bld-gallery-card__link {
    min-height: 220px;
  }

  .bld-gallery-card__arrow {
    opacity: 1;
    transform: none;
  }

  .bld-gallery-grid--count-2,
  .bld-gallery-grid--count-3 {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
  }
}
