/* Grid spacing — matches Webflow .case-divider-small / .image-divider-small / column gutters */

.container.w-container.machbar-page-grid,
.container.w-container.machbar-content-column {
  max-width: var(--machbar-content-max);
}

.machbar-page-grid {
  /* Desktop: matches column-1/2 gutters + image-divider-small (40px total) */
  --machbar-grid-gap: 40px;
  --machbar-grid-gap-tile: var(--machbar-grid-gap);
  --machbar-grid-gap-column: var(--machbar-grid-gap);
  --machbar-grid-gap-row: var(--machbar-grid-gap);
}

@media screen and (max-width: 991px) {
  .machbar-page-grid {
    --machbar-grid-gap: 20px;
  }
}

@media screen and (max-width: 767px) {
  .machbar-page-grid {
    --machbar-grid-gap: 20px;
  }
}

.machbar-page-grid .machbar-grid-rows {
  display: flex;
  flex-direction: column;
  gap: var(--machbar-grid-gap-row);
}

/* Two columns: Webflow float layout (clearfix on .w-row) — not CSS grid (breaks on ::before/::after). */
.machbar-page-grid .machbar-grid-row.w-row {
  margin-left: calc(var(--machbar-grid-gap-column) / -2);
  margin-right: calc(var(--machbar-grid-gap-column) / -2);
}

.machbar-page-grid .machbar-grid-row .w-col {
  float: left;
  width: 50%;
  min-height: 1px;
  box-sizing: border-box;
  padding-left: calc(var(--machbar-grid-gap-column) / 2);
  padding-right: calc(var(--machbar-grid-gap-column) / 2);
}

.machbar-page-grid .machbar-grid-row .column-1,
.machbar-page-grid .machbar-grid-row .column-2 {
  padding-bottom: 0;
}

/* Three columns — same content max as two-column rows */
.machbar-page-grid--three .machbar-grid-row--three.w-row {
  margin-left: calc(var(--machbar-grid-gap-column) / -2);
  margin-right: calc(var(--machbar-grid-gap-column) / -2);
}

.machbar-page-grid--three .machbar-grid-row--three .w-col {
  float: left;
  width: 33.3333%;
  min-height: 1px;
  box-sizing: border-box;
  padding-left: calc(var(--machbar-grid-gap-column) / 2);
  padding-right: calc(var(--machbar-grid-gap-column) / 2);
}

.machbar-page-grid .machbar-grid-column {
  display: flex;
  flex-direction: column;
  gap: var(--machbar-grid-gap-tile);
}

.machbar-page-grid .case-divider-small,
.machbar-page-grid .image-divider-small {
  display: none;
}

