body{
    font-family: Arial, sans-serif;
    padding: 40px;
    background-color: #fffbd3;
}

h1 {
  color: #333;
  text-align: center;
  font-size: 2.5em;
  font-weight: bold;
  letter-spacing: 2px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  text-transform: uppercase;
  border-bottom: 3px solid #333;
  padding-bottom: 15px;
}

#sortSelect {
  margin-bottom: 12px;
  padding: 6px 10px;
  font-size: 14px;
  border: 1px solid #333;
  border-radius: 4px;
  background-color: white;
  cursor: pointer;
}

label[for="imageSort"] {
  margin-right: 10px;
  font-weight: bold;
  color: #333;
}

#imageSort {
  appearance: none;           /* remove default arrow */
  -webkit-appearance: none;
  -moz-appearance: none;

  padding: 10px 40px 10px 14px;
  font-size: 14px;
  font-weight: 500;

  border-radius: 8px;
  border: 1px solid #333;
  background-color: #333;
  color: #fff;

  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* custom arrow */
#imageSort {
  background-image:
    linear-gradient(45deg, transparent 50%, #333 50%),
    linear-gradient(135deg, #333 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 55%,
    calc(100% - 12px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

#imageSort:hover {
  border-color: #555;
}

#imageSort:focus {
  outline: none;
  border-color: #333;
  box-shadow: 0 0 0 3px rgba(0,0,0,0.12);
}

.gallery{
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.gallery img{
  width: 100%;
  height: 150px;
  object-fit: contain;
  border-style: solid;
  border-color: #222;
  background-color: #222;
  border-radius: 8px;
  cursor: pointer;
}

.zoom {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.zoom-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.85);
  cursor: zoom-out;
  z-index: 1;
  pointer-events: auto;
}

#zoom img {
  max-width: 70vw;
  max-height: 70vh;
  object-fit: contain;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  transform-origin: 0 0;
  transition: transform 0.1s ease-out;
  border-radius: 8px;
}

/* smoother slide/fade transitions for the main zoom image */
#zoomedImage {
  transition: transform 0.35s ease, opacity 0.25s ease;
  opacity: 1;
}

.zoom-carousel {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  pointer-events: none;
  z-index: 2;
}

.zoom-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.35;
  pointer-events: none;
  transform: translateX(0);
  transition: none;
}

.zoom-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#currentSlide {
  left: 0;
  right: 0;
  margin: auto;
  opacity: 1;
  pointer-events: auto;
  justify-content: center;
}

#prevSlide {
  justify-content: flex-end;
}

#nextSlide {
  justify-content: flex-start;
}

.zoom-button {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 30px;
  line-height: 56px;
  text-align: center;
  cursor: pointer;
  z-index: 3;
  user-select: none;
  -webkit-user-select: none;
  transition: background 0.15s ease, transform 0.08s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  pointer-events: auto;
}

#zoomPrev {
  left: 18px;
}

#zoomNext {
  right: 18px;
}

.zoom-button:hover {
  background: rgba(255,255,255,0.08);
  transform: translateY(-50%) scale(1.03);
}

.zoom-button:active {
  transform: translateY(-50%) scale(0.98);
}

.smooth-transform {
  transition: transform 0.2s ease-out;
}

.instant-transform {
  transition: none;
}


.zoom #zoomCaption {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    z-index: 3;
  }

#zoomCaption {
  background: rgba(0, 0, 0, 0.7);
  padding: 8px 16px;
  border-radius: 4px;
  backdrop-filter: blur(4px);
}

#randomImageBtn {
  float: right;
  padding: 10px 20px;
  background-color: #333;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

#randomImageBtn:hover {
  background-color: #555;
  bottom: 20px;
  left: 50%;
  color: white;
  font-size: 14px;
  }
