/* Mirmid IG Feed - core styles (lightweight, palette via CSS vars) */
.mig-feed {
  --mig-cols: 3;
  --mig-mcols: 2;
  --mig-bg: #fff;
  --mig-card: #fff;
  --mig-accent: #000;
  --mig-text: #000;
  --mig-muted: #666;
  --mig-border: #e0e0e0;
  background: var(--mig-bg);
  color: var(--mig-text);
  padding: 20px clamp(12px, 2.5vw, 28px);
  font-family: inherit;
  contain: layout;
  border-radius: 6px;
}
.mig-feed .mig-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--mig-cols), 1fr);
  gap: 8px;
}
@media (max-width: 768px) {
  .mig-feed .mig-grid { grid-template-columns: repeat(var(--mig-mcols), 1fr); }
}
.mig-feed .mig-item {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: 4px;
  background: var(--mig-card);
}
.mig-feed .mig-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
}
.mig-feed .mig-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}
.mig-feed .mig-link:hover img {
  transform: scale(1.05);
}
.mig-feed .mig-cap {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
  color: #fff;
  font-size: 12px;
  line-height: 1.3;
  opacity: 0;
  transition: opacity 0.2s;
}
.mig-feed .mig-link:hover .mig-cap { opacity: 1; }
.mig-feed .mig-follow {
  display: inline-block;
  margin-top: 16px;
  padding: 10px 20px;
  background: var(--mig-accent);
  color: var(--mig-bg);
  text-decoration: none;
  border-radius: 4px;
  font-weight: bold;
  font-size: 14px;
  transition: opacity 0.2s;
}
.mig-feed .mig-follow:hover { opacity: 0.85; }
.mig-feed.mig-layout-masonry .mig-grid { grid-auto-rows: minmax(140px, auto); }
.mig-feed.mig-layout-masonry .mig-item:nth-child(3n+1) { aspect-ratio: 1 / 1.2; }

/* Lightbox v2 - truncated caption + prominent IG button */
.mig-lb-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: mig-lb-fade 0.18s ease;
}
@keyframes mig-lb-fade { from { opacity: 0; } to { opacity: 1; } }
.mig-lb-content {
  position: relative;
  max-width: 1100px;
  width: 100%;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.mig-lb-content img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 4px 30px rgba(0,0,0,0.3);
}
.mig-lb-cap {
  color: #fff;
  margin-top: 14px;
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
  max-width: 600px;
  width: 100%;
}
.mig-lb-cap p {
  margin: 0 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.mig-lb-cap-more {
  color: rgba(255,255,255,0.65);
  font-size: 12px;
  font-style: italic;
}
.mig-lb-actions {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.mig-lb-ig-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
  color: #fff !important;
  padding: 12px 22px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
  font-size: 14px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 2px 8px rgba(220,39,67,0.4);
}
.mig-lb-ig-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(220,39,67,0.6);
  color: #fff !important;
}
.mig-lb-ig-btn svg { flex-shrink: 0; }
.mig-lb-close-btn {
  background: rgba(255,255,255,0.15);
  color: #fff;
  padding: 12px 22px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  border: 1px solid rgba(255,255,255,0.2);
  cursor: pointer;
  transition: background 0.15s;
}
.mig-lb-close-btn:hover { background: rgba(255,255,255,0.25); }
.mig-lb-close {
  position: absolute;
  top: -42px;
  right: 0;
  background: transparent;
  color: #fff;
  border: none;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.mig-lb-close:hover { background: rgba(255,255,255,0.15); }
@media (max-width: 600px) {
  .mig-lb-content img { max-height: 50vh; }
  .mig-lb-actions { flex-direction: column; width: 100%; max-width: 320px; }
  .mig-lb-actions a, .mig-lb-actions button { justify-content: center; width: 100%; }
}
