/* grid vars (and other vars) */
:root {
  /* grid of 5 columns */
  --grid-size: calc(100% / 5);
  --grid-margin: 2px;
  --pink: #DB60CE;
}



/* Core Stuff */
* {
  -webkit-box-sizing: border-box;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}



/* type etc */
html{
  font-size: 1.25rem;
  line-height: 1.25;
}
h1, h2, h3, h4, h5, h6{
  font-size: 1em;
}
a{
  color: black;
}
.smaller-type{
  font-size: .666em;
}
.bold{
  font-weight: bold;
}
.hide{
  display: none!important;
}
@media only screen and (max-width: 999px) {
  .mobilehide{
    display: none!important;
  }
  .mobilehide2{
    display: none!important;
  }
}
.blur{
  filter: blur(5px);
}
.noscroll{
  pointer-events: none;
  max-height: 100vh;
  overflow: hidden;
  position: fixed;
}
.hide-filters{
  display: none!important;
}



/* main grid */
#body .wrapper{
  width: 100%;
  overflow: hidden;
}
ul.main-grid {
  /* width: calc(100% - var(--grid-margin));
  margin: 9.5em calc(var(--grid-margin) / 2) 0 calc(var(--grid-margin) / 2); */
  width: calc(100% + var(--grid-margin));
  margin: 9.5em calc(var(--grid-margin) / -2) 0 calc(var(--grid-margin) / -2);
  display: flex;
  flex-wrap: wrap;
  list-style: none;
  padding: 0;
}
.main-grid li {
  position: relative;
  width: calc( var(--grid-size) - var(--grid-margin) );
  padding-bottom: calc( var(--grid-size) - var(--grid-margin) );
  margin: calc( var(--grid-margin) / 2 );
  cursor: pointer;
}
.main-grid li:last-child {
  flex-grow: 100;
}
.main-grid img {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  bottom: 0;
  height: 100%;
  width: 100%;
  object-fit: cover;
  vertical-align: bottom;
}



/* menu */
.header{
  position: fixed;
  top: 0;
  z-index: 1001;
}
.header a{
  text-decoration: none;
  color: black;
}
.header .wrapper{
  position: fixed;
  width: 100%;
  padding: 9.5em 1em 1em 1em;
  top: -8.5em;
  background: white;
  filter: none;
}
nav{
  position: relative;
}
nav ul{
  position: absolute;
  width: 100%;
  z-index: 1001;

  margin: 0;
  right: 0;
  top: -9.5em;

  display: flex;
  flex-direction: column;

  text-align: right;
}
nav li{
  list-style: none;
}
nav .static-menu{
  margin-bottom: .625em;
}
nav .toggle-menu{
  position: absolute;
  z-index: 1002;
  top: -1.5em;
  right: 0;
  background: none;
  border: none;
  padding: 0;
}
nav .toggle-menu img{
  width: 1.5em;
  height: 1.5em;
}
.zoom-container{
  display: none;
}

/* filters */
.searchbar{
  width: 100%;
  margin-top: .8em;
  height: 1.8em;
  border: 1px solid black;
  border-radius: .2em;
  padding-left: .5em;
}
.searchbar::placeholder{
  color: #DB60CE;
}
.filters{
  width: 100%;
  height: 0;
  overflow: hidden;
  margin: 0;
  list-style: none;
  padding: 0;
}
.filters.show{
  margin-top: 1em;
  height: 50vh;
  overflow-y: auto;
}
.filter-button{
  margin-top: 1em;
  width: 100%;
  display: flex;
  justify-content: center;
}
.filter-button button{
  border: none;
  background: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 2.5em;
}
.filter-button img{
  width: 1.5em;
  height: 1.5em;
}
/* an entire section dedicated to custom checkboxes love it */
/* Customize the label (the container) */
.filter .container {
  display: block;
  position: relative;
  padding-left: 1.25em;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
/* Hide the browser's default checkbox */
.filter .container input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}
/* Create a custom checkbox */
.filter .checkmark {
  position: absolute;
  bottom: .2em;
  left: 0;
  height: 1em;
  width: 1em;
  background-color: white;
  border: 1px solid black;
}
/* Create the checkmark/indicator (hidden when not checked) */
.filter .checkmark:after {
  content: "";
  background: url('../images/archive_X.svg');
  background-size: 100%;
  background-position: center;
  background-repeat: no-repeat;
  color: black;
  position: absolute;
  display: none;
}
/* Show the checkmark when checked */
.filter input:checked ~ .checkmark:after {
  display: block;
}
/* Style the checkmark/indicator */
.filter .checkmark:after {
  width: 1.25em;
  height: 1.25em;
  left: -.2em;
  top: -.2em;
}

/* menu toggle */
.menu-down{
  transform: translateY(8.5em);
}
#body .wrapper.menu-down{
  position: relative;
  z-index: -1;
}
.logo.left.menu-down{
  position: fixed;
}

