body{
  margin: 18px 35px;
  overflow-x: hidden;
}
/* remove vertical scrollbar when fullscreen/split dual screen */
body.overlayer{
  overflow: hidden;
}
img {
  position: relative;
  z-index: 1;
}
img:not([src]) {
    display: none;
}

#imageGrid {
  display: grid;
  /* grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); */
  grid-template-columns: repeat(3, 1fr);
  grid-gap: 35px 35px;
  margin-top: 0px;
  margin-bottom: 35px;
}

@media (min-width: 570px){
  #imageGrid{
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 990px){
  #imageGrid{
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
}

@media (min-width: 1205px){
  #imageGrid{
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }
}

@media (min-width: 1450px){
  #imageGrid{
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 1730px){
  #imageGrid{
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
}

@media (min-width: 2000px){
  #imageGrid {
    grid-template-columns: repeat(auto-fit, minmax( calc(100% / 6 - 35px), 1fr ));
  }
}


.grid-item {
  text-align: center;
  position: relative;
  color: white;
  background-color: transparent;
  /* ^^^ bg color when an image is uploaded to the grid */
}

.image-container {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-bottom: 100%;
  position: relative;
  overflow: hidden;
  /* transition: all 500ms ease-in; */
}

.image-container img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  /* transition: all 500ms ease-in; */
}

/* Hide the file input selector */
.file-input {
  display: none;
}
/* clear all */
.action-buttons{
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  margin-top: -14px;
  margin-bottom: 5px;
}
h1{
  display: none;
}
@media (min-width: 480px){
  .action-buttons{
    flex-direction: row;
    margin-bottom: 5px;
  }
  h1{
    display: inline-block;
    padding: 0;
    margin: 0;
    font: clamp(.8rem, .8vw, 1.2rem)/.1rem monospace;
    line-height: 25px;
    background-color: #84edb2;
    color: #123;
  }
}

/* Style the label to look like a button */
.upload-label, .image-btn {
  display: inline-block;
  padding: 0px;
  text-align: center;
  vertical-align: middle;
  cursor: pointer;
  /* background-color: rgba(255, 255, 255, 0.7); */
  background-color: transparent;
  background-image: none !important;
  outline: none;
  border: 0;
  text-shadow: none;
  box-shadow: none;
  transition: all 0.12s linear 0s !important;
}
/* numbered buttons when active */
.image-btn{
  border: 1px solid grey;
  padding: 4px;
  margin-left: 4px;
}
@media (min-width: 480px){
  .image-btn{
    padding: 8px;
  }
}
.image-btn.selected {
  background-color: #007bff;
  color: #fff;
}
.image-btn.disabled {
  opacity: 0.5;
  pointer-events: none; 
  cursor: not-allowed; 
}
/* Add Image */
.upload-label::after{
  content: attr(data-text-add);
  transform: rotate(0deg);
  width: 100%;
}
.upload-label{
  position: absolute;
  z-index: 1;
  top: 0%;
  bottom: 0;
  left: 0%;
  right: 0;
  color: #111;
  background: #ccc;
  opacity: .5;
  /* ^^^ bg color when an image is uploaded to the grid */
  padding: 5px;
  user-select: none;
  font: clamp(.5rem, .8vw, 1.2rem)/.1rem monospace;
  display: flex;
  justify-content: center;
  align-items: center;
}
/* 'Swap' label rotated to side of uploaded image */
.upload-label.image-has-been-uploaded{
  position: absolute;
  z-index: 1;
  left: 0%;
  top: 0%;
  width: 10px;
  background: #f33;
  opacity: .8;
  color: #fff;
  padding: 10px;
}
.image-has-been-uploaded.upload-label::after{
  content: attr(data-text-swap);
  transform: rotate(-90deg);
  width: 100%;
}

.uploaded-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* transition: all 100ms ease-in; */
}

.slotNumber{
  position: absolute;
  z-index: 1;
  bottom: 0;
  right: 0;
  color: white;
  background: #000;
  padding: 4px;
  margin: 0;
  font-family: monospace;
}


/* Full-screen styles */
.grid-item.full-screen {
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  display: flex;
  justify-content: center; 
  align-items: center; 
  background: white; /* <--- single image full screen bg color */
  /* transition: all 100ms ease-in; */
}


.grid-item.full-screen img {
  /* max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto; */
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
  height: 50vw;
  /* transition: all 100ms ease-in; */
}

/* @media (min-width: 1200px) {
  .grid-item.full-screen .uploaded-image {
    width: 100%;
    height: 100%;
  }
} */
/* @media (min-width: 1500px){
  .grid-item.full-screen img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
  }
} */


.overlay {
  position: fixed;
  z-index: 9999;
  display: block;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  cursor: pointer;
}

.modal {
  display: flex;
  justify-content: space-around;
  align-items: center;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background-color: white; 
  padding: 20px;
}

/* For viewports larger than 1200px */
.modal-image {
  /* max-width: 45%;
  max-height: 100%; */
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
  width: 50vw;
}

/* Additional styles for the image container to control the spacing between images */
.splitscreen-container {
  display: flex;
  justify-content: space-around;
  width: 100%;
  /* add the following to stick the images together in the center of the fullscreen modal overlay */
  max-width: 1000px;
  margin: 0 auto;
}

/* For viewports smaller than 1200px */
.splitscreen-container.responsive .modal-image {
  width: 100%;
  height: 100%;
}

/* Additional styles for the image elements to preserve aspect ratio and scale down to fit within the container */
.splitscreen-container img {
  object-fit: contain;
  max-width: 100%;
  max-height: 100%;
  width: 50vw;
  height: 100vh;
}


/* github svg */
.github {
  align-self: center;
  /* margin: 40px 0 80px; */
}
.github img{
  width: 30px;
  height: auto;
}

@media (min-width: 769px){
  .github {
    margin: 0px 0px 0px;
  }
}