/* ═══════════════════════════════════════════════════════════════════
   Rich Presentation (markdown-rendered) — .g-presentation
   Used on detail-screen and as preview inside edit-screen
   ═══════════════════════════════════════════════════════════════════ */

/* Cover banner — imagem de capa extraída do PDF/arquivo original */
.g-cover-banner {
  width: 100%;
  max-width: 760px;
  margin-bottom: 28px;
  border-radius: var(--bp-r);
  overflow: hidden;
  background: var(--bp-surface, #1a1a2e);
  line-height: 0;        /* remove espaço extra abaixo da img */
}
.g-cover-banner img {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  object-position: top center;
  display: block;
  border-radius: var(--bp-r);
}

.g-presentation {
  max-width: 760px;
  color: var(--bp-ink);
}
.g-presentation-body > *:first-child { margin-top: 0; }
.g-presentation-body > *:last-child { margin-bottom: 0; }

.g-presentation h1 {
  font-family: var(--bp-poster);
  font-style: italic;
  font-weight: 500;
  font-size: 44px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--bp-ink);
  margin: 0 0 24px;
}
.g-presentation h2 {
  font-family: var(--bp-sans);
  font-weight: 700;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.005em;
  color: var(--bp-ink);
  margin: 56px 0 16px;
}
.g-presentation h3 {
  font-family: var(--bp-sans);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.3;
  color: var(--bp-ink);
  margin: 40px 0 12px;
}
.g-presentation p {
  font-family: var(--bp-sans);
  font-size: 16px;
  line-height: 1.75;
  color: var(--bp-ink-dim);
  margin: 0 0 20px;
  text-wrap: pretty;
}
.g-presentation p strong { color: var(--bp-ink); font-weight: 600; }
.g-presentation p em { color: var(--bp-ink); }
.g-presentation a {
  color: var(--bp-teal);
  text-decoration: underline;
  text-decoration-color: rgba(0, 153, 255,0.35);
  text-underline-offset: 3px;
  transition: color 160ms ease;
}
.g-presentation a:hover { text-decoration-color: var(--bp-teal); }

.g-presentation ul, .g-presentation ol {
  padding-left: 22px;
  margin: 0 0 24px;
  color: var(--bp-ink-dim);
  font-size: 16px;
  line-height: 1.7;
}
.g-presentation li { margin-bottom: 8px; }
.g-presentation li::marker { color: var(--bp-teal); }
.g-presentation li strong { color: var(--bp-ink); font-weight: 600; }

.g-presentation blockquote {
  border-left: 2px solid var(--bp-teal);
  padding: 4px 0 4px 22px;
  margin: 28px 0;
  font-style: italic;
  color: var(--bp-ink);
  font-size: 17px;
  line-height: 1.65;
}
.g-presentation blockquote p { color: inherit; font-size: inherit; margin: 0; }

.g-presentation img {
  max-width: 100%;
  height: auto;
  display: block;
  border: 1px solid var(--bp-line);
  margin: 32px 0;
  border-radius: var(--bp-r);
}

.g-presentation code {
  background: var(--bp-bg-elev);
  border: 1px solid var(--bp-line);
  padding: 1px 6px;
  font-family: var(--bp-mono);
  font-size: 13px;
  color: var(--bp-teal);
}
.g-presentation pre {
  background: var(--bp-bg-elev);
  border: 1px solid var(--bp-line);
  padding: 18px 20px;
  margin: 24px 0;
  overflow-x: auto;
}
.g-presentation pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--bp-ink-dim);
  font-size: 13px;
  line-height: 1.6;
}

.g-presentation hr {
  border: 0;
  border-top: 1px solid var(--bp-line);
  margin: 48px 0;
}

.video-embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 32px 0;
  background: #000;
  border: 1px solid var(--bp-line);
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.g-presentation-meta {
  font-family: var(--bp-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--bp-ink-faint);
  margin: 48px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--bp-line);
}

