/* ============================================================
   WOODLEY COLLISION — GALLERY PAGE
   Reuses: breadcrumb, .ba/.ba--labeled sliders (base in home.css
   + components.css), .cta-banner (home.css), header/footer.
   Adds: the centered hero, the category filter pills (same look
   as .blog-filter), the gallery grid of before/after tiles, and
   the Load More button wrapper.
   ============================================================ */

/* ---------- HERO (centered heading + subtitle) ---------- */
.gal-hero {
  max-width: var(--container-outer);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-top: var(--sp-16);
  padding-bottom: 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-12);
  text-align: center;
}
.gal-hero__title {
  font-size: clamp(2.5rem, 1.6rem + 2.8vw, 3.875rem);   /* 40 -> 62px */
  font-weight: 600;
  line-height: 1.06;
  color: var(--gray-900);
  max-width: 960px;
}
.gal-hero__subtitle {
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.5;
  color: #555;
  max-width: 600px;
}

/* ---------- GALLERY BODY (filters + grid + Load More) ---------- */
.gallery-page {
  max-width: var(--container-outer);
  margin-inline: auto;
  padding-inline: var(--gutter);
  padding-bottom: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-36);
}
.gallery-page__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-36);
  width: 100%;
}

/* Category filter pills — same visual language as .blog-filter */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-12);
}
.gallery-filter {
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: var(--sp-12) var(--sp-16);
  border-radius: var(--radius-round);
  border: 1px solid var(--gray-200);
  background: transparent;
  color: var(--gray-900);
  font-family: inherit;
  font-size: var(--fs-body);    /* 16px */
  font-weight: 500;
  line-height: var(--lh-snug);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.gallery-filter:not(.is-active):hover { border-color: var(--color-red); color: var(--color-red); }
.gallery-filter.is-active {
  background: var(--gray-900);
  border-color: var(--gray-900);
  color: var(--white);
}

/* Grid of before/after tiles — 3-up desktop */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-24);
}
/* Override the hero .ba sizing: gallery tiles are shorter, fill their cell */
.gallery-grid .ba {
  width: 100%;
  max-width: none;
  aspect-ratio: 397 / 260;      /* Figma gallery tile */
  margin-inline: 0;
}
.gallery-grid .ba--labeled .ba__img { object-fit: cover; }

/* Empty state (no tiles match the active filter) */
.gallery-empty {
  display: none;
  width: 100%;
  padding: var(--sp-40) 0;
  text-align: center;
  font-size: var(--fs-body);
  color: #555;
}
.gallery-grid.is-empty + .gallery-empty { display: block; }

/* Load More button wrapper (centered) */
.gallery-more { display: flex; justify-content: center; }
/* Tiles past the initial batch start hidden; JS reveals them */
.gallery-grid .ba.is-hidden { display: none; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1000px) {
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .gal-hero { padding-bottom: 60px; }
  .gal-hero__title { font-size: clamp(2.125rem, 1.75rem + 1.6vw, 2.25rem); line-height: 1.1; text-align: left; }
  .gal-hero__subtitle { text-align: left; }
  .gal-hero { align-items: stretch; text-align: left; }

  .gallery-page { padding-bottom: 120px; gap: var(--sp-32); }
  .gallery-page__body { gap: var(--sp-24); }
  /* Pills scroll horizontally on mobile instead of wrapping */
  .gallery-filters {
    flex-wrap: nowrap;
    overflow-x: auto;
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
    mask-image: linear-gradient(to right, #000 88%, transparent);
  }
  .gallery-filters::-webkit-scrollbar { display: none; }
  .gallery-filter { flex-shrink: 0; }

  .gallery-grid { grid-template-columns: 1fr; gap: var(--sp-16); }
  .gallery-grid .ba { aspect-ratio: 358 / 210; }   /* Figma mobile tile */
  .gallery-more { align-self: stretch; }
  .gallery-more .btn { width: 100%; justify-content: space-between; }
}
