.instagram-feed {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
  gap: 16px;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.instagram-feed__card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  color: #222;
  text-decoration: none;
  background: #fff;
  border: 1px solid #e4e4e4;
  border-radius: 8px;
}

.instagram-feed__head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
}

.instagram-feed__avatar {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  overflow: hidden;
  background: #f3f3f3;
  border-radius: 50%;
}

.instagram-feed__avatar img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.instagram-feed__avatar--fallback {
  color: #d62976;
  font-size: 18px;
  font-weight: 700;
  border: 2px solid #d62976;
}

.instagram-feed__user {
  min-width: 0;
}

.instagram-feed__name {
  display: block;
  overflow: hidden;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.instagram-feed__date {
  display: block;
  margin-top: 2px;
  color: #666;
  font-size: 12px;
  line-height: 1.2;
}

.instagram-feed__media {
  position: relative;
  aspect-ratio: 1.33 / 1;
  overflow: hidden;
  background: #f2f2f2;
}

.instagram-feed__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.instagram-feed__badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 4px 7px;
  color: #fff;
  font-size: 11px;
  line-height: 1;
  background: rgba(0, 0, 0, .72);
  border-radius: 999px;
}

.instagram-feed__caption {
  min-height: 3.4em;
  margin: 0;
  padding: 10px 12px 12px;
  color: #222;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-line;
}

.instagram-feed__empty,
.instagram-feed__error {
  max-width: 760px;
  margin: 0 auto;
  padding: 16px;
  color: #555;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  text-align: center;
  border: 1px solid #e4e4e4;
  border-radius: 8px;
}

.instagram-feed-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 120px;
  color: #555;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
}

.instagram-feed-loading__spinner {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 3px solid #e2e2e2;
  border-top-color: #4f8f2f;
  border-radius: 50%;
  animation: instagram-feed-spin .8s linear infinite;
}

.instagram-feed-loading__text {
  line-height: 1.4;
}

@keyframes instagram-feed-spin {
  to {
    transform: rotate(360deg);
  }
}
