/* === Global layout === */

.container {
  padding: 0 48px;
  max-width: 1800px;
  margin: 0 auto;
}

@media (max-width: 800px) {
  .container {
    padding: 0 20px;
  }
}

/* === Nav === */

.nav {
  padding: 32px 0;
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background-color: var(--light);
  transition: 0.6s;
}

.nav.nav--scrolled {
  padding: 12px 0;
  border-bottom: 1px solid var(--beige);
}

.footer ul,
.nav ul {
  list-style-type: none;
  padding-inline-start: 0px;
  margin-block-end: 0;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  gap: 4px;
}

.footer li,
.nav li {
  display: flex;
  flex-direction: row;
  align-items: center;
}

.footer li::before,
.nav li::before {
  padding-right: 4px;
}

.nav__breadcrumbs li::before {
  content: url("../img/icons/icon-arrow.svg");
  height: 20px;
}

.nav__other li::before {
  content: "·";
}

.footer li:first-child:before,
.nav li:first-child:before {
  content: none;
  padding-right: 0;
}

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

a.nav__logo:focus {
  background-color: var(--beige);
}

a.nav__logo::after {
  content: none;
}

.nav__logo svg {
  height: 1em;
}

.nav__logo svg #logo__mask {
  stroke-dashoffset: 1000;
  stroke-dasharray: 1000;
  animation: strokeOffset 1.5s linear forwards;
}

.nav__logo:hover svg #logo__mask {
  animation: strokeOffsetHover 1.5s linear both;
}

@keyframes strokeOffset {
  100% {
    stroke-dashoffset: 0;
  }
}

@keyframes strokeOffsetHover {
  100% {
    stroke-dashoffset: 0;
  }
}

.footer {
  padding: 12px 0;
  width: 100%;
  position: sticky;
  bottom: 0;
  z-index: 200;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  background-color: var(--light);
  border-top: 1px solid var(--beige);
  display: none;
}

@media (max-width: 800px) {
  .nav .nav__other {
    display: none;
  }

  .footer {
    display: flex;
  }
}

/* === Cards === */

main {
  min-height: calc(100vh - 120px - 1em); /* It keeps the footer down */
}

.card,
.minicard {
  background-color: var(--white);
  border: 1px solid var(--beige);
  display: flex;
  flex-direction: row;
  margin-bottom: 20px;
  overflow: hidden;
}

.card--reverse {
  flex-direction: row-reverse;
}

.card:last-child {
  margin-bottom: 48px;
}

.card {
  height: calc(100vh - 120px - 1em);
}

.minicard {
  height: 50vh;
}

.minicard:hover img {
  transform: scale(1.1);
}

.column--text {
  width: 50%;
  padding: 48px;
  text-wrap: pretty;
  display: flex;
  flex-direction: column;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
  overflow-y: scroll;
}

.column--text::-webkit-scrollbar {
  width: 4px;
}

.column--text::-webkit-scrollbar-track {
  background: transparent;
}

.column--text::-webkit-scrollbar-thumb {
  background: var(--beige);
}

.column--text::-webkit-scrollbar-thumb:hover {
  background: var(--beige);
}

.minicard .column--text {
  justify-content: flex-end;
  gap: 0;
}

.column--img {
  width: 50%;
  height: 100%;
  overflow: hidden;
  background-color: var(--beige);
  display: flex;
  justify-content: center;
  align-items: center;
}

.column--img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: 2s;
}

.column--slides {
  width: 50%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background-color: var(--beige);
}

@media (max-width: 800px) {
  .minicard {
    height: auto;
    flex-direction: column-reverse;
  }

  .card {
    flex-direction: column;
    height: auto;
  }

  .column--text,
  .column--img,
  .column--slides {
    width: 100%;
  }

  .column--img,
  .column--slides {
    height: 50vh;
  }

  .column--text {
    padding: 20px;
    overflow-y: visible;
  }

  .minicard .column--img {
    height: 30vh;
  }
}

/* === Grid === */

.grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
  margin-bottom: 48px;
}

.grid__item {
  aspect-ratio: 1/1;
}

.grid__item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

@media (max-width: 960px) {
  .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 800px) {
  .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 560px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* === Filters === */

.filters {
  position: relative;
  border-top: 1px solid var(--beige);
}

.filters__toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  padding: 12px 0;
  color: var(--brown);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 4px;
}

.filters__toggle:focus {
  outline: none;
  color: var(--blue);
}

.filters__toggle::before {
  height: 20px;
  content: url("../../assets/img/icons/icon-filter.svg");
}

.filters__list {
  display: none;
  width: auto;
  position: absolute;
  z-index: 300;
  padding: 32px 24px 20px 24px;
  background-color: var(--white);
  border: 1px solid var(--beige);
  columns: 2;
  column-gap: 12px;
}

@media (max-width: 600px) {
  .filters__list {
    columns: 1;
  }
}

.filters__list.active {
  display: block;
}

.filters__button {
  display: block;
  margin-bottom: 12px;
  background: none;
  border: none;
  cursor: pointer;
  transition: 0.2s, color 0s;
  color: var(--brown);
  outline: none;
  font-family: inherit;
  font-size: inherit;
}

.filters__button.tag--editorial-design:focus,
.filters__button.tag--editorial-design:hover,
.filters__button--active.tag--editorial-design {
  background-color: var(--brown);
  color: var(--light);
}
.filters__button.tag--graphic-design:focus,
.filters__button.tag--graphic-design:hover,
.filters__button--active.tag--graphic-design {
  background-color: var(--pink);
  color: var(--light);
}
.filters__button.tag--illustration:focus,
.filters__button.tag--illustration:hover,
.filters__button--active.tag--illustration {
  background-color: var(--green);
  color: var(--light);
}
.filters__button.tag--photography:focus,
.filters__button.tag--photography:hover,
.filters__button--active.tag--photography {
  background-color: var(--brown);
  color: var(--light);
}
.filters__button.tag--web-design:focus,
.filters__button.tag--web-design:hover,
.filters__button--active.tag--web-design {
  background-color: var(--tomato);
  color: var(--light);
}
.filters__button.tag--web-development:focus,
.filters__button.tag--web-development:hover,
.filters__button--active.tag--web-development {
  background-color: var(--blue);
  color: var(--light);
}

/* === Error pages === */

.error {
  min-height: calc(100vh - 120px - 1em);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.error h1 {
  font-size: 4em;
  margin-bottom: 0.2em;
}