/* actual content */
.content-item{
  position: fixed;
  top: 2.75em;
  left: 0;
  right: 0;
  width: 100%;
  height: calc(100% - 2.75em);
  padding: .5em;
  padding-top: 2em;
  background: white;
  max-width: 850px;
  margin: 0 auto;
  overflow-y: auto;
  overflow-y: overlay;
  overflow-x: hidden;
  z-index: 1000;
}
.content-item .close-project{
  position: fixed;
  width: 1.5em;
  height: 1.5em;
  padding: 0;
  top: 3.25em;
  right: 1em;
  border: 0;
  background: none;
}
.content-item .title{
  margin: 0;
  padding-bottom: .5em;
  max-width: calc(100% - 2em);
}
/* align margins */
.content-item .text, .content-item .related{
  margin-left: .5em;
  margin-right: .5em;
}
.content-item .title{
  position: fixed;
  top: 3.25em;
  left: .5em;
  padding: .5em;
  padding-top: 0;
  width: 100%;
  max-width: none;
  margin: 0;
  background: white;
}
.content-item .project-img{
  width: 100%;
  display: block;
  margin-bottom: .5em;
}
.content-item .related ul{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: flex-end;
  width: calc(100vw - 1.5em);
  flex-wrap: wrap;
}
.content-item .related figure{
  margin: 0;
  margin-right: .5em;
  padding: 0;
  width: calc(50vw - 1.25em);
}
.content-item .related figure img{
  width: 100%;
  height: 20%;
}
.content-item .prevnext{
  margin-top: 1em;
  margin-left: .75em;
  display: flex;
  flex-direction: column;
  float: left;
  background: none;
  padding: 0;
  border: none;
  font-size: .66em;
}
.content-item .prevnext span{
  margin-top: .5em;
}
.content-item .prev, .content-item .next{
  width: 100px;
  height: 100px;
  object-fit: cover;
}

/* never let the images get bigger than 100px */
@media only screen and (min-width: 500px) {
  :root {
    /* grid of 7 columns */
    --grid-size: calc(100% / 7);
  }
}
/* never let the images get bigger than 100px */
@media only screen and (min-width: 700px) {
  :root {
    /* grid of 9 columns */
    --grid-size: calc(100% / 9);
  }
}
/* desktop */
@media only screen and (min-width: 850px) {
  /* grid vars (and other vars) */
  :root {
    --grid-size: 50px;
  }
  /* grid */
  ul.main-grid{
    margin-top: 5.9em;
  }
  .main-grid li {
    /* revert mobile */
    width: auto;
    padding-bottom: 0;
    /* doing mah thang */
    height: var(--grid-size);
    flex-grow: 1;
    /* transition: height .2s; */
  }
  .main-grid li:hover {
    outline: var(--grid-margin) solid var(--pink);
  }
  .main-grid li:last-child {
    flex-grow: 100;
  }
  .main-grid li:last-child:hover {
    outline: none;
  }
  .main-grid img {
    /* revert mobile */
    position: relative;
    left: auto;
    right: auto;
    top: auto;
    bottom: auto;
    height: 100%;
    width: auto;
    /* own things */
    max-height: 100%;
    min-width: 100%;
  }
  /* actual content */
  .content-item{
    border: 1px solid black;
    height: calc(100vh - 5em);
    top: 4em;
    padding: 1em;
  }
  #body.down .content-item{
    height: calc(100vh - 15em);
  }
  .content-item .close-project{
    position: fixed;
    right: calc(50vw - 425px + 1em);
    top: 5em;
  }
  .content-item .title{
    padding: 1em 0;
    width: calc(850px - 2em);
    left: unset;
    top: calc(4em + 1px);
  }
  .content-item .text, .content-item .related{
    margin: 0;
  }
  .content-item .related ul{
    width: 100%;
  }
  .content-item .related figure {
    width: 150px;
  }
  .content-item .prevnext{
    margin-left: 0;
    margin-right: 0.75em;
  }
  /* menu */
  .toggle-menu{
    display: none;
  }
  .header .wrapper{
    padding: 1em;
    top: 0;
    filter: unset;
  }
  nav ul{
    width: unset;
    position: fixed;
    right: 1em;
    top: 1em;
    flex-direction: row;
  }
  nav .static-menu {
    margin-left: 1em;
  }
  /* menu/filters */
  .filter-button{
    position: absolute;
    top: 0;
    left: 14em;
    width: auto;
    margin-top: .35em;
  }
  .filter-button button {
    flex-direction: row;
  }
  /* .filter-button img{
    display: none;
  } */
  /* zoom buttons */
  .zoom-container{
    display: block;
    position: fixed;
    bottom: 1em;
    right: 1em;
    display: flex;
    flex-direction: row-reverse;
  }
  .zoom-button{
    margin-left: .5em;
    width: 1em;
    height: 1em;
    padding: 0;
    border: 1px solid black;
    border-radius: 0;
    background: white;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .zoom-button:disabled{
    opacity: .5;
  }
  .zoom-button img{
    padding: .1em;
    width: .8em;
    height: .8em;
  }
}
/* desktop bigger */
@media only screen and (min-width: 1000px) {
  /* grid */
  ul.main-grid{
    margin-top: 3.3em;
  }
  /* menu/filters */
  .searchbar{
    position: absolute;
    top: 0;
    left: 14em;
    width: 13em;
    margin-top: 0.7em;
  }
  .filter-button{
    position: absolute;
    top: 0;
    left: 28em;
    width: auto;
  }
  /* filters */
  #body.down{
    transform: translateY(9.75em);
  }
  .filters.show{
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-content: flex-start;
    height: 8.75em;
  }
  .filters .filter{
    padding: .25em 0;
    margin-right: 2em;
  }
  .filters .filter.s1{
    transform: translateX(calc( 1 * 1em ));
  }
  .filters .filter.s2{
    transform: translateX(calc( 2 * 1em ));
  }
  .filters .filter.s3{
    transform: translateX(calc( 3 * 1em ));
  }
  .filters .filter.s4{
    transform: translateX(calc( 4 * 1em ));
  }
}
/* desktop even bigger */
@media only screen and (min-width: 1500px) {
  /* filters */
  .filters.show{
    padding-left: 28.5em;
  }
}
