/* =========================================================
   Página de Prévia (Somente Visualização) — Instituto Estrela do Bem
   Minimalista, limpa e responsiva para celular e desktop
   ========================================================= */

:root {
  --bg: #F5F7FA;
  --surface: #FFFFFF;
  --surface-subtle: #FAFAFC;
  --surface-muted: #EFF3F8;
  --ink: #181922;
  --ink-secondary: #3E4554;
  --ink-muted: #647084;
  --border: #E2E7F0;
  --wa-green: #16A34A;
  --wa-soft: #ECFDF5;
  --wa-ink: #166534;
  --radius-lg: 18px;
  --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.05), 0 2px 6px rgba(15, 23, 42, 0.03);
  --shadow-art: 0 16px 38px rgba(15, 23, 42, 0.14);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font-family: inherit; color: inherit; }

.preview-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

/* HEADER */
.pv-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.pv-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pv-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.pv-brand img {
  height: 36px;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}
.pv-brand-text { min-width: 0; }
.pv-brand-text h1 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}
.pv-brand-text p {
  font-size: 12px;
  color: var(--ink-muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Instagram / WhatsApp switch */
.pv-seg {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  border-radius: 10px;
  flex-shrink: 0;
}
.pv-seg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 13px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-muted);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.14s ease;
  white-space: nowrap;
}
.pv-seg-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.pv-seg-btn:hover { color: var(--ink); }
.pv-seg-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}
.pv-seg-btn.is-wa.active {
  background: var(--wa-green);
  color: #FFFFFF;
}

/* MAIN GALLERY */
.pv-main {
  flex: 1;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 28px 20px 52px;
}

.pv-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* CARD — PURE PRESENTATION (ART LEFT + CAPTION RIGHT) */
.pv-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 28px;
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 34px;
  align-items: center;
}

.pv-art-col {
  display: flex;
  justify-content: center;
}

.pv-canvas-box {
  width: 100%;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-art);
  background: #1C222D;
}
.pv-canvas-box.fmt-4-5 {
  aspect-ratio: 4 / 5;
}
.pv-canvas-box.fmt-9-16 {
  width: min(300px, 100%);
  aspect-ratio: 9 / 16;
}
.pv-canvas-box canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.pv-info-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.pv-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.pv-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
}
.pv-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11.4px;
  font-weight: 700;
  background: var(--surface-muted);
  color: var(--ink-secondary);
}
.pv-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pv-badge-reels { background: #DCFCE7; color: #166534; }
.pv-badge-wa { background: var(--wa-soft); color: var(--wa-ink); border: 1px solid #BBF7D0; }

.pv-post-title {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.25;
}

.pv-caption-box {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
}
.pv-caption-text {
  font-size: 15px;
  line-height: 1.72;
  color: var(--ink);
  white-space: pre-line;
  word-break: break-word;
}

/* EMPTY STATE */
.pv-empty {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 56px 24px;
  text-align: center;
  max-width: 460px;
  margin: 40px auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.pv-empty-icon {
  width: 50px;
  height: 50px;
  border-radius: 14px;
  background: var(--surface-muted);
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  justify-content: center;
}
.pv-empty-icon svg { width: 24px; height: 24px; }
.pv-empty h2 {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 18px;
  font-weight: 800;
}
.pv-empty p {
  font-size: 13.5px;
  color: var(--ink-muted);
  line-height: 1.55;
}

/* FOOTER */
.pv-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 16px 20px;
  text-align: center;
  font-size: 12px;
  color: var(--ink-muted);
}

/* MOBILE RESPONSIVE */
@media (max-width: 860px) {
  .pv-header-inner {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 14px;
    gap: 10px;
  }
  .pv-brand img { height: 32px; }
  .pv-brand-text h1 { font-size: 14.5px; }
  .pv-seg { width: 100%; }
  .pv-seg-btn { flex: 1; height: 36px; font-size: 12.5px; }

  .pv-main { padding: 16px 12px 36px; }
  .pv-list { gap: 18px; }

  .pv-card {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 18px;
    border-radius: 16px;
  }
  .pv-canvas-box.fmt-9-16 {
    width: min(290px, 84vw);
  }
  .pv-post-title { font-size: 18.5px; }
  .pv-caption-box { padding: 15px 16px; }
  .pv-caption-text { font-size: 14.4px; line-height: 1.66; }
}
