/**
 * Pulmo — moldura de Instagram nas prévias (components/ig-frame.js).
 * A coluna da mídia do modal vira um "palco" neutro e a mídia fica dentro de um post/story/reel.
 */

/* palco: a coluna da mídia do modal (tinha fundo preto) */
.igf-host {
  background: #eef1f0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
}
html[data-theme="dark"] .igf-host { background: #0a0f11 !important; }

.igf {
  --ig-bg: #ffffff;
  --ig-ink: #0f0f0f;
  --ig-muted: #737373;
  --ig-line: #efefef;
  position: relative;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  max-width: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: var(--ig-bg);
  color: var(--ig-ink);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 24px 50px -28px rgba(0, 0, 0, 0.45);
  text-align: left;
}
html[data-theme="dark"] .igf { --ig-bg: #000000; --ig-ink: #f5f5f5; --ig-muted: #a8a8a8; --ig-line: #262626; box-shadow: 0 0 0 1px #262626, 0 24px 50px -28px rgba(0, 0, 0, 0.9); }
.igf svg { width: 24px; height: 24px; display: block; }
.igf .igf-ic { display: grid; place-items: center; color: var(--ig-ink); line-height: 0; }

/* avatar com o anel do Instagram */
.igf-ava {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 2px;
  border-radius: 50%;
  background: conic-gradient(from 210deg, #feda75, #fa7e1e, #d62976, #962fbf, #4f5bd5, #feda75);
}
.igf-ava-in {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  background: #004343;
  box-shadow: 0 0 0 2px var(--ig-bg);
}
.igf-ava-in b { color: #fff; font-size: 13px; font-weight: 700; }
.igf-ava-in img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* mídia */
.igf-media { position: relative; width: 100%; overflow: hidden; background: #000; }
.igf .igf-el {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  margin: 0 !important;
  aspect-ratio: auto !important;
  border-radius: 0 !important;
}
.igf img.igf-el,
.igf video.igf-el { object-fit: cover !important; }
/* carrossel: os slides continuam do próprio modal (contain, setas ‹ ›) */
.igf--carousel .ecp-preview .ecp-slide { object-fit: cover !important; }
/* setas do carrossel por cima da borda da moldura (metade dentro, metade fora): o carrossel não corta o que passa da borda */
.igf.igf--carousel,
.igf--carousel .igf-media { overflow: visible; }
.igf--carousel .igf-head { border-radius: 14px 14px 0 0; }
.igf-host.igf-host--carousel { padding-left: 28px !important; padding-right: 28px !important; }
.igf--carousel .ecp-preview .ecp-nav {
  z-index: 4 !important;
  width: 34px !important;
  height: 34px !important;
  display: grid !important;
  place-items: center;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 50% !important;
  background: #fff !important;
  color: #111 !important;
  font-size: 20px !important;
  line-height: 1 !important;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08), 0 6px 16px -4px rgba(0, 0, 0, 0.45) !important;
  cursor: pointer;
}
.igf--carousel .ecp-preview .ecp-nav.prev { left: -17px !important; right: auto !important; }
.igf--carousel .ecp-preview .ecp-nav.next { right: -17px !important; left: auto !important; }
.igf-count {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}

/* post do feed */
.igf-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; }
.igf-user { flex: 1; min-width: 0; font-size: 13.5px; }
.igf-user b { font-weight: 600; }
.igf-head .igf-ic svg { width: 20px; height: 20px; }
.igf-bar { position: relative; display: flex; align-items: center; gap: 16px; padding: 10px 12px 6px; }
.igf-bar .igf-ic--end { margin-left: auto; }
.igf-dots { position: absolute; left: 50%; top: 50%; display: flex; gap: 4px; transform: translate(-50%, -50%); }
.igf-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--ig-line); transition: background 0.2s, transform 0.2s; }
html[data-theme="dark"] .igf-dots i { background: #4a4a4a; }
.igf-dots i.is-on { background: #0095f6; transform: scale(1.1); }
.igf-cap {
  padding: 2px 12px 0;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--ig-ink);
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.igf-cap b { font-weight: 600; }
.igf-when { padding: 6px 12px 12px; font-size: 10.5px; letter-spacing: 0.02em; text-transform: uppercase; color: var(--ig-muted); }

/* story e reel: mídia ocupa tudo, interface por cima */
.igf--story,
.igf--reel { background: #000; color: #fff; border-radius: 18px; }
.igf--story .igf-ic,
.igf--reel .igf-ic { color: #fff; }
.igf-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, transparent 18%, transparent 62%, rgba(0, 0, 0, 0.6) 100%);
}
.igf--story .igf-ava-in,
.igf--reel .igf-ava-in { box-shadow: 0 0 0 2px #000; }

.igf-story-top { position: absolute; top: 0; left: 0; right: 0; z-index: 2; padding: 10px 10px 0; pointer-events: none; }
.igf-bars { display: flex; gap: 4px; margin-bottom: 10px; }
.igf-bars i { flex: 1; height: 2.5px; border-radius: 2px; background: rgba(255, 255, 255, 0.95); }
.igf-story-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.igf-story-head .igf-ava { width: 30px; height: 30px; }
.igf-story-head b { font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4); }
.igf-story-head small { opacity: 0.75; font-size: 12px; }
.igf-story-head .igf-ic--end { margin-left: auto; }
.igf-story-head svg { width: 20px; height: 20px; }
.igf-story-bottom { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; display: flex; align-items: center; gap: 14px; padding: 12px 12px 14px; pointer-events: none; }
.igf-reply { flex: 1; height: 40px; display: flex; align-items: center; padding: 0 16px; border: 1px solid rgba(255, 255, 255, 0.65); border-radius: 22px; font-size: 13px; color: rgba(255, 255, 255, 0.9); }

.igf-reel-side {
  position: absolute;
  right: 10px;
  bottom: 74px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  pointer-events: none;
}
.igf-reel-side svg { width: 26px; height: 26px; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4)); }
.igf-reel-disc .igf-ava { width: 28px; height: 28px; padding: 0; border-radius: 7px; background: #fff; }
.igf-reel-disc .igf-ava-in { border-radius: 6px; box-shadow: none; }
.igf-reel-info { position: absolute; left: 12px; right: 56px; bottom: 58px; z-index: 2; display: flex; flex-direction: column; gap: 8px; pointer-events: none; font-size: 13px; text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5); }
.igf-reel-user { display: flex; align-items: center; gap: 8px; }
.igf-reel-user .igf-ava { width: 30px; height: 30px; }
.igf-reel-user b { font-weight: 600; }
.igf-follow { padding: 3px 9px; border: 1px solid rgba(255, 255, 255, 0.85); border-radius: 8px; font-size: 12px; font-weight: 600; }
.igf-reel-info p { margin: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.igf-audio { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; opacity: 0.92; }
.igf-audio svg { width: 13px; height: 13px; }
/* controles nativos do vídeo ficam acessíveis (a interface por cima não captura clique) */
.igf--reel video.igf-el { z-index: 0; }

@media (max-width: 768px) {
  .igf-host { padding: 12px !important; }
}
