html, body {
  touch-action: pan-y; /* allow vertical scroll, block zoom/pinch */
  overscroll-behavior: contain;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 3vw;
  background: #000;
  z-index: 19;
}

.gallery-logo:hover {
  cursor: pointer;
}

.search-bar {
  background-color: #1e1e1e;
  border-radius: 10px;
  display: flex;
  align-items: center;
  padding: 8px 16px;
  width: calc((calc((100%) / (2))) - (6vw));
  gap: 8px;
  position: relative;
}

.search-icon {
  width: 24px;
  height: 24px;
  opacity: 0.7;
}

.search-field {
  flex: 1;
  background: transparent;
  border: none;
  color: white;
  font-size: inherit;
  outline: none;
  z-index: 2;
}

.placeholder-anim-wrapper {
  position: absolute;
  left: 48px;
  pointer-events: none;
  z-index: 1;
}

.clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%) translateX(5px);
  background: none;
  border: none;
  color: #aaa;
  font-size: 1.;
  cursor: pointer;
  padding: 0;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
  z-index: 2;
}

.clear-btn.show {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  pointer-events: auto;
}

.placeholder-anim-wrapper {
  display: flex;
  align-items: center;
  overflow: hidden;
  font-size: inherit;
  color: #aaa;
  opacity: 0.6;
  white-space: nowrap;
}

.static-text {
  margin-right: 6px;
  text-transform: none;
}

.tag-rotator {
  position: relative;
  overflow: hidden;
}

.tag-rotator .tag {
  display: inline-block;
  transition: transform 0.4s ease-in-out;
  will-change: transform;
  text-transform: lowercase;
  color: #aaa;
}

.main-content {
  padding-top: 72px;
  padding-bottom: 5vh;
}

.photo-grid {
  display: flex;
  gap: 2vw;
  padding: 0 2vw;
}

.photo-grid .column {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2vw;
}

.photo-wrapper {
  position: relative;
  width: 100%;
}

.photo-wrapper img {
  display: block;
  width: 100%;
  border-radius: 0.4vw;
  object-fit: cover;
}

.photo-overlay {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 8px;
  pointer-events: none;
}

.photo-wrapper:hover .photo-overlay {
  opacity: 1;
  pointer-events: auto;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.6));
  border-radius: 0.4vw;
  cursor: pointer;
}

.overlay-top {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
}

.overlay-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.photo-name {
  color: white;
  font-size: inherit;
  padding: 2px 6px;
  border-radius: 4px;
}

.download-btn {
  background-color: rgba(255,255,255,0.8);
  border: none;
  padding: 4px 8px;
  border-radius: 20px;
  font-weight: bold;
  cursor: pointer;
  color: black;
}

.meta-menu {
  position: relative;
  font-size: inherit;
  color: white;
  padding: 4px;
  border-radius: 50%;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.meta-menu:hover {
  border: none;
  background-color: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

.tooltip {
  display: none;
  position: absolute;
  pointer-events: none;
  top: 25px;
  right: 10px;
  background-color: rgba(28, 28, 28, 0.9);
  color: white;
  padding: 8px;
  border-radius: 6px;
  font-size: inherit;
  min-width: 140px;
  max-height: 743px;
  z-index: 10;
  line-height: 1.5em;
}

.meta-menu.open .tooltip {
  display: block;
}

.meta-menu,
.download-btn {
  transition: transform 0.1s ease, background-color 0.2s ease;
  transform-origin: center;
}

.meta-menu:active,
.download-btn:active {
  transform: scale(0.92);
}

@media (hover: none) {
  .photo-wrapper:hover .photo-overlay {
    opacity: 0 !important;
    pointer-events: none !important;
  }
}

@media (max-width: 639px) {
  .gallery-logo-wrapper {
    display: none;
  }
  .search-bar {
    width: 75%;
  }
}



