/* @file css/post_card.css
   @versao_deploy 2026-10-13-e-o-inicial-e-o-painel-com-o-postcard
   🃏 13/10 (F3, 2026-10-13-e-o-inicial-e-o-painel-com-o-postcard): a ORIGEM na linha de meta (op.origem — «em Comunidade», o inicial e o painel): o link no tom da marca, sem sublinhado. O feed não passa a origem: o seu cartão não muda. SUCEDE o 2026-10-13-c-o-postcard-na-comunidade.
   🃏 13/10 (F3, 2026-10-13-c-o-postcard-na-comunidade): o SELO ao lado do nome (op.selos — o papel na Comunidade) ganha a sua regra: tinha a classe e nenhum estilo, saía colado ao nome e lia-se como parte dele. O desenho é o do .post-badge (os mesmos tokens, nenhum valor novo). O feed não passa selos: o seu cartão não muda. SUCEDE o 2026-10-06-m-o-feed-e-a-comunidade-tem-o-mesmo-cartao.
   ⚠️ Trocar a data acima ao editar — o painel `</>` lê este marcador do disco, e só varre o começo do arquivo.
   🃏 05/10 (F3, PostCard — pedido do Rafael): o CARTÃO DE POST, UM desenho para o feed e para a Comunidade (/js/post_card.js).
      As regras vieram do base_literario.css SEM mudar nenhum valor, na mesma ordem (70 blocos); usam só os tokens
      de tema, iguais nos dois lados. As 2 regras do emoji que o editor do compositor partilha vieram INTEIRAS (nada se copia).
      Uma regra nova do cartão entra AQUI — nunca numa das páginas. */

.feed-post {
      background: var(--bg-card); border-radius: 12px; padding: 16px;
      margin-bottom: 16px; border: 1px solid var(--border);
      transition: box-shadow 0.4s ease, border-color 0.4s ease;
    }

.feed-post--highlight {
      border-color: var(--primary-light, #818cf8);
      box-shadow: 0 0 0 3px rgba(129,140,248,0.25), 0 4px 24px rgba(99,102,241,0.18);
      animation: post-highlight-pulse 1s ease 2;
    }

@keyframes post-highlight-pulse {
      0%, 100% { box-shadow: 0 0 0 3px rgba(129,140,248,0.25), 0 4px 24px rgba(99,102,241,0.18); }
      50%       { box-shadow: 0 0 0 6px rgba(129,140,248,0.40), 0 8px 32px rgba(99,102,241,0.30); }
    }

.post-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 12px; }

.post-avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }

.post-user-info { flex: 1; min-width: 0; }

.post-user-name { font-weight: 600; font-size: 0.9rem; line-height: 1.3; display: flex; align-items: center; gap: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 100%; }

.post-nome-completo { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; max-width: 160px; display: inline-block; vertical-align: bottom; }

.post-user-meta { font-size: 0.75rem; color: var(--text-dim); display: flex; gap: 4px; align-items: center; flex-wrap: wrap; margin-top: 2px; }

/* Botão seguir / seguindo — ícone apenas */
    .post-btn-seguir {
      flex-shrink: 0; display: flex; align-items: center; justify-content: center;
      width: 32px; height: 32px;
      background: transparent; border: 1px solid var(--primary);
      color: var(--primary-light); font-size: 1rem;
      border-radius: 50%; cursor: pointer;
      transition: all .2s;
    }

.post-btn-seguir:hover { background: rgba(167,139,250,.15); }

.post-btn-seguir.seguindo {
      background: rgba(167,139,250,.12); border-color: transparent;
      color: var(--text-muted);
    }

.post-btn-seguir.seguindo:hover {
      background: rgba(239,68,68,.1); border-color: #ef4444; color: #ef4444;
    }

.post-content { margin-bottom: 12px; font-size: 0.9rem; line-height: 1.5; }

.post-content .book-mention {
      color: var(--primary-light); cursor: pointer;
    }

.post-content .book-mention:hover { text-decoration: underline; }

.post-actions { display: flex; gap: 4px; padding-top: 12px; border-top: 1px solid var(--border); }

.post-action {
      flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px;
      padding: 8px; background: none; border: none; color: var(--text-muted);
      cursor: pointer; border-radius: 8px; font-size: 0.85rem; transition: all 0.2s;
    }

.post-action:hover { background: var(--bg-hover); color: var(--primary-light); }

