.gallery-hero {
  padding-bottom: 28px;
}

.gallery-section {
  display: grid;
  gap: clamp(24px, 4vw, 42px);
}

.gallery-tabs {
  display: grid;
  grid-template-columns: repeat(var(--gallery-category-count, 4), minmax(0, 1fr));
  gap: 1px;
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.28);
}

.gallery-tab {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 18px;
  border: 0;
  background: rgba(22,13,24,.22);
  color: var(--white);
  text-align: left;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}

.gallery-tab span {
  color: var(--white);
  font-size: clamp(19px, 2vw, 28px);
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.gallery-tab small {
  color: rgba(255,255,255,.78);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.gallery-tab:hover,
.gallery-tab:focus,
.gallery-tab[aria-pressed="true"] {
  background: var(--white);
  color: var(--ink);
  outline: 0;
}

.gallery-tab:hover,
.gallery-tab:focus {
  transform: translateY(-2px);
}

.gallery-tab:hover span,
.gallery-tab:focus span,
.gallery-tab[aria-pressed="true"] span,
.gallery-tab:hover small,
.gallery-tab:focus small,
.gallery-tab[aria-pressed="true"] small {
  color: var(--ink);
}

.gallery-status {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 32px;
  align-items: end;
  padding: 0 0 22px;
  border-bottom: 1px solid rgba(255,255,255,.28);
}

.gallery-status h2 {
  margin: 0 0 8px;
  padding: 0;
  color: var(--white);
  font-size: clamp(26px, 3vw, 34px);
  font-family: "Archivo Black", "Archivo", sans-serif;
  font-weight: 900;
  text-transform: uppercase;
  line-height: 1.2;
  text-align: left;
}

.gallery-status h2::after { content: none; }

.gallery-status p {
  max-width: 700px;
  margin: 0;
  color: rgba(255,255,255,.82);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
}

.gallery-status [data-gallery-count] {
  color: rgba(255,255,255,.82);
  font-size: 13px;
  font-weight: 400;
  text-align: right;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.photo-tile {
  position: relative;
  display: block;
  aspect-ratio: 1;
  padding: 0;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(247,245,239,.06);
  overflow: hidden;
  cursor: zoom-in;
}

.photo-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(180deg, transparent, rgba(230,44,32,.25));
  transition: opacity .24s ease;
  pointer-events: none;
}

.photo-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: none;
  transform: scale(1.01);
  transition: transform .34s cubic-bezier(.2,.8,.2,1), filter .34s ease;
}

.photo-tile:hover::after,
.photo-tile:focus::after {
  opacity: 1;
}

.photo-tile:hover img,
.photo-tile:focus img {
  transform: scale(1.07);
  filter: none;
}

.photo-tile:focus {
  outline: 2px solid var(--white);
  outline-offset: 3px;
}

.gallery-sentinel {
  min-height: 1px;
}

.gallery-more {
  justify-self: center;
}

.gallery-more[hidden] {
  display: none;
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: clamp(18px, 4vw, 54px);
  background: rgba(3,3,4,0);
  backdrop-filter: blur(0);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, background .28s ease, backdrop-filter .28s ease;
}

.gallery-lightbox.is-visible {
  background: rgba(22,13,24,.92);
  backdrop-filter: none;
  opacity: 1;
  pointer-events: auto;
}

.gallery-lightbox[hidden] {
  display: none;
}

.gallery-lightbox figure {
  display: grid;
  gap: 12px;
  width: min(100%, 1180px);
  max-height: 88svh;
  margin: 0;
  opacity: 0;
  transform: translateY(16px) scale(.985);
  transition: opacity .34s ease, transform .34s cubic-bezier(.2,.8,.2,1);
}

.gallery-lightbox.is-visible figure {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.gallery-lightbox img {
  width: 100%;
  max-height: 82svh;
  object-fit: contain;
}

.gallery-lightbox figcaption {
  color: rgba(255,255,255,.78);
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.gallery-lightbox-close {
  position: fixed;
  top: 18px;
  right: 18px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255,255,255,.62);
  background: rgba(3,3,4,.82);
  color: var(--white);
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity .28s ease, transform .28s ease, background .18s ease, color .18s ease;
}

.gallery-lightbox.is-visible .gallery-lightbox-close {
  opacity: 1;
  transform: translateY(0);
}

.gallery-lightbox-close:hover,
.gallery-lightbox-close:focus {
  background: var(--white);
  color: var(--ink);
}

@media (max-width: 900px) {
  .gallery-tab {
    padding: 14px 12px;
  }

  .gallery-tab span {
    font-size: clamp(16px, 2.6vw, 22px);
  }

  .gallery-status {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .gallery-status [data-gallery-count] {
    text-align: left;
  }

  .photo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .gallery-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }

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

  .gallery-tab {
    min-width: 0;
    min-height: 80px;
    padding: 12px 6px;
    gap: 6px;
    align-content: space-between;
    text-align: center;
  }

  .gallery-tab span {
    font-size: clamp(12px, 3.2vw, 16px);
    line-height: 1.15;
  }

  .gallery-tab small {
    font-size: 10px;
    line-height: 1.2;
  }

  .gallery-lightbox {
    padding: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-tab,
  .photo-tile::after,
  .photo-tile img,
  .gallery-lightbox,
  .gallery-lightbox figure,
  .gallery-lightbox-close {
    transition: none;
  }
}


.photo-tile { animation:gallery-reveal .4s ease both;animation-delay:var(--tile-delay,0ms); }
.gallery-lightbox figcaption { color:#fff; }
.gallery-lightbox img { display:block;min-height:0; }
@keyframes gallery-reveal { from { opacity:0;transform:translateY(14px); } to { opacity:1;transform:translateY(0); } }
@media(prefers-reduced-motion:reduce) { .photo-tile { animation:none; } }
