/* 
Title: Studio Berit
Author: Florian Schimanski
*/

/* ----- 1. Typefaces ----- */

@font-face {
    font-family: "Euclid Circular A";
    src: url("../fonts/EuclidCircularA-Medium-WebXL.woff") format("woff2");
  }

/* ----- 2. General ----- */

:root {
    --white:#ffffff;
    --grey: #5e5e5e;
    --black: #202020;
    
    --gap: 0.5rem;

    --text-l: 2rem;
    --text-m: 1rem;
    --text-s: 0.8rem;
    --text-xs: 0.6rem;
  }

html {
  font-family: "Euclid Circular A";
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: greyscale;
  background-color: var(--white);
  color: var(--black);
  scroll-behavior: smooth;
}

@media (hover: hover) {
  a:hover, 
  a:link:active, 
  a:visited:active {
    color: var(--grey);
  }
}

.mobile-only {
  display: none;
}

/* ----- 3. Header ----- */

header {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: var(--gap);
  position: fixed;
  top: 0;
  width: 100%;
  height: 3.5rem;
  z-index: 20;
  padding: var(--gap);
  box-sizing: border-box;
  background-color: var(--white);
  line-height: 1.25em;
}

h1 {
  font-size: 3.2rem;
  text-transform: uppercase;
  letter-spacing: -0.04em;
  line-height: 0.75em;
  align-self: flex-start;
  margin-top: 0.08rem;
}
  
h1 a {
  display: flex;
  justify-content: space-between;
  background-color: var(--white);
  width: 6em;
  padding-right: var(--gap);
  transition: width 1s;
  transition-timing-function: cubic-bezier(.77, 0, .175, 1);
}

h2 {
  text-transform: uppercase;
}

nav {
  display: flex;
  justify-content: space-between;
}

nav .contact {
  display: flex;
  flex-direction: column;
  text-align: right;
}

.menu {
  display: flex;
}

.menu li {
  margin-right: 1.5rem;
}

/* ----- 4. Main ----- */

main {
  min-height: 70vh;
}

section {
  padding: var(--gap);
  padding-top: 3.5rem;
  box-sizing: border-box;
}

article {
  margin-bottom: 2rem;
}

article:last-child {
  margin-bottom: 0;
}

.layout-a {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-gap: var(--gap);
}

.layout-a .title {
  position: sticky;
  top: 3.5rem;
  align-self: flex-start;
}

.layout-b {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-gap: var(--gap);
}

.box {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

p {
  margin-bottom: 1.25em;
  -ms-hyphens: none;
  -webkit-hyphens: none;
  hyphens: none;
}

p:last-child {
  margin-bottom: 0;
}

/* ----- 5. Intro ----- */

#intro {
  position: absolute;
  height: calc(100vh - 3.5rem);
  background-color: var(--white);
  opacity: 0;
  top: 3.5rem;
  left: 0;
  right: 0;
  bottom: var(--gap);
  transition: opacity 0.5s, height 0.5s;
  z-index: 10;
  padding-top: 2px;
}

#intro div {
  top: 0;
  bottom: 0;
  height: 100%;
  outline: 2px solid var(--black);
  outline-style: dashed;
  display: flex;
  justify-content: center;
  align-items: center;
}

#intro h2 {
  font-size: var(--text-l);
  text-transform: none;
  text-align: center;
  padding-left: 10vw;
  padding-right: 10vw;
  box-sizing: border-box;
  margin-top: -0.6em;
}

/* ----- 6. Animation ----- */

body.intro {
  overflow: hidden;
}

#intro.intro {
  opacity: 1;
}

h1 a.intro {
  width: calc(100vw - 2.5 * var(--gap));
}

#images.intro {
  opacity: 0;
  height: 100vh;
}

/* ----- 7. Slideshow ----- */

