html,
body {
    margin: 0;
    padding: 0px;
    font-family: Arial, Helvetica, sans-serif;
    text-transform: lowercase;
    overflow-y: scroll;
}

/* Allow full-page scroll */
body {
    display: flex;
    min-height: 100dvh
}

/* LEFT SECTION: main content + header */
.gallery-page, .selected-img-pg {
   display: flex;
   flex-direction: column;
   padding-left: 30px;
   padding-right: 30px;
   height: 100dvh;

}

p{
    font-size:xx-large;
    letter-spacing: -1.75px;
    color: gray;
    width: 100%;
}

/* Sticky header */
header {
   position: sticky;
   top: 0;
   z-index: 10;
   display: flex;
   align-items: center;
   justify-content: space-between;
   gap: 15px;
   padding-bottom: 15px;
   padding-top: 20px;
   width: 100%;
   font-size: xx-large;

}


/* LEFT SECTION: main content + header */
.intro {
   flex: 1;
   display: flex;
    flex-direction: row;
}

header,
footer,
.related-tags {
    /* font-weight: bold; */
    letter-spacing: -1.75px;
}
.galleryspace {
    flex:1;
    flex-direction: row;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
    min-width: 300px;
    padding-right:1px;
}

/* RIGHT FIXED SIDEBAR */
.tag-container {
    flex:1;
    max-width: 170px;
    padding-left: 20px;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    position: relative;
    z-index: 1; 
}



.title {
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    position: relative;
    z-index: 0;
     /* border: 1px solid transparent; 
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 8px; */
}

.title:hover {
    opacity: 1;
}


.camBtn {
    display: flex;
    flex-direction: row;
    font-size: xx-large;
    gap: 10px;
    color:black;
     cursor: pointer;
}

.camBtn:hover .camBtn-txt {
    /* color: rgb(100, 100, 100); */
  text-decoration: underline;
}

.camBtn-icon {
    display: none;
}

@keyframes blink {
  0% { opacity: 0; }
  50% { opacity: 1; }
  100% { opacity: 0; }
}

.camBtn:hover .camBtn-icon {
  display: inline;
  color: rgb(219, 12, 12);
  text-decoration: none;
  animation: blink 1s step-start infinite;
}

footer {
  position: sticky;
  z-index: 10;
  bottom:0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: xx-large;
  /* font-weight: bold; */
  gap: 15px;
  width: 100%;
  padding-bottom: 20px;
  padding-top: 20px;
}
a {
    text-decoration: none;
    color: black;
}

a:hover {
    /* color: rgb(100, 100, 100); */
    text-decoration: underline;
}

.help{
    flex:1;
    max-width: fit-content;
    text-align: right;
    flex-shrink: 0;
    padding-left: 30px;
}

/* #end region */

/* #region RIGHT SECTION*/

.tag-list-container{
    display:flex;
    flex-direction: column;
    background-color: transparent;
}

.tag-list {
    display: flex;
  flex-wrap: wrap;
  gap: 6px 3px;
  align-content: flex-start;
  justify-content: flex-end;
  padding: 0px 0px;
  background-color: transparent;
  }
/* 
UPDATED */

.tag {
  font-family: serif;
  display: inline-block;
  padding: 3px 8px;
  background-color: rgb(238, 238, 238);
   color: rgb(100, 100, 100);
  border-radius: 23px;
  cursor: pointer;
  text-align: center;
  white-space: nowrap; 
  max-width: 83px;
  overflow: hidden;
  text-overflow: ellipsis;

  border: 1px solid transparent;
  /* box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.03); */
  transition: 
    background-color 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.2s ease,
    border-color 0.2s ease;
}

.tag:hover {
  background-color: rgb(225, 225, 225);
 color: rgb(100, 100, 100);
  border-color: rgb(180, 180, 180);
  /* box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); */
}