.post-action.liked { color: #ef4444; }

.post-action i { font-size: 1.1rem; }

.post-action-count { font-size: 0.8rem; font-weight: 600; line-height: 1; }

/* Curtir — ativo = coração vermelho */
    .post-btn-curtir.ativo { color: #ef4444; }

.post-btn-curtir.ativo:hover { color: #dc2626; background: rgba(239,68,68,0.08); }

.post-btn-curtir.ativo i { animation: pulse-heart 0.35s ease; }

@keyframes pulse-heart {
      0%   { transform: scale(1); }
      50%  { transform: scale(1.4); }
      100% { transform: scale(1); }
    }

/* Favoritar — ativo = marcador roxo */
    .post-btn-favoritar.ativo { color: var(--primary-light, #a78bfa); }

.post-btn-favoritar.ativo:hover { color: var(--primary, #7c3aed); background: rgba(167,139,250,0.1); }

/* Compartilhar */
    .post-btn-compartilhar:hover { color: #3b82f6; background: rgba(59,130,246,0.08); }

/* Responder — ativo = azul claro */
    .post-btn-responder.ativo { color: #60a5fa; }

.post-btn-responder:hover { color: #60a5fa; background: rgba(96,165,250,0.08); }

/* -- Área de respostas ------------------------------------------- */
    .post-respostas-area {
      margin-top: 12px;
      padding-top: 12px;
      border-top: 1px solid var(--border);
    }

/* Post content com "ver mais" */
    .post-content.collapsed { max-height: 220px; overflow: hidden; position: relative; }

.post-content.collapsed::after {
      content: ''; position: absolute; bottom: 0; left: 0; right: 0;
      height: 50px; background: linear-gradient(transparent, var(--bg-card));
    }

.post-ver-mais {
      display: inline-block; color: var(--primary-light); cursor: pointer;
      font-size: 0.85rem; font-weight: 500; margin-top: 4px;
    }

.post-ver-mais:hover { text-decoration: underline; }

/* Título principal do post (Cinzel épico) */
    .post-titulo {
      font-family: 'Cinzel', serif;
      font-weight: 700;
      font-size: 1.1rem;
      color: var(--text);
      line-height: 1.3;
      margin-top: calc(1.1rem * 2);
      margin-bottom: calc(1.1rem * 1);
      letter-spacing: 0.02em;
    }

.post-titulo:first-child, .post-header + .post-titulo { margin-top: 0; }

/* Rich text dentro dos posts */
    .post-content h1, .post-content h2, .post-content h3,
    .post-content h4, .post-content h5, .post-content h6 {
      font-family: 'Cinzel', serif;
      line-height: 1.3; color: var(--text);
    }

.post-content h1 { font-size: 1.3rem; margin: calc(1.3rem * 2) 0 calc(1.3rem * 1); }

.post-content h2 { font-size: 1.15rem; margin: calc(1.15rem * 2) 0 calc(1.15rem * 1); }

.post-content h3 { font-size: 1.05rem; margin: calc(1.05rem * 2) 0 calc(1.05rem * 1); }

.post-content h4, .post-content h5, .post-content h6 { font-size: 0.95rem; margin: calc(0.95rem * 2) 0 calc(0.95rem * 1); }

/* Capitular épica no primeiro parágrafo após h1 */
    .post-content h1 + p::first-letter {
      font-family: 'Cinzel', serif;
      font-weight: 700;
      font-size: 3.2em;
      float: left;
      line-height: 0.8;
      margin-right: 8px;
      margin-top: 4px;
      color: var(--primary-light);
    }

.post-content p { margin-bottom: 10px; }

.post-content ul, .post-content ol { margin: 8px 0; padding-left: 24px; }

.post-content li { margin-bottom: 4px; }

.post-content strong, .post-content b { font-weight: 700; color: var(--text); }

.post-content em, .post-content i:not([class]) { font-style: italic; }

.post-content u { text-decoration: underline; }

.post-content blockquote {
      margin: 10px 0; padding: 8px 14px; border-left: 3px solid var(--primary-light);
      background: var(--bg-hover); border-radius: 0 6px 6px 0;
      font-style: italic; color: var(--text-muted);
    }

.post-content a { color: var(--primary-light); text-decoration: underline; }

.post-content img {
      max-width: 100%; height: auto; border-radius: 8px; margin: 8px 0;
    }

.post-content table {
      width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 0.85rem;
    }

.post-content th, .post-content td {
      padding: 6px 10px; border: 1px solid var(--border); text-align: left;
    }

.post-content th { background: var(--bg-hover); font-weight: 600; }

.post-content hr { border: none; border-top: 1px solid var(--border); margin: 12px 0; }

.post-content pre { background: var(--bg-hover); padding: 10px; border-radius: 6px; overflow-x: auto; font-size: 0.85rem; }

.post-content code { background: var(--bg-hover); padding: 2px 5px; border-radius: 3px; font-size: 0.85rem; }

/* Post media — container 9:10 fixo com fundo desfocado */
    .post-media-wrap {
      position: relative;
      aspect-ratio: 9/10;
      border-radius: 10px;
      overflow: hidden;
      margin-bottom: 10px;
      background: #000;
    }

.post-media-wrap--youtube {
      aspect-ratio: 16/9;
    }

.post-media-wrap--youtube iframe {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      border: 0;
      display: block;
    }

/* Camada de fundo: mesma imagem desfocada cobrindo tudo */
    .post-media-bg {
      position: absolute;
      inset: -8%;
      width: 116%;
      height: 116%;
      object-fit: cover;
      filter: blur(22px) brightness(0.6) saturate(1.2);
      display: block;
      pointer-events: none;
      user-select: none;
    }

/* Camada frontal: imagem real, sem corte */
    .post-media-fg {
      position: absolute;
      inset: 0;
      width: 100%;
      height: 100%;
      object-fit: contain;
      display: block;
      filter: drop-shadow(0 0 30px rgba(0,0,0,0.90)) drop-shadow(0 8px 18px rgba(0,0,0,0.70));
    }

/* Post badge tipo notícia/evento/análise */
    .post-badge {
      display: inline-flex; align-items: center; gap: 4px;
      font-size: 0.7rem; padding: 2px 8px; border-radius: 10px;
      background: var(--bg-hover); color: var(--primary-light);
    }

.post-badge.analise { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

/* 🏷️ 13/10 (F3, 2026-10-13-c-o-postcard-na-comunidade): o SELO ao lado do nome (op.selos do PostCard — o papel na Comunidade). Tinha a classe e
   nenhuma regra: saía colado ao nome, com o mesmo peso, e lia-se como parte dele. O desenho é o do .post-badge. */
    .post-selo {
      display: inline-flex; align-items: center; flex-shrink: 0;
      font-size: 0.7rem; font-weight: 600; padding: 2px 8px; border-radius: 10px;
      background: var(--bg-hover); color: var(--primary-light);
    }

/* 🏷️ 13/10 (F3, 2026-10-13-e-o-inicial-e-o-painel-com-o-postcard): a ORIGEM do post na linha de meta (op.origem — «em Comunidade», decisão C do Rafael). */
    .post-origem-link { color: var(--primary); font-weight: 600; text-decoration: none; }
    .post-origem-link:hover { text-decoration: underline; }

/* --- Botão deletar post (apenas para o autor) --- */
    .post-delete-btn {
      background: none; border: none; padding: 5px 8px;
      color: var(--text-dim); cursor: pointer; border-radius: 6px;
      font-size: 0.82rem; transition: all 0.2s;
      display: flex; align-items: center; gap: 4px; margin-left: auto;
    }

.post-delete-btn:hover { color: #ef4444; background: rgba(239,68,68,0.1); }

/* Noto emoji inline no editor e nos posts — grande e com sombra suave */
    .composer-editor .noto-emoji,
    .post-content .noto-emoji {
      width: 2.2rem;
      height: 2.2rem;
      vertical-align: -0.55rem;
      display: inline-block;
      margin: 0 1px;
      filter: drop-shadow(0 2px 5px rgba(0,0,0,.22));
    }

/* Garante que linhas com emoji não cortam verticalmente */
    .composer-editor p:has(.noto-emoji),
    .composer-editor div:has(.noto-emoji),
    .post-content p:has(.noto-emoji) {
      line-height: 2.8rem;
    }

    /* 🔤 D3 (decisão do Rafael, 05/10): o cartão usa a letra do SISTEMA nas duas páginas. O feed declarava 'Inter' no
       body e nunca a carregava (no Windows caía no Arial); a Comunidade já era system-ui. É a ÚNICA mudança visível
       no feed deste lote (Arial → Segoe UI no Windows; no telemóvel nada muda). Os botões herdam (o feed não tinha). */
    .feed-post { font-family: system-ui, -apple-system, 'Segoe UI', sans-serif; }
    .feed-post button { font-family: inherit; }

    /* 🧱 O cartão não herda o que a PÁGINA lhe dá (05/10): os valores que já tinha no feed, agora dele. */
    .feed-post { font-size: 1rem; line-height: normal; -webkit-font-smoothing: auto; }
    :where(.feed-post) img { max-width: none; }
    /* no feed SÓ os botões e os links têm o toque sem realce (base_literario.css, regra geral do touch-action) */
    :where(.feed-post) :is(button, a) { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
    .post-content ul { list-style-type: disc; }
    .post-content ol { list-style-type: decimal; }
    /* o emoji herda a entrelinha do parágrafo (na Comunidade, .noto-emoji { line-height: 1 } fixava-a) */
    .post-content img.noto-emoji { object-fit: contain; line-height: inherit; }
