/* ===========================
   Gallery page styles
   =========================== */

.gallery-hero {
  position: relative;
  background: #111;
}

.gallery-hero-collage {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  grid-template-rows: repeat(2, 175px);
  gap: 3px;
  opacity: 0.55;
}

.gallery-hero-collage img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-hero-collage .span-2 {
  grid-column: span 2;
}

.gallery-hero-collage .row-2 {
  grid-row: span 2;
}

.gallery-hero-collage .stripe-dark {
  background: repeating-linear-gradient(135deg, #3a3a3a 0 8px, #2e2e2e 8px 16px);
}

.gallery-hero-body {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(163, 0, 0, 0.82) 0%, rgba(17, 17, 17, 0.88) 140%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0 1.5rem;
}

.gallery-hero-body .lead {
  color: rgba(255, 255, 255, 0.85);
}

.pill-hero {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

@media (max-width: 768px) {
  .gallery-hero-collage {
    grid-template-rows: repeat(2, 110px);
  }
}

/* Filter pills */
.filter-pill {
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  color: rgba(0, 0, 0, 0.7);
  cursor: pointer;
  transition: all 160ms ease;
}

.filter-pill:hover {
  border-color: rgba(163, 0, 0, 0.35);
  color: var(--tu-cherry);
}

.filter-pill.is-active {
  background: var(--tu-cherry);
  border-color: var(--tu-cherry);
  color: #fff;
}

/* Square tile grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

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

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

.gallery-tile {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  background: #f0f0f0;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

.gallery-tile .tile-placeholder {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background: repeating-linear-gradient(135deg, #e6e6e9 0 9px, #dcdce0 9px 18px);
  display: flex;
  align-items: flex-end;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(0, 0, 0, 0.45);
  text-align: left;
}

.gallery-tile .tile-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0) 55%);
  opacity: 0;
  transition: opacity 200ms ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 14px;
  text-align: left;
}

.gallery-tile:hover .tile-overlay,
.gallery-tile:focus-visible .tile-overlay {
  opacity: 1;
}

.tile-overlay .tile-caption {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
}

.tile-overlay .tile-date {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.75);
}

.btn-load-more {
  padding: 0.65rem 1.6rem;
  border: 1px solid rgba(163, 0, 0, 0.45);
  border-radius: 999px;
  background: transparent;
  color: var(--tu-cherry);
  font-weight: 700;
  font-size: 0.95rem;
  transition: all 180ms ease;
}

.btn-load-more:hover {
  background: var(--tu-cherry);
  color: #fff;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1050;
  background: rgba(17, 17, 17, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  box-sizing: border-box;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-inner {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  max-width: 1100px;
  width: 100%;
}

@media (max-width: 768px) {
  .lightbox-inner {
    flex-direction: column;
    gap: 1rem;
  }
}

.lightbox-figure {
  flex: 1;
  width: 100%;
  height: min(70vh, 560px);
  border-radius: 3px;
  overflow: hidden;
  background: #1c1c1c;
}

.lightbox-figure img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.lightbox-figure .lb-placeholder {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  background: repeating-linear-gradient(135deg, #333 0 10px, #2b2b2b 10px 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

.lightbox-meta {
  width: 260px;
  flex-shrink: 0;
  color: #fff;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
}

@media (max-width: 768px) {
  .lightbox-meta {
    width: 100%;
  }
}

.lightbox-tag {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
}

.lightbox-caption {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.35;
}

.lightbox-date {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
}

.lightbox-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 1.1rem;
}

.lightbox-actions a,
.lightbox-close {
  color: rgba(255, 255, 255, 0.75);
  background: transparent;
  border: 0;
  padding: 0;
}

.lightbox-actions a:hover,
.lightbox-close:hover {
  color: #fff;
}

.lightbox-nav {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 26px;
}

.lightbox-nav:hover {
  color: #fff;
}
