/*------------------------------
  Work list
    multi-column layout
-------------------------------*/
#listjson {
  display: none !important;
}

/* for gallery */
.worklist ul {
  padding: 0;
  margin: 3em 0 0;
  display: grid;
  align-items: start;
  position: relative;
  width: 100%;
  grid-template-columns: repeat(2, 1fr);
  column-gap: 1em;
  grid-column-gap: 1em; /* for old iOS */
  grid-auto-rows: fit-content(200px);
  grid-auto-flow: row; 
}

.worklist li {
  list-style: none;
  display: inline-block;
  grid-row-start: span 50;
  line-height: 1.2;
  padding-bottom: 1.3em;
  break-inside: avoid;
}

.worklist img {
  /*width: 100%;*/
  max-height: 90vw;
  box-shadow: var(--image-shadow);
  filter: brightness(1.05) saturate(1.1);
  content-visibility: auto;
}

.worklist .imagetitle, .expo-head .imagetitle {
  display: block;
  color: var(--note-color);
  margin-top: 0.2em;
  margin-right: 0.5em;
  font-size: 90%;
  font-weight: var(--light-font-weight);
  font-family: var(--image-title-font);
}
.worklist .imageinfo {
  display: block;
  color: var(--aside-color);
  font-size: 80%;
  font-weight: var(--thin-font-weight);
  font-family: var(--image-title-font);
}

.worklist a img:hover {
  filter: brightness(1.10);
  transform: scale(1.03);
}


/***************************************
    Lightbox Modal
***************************************/
#modal {
  display: none;
}
#modal.enabled {
  background-color: var(--modal-bg-color);
  display: grid;
  position: fixed;
  z-index: 500;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-width: 100vw;
  grid-template-rows: auto 2em;
  gap: 0;
  user-select: none;
  -webkit-user-select: none;
  overflow-y: hidden;
}

#modal.enabled #gallery-panel {
  margin: 0;
  width: 100vw;
  /*height: calc(100vh - 2em);*/
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 500;
}

#gallery-image {
  max-width: 100vw;
  max-height: 85vh;
  max-height: 85dvh;
  cursor: pointer;
  z-index: 999;
  
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
  
  animation: 0.8s fadein;
}

#gallery-image.moveToRight, #gallery-image.moveToLeft, #gallery-image.moveToBottom {
  animation-timing-function: linear;
  animation-duration: 0.2s;
  animation-fill-mode: forwards;
}
#gallery-image.moveToRight {
  animation-name: moveToRight;
}
#gallery-image.moveToLeft {
  animation-name: moveToLeft;
}
#gallery-image.moveToBottom {
  animation-name: moveToBottom;
}

#gallery-info {
  color: var(--footer-color);
  margin: 0;
  text-align: center;
  max-width: 100vw
}
#gallery-title {
  font-weight: var(--normal-font-weight);
  margin-right: 1em;
}
#gallery-notes {
  font-weight: var(--thin-font-weight);
}
#gallery-link {
  display: none;
  position: absolute;
  right: 2em;
  color: var(--footer-link-color);
  text-decoration: none;
}

#modal .gallery-button {
  position: fixed;
  background: transparent;
  border: 0;
  z-index: 9999;
  
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  filter: invert(100%) opacity(70%);
}
#modal .gallery-button:hover {
  background-color: white;
  filter: opacity(60%);;
}
#modal .gallery-button:active {
  filter: opacity(100%);
  transform: translateY(0.2rem) translateX(0.2rem);
}
#modal .gallery-button[disabled] {
  background-color: transparent;
  filter: opacity(10%);
}
#modal #gallery-prev-button {
  width: 2rem;
  height: 2rem;
  border-radius: 1rem;

  background-image: url(prev.svg);
  bottom: 1%;
  left: 1rem;
}
#modal #gallery-next-button {
  width: 2rem;
  height: 2rem;
  border-radius: 1rem;

  background-image: url(next.svg);
  bottom: 1%;
  right: 1rem;
}
#modal #gallery-close-button {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 0.8rem;

  background-image: url(close.svg);
  top: 0.5rem;
  right: 0.5rem;
}  




@media screen and (max-width:799px) {
  .worklist .imagetitle {
    display: inline-block;
  }
  .worklist .imageinfo {
    display: inline-block;
  }
}


@media screen and (min-width: 451px) {

  .worklist ul {
    margin-top: 5em;
    max-width: unset !important;
    width: 100vw;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    padding: 0 2.5vw;
    grid-template-columns: repeat(3, 1fr);
    box-sizing: border-box;
    gap: 0;
  }
  
  .worklist li {
    grid-row-start: unset !important; /*span 50;*/
    /*aspect-ratio: 1;*/
    padding: 2vw;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
  }
  
  .worklist li a {
    /*display: block;
    box-sizing: border-box;
    padding: 1em;
    width: 100%;
    height: 100%;*/
  }
  .worklist img {
    /*box-shadow: unset;*/
  }
  
  .worklist [class^='image'], .expo-head .imagetitle {
    display: block;
    width: 100%;
    text-align: right;
  }
  .worklist .imagetitle, .expo-head .imagetitle {
    margin: 0.8em 0 0.3em 0;
    font-size: 85%;
  }
  .worklist .imageinfo {
    font-size: 70%;
  }

}

@media screen and (min-width: 800px) {
  .worklist ul {
    grid-template-columns: repeat(4, 1fr);
    /*column-gap: 1.5em;*/
  }
  .worklist .imageinfo {

  }
  
  .expo-head {
    max-height: 80vw;
    max-width: 60%;
    margin: 0 auto;
  }

}

@media screen and (min-width:1440px) {
  .worklist {
    padding: 0;
    margin: 0;
  }
  
  .worklist ul {
    /*grid-template-columns: repeat(4, 1fr);
    column-gap: 2em;*/
  }  

  .worklist .imageinfo {

  }

  /* lightbox modal for worklist */
  #modal .gallery-button {
    filter: invert(100%) opacity(30%);
  }
  
  #gallery-link {
    display: inline;
  }

  #modal #gallery-prev-button {
    width: 5rem;
    height: 5rem;
    border-radius: 2.5rem;
    bottom: 50%;
  }
  #modal #gallery-next-button {
    width: 5rem;
    height: 5rem;
    border-radius: 2.5rem;
    bottom: 50%;
  }
  #modal #gallery-close-button {
    width: 3rem;
    height: 3rem;
    border-radius: 1.5rem;
    top: 2rem;
    right: 2rem;
  }  

  /*------------------------------
     horizontal align for worklist 
     keep for reference
  ------------------------------ */
  /*
  .worklist ul {  
    display: inline-flex;
    flex-wrap: wrap;
    gap: 1em; // for ipad
  }
  .worklist li {
    line-height: 1.2;
    font-size: 90%;
    margin-right: 1em; // for ipad
    margin-bottom: 1em;
  }
  .worklist img {
    width: auto;
    height: 10em;
  } */

}