/* ---------------- RESET & LAYOUT ---------------- */
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #fff;
  color: #000;
  display: flex;
  height: 100vh;
  overflow: hidden; /* allows internal scrolling */
}

/* ---------------- SIDEBAR ---------------- */
#sidebar {
  width: 220px;
  background: #fff;
  border-right: 2px solid #000;
  display: flex;
  flex-direction: column;
  padding: 20px;
  box-sizing: border-box;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-title {
  font-weight: bold;
  font-size: 14px;
  color: #888; 
  margin-bottom: 6px;
  text-transform: uppercase;
}

.sidebar-subtitle {
  font-size: 13px;
  color: #aaa;
  margin-bottom: 16px;
}

/* ---------------- SEARCH ---------------- */
#search-container {
  margin-bottom: 20px;
}

#search {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  border: 2px solid #000;
  outline: none;
  font-weight: bold;
  box-sizing: border-box;
}

#search:focus {
  border-color: #555;
}

/* ---------------- CATEGORIES ---------------- */
#categories button {
  background: none;
  border: none;
  font-weight: bold;
  font-size: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  text-align: left;
  padding: 4px 0;
}

#categories button:hover {
  color: #555;
}

#categories button.active {
  background: #000;
  color: #fff;
  padding-left: 4px;
}

/* ---------------- MAIN GALLERY ---------------- */
#main {
  flex: 1;
  display: flex;
  overflow: hidden;
}

/* Desktop gallery images */
@media (min-width: 769px) {
  #gallery img {
    height: 360px;
    width: auto;
    object-fit: cover;
    cursor: pointer;
    transition: transform 0.25s ease;
  }
}

/* Gallery container */
#gallery {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  padding: 20px;
  gap: 24px;
  overflow-y: auto;
  align-content: flex-start;
  box-sizing: border-box;
}

#gallery img:hover {
  transform: scale(1.05);
  transition: transform 0.25s ease;
}

/* ---------------- FULLSCREEN OVERLAY ---------------- */
.fullscreen-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  cursor: zoom-out;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.fullscreen-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.fullscreen-overlay img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
  transition: transform 0.35s ease;
  will-change: transform;
}

/* ---------------- FLOATING CATEGORY LABEL ---------------- */
#floating-category {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-weight: bold;
  font-size: 20px;
  color: #fff;
  background: rgba(0,0,0,0.65);
  padding: 6px 14px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 10000;
}

/* ---------------- MOBILE RESPONSIVE ---------------- */
@media (max-width: 768px) {
  body {
    flex-direction: column;
  }

  #sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 2px solid #000;
    padding: 12px;
    overflow-x: auto;
    overflow-y: visible;
    flex-direction: column;
  }

  #categories {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  #categories button {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 14px;
    margin-bottom: 0;
  }

  #search-container {
    margin-bottom: 10px;
  }

  #main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #gallery {
    padding: 12px;
    gap: 12px;
    overflow-y: auto;
    height: calc(100vh - 120px);
  }

  #gallery img {
  width: 100%;
  height: auto;
  max-height: 70vh; /* keeps them from getting absurdly tall */
}

}