.tag.active {
 background-color: rgb(251, 241, 241);
 color: rgb(180, 95, 95);
  border-color: rgb(180, 95, 95);
  /* box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.08); */
}

/* #end region */

/* #region index.html gallery*/
.gallery {
    flex:1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(243px, 1fr));
    column-gap: 10px;
    row-gap: 17px;
    justify-content: flex-start;
    width: 100%;
}

.gallery-item {
    color: rgb(135 ,135 , 135);
    align-items: center;
    text-align: center;
    position: relative;
}

.gallery-item:hover {
    /* border-color: red;
    color: red; */
}

.gallery-item img {
    aspect-ratio: 3 / 2;
  width: 100%; 
  height: auto;
  object-fit: cover;
  opacity: 0;
  border-radius: 3px;
  border: .5px solid rgba(80, 80, 80, 0.4);
  transition: 
    border 0.2s ease-in-out,
    box-shadow 0.2s ease-in-out,
    transform 0.2s ease-in-out,
    opacity 0.3s ease-in-out;
}

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

/* #end region */

/* #region searchbar */

.searchbar {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 15px;
    width: 100%;
  }

.search-form {
    max-width: 0;
    opacity: 0;
    transition: max-width .8s ease, opacity 0.3s ease;
    overflow: hidden;
    display: flex;
    height: 35px;
 border: 1px solid rgba(80, 80, 80, 0.4); 
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
    border-radius: 3px;  
    min-width: 0;
}

.search-form.expanded {
    max-width: 2000px; 
    opacity: 1;
    flex: 1;
}


.search-input {
    flex: 1;
    padding-left: 6px;
    font-size: 16px;
    border: none;
    outline: none;
    box-sizing: border-box;
    font-family: serif;
    color: black;
    background-color: transparent;
}

.search-button {
    white-space: nowrap;
    cursor: pointer;
    flex-shrink: 0;
}

.search-button:hover {
    /* color: rgb(100, 100, 100); */
    text-decoration-line: underline;
}

.active {
  color: rgb(180, 95, 95);
}


.hidden {
  display: none !important;
  transition: all 0.3s ease-in-out ;
}
/* #end region */

.caption-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    box-sizing: border-box;
    gap: 5px;
    font-size: 16px;
}
.image-selected-item .caption-container {
  /* background-color: rgb(238, 238, 238);
padding: 15px;
border-radius: 3px; */
padding-top: 5px;
}

.gallery-page .tags {
    /* color:  rgb(180, 95, 95); */
    color: black;
    font-family:serif;
    text-transform: lowercase;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tags {
    font-family: serif;
    font-size: 16px;
}

.gallery-page .date {
font-size: small;
    white-space: nowrap;
}

.timestamp{
    font-size: small;
     display: flex;          
    flex-direction: row;    
    gap: 5px; 
    white-space: nowrap;
    flex-shrink: 0;
}
.date {
    font-size: small;
    white-space: nowrap;
    flex-shrink: 0;
}

.time{
    white-space: nowrap;
    flex-shrink: 0;
}

/* #region image.html */

.top-section {
    display: flex;
    gap: 30px;
    align-items: stretch;
    flex-wrap: nowrap;
    width: 100%;
    margin: 0 auto;

}

.image-selected {
    flex: 1 1 auto;
    flex-shrink: 0;
    min-width: 61%;
    max-width: 740px;
}

.image-selected-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* padding: 20px;
    border: solid 1.5px black; */
    gap:10px;
}

.image-selected-item:hover {
    /* color: red; */
}

.image-selected-item img {
    width: 100%;
    height: 100%;
    flex-grow: 1;
    object-fit: contain; 
   border-radius: 3px;
    border: .5px solid rgba(80, 80, 80, 0.4);
}



.image-selected-item img.loaded {
  opacity: 1;
}

.right-section {
   flex: 1 1 auto;
   max-width: 37%;
   min-width: 390px;
  }

