/* =====================================================================
   reader.css — coluna de leitura, parágrafos, citação, navegação
   ===================================================================== */

.reader {
  max-width: 720px;
  margin: 0 auto;
  padding: 88px 1.1rem 2rem;   /* topo = altura do header + folga */
}

/* ---------- Cabeçalho do documento ---------- */
.doc-header { text-align: center; margin: 1.5rem 0 2.5rem; }
.doc-eyebrow {
  margin: 0 0 .35rem;
  font-size: .8rem; font-weight: 700; letter-spacing: 1.5px;
  text-transform: uppercase; color: var(--gold);
}
.doc-title {
  margin: 0;
  font-family: var(--reading-font);
  font-size: calc(var(--reading-size) * 1.7);
  line-height: 1.2; color: var(--text);
}

/* ---------- Divisor de seção ---------- */
.section-divider {
  display: flex; align-items: center; justify-content: center;
  margin: 2.5rem 0 1.5rem;
}
.section-divider::before,
.section-divider::after {
  content: ""; height: 1px; flex: 1; background: var(--border);
}
.section-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 2rem; height: 2rem; margin: 0 .75rem 0 1rem;
  border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: .85rem; font-weight: 700; flex: 0 0 auto;
}
.section-name {
  margin-right: 1rem;
  font-family: var(--reading-font);
  font-size: calc(var(--reading-size) * 1.05);
  font-weight: 600; color: var(--text);
  text-align: center;
}

/* ---------- Parágrafo ---------- */
.para {
  position: relative;
  padding: .15rem .25rem .15rem 0;
  scroll-margin-top: 80px;
  border-radius: 8px;
  transition: background .3s ease;
}
.para:hover { background: var(--accent-soft); }
/* Destaque temporário ao chegar via âncora (resultado de busca) */
.para.target-flash { animation: ub-flash 2.4s ease forwards; }
@keyframes ub-flash {
  0%, 18% { background: var(--mark-bg); box-shadow: 0 0 0 6px var(--mark-bg); }
  100%    { background: transparent;    box-shadow: 0 0 0 6px transparent; }
}

.para-ref {
  font-family: Inter, -apple-system, "Segoe UI", Arial, sans-serif;
  font-size: .74rem; font-weight: 600;
  color: var(--muted);
  margin-right: .35rem;
  user-select: none;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.para-text {
  display: inline;
  font-family: var(--reading-font);
  font-size: var(--reading-size);
  line-height: 1.75;
  color: var(--text);
  text-align: justify;
  hyphens: auto;
}

/* ícone de citação */
.cite-btn {
  position: absolute;
  top: .2rem; right: -2.4rem;
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px;
  background: transparent; color: var(--muted);
  cursor: pointer; opacity: 0;
  transition: opacity .15s ease, color .15s ease, background .15s ease;
}
.para:hover .cite-btn { opacity: 1; }
.cite-btn:hover { color: var(--accent); background: var(--accent-soft); }
.cite-btn.copied { color: var(--gold); }

/* destaque de busca (usado depois) */
mark { background: var(--mark-bg); color: inherit; padding: 0 .1em; border-radius: 3px; }

/* ---------- Navegação entre documentos ---------- */
.doc-nav {
  display: flex; justify-content: space-between; gap: 1rem;
  margin-top: 3rem; padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.doc-nav-link {
  display: flex; flex-direction: column; gap: .2rem;
  padding: .75rem 1rem;
  border: 1px solid var(--border); border-radius: 12px;
  max-width: 47%; color: var(--text);
  transition: border-color .15s ease, background .15s ease;
}
.doc-nav-link:hover { border-color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.doc-nav-link.next { text-align: right; margin-left: auto; }
.doc-nav-link .dir { font-size: .75rem; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .5px; }
.doc-nav-link .t { font-family: var(--reading-font); font-size: .98rem; }

/* ---- Mobile: botões no canto inferior-direito do parágrafo ---- */
@media (max-width: 820px) {
  .para {
    padding-bottom: 2.4rem; /* espaço para cite-btn + share-btn na base */
  }
  .para-text { text-align: left; }

  .cite-btn {
    top: auto;
    bottom: .2rem;
    right: 0;
    width: 38px;
    height: 38px;
    opacity: .55;
  }
  /* Garante que o hover de .para não cubra os botões */
  .para:hover .cite-btn { opacity: .8; }
}