/* ── CTA banner: "monte uma apresentação" (shown only to author) ──────── */
.g-presentation-cta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 22px 24px;
  margin: 0 0 36px;
  border: 1px solid rgba(0, 153, 255,0.35);
  background: linear-gradient(135deg, rgba(0, 153, 255,0.08), rgba(0, 153, 255,0.02));
  border-left: 3px solid var(--bp-teal);
}
.g-presentation-cta-eyebrow {
  display: block;
  font-family: var(--bp-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--bp-teal);
  margin-bottom: 6px;
}
.g-presentation-cta-text p {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--bp-ink-dim);
  max-width: 56ch;
}
.g-presentation-cta .bp-btn { flex-shrink: 0; white-space: nowrap; }
@media (max-width: 720px) {
  .g-presentation-cta { grid-template-columns: 1fr; }
  .g-presentation h1 { font-size: 32px; }
  .g-presentation h2 { font-size: 22px; margin-top: 40px; }
}


/* ═══════════════════════════════════════════════════════════════════
   Edit screen — full-page markdown editor
   ═══════════════════════════════════════════════════════════════════ */

.bp-edit-shell {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--bp-bg);
  display: grid;
  grid-template-rows: 56px 48px 1fr;
  overflow: hidden;
}

/* ── Header 56px ─────────────────────────────────────────────────────── */
.bp-edit-hd {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  border-bottom: 1px solid var(--bp-line);
  background: var(--bp-bg);
  min-width: 0;
}
.bp-edit-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--bp-mono);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bp-ink-mute);
  background: transparent;
  border: 1px solid var(--bp-line);
  padding: 7px 12px;
  cursor: pointer;
  transition: color 160ms ease, border-color 160ms ease;
}
.bp-edit-back:hover { color: var(--bp-ink); border-color: var(--bp-line-strong); }

.bp-edit-hd-center {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
}
.bp-edit-hd-eyebrow {
  font-family: var(--bp-mono);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--bp-ink-faint);
  flex-shrink: 0;
}
.bp-edit-hd-title {
  font-family: var(--bp-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--bp-ink);
  background: transparent;
  border: 0;
  padding: 4px 6px;
  cursor: text;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bp-edit-hd-title:hover { background: var(--bp-bg-elev); }
.bp-edit-hd-title svg { opacity: 0.4; flex-shrink: 0; }
.bp-edit-hd-title:hover svg { opacity: 0.9; color: var(--bp-teal); }

.bp-edit-hd-input {
  font-family: var(--bp-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--bp-ink);
  background: var(--bp-bg-elev);
  border: 1px solid var(--bp-teal);
  padding: 4px 8px;
  width: 100%;
  max-width: 560px;
  outline: none;
}

.bp-edit-hd-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.bp-edit-saved {
  font-family: var(--bp-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--bp-ink-faint);
  opacity: 0;
  transition: opacity 200ms ease, color 200ms ease;
  min-width: 130px;
  text-align: right;
}
.bp-edit-saved:not(:empty) { opacity: 1; }
.bp-edit-saved.on { color: var(--bp-teal); }

.bp-edit-preview-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--bp-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--bp-ink-mute);
  background: transparent;
  border: 1px solid var(--bp-line);
  padding: 7px 12px;
  cursor: pointer;
  transition: all 160ms ease;
}
.bp-edit-preview-toggle:hover { color: var(--bp-ink); }
.bp-edit-preview-toggle.on {
  color: var(--bp-teal);
  border-color: rgba(0, 153, 255,0.4);
  background: rgba(0, 153, 255,0.06);
}
.bp-edit-save { padding: 8px 18px; font-size: 12px; }

/* ── Toolbar 48px ────────────────────────────────────────────────────── */
.bp-edit-tb {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0 14px;
  border-bottom: 1px solid var(--bp-line);
  background: var(--bp-bg);
  overflow-x: auto;
  scrollbar-width: none;
}
.bp-edit-tb::-webkit-scrollbar { display: none; }
.bp-edit-tb-group { display: inline-flex; gap: 2px; }
.bp-edit-tb-sep {
  width: 1px;
  height: 22px;
  background: var(--bp-line);
  margin: 0 6px;
  flex-shrink: 0;
}
.bp-edit-tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--bp-ink-mute);
  cursor: pointer;
  transition: all 140ms ease;
  font-family: var(--bp-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.bp-edit-tb-btn:hover {
  background: var(--bp-bg-elev);
  color: var(--bp-ink);
  border-color: var(--bp-line);
}
.bp-edit-tb-btn:active { background: var(--bp-bg-elev-2); }
.bp-edit-tb-txt { font-family: var(--bp-mono); font-size: 11px; }
.bp-edit-tb-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.1em; }

