.gallery-page {
  background:
    radial-gradient(circle at 84% 18%, rgba(188, 123, 49, 0.08), transparent 30rem),
    var(--ink);
}

.gallery-hero {
  position: relative;
  display: flex;
  min-height: clamp(380px, 48vw, 650px);
  align-items: flex-end;
  overflow: hidden;
  background-image: var(--gallery-cover);
  background-position: center;
  background-size: cover;
}

.gallery-hero__shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 7, 7, 0.84), rgba(5, 7, 7, 0.16) 58%, rgba(5, 7, 7, 0.4)),
    linear-gradient(180deg, rgba(5, 7, 7, 0.34), transparent 38%, #080a0a 100%);
}

.gallery-hero__content {
  position: relative;
  z-index: 1;
  padding-bottom: clamp(2rem, 5vw, 5.5rem);
}

.gallery-hero__content .section-label {
  margin-bottom: 0.7rem;
}

.gallery-hero h1 {
  margin: 0;
  color: var(--paper-bright);
  font-size: clamp(3.4rem, 7vw, 7rem);
  font-weight: 300;
  letter-spacing: -0.045em;
  line-height: 0.9;
  text-shadow: 0 3px 30px rgba(0, 0, 0, 0.5);
}

.gallery-hero__content > p:not(.section-label) {
  max-width: 34rem;
  margin: 1.2rem 0 0;
  color: #c6c1b8;
  font-size: 0.9rem;
}

.gallery-hero__content > span {
  display: block;
  margin-top: 0.75rem;
  color: var(--gold-light);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gallery-categories {
  position: sticky;
  z-index: 10;
  top: 0;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 10, 10, 0.94);
  backdrop-filter: blur(16px);
}

.gallery-categories .shell {
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}

.gallery-categories .shell::-webkit-scrollbar {
  display: none;
}

.gallery-categories a {
  position: relative;
  padding: 1rem clamp(0.8rem, 1.5vw, 1.5rem);
  flex: 0 0 auto;
  color: #8d8981;
  font-size: 0.62rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.gallery-categories a:first-child {
  padding-left: 0;
}

.gallery-categories a[aria-current="page"] {
  color: var(--paper-bright);
}

.gallery-categories a[aria-current="page"]::after {
  position: absolute;
  right: 0.8rem;
  bottom: -1px;
  left: 0.8rem;
  height: 1px;
  background: var(--gold-light);
  content: "";
}

.gallery-categories a:first-child[aria-current="page"]::after {
  left: 0;
}

.gallery-shell {
  padding-block: clamp(1rem, 2vw, 2.2rem) clamp(3rem, 7vw, 7rem);
}

.gallery-grid {
  columns: 3 280px;
  column-gap: clamp(0.6rem, 1vw, 1rem);
}

.gallery-tile {
  position: relative;
  display: block;
  width: 100%;
  margin: 0 0 clamp(0.6rem, 1vw, 1rem);
  padding: 0;
  overflow: hidden;
  border: 0;
  break-inside: avoid;
  cursor: zoom-in;
  background: #111414;
}

.gallery-tile img {
  width: 100%;
  height: auto;
  filter: saturate(0.86) brightness(0.9);
  transition: filter 350ms ease, transform 650ms cubic-bezier(0.2, 0.75, 0.2, 1);
}

.gallery-tile > span {
  position: absolute;
  right: 0.7rem;
  bottom: 0.55rem;
  color: white;
  font: 500 0.55rem/1 var(--font);
  letter-spacing: 0.14em;
  opacity: 0;
  text-shadow: 0 1px 8px black;
  transform: translateY(5px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.gallery-tile:hover img,
.gallery-tile:focus-visible img {
  filter: saturate(1) brightness(1);
  transform: scale(1.018);
}

.gallery-tile:hover > span,
.gallery-tile:focus-visible > span {
  opacity: 0.85;
  transform: translateY(0);
}

.lightbox {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--paper);
  background: rgba(3, 5, 5, 0.96);
}

.lightbox::backdrop {
  background: rgba(3, 5, 5, 0.92);
}

.lightbox__frame {
  position: relative;
  display: grid;
  width: 100%;
  height: 100%;
  padding: clamp(2.5rem, 5vw, 5rem);
  grid-template-columns: 3rem minmax(0, 1fr) 3rem;
  align-items: center;
  gap: clamp(0.5rem, 2vw, 2rem);
}

.lightbox figure {
  display: flex;
  min-width: 0;
  height: 100%;
  margin: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.lightbox figure img {
  max-width: 100%;
  max-height: calc(100vh - 9rem);
  object-fit: contain;
}

.lightbox figcaption {
  min-height: 1rem;
  margin-top: 0.8rem;
  color: #8f8b83;
  font-size: 0.62rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.lightbox button {
  border: 0;
  color: #cac5bc;
  cursor: pointer;
  background: transparent;
  font: inherit;
}

.lightbox__close {
  position: absolute;
  z-index: 2;
  top: 1.5rem;
  right: 1.5rem;
  padding: 0.65rem;
  font-size: 0.62rem !important;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.lightbox__nav {
  width: 3rem;
  height: 3rem;
  color: var(--gold-light) !important;
  font-size: 1.5rem !important;
}

body.lightbox-open {
  overflow: hidden;
}

@media (max-width: 760px) {
  .gallery-hero { min-height: 520px; }
  .gallery-hero h1 { font-size: clamp(3rem, 15vw, 4.5rem); }
  .gallery-hero__content { padding-bottom: 3rem; }
  .gallery-hero__content > p:not(.section-label) { max-width: 20rem; font-size: 0.82rem; }
  .gallery-categories .shell { width: 100%; padding-left: 1.1rem; }
  .gallery-categories a { padding-block: 0.85rem; }
  .gallery-grid { columns: 2; column-gap: 0.55rem; }
  .gallery-tile { margin-bottom: 0.55rem; }
  .lightbox__frame { padding: 3.5rem 0.7rem 1rem; grid-template-columns: 2.4rem minmax(0, 1fr) 2.4rem; gap: 0; }
  .lightbox__nav { width: 2.4rem; }
  .lightbox figure img { max-height: calc(100vh - 7rem); }
}