#images {
  position: relative;
  padding-left: 0;
  padding-right: 0;
  height: 50vw;
  margin-bottom: -3.6rem;
  opacity: 1;
  transition: opacity 3s, height 1s;
}

#slideshow {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  overflow-x: auto;
  overflow-x: scroll;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  padding-bottom: var(--gap);
  z-index: 0;
}

#slideshow::-webkit-scrollbar {
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-overflow-scrolling: auto;
}

#slideshow::-webkit-scrollbar:vertical {
  width: 12px;
}

#slideshow::-webkit-scrollbar:horizontal {
  height: 3px;
}

#slideshow::-webkit-scrollbar-track {
  background: none;
  margin-left: var(--gap);
  margin-right: var(--gap);
}
#slideshow::-webkit-scrollbar-thumb {
  background: var(--black);
}
#slideshow::-webkit-scrollbar-thumb:hover {
  opacity: 0.5;
  cursor: pointer;
}

.slides {
  position: relative;
  scroll-snap-align: start;
  flex-shrink: 0;
  padding-left: var(--gap);
  padding-right: var(--gap);
  display: flex;
  box-sizing: border-box;
}

.prev-slide,
.next-slide {
  position: absolute;
  top: 0;
  bottom: calc(2 * var(--gap) + 3px);
  width: 20vw;
  z-index: 10;
  display: none;
}

.prev-slide {
  left: 0;
  cursor: w-resize;
}

.next-slide {
  right: 0;
  cursor: e-resize;
}

@media (hover: hover) {
    .prev-slide,
    .next-slide {
      display: block;
  }
}

/* ----- 7.1 Slideshow (Home) ----- */

.home .slides {
  width: 100%;
}

.home .slide {
  width: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
}

.home .slide h3 {
  font-size: var(--text-l);
  z-index: 20;
  padding-left: 4rem;
  padding-right: 4rem;
  box-sizing: border-box;
}

.home .slide h4 {
  z-index: 20;
}

@media (hover: hover) {
  .home a.slide:hover {
    color: var(--black);
  }
}

/* ----- 7.2 Slideshow (Project) ----- */

.project #images {
  height: 40vw;
  padding-top: 1rem;
  margin-bottom: -3.4rem;
}

.project #slideshow {
  opacity: 1;
}

.project #images:hover #slideshow {
  opacity: 1;
}

.project .slides {
  padding-right: 0;
}

.project .slides.landscape {
  width: calc((100vw - var(--gap)) / 2);
}

.project .slides.portrait {
  width: calc((100vw - var(--gap)) / 4);
}

.project .slides.square {
  width: calc((100vw - var(--gap)) / 2);
}

.project .slides:last-of-type {
  padding-right: var(--gap);
  box-sizing: border-box;
}

.project .slide {
  width: 100%;
  object-fit: cover;
} 

.slide figcaption {
  position: absolute;
  bottom: 0;
  left: var(--gap);
  right: 0;
  padding-top: 0.3rem;
  padding-right: 0.3rem;
  box-sizing: border-box;
  font-size: var(--text-xs);
  letter-spacing: 0.01em;
  background-color: var(--white);
}

img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ----- 8. Expertises ----- */

.package {
  margin-bottom: 2rem;
}

.package .box {
  height: 5rem;
  outline: 2px dashed var(--black);
  outline-offset: -2px;
  margin-bottom: 1rem;
  position: sticky;
  top: 3.5rem;
  background-color: var(--black);
  color: var(--white);
  transition: background-color, color;
  transition-duration: 0.2s;
}

@media (hover: hover) {
  .package:hover .box {
    background-color: var(--white);
    color: var(--black);
  }
}

.package h3 {
  text-transform: uppercase;
}

.package p {
  padding-right: 0.5em;
  box-sizing: border-box;
  margin-bottom: 0.2rem;
}

.package .contact {
  font-size: var(--text-s);
  margin-bottom: 10rem;
}

/* ----- 9. News ----- */

