:root {
  --spacing: 8px;
  --spacing-0: 0px;
  --spacing-1: calc(var(--spacing) * 1);
  --spacing-2: calc(var(--spacing) * 2);
  --spacing-3: calc(var(--spacing) * 3);
  --spacing-4: calc(var(--spacing) * 4);
  --spacing-5: calc(var(--spacing) * 5);
  --spacing-6: calc(var(--spacing) * 6);
  --spacing-7: calc(var(--spacing) * 7);
  --spacing-8: calc(var(--spacing) * 8);
  --duration: 250ms;
  --max-width: 1200px;
  --page-padding: var(--spacing-4);
  --sidebar-width: 14rem;
  --text-color: #555;
  --text-color-hover: #888;
}

* {
  &,
  &::before,
  &::after {
    box-sizing: border-box;
  }
}

body {
  margin: 0;
  height: 100vh;
  font: 1em/160% sans-serif;

  display: flex;
  justify-content: center;
  gap: var(--spacing-4);
  padding: var(--page-padding);
  font-family: 'Quicksand', Tahoma;
  user-select: none;
}

h1 {
  margin-top: 0;
  text-transform: uppercase;
  font-size: 20px;
}

a,
a:visited {
  text-decoration: none;
  color: var(--text-color);
  cursor: pointer;
  transition: all var(--duration) ease-out;
}

a:hover {
  color: var(--text-color-hover);
}

em {
  font-style: normal;
  font-weight: 700;
  color: #000;
}

aside {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  width: var(--sidebar-width);
  padding: var(--page-padding);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-transform: uppercase;
  font-size: 12px;
  background: #fff;
}

aside .about {
  display: flex;
  align-items: center;
  gap: 6px;

  a {
    display: flex;
    align-items: center;
  }

  span {
    color: #999;
  }

  svg {
    width: 18px;

    circle, rect {
      transition: all var(--duration);
    }

    &:hover circle,
    &:hover rect {
      stroke: #888;
    }

    &:hover circle:last-child {
      fill: #888;
    }
  }
}

main {
  flex: 1;
  margin-left: var(--sidebar-width);
}

figure {
  margin: 0;
}

img {
  transition: all var(--duration), opacity 0.5s ease;
  opacity: .25;
}

#projects {
  display: flex;
  flex-direction: column;
/*  gap: var(--spacing-1);*/
}

#projects a {
  width: fit-content;
}

/* Cart */

.cart {
  margin-bottom: var(--spacing-2);
  display: flex;
  color: var(--text-color);
  cursor: pointer;

  svg {
    width: 18px;
  }

  .cart__num {
    min-width: 16px;
    padding: 0 var(--spacing-1);
    font-size: 12px;
  }
}

/* Gallery */

.gallery-caption {
  font-size: 14px;
  padding-bottom: var(--spacing-3);
  line-height: 1.9;
  user-select: text;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-2);
  justify-content: center;
  max-width: var(--max-width);
  padding-bottom: var(--page-padding);
  margin: auto;
}

.gallery-item {
  flex: 1 1 calc(25% - 10px);
  box-sizing: border-box;
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  cursor: pointer;
}

.gallery-item img:hover {
  transform: translateY(-4px);
}

@media (max-width: 1200px) {
  .gallery-item {
    flex: 1 1 calc(33.33% - 10px); 
  }
}

@media (max-width: 768px) {
  .gallery-item {
    flex: 1 1 calc(50% - 10px);
  }
}

@media (max-width: 480px) {
  .gallery-item {
    flex: 1 1 100%;
  }
}

/* Viewer 1 photo */

.viewer {
  display: flex;
  align-items: center;
  flex-direction: column;
}

.viewer img {
  height: calc(100vh - var(--page-padding) * 2);
  width: fit-content;
  max-width: var(--max-width);
}

.viewer .caption {
  padding: 0 2px;
  padding-bottom: var(--spacing-2);
  font-size: 12px;
  color: var(--text-color);
  user-select: text;
}

.caption__buy {
  margin-right: var(--spacing-1);
  cursor: pointer;
  transition: all var(--duration);
  user-select: none;
}

.caption__buy:hover {
  color: #000;
}

.caption__addedInCart {
  margin-right: var(--spacing-1);
  user-select: none;
}

/* Buy Page */

.prints {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-2);
  width: fit-content;

  .print {
    display: flex;
    gap: var(--spacing-2);

    img {
      width: 200px;
    }
  }

  .total {
    display: flex;
    justify-content: space-between;
  }
}