.bp-edit-tb-mobile { display: none; margin-left: auto; gap: 2px; }
.bp-edit-tab {
  font-family: var(--bp-mono);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--bp-ink-mute);
  background: transparent;
  border: 1px solid var(--bp-line);
  padding: 6px 10px;
  cursor: pointer;
}
.bp-edit-tab.on { color: var(--bp-teal); border-color: var(--bp-teal); background: rgba(0, 153, 255,0.05); }

/* ── Split pane ──────────────────────────────────────────────────────── */
.bp-edit-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  min-height: 0;
}
.bp-edit-split.single { grid-template-columns: 1fr; }
.bp-edit-split.single .bp-edit-pane-editor { max-width: 820px; margin: 0 auto; width: 100%; }

.bp-edit-pane {
  overflow-y: auto;
  min-height: 0;
  position: relative;
}
.bp-edit-pane-editor {
  background: var(--bp-bg-elev);
  border-right: 1px solid var(--bp-line);
}
.bp-edit-split.single .bp-edit-pane-editor { border-right: 0; }

.bp-edit-textarea {
  width: 100%;
  min-height: 100%;
  padding: 40px 48px 80px;
  background: transparent;
  border: 0;
  outline: none;
  resize: none;
  color: var(--bp-ink);
  font-family: var(--bp-mono);
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0;
  tab-size: 2;
}
.bp-edit-textarea::placeholder { color: var(--bp-ink-faint); }

.bp-edit-drop-overlay {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 153, 255,0.08);
  border: 2px dashed var(--bp-teal);
  opacity: 0;
  transition: opacity 160ms ease;
}
.bp-edit-pane-editor.dragover .bp-edit-drop-overlay { opacity: 1; }
.bp-edit-drop-msg {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  font-family: var(--bp-mono);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--bp-teal);
}

.bp-edit-pane-preview { background: var(--bp-bg); }
.bp-edit-preview-inner {
  padding: 40px 48px 40px;
  max-width: 760px;
  margin: 0 auto;
}
.bp-edit-preview-foot {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 48px 48px;
  font-family: var(--bp-mono);
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--bp-ink-faint);
  border-top: 1px solid var(--bp-line);
  padding-top: 16px;
  margin-top: 32px;
}

/* ── Toast on publish ────────────────────────────────────────────────── */
.bp-edit-toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bp-teal);
  color: var(--bp-teal-ink);
  font-family: var(--bp-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 12px 22px;
  z-index: 100;
  animation: bpToastIn 220ms ease;
  box-shadow: 0 18px 40px rgba(0,0,0,0.4);
}
@keyframes bpToastIn {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .bp-edit-tb-mobile { display: inline-flex; }
  .bp-edit-hd { grid-template-columns: auto 1fr auto; gap: 12px; padding: 0 14px; }
  .bp-edit-hd-eyebrow { display: none; }
  .bp-edit-saved { display: none; }
  .bp-edit-split { grid-template-columns: 1fr !important; }
  .bp-edit-split.mobile-editor .bp-edit-pane-preview { display: none; }
  .bp-edit-split.mobile-preview .bp-edit-pane-editor { display: none; }
  .bp-edit-preview-toggle { display: none; }
  .bp-edit-textarea { padding: 24px 24px 60px; }
  .bp-edit-preview-inner { padding: 24px 24px 40px; }
  .bp-edit-preview-foot { padding: 16px 24px 40px; }
}
@media (max-width: 620px) {
  .bp-edit-hd-title { font-size: 13px; }
  .bp-edit-back span { display: none; }
  .bp-edit-back { padding: 7px 9px; }
  .bp-edit-save { padding: 7px 12px; font-size: 11px; }
}