.message {
  border-top: 2px dashed var(--black);
  padding-top: 1rem;
  padding-bottom: 1.3rem;
}

.message h3 {
  text-transform: uppercase;
}

.date {
  font-size: var(--text-s);
  font-feature-settings: "tnum";
}

/* ----- 10. Project Tile ----- */

#projects h2 {
  margin-bottom: 0.7rem;
}

.project-tile {
  width: 100%;
  height: 30vw;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.project-tile h3 {
  font-size: var(--text-l);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin-bottom: 0.2rem;
  z-index: 10;
} 

.project-tile h4 {
  z-index: 10;
}

@media (hover: hover) {
  a.project-tile:hover {
    color: var(--black);
  }
}

@media (hover: hover) {
  .project-tile:hover {
    outline: 2px dashed var(--black);
  }
  
  .project-tile:hover .backgroundimage{
    opacity: 0;
  }
}

.backgroundimage {
  box-sizing: border-box;
  position: absolute;
  width: 100%;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 0;
  background-image: url("../images/placeholder.jpg");
  background-position: center;
  background-size: cover;
  opacity: 0.3;
  transition: opacity 0.2s;
}

/* ----- 11. Project Page ----- */

.project h2 {
  text-transform: none;
} 

blockquote {
  border-top: 2px dashed var(--black);
  border-bottom: 2px dashed var(--black);
  padding: 3em;
  padding-top: 2rem;
  padding-bottom: 1.8rem;
  margin-bottom: 1.25em;
  text-align: center;
}

blockquote + blockquote {
  border-top: none;
  margin-top: -1.25em;
}

blockquote p {
  margin-bottom: 0.5em!important;
}

cite {
  font-size: var(--text-s);
}

.project-info {
  font-size: var(--text-s);
  margin-top: 1.5rem;
}

/* ----- 12. Info ----- */

#info .text p {
  display: none;
}

#info .text p:first-child {
  display: block;
}

.info article {
  margin-bottom: 4rem;
}

.info article:last-child {
  margin-bottom: 0rem;
}

.info .portrait {
  width: 19.5rem;
}

.info figcaption {
  width: 19.5rem;
  font-size: var(--text-xs);
}

.text a {
  text-decoration: underline;
}

.text em {
  font-style: italic;
}

.text strong {
  font-size: var(--text-s);
}

.text p + ul {
  margin-top: -1.25em;
  margin-bottom: 1.25em;
}

.text ul {
  margin-left: 1rem;
}

.text li {
  list-style-type: disc;
  list-style-position: outside;
}

.text h3 {
  text-transform: uppercase;
}

/* ----- 13. Footer ----- */

footer {
  padding: var(--gap);
  box-sizing: border-box;
  margin-top: 3.5rem;
  width: 100%;
  background-color: var(--black);
  color: var(--white);
}

footer .title {
  margin-bottom: 0.8em;
}

footer nav {
  margin-top: 2.5rem;
  justify-content: flex-start;
}

footer nav ul {
  display: flex;
  font-size: var(--text-s);
}

footer nav li {
  margin-right: 1.5rem;
}

/* ----- 14. Lazy Load ----- */

.lazy {
  opacity: 0;
}

.loaded {
  opacity: 1;
  transition: opacity 1s;
}

/* ----- 15. Keyframes ----- */

@keyframes shake {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(2deg); }
  50% { transform: rotate(0deg); }
  75% { transform: rotate(-2deg); }
  100% { transform: rotate(0deg); }
}

/* ----- 16. Cookies ----- */

.cookies {
  position: fixed;
  bottom: var(--gap);
  left: var(--gap);
  background-color: var(--black);
  color: var(--white);
  padding: var(--gap);
  font-size: var(--text-xs);
  text-align: center;
  display: none;
}

.cookies.unset {
  display: block;
}

.cookies button {
  text-decoration: underline;
  margin-right: 0.75em;
}