:root {
  --gallery-bg: #080808;
  --gallery-text: #f5f5f2;
  --gallery-muted: rgba(255, 255, 255, 0.58);
  --gallery-border: rgba(255, 255, 255, 0.16);
  --gallery-transition: 240ms ease;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.gallery-page {
  margin: 0;
  overflow-x: hidden;
  background: var(--gallery-bg);
  color: var(--gallery-text);
  font-family: Arial, Helvetica, sans-serif;
}

.gallery-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  min-height: 88px;
  padding: 0 5vw;
  border-bottom: 1px solid var(--gallery-border);
  background: rgba(8, 8, 8, 0.9);
  backdrop-filter: blur(18px);
}

.gallery-logo {
  color: var(--gallery-text);
  text-decoration: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
  letter-spacing: 0.16em;
}

.gallery-nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.gallery-nav a,
.gallery-footer a {
  color: var(--gallery-muted);
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: var(--gallery-transition);
}

.gallery-nav a:hover,
.gallery-footer a:hover {
  color: var(--gallery-text);
}

.gallery-hero {
  min-height: calc(100svh - 88px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 10vw 7vw 7rem;
  border-bottom: 1px solid var(--gallery-border);
}

.gallery-eyebrow {
  margin: 0 0 18px;
  color: var(--gallery-muted);
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.gallery-hero h1 {
  max-width: 1080px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(4rem, 9vw, 8.6rem);
  font-weight: 400;
  line-height: 0.88;
  letter-spacing: -0.05em;
}

.gallery-intro {
  max-width: 590px;
  margin: 38px 0 0;
  color: var(--gallery-muted);
  font-size: 1rem;
  line-height: 1.8;
}

.gallery-explore-link {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  width: fit-content;
  margin-top: 46px;
  color: var(--gallery-text);
  text-decoration: none;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.gallery-section {
  min-height: 100svh;
  padding: 9vw 7vw;
}

.gallery-section-heading {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 30px;
  padding-bottom: 36px;
  border-bottom: 1px solid var(--gallery-border);
}

.gallery-section-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.5rem, 7vw, 6.5rem);
  font-weight: 400;
  line-height: 0.9;
}

.gallery-search-toggle {
  width: 58px;
  height: 58px;
  cursor: pointer;
  border: 1px solid var(--gallery-border);
  border-radius: 50%;
  background: transparent;
  color: var(--gallery-text);
  font-size: 1.7rem;
  transition: var(--gallery-transition);
}

.gallery-search-toggle:hover {
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.05);
}

.gallery-search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 28px;
}

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

.gallery-search-panel input {
  width: 100%;
  border: 1px solid var(--gallery-border);
  outline: none;
  background: transparent;
  color: var(--gallery-text);
  padding: 17px 18px;
}

.gallery-search-panel button {
  width: 56px;
  cursor: pointer;
  border: 1px solid var(--gallery-border);
  background: transparent;
  color: var(--gallery-text);
  font-size: 1.35rem;
}

.main-gallery-grid {
  columns: 3 280px;
  column-gap: 16px;
  margin-top: 44px;
}

.gallery-photo-card {
  position: relative;
  width: 100%;
  margin: 0 0 16px;
  padding: 0;
  overflow: hidden;
  break-inside: avoid;
  cursor: pointer;
  border: 1px solid var(--gallery-border);
  background: #0d0d0d;
}

.gallery-photo-card img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.45s ease;
}

.gallery-photo-card:hover img {
  transform: scale(1.02);
}

.gallery-photo-label {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 28px 20px 18px;
  background: linear-gradient(
    180deg,
    transparent,
    rgba(0, 0, 0, 0.82)
  );
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.67rem;
  letter-spacing: 0.14em;
  text-align: left;
  text-transform: uppercase;
}

.gallery-empty-state {
  min-height: 280px;
  display: grid;
  place-items: center;
  border: 1px solid var(--gallery-border);
  color: var(--gallery-muted);
}

.gallery-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 5vw;
  border-top: 1px solid var(--gallery-border);
}

.gallery-footer p {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.12em;
}

/* Fullscreen viewer */

.gallery-lightbox {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 32px 90px;
  background: rgba(0, 0, 0, 0.96);
}

.gallery-lightbox.is-open {
  display: flex;
}

.gallery-lightbox img {
  display: block;
  max-width: min(1100px, 100%);
  max-height: 88vh;
  object-fit: contain;
}

.gallery-lightbox-close,
.gallery-lightbox-arrow {
  position: absolute;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
}

.gallery-lightbox-close {
  top: 24px;
  right: 28px;
  width: 48px;
  height: 48px;
  font-size: 1.8rem;
}

.gallery-lightbox-arrow {
  top: 50%;
  width: 52px;
  height: 52px;
  transform: translateY(-50%);
  font-size: 1.3rem;
}

.gallery-lightbox-prev {
  left: 28px;
}

.gallery-lightbox-next {
  right: 28px;
}

.gallery-lightbox-count {
  position: absolute;
  bottom: 22px;
  left: 50%;
  margin: 0;
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  transform: translateX(-50%);
}

@media (max-width: 760px) {
  .gallery-header {
    min-height: 76px;
    padding: 0 20px;
  }

  .gallery-logo {
    font-size: 0.98rem;
  }

  .gallery-nav {
    gap: 18px;
  }

  .gallery-nav a {
    font-size: 0.66rem;
  }

  .gallery-nav a:nth-child(2) {
    display: none;
  }

  .gallery-hero {
    min-height: auto;
    justify-content: flex-start;
    padding: 8rem 24px 5rem;
  }

  .gallery-hero h1 {
    font-size: clamp(3.25rem, 14vw, 5.4rem);
    line-height: 0.94;
  }

  .gallery-intro {
    margin-top: 28px;
    font-size: 0.95rem;
    line-height: 1.7;
  }

  .gallery-section {
    padding: 6rem 24px;
  }

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

  .gallery-search-toggle {
    width: 52px;
    height: 52px;
  }

  .main-gallery-grid {
    columns: 2 150px;
    column-gap: 8px;
    margin-top: 30px;
  }

  .gallery-photo-card {
    margin-bottom: 8px;
  }

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

  .gallery-lightbox-arrow {
    top: auto;
    bottom: 20px;
  }

  .gallery-lightbox-prev {
    left: 18px;
  }

  .gallery-lightbox-next {
    right: 18px;
  }

  .gallery-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 30px 24px;
  }
}