.native-instagram-feed {
  position: relative;
  width: 100%;
  min-height: 360px;
}

.native-instagram-controls {
  display: none;
}

.native-instagram-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
}

.native-instagram-post {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  background: #e4ebef;
}

.native-instagram-post img,
.native-instagram-post video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.native-instagram-icon {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 18px;
  height: 18px;
  border: 2px solid #fff;
  border-radius: 5px;
  filter: drop-shadow(0 1px 3px #0a234066);
}

.native-instagram-icon::before,
.native-instagram-icon::after {
  position: absolute;
  content: '';
}

.native-instagram-icon::before {
  inset: 4px;
  border: 2px solid #fff;
  border-radius: 50%;
}

.native-instagram-icon::after {
  top: 2px;
  right: 2px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #fff;
}

.native-instagram-username {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
  padding: 28px 10px 9px;
  background: linear-gradient(transparent, #06182dcc);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  text-shadow: 0 1px 3px #06182d;
  white-space: nowrap;
}

.native-instagram-post:hover img,
.native-instagram-post:hover video,
.native-instagram-post:focus-visible img,
.native-instagram-post:focus-visible video {
  transform: scale(1.035);
}

.native-instagram-type {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 30px;
  padding: 0 7px;
  border-radius: 999px;
  background: #0a2340cc;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
}

.ugc-hashtag {
  color: #168fba;
  font-weight: 700;
  white-space: nowrap;
}

.ugc-hashtag:hover,
.ugc-hashtag:focus-visible {
  text-decoration: underline;
}

.native-instagram-empty {
  display: flex;
  min-height: 160px;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border: 1px solid #cbd3da;
  background: #fff;
  color: #0a2340;
  font-weight: 700;
  text-align: center;
}

@media (min-width: 761px) {
  [data-instagram-feed="tagged"] .native-instagram-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  [data-instagram-feed="tagged"] .native-instagram-post:nth-child(n + 7) {
    display: none;
  }
}

@media (max-width: 760px) {
  .native-instagram-grid {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    border-radius: 8px;
    scroll-behavior: smooth;
    scroll-snap-type: inline mandatory;
    scrollbar-width: none;
  }

  .native-instagram-grid::-webkit-scrollbar {
    display: none;
  }

  .native-instagram-feed {
    min-height: 300px;
  }

  .native-instagram-post {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .native-instagram-controls {
    position: absolute;
    top: 50%;
    right: 8px;
    left: 8px;
    z-index: 3;
    display: flex;
    justify-content: space-between;
    pointer-events: none;
    transform: translateY(-50%);
  }

  .native-instagram-controls[hidden] {
    display: none;
  }

  .native-instagram-arrow {
    display: grid;
    width: 44px;
    height: 44px;
    padding: 0 0 4px;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #fffde8;
    box-shadow: 0 3px 14px #06182d40;
    color: #0a2340;
    cursor: pointer;
    font: 700 36px/1 Arial, sans-serif;
    pointer-events: auto;
  }

  .native-instagram-arrow:disabled {
    visibility: hidden;
  }

  .native-instagram-post:nth-child(n + 7) {
    display: none;
  }

  .native-instagram-icon {
    top: 7px;
    right: 7px;
    width: 15px;
    height: 15px;
  }

  .native-instagram-username {
    padding: 40px 14px 12px;
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .native-instagram-post img,
  .native-instagram-post video {
    transition: none;
  }
}
