body, html {
  margin: 0;
  padding: 0;
  height: 100%;
}

#thumbnailRow {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

/* Container for the image caption */
#imgtext {
  max-width: 90%; 
  margin: 10px auto 0 auto;
  text-align: center;
  color: #444;
  font-family: 'Helvetica', sans-serif;
}

/* The title (e.g., artwork name) */
#imgTitle {
  font-size: 28px;
  font-weight: bold;
  margin-bottom: 5px;
  color: #222;
}

/* The size and medium info */
#imgSize,
#imgMedium {
  font-size: 16px;
  margin: 2px 0;
  color: #666;
  font-style: italic;
}

/* Gallery wrapper fills viewport vertically */
.gallery-wrapper {
  display: flex;
  flex-direction: column;
  height: 110vh;
  box-sizing: border-box;
  padding-top: 5vw;
}

/* Expanded area grows to fill space, centers content */
.expanded-area {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
  overflow: auto;
  text-align: center;
  max-height: 50vh;
}

/* Wrapper for image + click zones */
.expanded-image-container {
  overflow: hidden;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative; /* Required for absolutely-positioned arrows */
}

/* Large image styling */
#expandedImg {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

/* Click zones */
.click-zone {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
}

.left-zone {
  left: 0;
  cursor: w-resize;
}

.right-zone {
  right: 0;
  cursor: e-resize;
}

/* Arrows inside click zones */
.arrow {
  font-size: 3rem;
  color: #53784F;
  pointer-events: none; /* Allows clicks to pass through to .click-zone */
  transition: color 0.3s ease, opacity 0.3s ease;
  opacity: 0.4;
}

.click-zone:hover .arrow {
  color: #31472E;
  opacity: 0.8;
}

/* Thumbnail bar styling */
.thumbnail-bar {
  flex-shrink: 0;
  padding: 10px 20px;
  box-sizing: border-box;
}

/* Thumbnails container */
.row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  align-items: center;
}

/* Each thumbnail container */
.column {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  height: 15vw;
}

/* Thumbnail images */
.column img {
  max-width: 200px;
  max-height: 10vw;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.3s;
  display: block;
}

.column img:hover,
.column img.selected {
  border-color: #333;
}

/* Mobile formatting */
@media only screen and (max-width: 1000px) {

  .gallery-wrapper {
    display: flex;
    flex-direction: column;
    height: 90vh;
    box-sizing: border-box;
    padding-top: 5vw;
  }

  #imgTitle {
    font-size: 35pt;
    font-weight: bold;
    margin-bottom: 5px;
    color: #222;
  }

  #imgSize,
  #imgMedium {
    font-size: 20pt;
    margin: 2px 0;
    color: #666;
    font-style: italic;
  }

  .arrow {
    font-size: 4rem;
  }
}
