/* Reset default margins and paddings, and set box-sizing */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Body styles */
body {
  display: flex;
  height: 100vh;
  overflow: hidden;
  font-family: Arial, sans-serif;
}

/* Sidebar Styling */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 200px;
  height: 50vh;
  padding-left: 20px;
  padding-top: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

.sidebar img {
  width: 150px;
  margin-bottom: 2px;
  opacity: 0.8;
}

.sidebar a {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: rgb(0, 0, 0);
  margin: 15px 0;
  font-size: 14px;
  cursor: pointer;
  position: relative; /* Ensure it respects z-index */
  z-index: 20; /* Higher than other overlapping elements */
}

.sidebar .sidebar-links a:hover {
  color: rgb(255, 255, 255);
  font-weight: bold;
}

.sidebar .contact-details a:hover {
  color: rgb(255, 255, 255);
  font-weight: bold;
}

.contact-content {
  margin-top: auto;
  padding-bottom: 24px;
}

.contact-content p,
.contact-content a {
  margin: 5px 0;
  font-size: 14px;
  color: black;
  text-decoration: none;
}

/* Gallery Container Styling */
.gallery {
  flex: 1;
  height: 100vh;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 0px;
  padding-left: 220px; /* Sidebar width + spacing */
  background-color: white;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
}

/* Scrollbar Styling */
.gallery::-webkit-scrollbar {
  height: 12px;
}

.gallery::-webkit-scrollbar-track {
  background: #f1f1f1;
}

.gallery::-webkit-scrollbar-thumb {
  background-color: #888;
  border-radius: 6px;
  border: 3px solid #f1f1f1;
}

.gallery::-webkit-scrollbar-thumb:hover {
  background-color: #555;
}

/* Image Container Styling */
.image-container {
  display: flex;
  flex-direction: row;
}

.gallery-item {
  position: relative;
  scroll-snap-align: start;
  margin-right: 0px;
}

.gallery-item img {
  height: 100vh;
  width: auto;
  opacity: 0;
  transition: opacity 0.2s ease-in;
  user-select: none;
  pointer-events: auto;
  -webkit-user-drag: none;
}

.gallery-item img.loaded {
  opacity: 1;
}

/* Overlay styles */
.overlay {
  position: absolute;
  bottom: 80px;
  left: 20px;
  color: white;
  padding: 5px;
  border-radius: 4px;
  opacity: 0;
  transition: opacity 2.5s;
}

.gallery-item:hover .overlay {
  opacity: 1;
}

/* Media query for screens smaller than 768px */
@media (max-width: 768px) {
  .sidebar {
    padding-left: 10px;
    padding-top: 10px;
    width: 124px;
    height: 154px;
  }

  .sidebar img {
    width: 120px;
  }

  .sidebar a {
    margin-top: 1px;
    margin-bottom: 0px;
  }

  .gallery {
    padding-left: 0px;
  }
}

/* Accessibility Enhancements */
.sidebar a:focus,
.contact-content a:focus,
.gallery-item img:focus {
  outline: 2px solid #555;
  outline-offset: 2px;
}
