/* Notas diplomáticas: a folha timbrada da Chancelaria Imperial, pousada sobre
   pedra clara. Distinta dos tratados (capa escura, mesa verde, moldura grega):
   aqui é correspondência de gabinete, com timbre, referência, destinatários,
   pontos numerados à margem, fórmula de cortesia, firma e carimbo a tinta.
   Cada nota é um documento do CMS com um bloco html-bruto em <main class="nd">.
   Nenhum ornamento é caractere de texto: tudo é desenho (SVG ou CSS). */

.nd { --nd-pedra: #e4ded2; --nd-pedra-2: #d3cbbb; --nd-folha: #fdfbf6; --nd-tinta: #1f2430; --nd-suave: #5f5a52;
  --nd-azul: #14213d; --nd-ouro: #a8863a; --nd-rubro: #7c1d22; --nd-carimbo: #8a2a25; --nd-linha: #d8cfbd;
  background:
    radial-gradient(70% 50% at 50% 0%, rgba(255, 255, 255, .55), transparent 70%),
    linear-gradient(180deg, var(--nd-pedra), var(--nd-pedra-2));
  color: var(--nd-tinta); font-family: "EB Garamond", Georgia, serif; overflow-x: clip;
  padding: 1.6rem 1rem 3.5rem; }
.nd *, .nd *::before, .nd *::after { box-sizing: border-box; }
.nd img { display: block; max-width: 100%; height: auto; }
.nd a { color: inherit; }

.nd-trilha, .nd-volta { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem .9rem; max-width: 820px; margin: 0 auto;
  font-family: "Cinzel", Georgia, serif; font-size: .66rem; letter-spacing: .2em; text-transform: uppercase; color: var(--nd-suave); }
.nd-trilha { margin-bottom: 1.4rem; }
.nd-trilha a, .nd-volta a { text-decoration: none; }
.nd-trilha a:hover, .nd-volta a:hover { color: var(--nd-rubro); }
.nd-trilha span { opacity: .5; }
.nd-volta { margin-top: 2rem; gap: .6rem 2rem; }

/* ── A folha ─────────────────────────────────────────────────────────── */
.nd-folha { position: relative; isolation: isolate; max-width: 820px; margin: 0 auto; background: var(--nd-folha);
  padding: 3.4rem 4.6rem 3rem 5.4rem;
  box-shadow: 0 1px 0 #fff inset, 0 1px 2px rgba(40, 30, 10, .12), 0 12px 28px -10px rgba(40, 30, 10, .28), 0 40px 70px -40px rgba(40, 30, 10, .35); }
/* papel: fibras finas e o brasão em marca-d'água */
.nd-folha::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    url("/img/cartas/brasao-imperial.webp") center 54% / min(46%, 330px) auto no-repeat,
    repeating-linear-gradient(0deg, rgba(120, 100, 60, .018) 0 1px, transparent 1px 3px);
  opacity: .045; filter: grayscale(1); }
.nd-folha::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(120, 100, 60, .025) 0 1px, transparent 1px 3px); }
/* fita de seda da Chancelaria, que amarra a correspondência oficial */
.nd-fita { position: absolute; top: 0; bottom: 0; left: 1.9rem; width: 12px; pointer-events: none;
  background: linear-gradient(90deg, var(--nd-ouro) 0 1.5px, var(--nd-rubro) 1.5px 10.5px, var(--nd-ouro) 10.5px); opacity: .92; }
.nd-fita::after { content: ""; position: absolute; left: 50%; bottom: -14px; width: 12px; height: 14px; transform: translateX(-50%);
  background: linear-gradient(90deg, var(--nd-ouro) 0 1.5px, var(--nd-rubro) 1.5px 10.5px, var(--nd-ouro) 10.5px);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 62%, 0 100%); }

/* ── Timbre ──────────────────────────────────────────────────────────── */
.nd-timbre { text-align: center; padding-bottom: 1.3rem; border-bottom: 3px double var(--nd-linha); }
.nd-timbre img { width: 58px; margin: 0 auto .8rem; }
.nd-timbre__estado { margin: 0; font-family: "Cinzel", Georgia, serif; font-size: .9rem; font-weight: 600; letter-spacing: .26em; text-transform: uppercase; color: var(--nd-azul); }
.nd-timbre__casa { margin: .3rem 0 0; font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 1.12rem; color: var(--nd-suave); }

/* ── Referência e data ───────────────────────────────────────────────── */
.nd-ref { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem 2rem; margin: 1.6rem 0 2.2rem;
  font-size: .95rem; color: var(--nd-suave); }
.nd-ref p { margin: 0; line-height: 1.5; }
.nd-ref__data { text-align: right; }
.nd-tipo { display: inline-block; margin-bottom: .35rem; padding: .18rem .6rem .14rem; border: 1px solid var(--nd-rubro); color: var(--nd-rubro);
  font-family: "Cinzel", Georgia, serif; font-size: .64rem; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; }
.nd-ref strong { font-family: "Cinzel", Georgia, serif; font-size: .78rem; font-weight: 600; letter-spacing: .14em; color: var(--nd-tinta); }

.nd-dest { margin: 0 0 .5rem; font-size: 1.06rem; }
.nd-dest span, .nd-assunto span { font-family: "Cinzel", Georgia, serif; font-size: .66rem; font-weight: 600; letter-spacing: .2em; text-transform: uppercase;
  color: var(--nd-suave); margin-right: .55rem; }
