/* Rico aos Poucos — Publicações widget (aba Publicações) */
.rap-news-root {
  width: 100%;
  padding: 12px 0 64px;
  color: #e2e8f0;
  font-family: inherit;
}
/* Neutraliza o header global do site (css/style.css) que se aplica a
   qualquer <header> da página — sem isso os headers dos widgets pegam
   background, borda e position:sticky herdados. */
.rap-news-root header,
.rap-news-root .rap-news-header {
  background: transparent !important;
  border-bottom: 0 !important;
  position: static !important;
  backdrop-filter: none !important;
  padding: 0;
  margin: 0;
  top: auto;
  z-index: auto;
}
.rap-news-header h2 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 4px;
  color: #f1f5f9;
}
.rap-news-header .muted {
  color: #94a3b8;
  margin: 0 0 18px;
  font-size: 0.95rem;
}
.rap-news-root .muted { color: #94a3b8; font-weight: normal; }

/* Login CTA */
.rap-news-login {
  border: 1px dashed rgba(148,163,184,0.30);
  background: rgba(15,23,42,0.45);
  border-radius: 14px;
  padding: 24px;
  text-align: center;
  margin: 18px 0;
}
.rap-news-login p { margin: 0 0 12px; }
.rap-news-login p strong { color: #f1f5f9; font-size: 1.05rem; }

.rap-news-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: #f1f5f9;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background .15s, border-color .15s;
}
.rap-news-btn:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.30);
}
.rap-news-btn.primary {
  background: linear-gradient(135deg, #10b981, #06b6d4);
  border-color: transparent;
  color: white;
}
.rap-news-btn.primary:hover { filter: brightness(1.10); }
.rap-news-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Compose */
.rap-news-compose {
  border: 1px solid rgba(148,163,184,0.18);
  background: rgba(15,23,42,0.55);
  border-radius: 14px;
  margin: 0 0 24px;
  overflow: hidden;
}
.rap-news-compose summary {
  padding: 14px 18px;
  cursor: pointer;
  font-weight: 600;
  color: #6ee7b7;
  list-style: none;
}
.rap-news-compose summary::-webkit-details-marker { display: none; }
.rap-news-compose summary::before { content: '＋ '; font-weight: 700; }
.rap-news-compose[open] summary::before { content: '× '; }
.rap-news-compose form {
  padding: 4px 18px 18px;
  display: grid;
  gap: 12px;
}
.rap-news-compose label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #cbd5e1;
}
.rap-news-compose input,
.rap-news-compose textarea {
  background: rgba(2,6,23,0.65);
  border: 1px solid rgba(148,163,184,0.30);
  color: #f1f5f9;
  padding: 10px 12px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: normal;
  resize: vertical;
}
.rap-news-compose textarea { min-height: 80px; }
.rap-news-detected {
  font-size: 0.82rem;
  color: #94a3b8;
}
.rap-news-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.rap-news-form-footer .muted { font-size: 0.82rem; margin: 0; max-width: 65%; }

/* Posts */
.rap-news-post {
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(148,163,184,0.14);
  border-radius: 14px;
  padding: 16px 18px 14px;
  margin-bottom: 18px;
}
/* Publicações automáticas da plataforma (artigos do próprio site) */
.rap-news-post-site {
  border-color: rgba(196,181,253,0.30);
  background: linear-gradient(180deg, rgba(99,102,241,0.06) 0%, rgba(15,23,42,0.55) 60%);
}
.rap-news-post-site .rap-news-kind {
  background: rgba(196,181,253,0.20);
  border-color: rgba(196,181,253,0.55);
  color: #ddd6fe;
}
.rap-news-post-site .rap-news-author { color: #ddd6fe; }
.rap-news-post-header {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: #94a3b8;
  margin-bottom: 10px;
}
.rap-news-kind {
  display: inline-block;
  padding: 3px 9px;
  background: rgba(99,102,241,0.18);
  border: 1px solid rgba(99,102,241,0.40);
  border-radius: 999px;
  color: #c4b5fd;
  font-weight: 600;
  font-size: 0.78rem;
}
.rap-news-author { color: #f1f5f9; font-weight: 600; }
.rap-news-delete {
  margin-left: auto;
  background: none;
  border: 0;
  color: #94a3b8;
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.9rem;
}
.rap-news-delete:hover { color: #f87171; background: rgba(248,113,113,0.10); }

.rap-news-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 10px;
  color: #f1f5f9;
}
.rap-news-body {
  margin-top: 12px;
  color: #e2e8f0;
  line-height: 1.55;
  font-size: 0.95rem;
  word-break: break-word;
}
.rap-news-body a { color: #6ee7b7; text-decoration: underline; }

/* YouTube lite */
.rap-news-yt {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000 center/cover no-repeat;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
}
.rap-news-yt::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(0,0,0,0.45));
  pointer-events: none;
}
.rap-news-yt-play {
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 64px; height: 64px;
  border-radius: 50%;
  background: rgba(239,68,68,0.92);
  color: white;
  border: 0;
  font-size: 1.8rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  transition: transform .15s, background .15s;
}
.rap-news-yt:hover .rap-news-yt-play {
  transform: translate(-50%, -50%) scale(1.10);
  background: rgba(220,38,38,1);
}
.rap-news-iframe {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.rap-news-iframe iframe {
  width: 100%; height: 100%; border: 0;
}

/* Link card (article/tiktok/instagram fallback) */
.rap-news-card-link {
  display: flex;
  text-decoration: none;
  color: inherit;
  background: rgba(2,6,23,0.55);
  border: 1px solid rgba(148,163,184,0.18);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color .15s, transform .15s;
}
.rap-news-card-link:hover {
  border-color: rgba(110,231,183,0.45);
  transform: translateY(-1px);
}
.rap-news-card-img {
  flex: 0 0 38%;
  min-height: 130px;
  background: center/cover no-repeat;
  background-color: #1e293b;
}
.rap-news-card-body {
  flex: 1;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}
.rap-news-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: #f1f5f9;
  line-height: 1.30;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rap-news-card-desc {
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.rap-news-card-domain {
  font-size: 0.8rem;
  color: #6ee7b7;
  margin-top: auto;
  font-weight: 600;
}

.rap-news-empty {
  padding: 40px 16px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.95rem;
}
.rap-news-empty p { margin: 0 0 4px; }
.rap-news-loading {
  padding: 40px; text-align: center; color: #94a3b8;
}

/* Toast */
.rap-news-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  border: 1px solid rgba(148,163,184,0.30);
  color: #f1f5f9;
  padding: 12px 20px;
  border-radius: 10px;
  z-index: 9999;
  font-size: 0.92rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.30);
  animation: rapNewsToastIn .25s ease-out;
}
.rap-news-toast.ok { border-color: rgba(34,197,94,0.50); color: #86efac; }
.rap-news-toast.err { border-color: rgba(248,113,113,0.55); color: #fca5a5; }
@keyframes rapNewsToastIn {
  from { opacity: 0; transform: translate(-50%, 10px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (max-width: 640px) {
  .rap-news-root { padding: 8px 12px 80px; }
  .rap-news-card-link { flex-direction: column; }
  .rap-news-card-img { flex-basis: 160px; min-height: 160px; width: 100%; }
}