@media screen and (max-width: 991px) {
  /* Stack 2/3-col Webflow rows — beat .w-col-6 / .w-col-4 (same specificity as .w-col alone). */
  .machbar-page-grid .machbar-grid-row.w-row,
  .machbar-page-grid--three .machbar-grid-row--three.w-row,
  .machbar-case-body .machbar-grid-row.w-row {
    display: flex;
    flex-direction: column;
    gap: var(--machbar-grid-gap-tile, 20px);
    margin-left: 0;
    margin-right: 0;
  }

  /* Clearfix pseudos become flex items and inflate gap (extra space above/below half rows). */
  .machbar-page-grid .machbar-grid-row.w-row::before,
  .machbar-page-grid .machbar-grid-row.w-row::after,
  .machbar-page-grid--three .machbar-grid-row--three.w-row::before,
  .machbar-page-grid--three .machbar-grid-row--three.w-row::after,
  .machbar-case-body .machbar-grid-row.w-row::before,
  .machbar-case-body .machbar-grid-row.w-row::after {
    content: none;
    display: none;
  }

  .machbar-page-grid .machbar-grid-row .w-col,
  .machbar-page-grid .machbar-grid-row .w-col-6,
  .machbar-page-grid .machbar-grid-row .w-col-4,
  .machbar-page-grid--three .machbar-grid-row--three .w-col,
  .machbar-page-grid--three .machbar-grid-row--three .w-col-4,
  .machbar-case-body .machbar-grid-row .w-col,
  .machbar-case-body .machbar-grid-row .w-col-6,
  .machbar-case-body .machbar-grid-row .w-col-4 {
    float: none;
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
  }

  .machbar-page-grid .machbar-grid-row .column-1,
  .machbar-page-grid .machbar-grid-row .column-2,
  .machbar-page-grid--three .machbar-grid-row--three .column-1-3ergrid,
  .machbar-page-grid--three .machbar-grid-row--three .column-2-3ergrid,
  .machbar-page-grid--three .machbar-grid-row--three .column-3-3ergrid,
  .machbar-case-body .machbar-grid-row .column-1,
  .machbar-case-body .machbar-grid-row .column-2,
  .machbar-case-body .machbar-grid-row .column-1-3ergrid,
  .machbar-case-body .machbar-grid-row .column-2-3ergrid,
  .machbar-case-body .machbar-grid-row .column-3-3ergrid {
    padding-left: 0;
    padding-right: 0;
    padding-bottom: 0;
  }

  .machbar-page-grid .machbar-grid-full,
  .machbar-page-grid .machbar-grid-full .grid-tile-static,
  .machbar-page-grid .machbar-grid-column,
  .machbar-page-grid .case_link_block,
  .machbar-page-grid .caseteaser,
  .machbar-page-grid .video_w_pi_div,
  .machbar-case-body .machbar-grid-column,
  .machbar-case-body .video_w_pi_div {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .machbar-page-grid .machbar-grid-full img,
  .machbar-page-grid .grid-tile-image,
  .machbar-page-grid .grid-tile-image--full,
  .machbar-page-grid .machbar-caseteaser-media,
  .machbar-page-grid .machbar-grid-poster,
  .machbar-page-grid .posterimage_of_video,
  .machbar-case-body .machbar-grid-column img,
  .machbar-case-body .machbar-grid-poster,
  .machbar-case-body .posterimage_of_video {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  /* Case text rows: Webflow keeps .container.horizontal as row flex — force stack. */
  body.machbar-case .machbar-case-body .container.horizontal {
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  body.machbar-case .machbar-case-body .filler-block {
    display: none !important;
  }

  body.machbar-case .machbar-case-body .text-block {
    width: 100%;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
  }
}

/* Full-width rows (images + interactive video) */
.machbar-page-grid .machbar-grid-full {
  width: 100%;
  display: block;
}

.machbar-page-grid .machbar-grid-full .grid-tile-static {
  display: block;
  width: 100%;
}

.machbar-page-grid .machbar-grid-full .grid-tile-image--full {
  width: 100%;
  height: auto;
  display: block;
}

.machbar-page-grid .machbar-grid-full .video_w_pi_div {
  width: 100%;
  position: relative;
}

.machbar-page-grid .machbar-grid-full .video_w_pi_div .machbar-grid-poster {
  width: 100%;
  height: auto;
  display: block;
  position: relative;
  z-index: 0;
}

.machbar-page-grid .machbar-grid-full .video_w_pi_div .machbar-grid-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.machbar-page-grid .machbar-grid-unmute {
  z-index: 99;
  width: 100px;
  height: 100px;
  margin: 0;
  padding: 20px;
  position: absolute;
  right: 0;
  bottom: 0;
  top: auto;
  left: auto;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.machbar-page-grid .machbar-grid-unmute-icon {
  position: absolute;
  inset: 20px;
  width: calc(100% - 40px);
  height: calc(100% - 40px);
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.machbar-page-grid .machbar-grid-unmute-icon[hidden] {
  display: none !important;
}

@media screen and (max-width: 991px) {
  .machbar-page-grid .machbar-grid-unmute {
    width: 72px;
    height: 72px;
    padding: 12px;
  }

  .machbar-page-grid .machbar-grid-unmute-icon {
    inset: 12px;
    width: calc(100% - 24px);
    height: calc(100% - 24px);
  }
}

@media screen and (max-width: 767px) {
  .machbar-page-grid .machbar-grid-unmute {
    width: 56px;
    height: 56px;
    padding: 8px;
  }

  .machbar-page-grid .machbar-grid-unmute-icon {
    inset: 8px;
    width: calc(100% - 16px);
    height: calc(100% - 16px);
  }
}

/* Grid tiles: viewport videos + poster fade */

.machbar-grid-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  opacity: 0;
  transition: none;
  z-index: 2;
  clip-path: inset(0 1px 1px 1px);
}

.machbar-grid-video.is-playing,
.machbar-grid-video[data-video-layer-active='1'] {
  opacity: 1;
}

.video_w_pi_div .machbar-grid-poster {
  position: relative;
  z-index: 1;
  width: 100%;
  height: auto;
  display: block;
  transition: none;
}

.video_w_pi_div:has(.machbar-grid-video.is-playing) .machbar-grid-poster,
.video_w_pi_div:has(.machbar-grid-video[data-video-layer-active='1']) .machbar-grid-poster {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* All grid teaser images fill their column / full row (not only --big / --full). */
.machbar-page-grid .grid-tile-image,
.machbar-page-grid .machbar-caseteaser-media,
.machbar-page-grid .grid-tile-static > img,
.grid-tile--big .grid-tile-image,
.caseteaser.grid-tile--big > img:not(.coming-soon) {
  width: 100%;
  height: auto;
  display: block;
}

.machbar-page-grid .video_w_pi_div {
  width: 100%;
}

.mitarbeiter.grid-tile--big .mitarbeiter-foto {
  width: 100%;
  height: auto;
  min-height: 420px;
  object-fit: cover;
  object-position: center top;
}

.grid-tile-image--full {
  width: 100%;
  height: auto;
  display: block;
}

.grid-tile--interactive {
  position: relative;
}

.machbar-grid-unmute {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 5;
  width: 48px;
  height: 48px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
}

.machbar-grid-unmute-icon {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.machbar-grid-unmute-icon[hidden] {
  display: none !important;
}
