body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin:0;
  padding: 0;
  font-family: sans-serif;
}
#main {
  flex: 1;
  overflow-y: auto;
}
/* top bar */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #191f2b;
  color: #fff;
  padding: 0.5em 1em;
  flex-shrink: 0;
  max-height: 70px; 
}
.hamburger {
  font-size: 1.5em;
  cursor: pointer;
  margin-right: 1em;
}
header h1 {
  margin: 0;
}
header h1 a {
  padding: 0.4rem 0.4rem 0.1rem 0.4rem;
  display: inline-block;
  width: 5.5rem;
}
header p.return {
  margin:0;
}
header p.return a {
  background: #35bae6;
  border: 1px solid #35bae6;
  border-radius: 0.2rem;
  color: white;
  display: inline-block;
  padding: 0.4rem 0.9rem;
  text-decoration: none;
  font-size: 0.8rem;
  transition: all 0.2s ease;
}
header p.return a:hover {
  background: transparent;
  border: 1px solid #fff;
}

/* sidebar menu */
aside {
  position: fixed;
  top: 0;
  left: -300px;
  width: 250px;
  height: 100%;
  background: #191f2b;
  color: #fff;
  padding: 1em;
  box-shadow: 2px 0 5px rgba(0,0,0,0.5);
  transition: left 0.3s ease;
  overflow-y: auto;
  z-index: 888;
}
aside.visible {
  left: 0;
}
aside h2 {
  margin-top: 0;
  font-size: 1.1em;
}
.filter-group {
  margin-bottom: 1em;
}
.filter-group label {
  display: block;
  margin-bottom: 0.5em;
  cursor: pointer;
}
/* gallery grid */
#gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 26px;
  padding: 16px;
  overflow-y: hidden;
} 
/* each thumbnail container */
.thumb {
  opacity: 0; 
  position: relative;
  cursor: pointer;
  height: 400px;
  overflow: hidden;
  transition: none;  
} 
.thumb .thumb_box{
  filter: blur(5px);
  transition: filter .8s ease-out;
} 
.thumb .thumb_box.loaded {
  filter: none;
}

@keyframes thumbFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.thumb:hover {
  outline: 3px solid #35bae6;
}
.thumb img {
  width: 100%;
  height: auto;
  display: block;
  user-select: none;
  opacity: 1;
  transition: filter 0.3s ease, opacity 0.3s ease;
}

#gallery.hovering .thumb:hover img { filter: none; opacity: 1; } 

/* lightbox */
#lightbox {
  position: fixed; top:0; left:0;
  width:100%; height:100%;
  background: rgba(0,0,0,0.9);
  display: flex;
  justify-content: center;
  align-items: flex-start;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  overflow: auto;
  padding: 32px;
  box-sizing: border-box;
  z-index: 886;
}
#lightbox.visible { opacity:1; pointer-events:auto; }
#lightbox .content { position: relative; }
#lightbox .content::after {
  content: '';
  position: absolute; top:0; left:0;
  width:100%; height:100%;
  background-image: url('../img/watermark.png');
  background-repeat: repeat;
  background-size: 500px 500px;
  opacity: 0.07;
  pointer-events: none;
  z-index: 2;
}
#lightbox img.piece { position:absolute; display:block; user-select:none; }
#lightbox .close-btn {
  position: fixed; top:16px; right:16px;
  font-size:2em; color:#fff; cursor:pointer; z-index:1001;
}

/* floating action button */
.fab {
  position: fixed;
  bottom: 20px; 
  right: 20px;
  background: #35bae6;
  color: #fff;
  display: inline-block;
  align-items: center; justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
  z-index: 1002;
  padding: 0.4rem 1rem 0.4rem 2.1rem;
  border-radius: 0.2rem;
}
.fab:before {
  content:"";
  background: url('../img/customer_service_white.svg') no-repeat center;
  background-size: contain;
  position: absolute;
  width: 1.3rem;
  height: 1.3rem;
  left: 0.5rem;
  top: 0.6rem;
}
#gallery + #loading {
  text-align: center;
  padding: 1rem;
  color: #888;
  font-size: 0.9rem;
}

#lightbox.loading:before{
	content: "";
	position: absolute;
	width: 100%;
	height: 100%;
	top: 0;
	left: 0;
	background: url('../img/loading.gif') no-repeat center;
	background-size: 30px; 
} 