/* Scattered four-image stage around the Native-to-the-Feed copy. */
.ttshop-native-feed-stage {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  justify-items: center;
  gap: 12px;
}

.ttshop-native-feed-copy {
  display: flex;
  z-index: 2;
}

/* TikTok native-feed title sits above the overlapping photos. */
.ttshop-native-feed:not(.ttshop-native-feed--corners) .ttshop-native-feed-copy {
  z-index: 4;
  grid-column: 1 / -1;
  width: 100%;
  max-width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ttshop-native-feed-copy .ttshop-native-feed-title {
  width: max-content !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  font-size: clamp(28px, 5vw, 92px);
  line-height: 1.08;
  text-align: center !important;
  text-wrap: wrap;
}

.ttshop-native-feed-copy .ttshop-native-feed-title-line {
  display: block;
  width: 100%;
  text-align: center !important;
}

@media (min-width: 768px) {
  .ttshop-native-feed-copy .ttshop-native-feed-title-line {
    white-space: nowrap;
  }
}

.ttshop-native-feed-copy .ttshop-native-feed-desc {
  max-width: min(100%, 860px);
  margin-left: auto;
  margin-right: auto;
  font-size: 14px;
  line-height: 1.5;
  text-align: center !important;
}

.ttshop-native-feed-card {
  position: relative;
  z-index: 3;
  overflow: hidden;
  border-radius: 16px;
  pointer-events: none;
}

.ttshop-native-feed-card--0,
.ttshop-native-feed-card--3 {
  aspect-ratio: 3 / 4;
}

.ttshop-native-feed-card--1,
.ttshop-native-feed-card--2 {
  aspect-ratio: 16 / 10;
}

.ttshop-native-feed-card--0 {
  width: min(100%, 180px);
}

.ttshop-native-feed-card--1 {
  width: min(100%, 220px);
  margin-top: 28px;
}

.ttshop-native-feed-card--2 {
  width: min(100%, 240px);
}

.ttshop-native-feed-card--3 {
  width: min(100%, 190px);
  margin-top: 12px;
}

@media (max-width: 1023px) {
  .ttshop-native-feed-copy {
    margin-top: -36px;
  }
}

@media (min-width: 1024px) {
  .ttshop-native-feed-stage {
    display: block;
    min-height: 620px;
  }

  .ttshop-native-feed-copy {
    position: absolute;
    inset: 0;
    top: 0;
    left: 0;
    width: 100%;
    max-width: none;
    transform: none;
  }

  .ttshop-native-feed-card {
    position: absolute;
    margin-top: 0;
  }

  /* Pull each card into the title so it meets the type. */
  .ttshop-native-feed-card--0 {
    top: 11%;
    left: 0;
    width: clamp(168px, 15vw, 240px);
  }

  .ttshop-native-feed-card--1 {
    top: 6%;
    right: 0;
    width: clamp(220px, 20vw, 320px);
  }

  .ttshop-native-feed-card--2 {
    bottom: 8%;
    left: 1%;
    width: clamp(240px, 22vw, 360px);
  }

  .ttshop-native-feed-card--3 {
    right: 0;
    bottom: 10%;
    width: clamp(176px, 15vw, 248px);
  }
}

@media (min-width: 1440px) {
  .ttshop-native-feed-stage {
    min-height: 680px;
  }
}

/* Match Every Video Ad keeps the original corner placement. */
.ttshop-native-feed--corners .ttshop-native-feed-card {
  z-index: auto;
  pointer-events: auto;
}

@media (max-width: 1023px) {
  .ttshop-native-feed--corners .ttshop-native-feed-stage {
    justify-items: center;
  }

  .ttshop-native-feed--corners .ttshop-native-feed-copy {
    grid-column: 1 / -1;
    order: -1;
    width: 100%;
    margin-top: 0;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .ttshop-native-feed--corners .ttshop-native-feed-copy .ttshop-native-feed-title,
  .ttshop-native-feed--corners .ttshop-native-feed-copy .ttshop-native-feed-title-line {
    width: 100% !important;
    max-width: 100% !important;
    white-space: normal;
    text-align: center !important;
  }

  .ttshop-native-feed--corners .ttshop-native-feed-card {
    width: min(100%, 220px);
    margin-top: 0;
  }
}

@media (min-width: 1024px) {
  .ttshop-native-feed--corners .ttshop-native-feed-stage {
    min-height: 840px;
  }

  .ttshop-native-feed--corners .ttshop-native-feed-card--0 {
    top: 0;
    left: 0;
    width: clamp(168px, 14.5vw, 248px);
  }

  .ttshop-native-feed--corners .ttshop-native-feed-card--1 {
    top: 36px;
    right: 0;
    width: clamp(220px, 22vw, 360px);
  }

  .ttshop-native-feed--corners .ttshop-native-feed-card--2 {
    bottom: 56px;
    left: 4%;
    width: clamp(240px, 24vw, 400px);
  }

  .ttshop-native-feed--corners .ttshop-native-feed-card--3 {
    right: 3%;
    bottom: 0;
    width: clamp(180px, 16vw, 268px);
  }
}

@media (min-width: 1440px) {
  .ttshop-native-feed--corners .ttshop-native-feed-stage {
    min-height: 920px;
  }
}

@media (min-width: 1024px) {
  .ttshop-native-feed--corners .ttshop-native-feed-copy {
    align-items: center;
    justify-content: center;
  }
}

@media (min-width: 1536px) {
  .ttshop-native-feed--corners .ttshop-native-feed-stage {
    width: min(1600px, 100%);
    margin-inline: auto;
  }

  .ttshop-native-feed--corners .ttshop-native-feed-copy {
    align-items: center;
    justify-content: center;
  }
}