.nd-assunto { margin: 0 0 2rem; padding-bottom: 1.4rem; border-bottom: 1px solid var(--nd-linha); font-size: 1.06rem; font-weight: 600; color: var(--nd-azul); }

/* ── Texto ───────────────────────────────────────────────────────────── */
.nd-texto { font-size: 1.12rem; line-height: 1.78; text-align: justify; hyphens: auto; }
.nd-texto p { margin: 0 0 1rem; }
.nd-abertura { text-indent: 2.2rem; }
.nd-pontos { list-style: none; margin: 1.8rem 0 0; padding: 0; counter-reset: nd; }
.nd-ponto { position: relative; counter-increment: nd; margin: 0 0 1.5rem; }
.nd-ponto::before { content: counter(nd) "."; position: absolute; left: -3.1rem; top: .1rem; width: 2.2rem; text-align: right;
  font-family: "Cinzel", Georgia, serif; font-size: .95rem; font-weight: 600; color: var(--nd-rubro); }
.nd-ponto h3 { margin: 0 0 .35rem; font-family: "Cinzel", Georgia, serif; font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--nd-azul); }

.nd-cortesia { margin: 2.2rem 0 0; font-size: 1.12rem; line-height: 1.78; text-indent: 2.2rem; text-align: justify; hyphens: auto; }

/* ── Firma e carimbo ─────────────────────────────────────────────────── */
.nd-fecho { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 1rem; margin-top: 2.6rem; }
.nd-local { margin: 0; font-style: italic; color: var(--nd-suave); align-self: start; }
.nd-firma { position: relative; text-align: center; min-width: 17rem; }
.nd-firma__manuscrita { min-height: 4.5rem; display: flex; align-items: flex-end; justify-content: center; color: var(--nd-azul);
  border-bottom: 1px solid var(--nd-tinta); }
.nd-firma__nome { margin: .55rem 0 0; font-family: "Cinzel", Georgia, serif; font-size: .86rem; font-weight: 600; letter-spacing: .08em; }
.nd-firma__titulo { margin: .15rem 0 0; font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 1.02rem; color: var(--nd-suave); }
.nd-carimbo { position: absolute; width: 7.4rem; height: 7.4rem; left: -5.4rem; top: -1.2rem; color: var(--nd-carimbo);
  opacity: .72; transform: rotate(-14deg); mix-blend-mode: multiply; pointer-events: none; }
.nd-carimbo text { font-family: "Cinzel", Georgia, serif; font-weight: 700; fill: currentColor; }

.nd-rodape { display: flex; justify-content: space-between; gap: .5rem 1.5rem; flex-wrap: wrap; margin-top: 3rem; padding-top: .9rem;
  border-top: 1px solid var(--nd-linha); font-family: "Cinzel", Georgia, serif; font-size: .6rem; letter-spacing: .18em; text-transform: uppercase; color: var(--nd-suave); }

/* Assinatura sem traço desenhado: o nome na letra da Chancelaria. */
.nd-firma__manuscrita--texto { font-family: "Pinyon Script", "Cormorant Garamond", cursive; font-size: 2.35rem; line-height: 1.1; padding-bottom: .2rem; }

/* Termos: o juramento destacado e duas firmas lado a lado. */
.nd-juramento { margin: 1.6rem 0 1.8rem; padding: 1.2rem 1.6rem; border-left: 3px solid var(--nd-rubro); background: rgba(124, 29, 34, .035);
  font-family: "Cormorant Garamond", Georgia, serif; font-style: italic; font-size: 1.24rem; line-height: 1.6; color: var(--nd-azul); }
.nd-juramento p { margin: 0; }
.nd-firmas { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem 3rem; align-items: start; margin-top: 3.2rem; }
/* as linhas de assinatura na mesma altura, qualquer que seja o tamanho do nome embaixo */
.nd-firmas .nd-firma__manuscrita { height: 5rem; min-height: 0; }
.nd-firmas .nd-firma { min-width: 0; }
.nd-firmas .nd-carimbo { left: -3.8rem; top: -2.4rem; }

@media (max-width: 720px) {
  .nd { padding: 1rem 0 2.5rem; }
  .nd-trilha, .nd-volta { padding: 0 1rem; }
  .nd-folha { padding: 2.4rem 1.4rem 2rem 2.6rem; }
  .nd-fita { left: .8rem; width: 9px; }
  .nd-fita::after { width: 9px; }
  .nd-ref { flex-direction: column; }
  .nd-ref__data { text-align: left; }
  .nd-texto, .nd-cortesia { text-align: left; font-size: 1.06rem; }
  .nd-ponto::before { position: static; display: inline; margin-right: .4rem; }
  .nd-ponto h3 { display: inline; }
  .nd-ponto h3 + p { margin-top: .35rem; }
  .nd-fecho { grid-template-columns: 1fr; }
  .nd-firma { min-width: 0; margin-top: 1rem; }
  .nd-carimbo { left: auto; right: -.6rem; top: -2.6rem; width: 6rem; height: 6rem; }
  .nd-firmas { grid-template-columns: 1fr; gap: 3rem; }
  .nd-firmas .nd-carimbo { left: auto; right: -.6rem; top: -2.6rem; }
  .nd-juramento { padding: 1rem 1.1rem; font-size: 1.14rem; }
}
