/* For:Human Work — statement + dense image grid, tag filter (structure of polar.ltda/archive).
   Only CSS: the card DOM (.case-item > .case-thumb-wrapper > img/iframe) is untouched,
   so the organic Pixi mask and the route transition keep working. */
.work_body {
  /* the page edge lines up with the header's logo: bar inset + the bar's inner padding */
  --fh-work-gutter: calc(var(--fh-bar-inset, 16px) + clamp(16px, 1.8vw, 28px));
  --fh-work-gap: 16px;
  --fh-work-cols: 3;
  --fh-work-radius: 16px;
}

/* one white page: the two Webflow sections had different greys, which read as a rule */
.work_body .work-header-section,
.work_body .work-section { background: var(--surface-canvas, #ffffff) !important; }

/* ---------------------------------------------------------------- statement */
.work_body .work-header-section {
  padding: calc(var(--fh-topbar-height, 72px) + 56px) var(--fh-work-gutter) 0;
}
.work_body .work-header-container {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 40px;
  max-width: none;
}
.work_body .work-title-wrapper { max-width: 1240px; }
.work_body .work-title {
  margin: 0;
  font-size: clamp(32px, 3.4vw, 56px);
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: -0.02em;
}

/* Filters become quiet pills under the statement */
.work_body .work-filters-wrapper { width: 100%; }
.work_body .work-filter-tab-header { display: flex !important; justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
.work_body .work-filter-header {
  padding: 10px 20px;
  border-radius: 999px;
  background: #e6e6e6;
  color: #0a0a0a;
  font-size: 16px;
  line-height: 20px;
}
.work_body .work-filter-header.is-list-active,
.work_body .work-filter-header.active,
.work_body .work-filter-header.w--current { background: #0a0a0a; color: #ffffff; }

/* The Highlights / All / Services / Clientes / Sector tabs are off: the page shows every case
   (src/forhuman-work-filter.ts switches to All) and the tag filter does the filtering. */
.work_body .work-filters-wrapper { display: none !important; }

/* Horizontal/vertical toggle doesn't apply to a grid */
.work_body .div-block-1019 { display: none !important; }

/* ---------------------------------------------------------------- grid */
.work_body .work-section { padding: 40px var(--fh-work-gutter) 72px; }
.work_body .work-cases-wrapper {
  display: block;
  width: auto;
  padding: 0;
  container-type: inline-size;
}

.work_body .case-collection-list {
  display: grid !important;
  grid-template-columns: repeat(var(--fh-work-cols), minmax(0, 1fr)) !important;
  /* one grid row = 1/10 of a column width, so the row spans below are aspect ratios */
  grid-auto-rows: calc((100cqw - var(--fh-work-gap) * (var(--fh-work-cols) - 1)) / var(--fh-work-cols) / 10);
  grid-template-rows: none !important;
  grid-auto-flow: row dense;
  column-gap: var(--fh-work-gap);
  row-gap: 0;
  width: 100%;
}

/* One proportion for every case (the Natura card): 15 rows = 2:3 portrait */
.work_body .case-item { grid-column: auto !important; grid-row: span 15; width: auto !important; min-width: 0; height: auto; margin: 0 !important; padding-bottom: var(--fh-work-gap); }

.work_body .case-wrapper {
  position: relative;
  display: block;
  height: 100%;
}

.work_body .case-collection-list { margin: 0; padding: 0; list-style: none; }
.work_body a { text-decoration: none; }
.work_body .case-thumb-wrapper {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  height: 100%;
  aspect-ratio: auto !important;
  border-radius: var(--fh-work-radius);
}
.work_body .case-thumbnail {
  position: absolute;
  inset: 0;
  display: block;
  transition: opacity 0.4s ease;
  width: 100%;
  height: 100% !important;
  aspect-ratio: auto !important;
  object-fit: cover;
  border-radius: 0;
}
/* Vimeo letterboxes inside its iframe, so overscan the iframe to cover the card (16:9 previews).
   Plain top/left (no transform) so the organic clip-path can offset by offsetLeft/Top. */
.work_body .case-thumb-wrapper { container-type: size; }
.work_body .case-video-thumbnail {
  position: absolute;
  border: 0;
  pointer-events: none;
  width: max(100cqw, 177.78cqh);
  height: max(100cqh, 56.25cqw);
  left: calc(50cqw - max(100cqw, 177.78cqh) / 2);
  top: calc(50cqh - max(100cqh, 56.25cqw) / 2);
  right: auto;
  bottom: auto;
  max-width: none;
  transform: none !important;
}
.work_body .case-arrow-link-wrapper { display: none !important; }

/* No rectangular scrim: it can't follow the organic silhouette and showed as a grey card
   behind the deformed media. The name carries its own shadow instead. */
.work_body .case-scrim { display: none !important; }

/* Info sits on top of the image: tags top-left, name bottom-left */
.work_body .case-info-wrapper-v3 {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-start;
  padding: 16px;
  pointer-events: none;
}
.work_body .case-info-wrapper-v3 > :not(:first-child):not(.case-name) {
  /* filter data fields (read by Finsweet), never shown */
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.work_body .case-tags-collection-list-v3 { display: flex; flex-wrap: wrap; gap: 6px; }
.work_body .case-tag-item { display: block; }
.work_body .case-tag-item:nth-child(n + 3) { display: none; }
.work_body .category-case-divider { display: none; }
/* Card tags: solid white pills, so they read the same on any image (a translucent fill took the
   image's colour: pink on red, beige on orange). On card hover they turn ink, like a picked
   tag in the Filtro stack (forhuman-filter.css). */
.work_body .category-case-v3 {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 13px;
  border-radius: 999px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 10px rgba(0, 0, 0, 0.08);
  color: #0a0a0a;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.005em;
  white-space: nowrap;
  transition: background-color 0.25s ease, color 0.25s ease;
}
.work_body .case-wrapper:hover .category-case-v3,
.work_body .case-wrapper:focus-within .category-case-v3 { background: #0a0a0a; color: #ffffff; }
.work_body .case-name {
  color: #ffffff !important;
  font-size: clamp(22px, 2.2vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 4px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}
.work_body .case-wrapper:hover .case-name,
.work_body .case-wrapper:focus-within .case-name { opacity: 1; transform: none; }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 991px) {
  .work_body { --fh-work-cols: 2; }
}

@media (max-width: 767px) {
  .work_body { --fh-work-cols: 1; --fh-work-gap: 12px; }
  .work_body .work-header-container { gap: 24px; }
  .work_body .case-item,
  .work_body .case-item:nth-child(n) { grid-row: span 12; }
  .work_body .category-case-v3 { height: 26px; padding: 0 11px; font-size: 12px; }
}

/* No hover on touch: keep names visible */
@media (hover: none) {
  .work_body .case-name { opacity: 1; transform: none; }
}

/* the dense grid keeps its columns still (no column parallax) */
.work_body .case-collection-list > .case-item > .case-wrapper { transform: none !important; }

/* Self-hosted loop (card.video): already in the card's ratio, so it simply covers the card. */
.work_body .case-video-native {
  inset: 0;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
