.work-section {
  padding: clamp(72px, 8vw, 112px) 0;
}

/* Tabs */

.work-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 32px;
}

.work-tab {
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid rgba(31, 111, 92, 0.18);
  border-radius: 999px;
  background: transparent;
  color: var(--color-primary);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  cursor: pointer;
  transition:
    color 180ms ease,
    background-color 180ms ease,
    border-color 180ms ease,
    transform 180ms ease;
}

.work-tab:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
}

.work-tab.is-active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #ffffff;
}

.work-tab:focus-visible,
.work-item:focus-visible {
  outline: 3px solid rgba(31, 111, 92, 0.35);
  outline-offset: 4px;
}

/* Galeria */

.work-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: 18px;
  align-items: stretch;
}

/* Cards */

.work-item,
.work-item--wide,
.work-item--large {
  display: flex;
  align-items: center;
  justify-content: center;

  grid-column: auto;
  grid-row: auto;

  width: 100%;
  min-width: 0;
  aspect-ratio: 4 / 3;

  overflow: hidden;
  border-radius: 20px;
  background: #f5f5f5;

  cursor: default;
}

.work-item[hidden],
.work-item--wide[hidden],
.work-item--large[hidden] {
  display: none !important;
}

/* Imagens */

.work-item img {
  display: block;
  width: 100%;
  height: 100%;

  object-fit: contain;
  object-position: center;

  user-select: none;
  -webkit-user-drag: none;
}

/* Embeds */

.work-item iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Instagram */

.work-item.instagram {
  padding: 0;
}

.work-item.instagram iframe,
.work-item.instagram .instagram-media {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
  margin: 0 !important;
  border: 0 !important;
}

/* Vídeos verticais */

.work-item.video {
  aspect-ratio: 9 / 16;
  width: min(100%, 360px);
  max-width: 360px;
  justify-self: center;
  background: #ffffff;
}

.work-item.video iframe {
  width: 100%;
  height: 100%;
}

/* LinkedIn */

.linkedin-video {
  width: 100%;
  height: 100%;
}

.linkedin-video iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Tablet */

@media (max-width: 980px) {
  .work-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-item,
  .work-item--wide,
  .work-item--large {
    grid-column: auto;
    grid-row: auto;
  }

  .work-item.video {
    width: min(100%, 340px);
    max-width: 340px;
  }
}

/* Celular */

@media (max-width: 680px) {
  .work-tabs {
    flex-wrap: nowrap;
    margin-right: -20px;
    padding-right: 20px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
  }

  .work-tabs::-webkit-scrollbar {
    display: none;
  }

  .work-tab {
    flex: 0 0 auto;
  }

  .work-gallery {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .work-item,
  .work-item--wide,
  .work-item--large {
    aspect-ratio: 4 / 3;
  }

  .work-item.video {
    width: min(100%, 320px);
    max-width: 320px;
    aspect-ratio: 9 / 16;
  }
}

/* Acessibilidade */

@media (prefers-reduced-motion: reduce) {
  .work-tab {
    transition: none;
  }

  .work-tab:hover {
    transform: none;
  }
}