/* ——— PAGE HEADER ——— */
.page-header {
  padding: calc(var(--nav-h) + 80px) 0 72px;
  background: var(--cream);
  border-bottom: 1px solid var(--border);
}
.page-header-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.page-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 8vw, 110px);
  font-weight: 300;
  line-height: 0.9;
  letter-spacing: -2px;
}
.page-title em { font-style: italic; }
.page-header-meta {
  text-align: right;
}
.page-header-count {
  font-family: var(--font-display);
  font-size: 48px;
  font-weight: 300;
  /* Ghosted-stat device, nudged up from --border (near-invisible on cream) to
     --stone-light for a touch more presence. It stays deliberately quiet — the
     accessible datum is the "Bilder/Images" label beneath it. */
  color: var(--stone-light);
  line-height: 1;
  margin-bottom: 4px;
}

/* ——— FILTER TABS ——— */
.filter-bar {
  background: white;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: var(--nav-h);
  z-index: 50;
}
.filter-inner {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.filter-inner::-webkit-scrollbar { display: none; }
.filter-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 18px 28px;
  font-family: var(--font-body);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--stone); /* was --stone-light (2.16:1 on white — failed AA); --stone is the design system's micro-label tone */
  cursor: pointer;
  transition: color 0.25s, border-color 0.25s;
  white-space: nowrap;
  flex-shrink: 0;
}
.filter-tab:hover { color: var(--ink); }
.filter-tab.active {
  color: var(--ink);
  border-bottom-color: var(--ink);
  font-weight: 500;
}

/* ——— MASONRY GALLERY ——— */
.gallery-section {
  padding: 64px 0 120px;
  background: var(--cream);
}
.gallery-grid {
  columns: 3 280px;
  column-gap: 12px;
}
.gallery-item {
  break-inside: avoid;
  margin-bottom: 12px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  background: var(--border);
  transition: opacity 0.35s ease, transform 0.35s ease;
  /* Tiles are <button>s so they open the lightbox by keyboard (Enter/Space),
     not just click — reset the native button chrome back to a bare tile. */
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  margin-top: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  -webkit-appearance: none;
  appearance: none;
}
.gallery-item.hidden {
  display: none;
}
.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.7s cubic-bezier(0.25,0.46,0.45,0.94);
}
.gallery-item:hover img { transform: scale(1.04); }
.gallery-item-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.35s;
  display: flex;
  align-items: flex-end;
  padding: 18px;
}
.gallery-item:hover .gallery-item-overlay {
  background: rgba(10,9,8,0.18); /* warm ink */
}
.gallery-item-icon {
  width: 32px; height: 32px;
  border: 1px solid rgba(255,255,255,0.7);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 14px;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.3s, transform 0.3s;
  margin-left: auto;
}
.gallery-item:hover .gallery-item-icon {
  opacity: 1;
  transform: scale(1);
}
/* Touch devices have no :hover, so the "+" (the only signal a tile is
   interactive) would never appear. Show it persistently, a little softer,
   wherever hover is unavailable. */
@media (hover: none) {
  .gallery-item-overlay {
    background: linear-gradient(to top, rgba(10,9,8,0.28), rgba(10,9,8,0) 42%);
  }
  .gallery-item-icon { opacity: 0.9; transform: scale(1); }
}

/* ——— LIGHTBOX ——— */
.lightbox {
  position: fixed; inset: 0;
  z-index: 999;
  background: rgba(10,9,8,0.96); /* warm ink lightbox backdrop */
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s;
}
.lightbox.open {
  display: flex;
  opacity: 1;
}
.lb-img-wrap {
  max-width: 88vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-img {
  max-width: 88vw;
  max-height: 88vh;
  object-fit: contain;
  display: block;
  transition: opacity 0.22s ease;
}
.lb-img.loading { opacity: 0; }
.lb-close {
  position: absolute;
  top: 28px; right: 36px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.6);
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  transition: color 0.2s;
  padding: 8px;
}
.lb-close:hover { color: white; }
.lb-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: rgba(255,255,255,0.5);
  font-size: 32px;
  font-weight: 300;
  padding: 20px 28px;
  transition: color 0.2s, transform 0.2s;
  line-height: 1;
}
.lb-btn:hover { color: white; }
.lb-prev { left: 0; }
.lb-prev:hover { transform: translateY(-50%) translateX(-4px); }
.lb-next { right: 0; }
.lb-next:hover { transform: translateY(-50%) translateX(4px); }
.lb-counter {
  position: absolute;
  bottom: 28px; left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6); /* was 0.35 (3.13:1 on warm ink — failed AA); 0.6 clears it while staying quiet */
}

/* ——— RESPONSIVE ——— */
@media (max-width: 900px) {
  .page-header-inner { flex-direction: column; align-items: flex-start; gap: 16px; }
  .page-header-meta { text-align: left; }
  .gallery-grid { columns: 2 160px; }
  /* Let the work lead sooner — trim the header's tall top/bottom band. */
  .page-header { padding: calc(var(--nav-h) + 40px) 0 36px; }
  .gallery-section { padding: 32px 0 90px; }
}
@media (max-width: 520px) {
  .gallery-grid { columns: 1; }
  .filter-tab { padding: 16px 16px; }
  /* First viewport was mostly wordmark + empty cream before photo #1 on phones;
     pull the grid up so the first image peeks above the fold. */
  .page-header { padding: calc(var(--nav-h) + 22px) 0 22px; }
  .page-title { font-size: clamp(42px, 15vw, 72px); }
  .gallery-section { padding: 18px 0 72px; }
  /* The tab row scrolls but its scrollbar is hidden, so "Hochzeit" clipped with
     no hint. A right-edge fade signals there's more to scroll to. */
  .filter-inner {
    -webkit-mask-image: linear-gradient(to right, var(--ink) 90%, transparent);
    mask-image: linear-gradient(to right, var(--ink) 90%, transparent);
  }
}
/* Reduced-motion: kill the tile zoom and lightbox/tile fades for this page,
   matching the design system's reduced-motion path in app.css. */
@media (prefers-reduced-motion: reduce) {
  .gallery-item,
  .gallery-item img,
  .gallery-item-overlay,
  .gallery-item-icon,
  .lightbox,
  .lb-img,
  .lb-btn,
  .lb-close { transition: none !important; }
  .gallery-item:hover img { transform: none !important; }
}