.right-section:hover > div:first-child{
    /* color: rgb(180, 95, 95); */
}
.small-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    column-gap: 10px;
    row-gap: 12px;
    flex-grow: 1;
    z-index: 10;
}



.small-gallery .gallery-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.small-gallery .gallery-item img {
    min-width: 100px;
    max-width: 100%;
    object-fit: cover;
    transition: all 0.3s ease-in-out;
}

.lower-section {
  margin-top: 20px;
}

.lower-section:hover > div:first-child{
    /* color:red; */
}

.small-gallery2 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
    column-gap: 10px;
    row-gap: 17px;
}
.small-gallery .tags,
.small-gallery2 .tags {
  /* color:  rgb(180, 95, 95); */
  color:black;
  text-transform: lowercase;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-tags {
    margin-bottom: 15px;
    font-size: xx-large;
    /* font-weight: bold; */
}
.tag-link{
    color:  rgb(180, 95, 95)
}
.tag-link:hover{
     color: rgb(180, 95, 95);
}
/* #end region */

/* mobile view region */
.search-overlay {
  display: none;
}

.nav{
    display: none;
}

/* #end region */

@media only screen and (min-device-width: 320px) and (max-device-width: 1012px) and (-webkit-min-device-pixel-ratio: 2) {
    body{
        font-size: x-large;
    }
    .gallery-page, .selected-img-pg {
        padding-left: 10px;
        padding-right: 10px;
    }
    .intro{
        margin-right: 0px;
        flex-direction: column-reverse;
        gap: 7px;
    }
    .camBtn {
      display: none;
    }
    .gallery, .small-gallery2 {
        grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
        row-gap: 15px;
        column-gap: 5px;
    }
    .small-gallery{
        grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
        row-gap: 15px;
        column-gap: 6px;
    }
    .top-section {
        display: flex;
        flex-direction: column;
        gap: 20px;
        align-items: flex-start;
    }
    .tag-container{
        /* display: none; */
        max-width: 100%;
        max-height: 30px;
        padding: 0px 0px 10px 1px;
       -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    }
    .tag-list-container{
        display:flex;
        flex-direction: row;
    }
    .tag-list {
        display: flex;
        flex-wrap: nowrap;
        align-items: center;
        padding: 0px 0px;
        font-size: medium;
    }

    .image-selected {
        width: 100%;
        max-width: 100%;
    }
    .right-section {
        width:100%;
        max-width: 100%;
    }
    .help{
    padding-left: 0px;
    }
    .galleryspace{
    overflow-y:visible;
    overflow-x: visible;
    }
    header{
        padding-top: 12px;
        padding-bottom: 12px;
    }
    footer{
        margin-top: auto;
        padding-bottom: 12px;
        z-index: 0;
    }

    .image-selected-item{
        padding-top: 7px;
    }
    .nav{
        display: block;
    }
    .help{
        display: none;
    }
     .search-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none; /* still controlled by JS */
    flex-direction: column;
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding-top: 12px;
  }

  .search-overlay.active {
    display: flex;
  }

  .overlay-search-form {
    display: flex;
    padding-left: 15px;
  }

  .overlay-search-form .search-input {
    flex: 1;
    font-size: xx-large;
    border: none;
    color: black;
  }
  .overlay-search-form ::placeholder {
   color:black;
  }
  .search-form{
    display: none;
} 

.nav-toggle:hover{
    cursor: pointer;
    text-decoration: underline;
}

.nav-overlay{
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none; 
    flex-direction: column;
    justify-content: flex-start;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.nav-overlay.active {
    display: flex;
}
.nav-menu {
  display: none;
  position: fixed;
  flex-direction: column;
  inset: 0;
 justify-content: flex-start;
  padding: 12px 20px;
  z-index: 1000;
  align-items: flex-end;
  flex-direction: column;
}

.nav-menu a {
    text-align: right;
  display: block;
  margin-bottom: 10px;
}

.nav-menu.active {
  display: flex;
}
}
  
