/* Instagram Feed Container */
.ig-feed-container {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

/* Tablet */
@media (max-width: 900px) {
  .ig-feed-container {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 600px) {
  .ig-feed-container {
    grid-template-columns: 1fr;
  }
}

/* Card */
.ig-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 8px;
  background-color: #f0f0f0;
  display: block;
}

.ig-card img.ig-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* Hover Overlay */
.ig-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 20px;
  text-align: center;
  box-sizing: border-box;
}

.ig-card:hover .ig-overlay {
  opacity: 1;
}

.ig-card:hover img.ig-image {
  transform: scale(1.05); /* Slight zoom on hover */
}

/* Caption Truncate */
.ig-caption {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 12px;
}

.ig-icon {
  width: 24px;
  height: 24px;
  fill: white;
}

/* Skeleton Loader */
.ig-skeleton {
  background: #e0e0e0;
  background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Carousel UI Elements */
.ig-carousel-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 20px;
  height: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M22 16V4c0-1.1-.9-2-2-2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2zm-11-4l2.03 2.71L16 11l4 5H8l3-4zM2 6v14c0 1.1.9 2 2 2h14v-2H4V6H2z'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  filter: drop-shadow(0 0 2px rgba(0,0,0,0.5));
  z-index: 2;
  pointer-events: none; /* Let clicks pass through */
}

/* Carousel Navigation Arrows */
.ig-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  color: white;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.2s, background 0.2s;
}

.ig-card:hover .ig-arrow {
  opacity: 1;
}

.ig-arrow:hover {
  background: rgba(0,0,0,0.7);
}

.ig-arrow-left {
  left: 8px;
}

.ig-arrow-right {
  right: 8px;
}

/* Carousel Counter */
.ig-counter {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.6);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-family: sans-serif;
  z-index: 10;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.ig-card:hover .ig-counter {
  opacity: 1;
}
