/* ==========================================================================
   Carta do Rio Grande pelo Brasil
   Tema: carimbo em tinta azul sobre papel, como o selo da carta.
   ========================================================================== */

:root {
  --ink: #192B58;        /* azul do selo */
  --ink-2: #24396F;
  --ink-soft: #46557D;   /* texto secundário */
  --paper: #F1F0E4;      /* papel do selo */
  --paper-2: #E8E6D6;
  --sheet: #FAF9F1;      /* folha da carta */
  --line: #CFCDBB;

  --serif-display: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --serif-text: "Newsreader", Georgia, "Times New Roman", serif;

  --gutter: 16px;
  --radius: 14px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@media (min-width: 640px) { :root { --gutter: 28px; } }

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--serif-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  /* grão de papel */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .17 0 0 0 0 .35 0 0 0 .06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; font-family: var(--serif-display); font-weight: 400; line-height: 1.12; text-wrap: balance; }
p { margin: 0 0 1em; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; height: auto; }
button, input { font: inherit; color: inherit; }
::selection { background: rgba(25, 43, 88, .16); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

.wrap { width: 100%; max-width: 1120px; margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 820px; }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.icon { width: 1.1em; height: 1.1em; flex: none; }

.skip-link {
  position: absolute; left: var(--gutter); top: -80px; z-index: 50;
  padding: .6rem 1rem; border-radius: 8px; background: var(--ink); color: var(--paper); text-decoration: none;
}
.skip-link:focus { top: 10px; }

/* ---------- Cabeçalho ---------- */
.masthead { position: relative; }

.masthead-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding-block: 1rem;
}

.brand { display: inline-flex; align-items: center; gap: .75rem; text-decoration: none; }
.brand img { width: 52px; height: 52px; border-radius: 50%; mix-blend-mode: multiply; }
.brand-text { margin: 0; font-weight: 400; font-family: var(--serif-display); font-size: 1.05rem; line-height: 1.15; letter-spacing: .02em; text-transform: uppercase; }
.brand-text em { display: block; font-style: italic; text-transform: none; font-size: .95rem; letter-spacing: 0; color: var(--ink-soft); }

.masthead-date { display: none; margin: 0; font-size: .9rem; font-style: italic; color: var(--ink-soft); }
@media (min-width: 720px) { .masthead-date { display: block; } }

/* Abas — barra fixa, botões como carimbos */
.tabs-bar {
  position: sticky; top: 0; z-index: 20;
  border-block: 1.5px solid var(--ink);
  background: rgba(241, 240, 228, .94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.tabs {
  display: flex; gap: .4rem;
  padding-block: .55rem;
  overflow-x: auto; scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }

.tab {
  flex: 0 0 auto;
  padding: .5rem 1rem;
  border: 1.5px solid transparent;
  border-radius: 999px;
  background: none;
  font-family: var(--serif-display);
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color .25s, color .25s, border-color .25s;
}
.tab:hover { border-color: var(--ink); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }

@media (min-width: 640px) {
  .tabs { justify-content: center; gap: .8rem; }
  .tab { padding: .55rem 1.3rem; font-size: .86rem; }
}
@media (max-width: 639.98px) {
  .refs li { padding-left: 2.3rem; font-size: .98rem; }
}

/* ---------- Painéis ---------- */
.panel { padding-block: clamp(2.5rem, 2rem + 4vw, 5rem) clamp(3.5rem, 3rem + 4vw, 6rem); outline: none; }
.panel[hidden] { display: none; }
.panel.is-entering { animation: rise .55s var(--ease); }

.kicker {
  margin: 0 0 .8rem;
  font-family: var(--serif-display);
  font-size: .78rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink-soft);
}

.panel-head { text-align: center; margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem); }
.panel-title { font-size: clamp(2.2rem, 1.6rem + 3vw, 3.6rem); letter-spacing: .02em; }
.panel-title::after {
  content: ""; display: block; width: 72px; height: 1.5px; margin: 1.2rem auto 0; background: var(--ink);
}
.panel-intro { max-width: 36rem; margin: 1.2rem auto 0; font-size: 1.15rem; color: var(--ink-soft); }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 48px; padding: .7rem 1.4rem;
  border: 1.5px solid var(--ink); border-radius: 999px;
  font-family: var(--serif-display); font-size: .82rem; letter-spacing: .12em; text-transform: uppercase;
  text-decoration: none; cursor: pointer; background: none;
  transition: background-color .25s, color .25s, transform .25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-ink { background: var(--ink); color: var(--paper); }
.btn-ink:hover { background: var(--ink-2); }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn.is-disabled { opacity: .45; cursor: default; transform: none; }

/* ---------- Hero ---------- */
.hero {
  display: grid; gap: 2rem; align-items: center; justify-items: center;
  text-align: center;
  padding-bottom: clamp(2.5rem, 2rem + 3vw, 4.5rem);
}

.hero-seal { width: min(78vw, 400px); }
.hero-seal img {
  mix-blend-mode: multiply;
  /* recorta só o selo (sem o quadrado de papel da imagem) */
  -webkit-mask-image: radial-gradient(circle closest-side at 49.5% 46.5%, #000 84%, transparent 89%);
  mask-image: radial-gradient(circle closest-side at 49.5% 46.5%, #000 84%, transparent 89%);
  transform: scale(1.18);
  animation: stamp .9s var(--ease) both;
}

.hero-title { font-size: clamp(2.3rem, 1.6rem + 3.6vw, 4.2rem); letter-spacing: .02em; text-transform: uppercase; }
.hero-title span { display: block; margin-top: .3rem; font-style: italic; text-transform: none; font-size: .62em; color: var(--ink-soft); }

.hero-lead { max-width: 30rem; margin: 1.4rem auto 2rem; font-size: clamp(1.2rem, 1.1rem + .5vw, 1.45rem); font-style: italic; line-height: 1.45; }

.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; }

@media (min-width: 900px) {
  .hero { grid-template-columns: 1fr 1.1fr; text-align: left; justify-items: start; gap: 3.5rem; }
  .hero-seal { width: 100%; max-width: 440px; justify-self: center; }
  .hero-lead { margin-inline: 0; }
  .hero-actions { justify-content: flex-start; }
}

/* ---------- A carta ---------- */
.letter-sheet {
  position: relative;
  max-width: 780px; margin-inline: auto;
  padding: clamp(1.8rem, 1rem + 4vw, 4.5rem) clamp(1.3rem, .6rem + 4vw, 4.5rem);
  background: var(--sheet);
  border: 1.5px solid var(--ink);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--line), 0 24px 50px -30px rgba(25, 43, 88, .35);
}
/* moldura dupla, como a borda do selo */
.letter-sheet::before {
  content: ""; position: absolute; inset: 8px;
  border: 1px solid rgba(25, 43, 88, .45); border-radius: 2px;
  pointer-events: none;
}

.letter-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 2.2rem; }
.stamp-rule { flex: 1; height: 1.5px; background: var(--ink); }
.letter-title {
  font-size: clamp(1.15rem, 1rem + .9vw, 1.6rem);
  letter-spacing: .14em; text-transform: uppercase; text-align: center;
}

.letter-body p {
  font-size: clamp(1.08rem, 1.02rem + .25vw, 1.22rem);
  line-height: 1.75;
  text-align: justify; hyphens: auto; -webkit-hyphens: auto;
  text-indent: 2em;
  margin-bottom: 1.1em;
}
.letter-body p:first-child { text-indent: 0; }
.letter-body p:first-child::first-letter {
  float: left;
  margin: .08em .12em 0 0;
  font-family: var(--serif-display);
  font-size: 4.1em; line-height: .8;
}

.letter-foot { margin-top: 2.4rem; text-align: center; }
.letter-place { font-size: 1.15rem; font-style: italic; text-align: right; margin-bottom: 2.4rem; }
.letter-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; }
.share-feedback { min-height: 1.5em; margin: .9rem 0 0; font-size: .95rem; font-style: italic; color: var(--ink-soft); }
.letter-refs-note { margin: 1rem 0 0; font-size: .95rem; color: var(--ink-soft); }
.letter-refs-note a { text-underline-offset: 3px; }

/* ---------- Referências ---------- */
.search {
  position: relative; display: flex; align-items: center; gap: .6rem;
  margin-bottom: 1.8rem; padding: 0 1.1rem;
  border: 1.5px solid var(--ink); border-radius: 999px;
  background: var(--sheet);
}
.search .icon { color: var(--ink-soft); }
.search input {
  flex: 1; min-width: 0; min-height: 50px;
  border: 0; background: none; font-size: 1.05rem; outline: none;
}
.search input::placeholder { color: #6F7896; }
.search:focus-within { box-shadow: 0 0 0 3px rgba(25, 43, 88, .2); }
.search-count { font-size: .9rem; color: var(--ink-soft); white-space: nowrap; }

.refs { margin: 0; padding: 0; list-style: none; counter-reset: ref; }
.refs li {
  position: relative;
  padding: 1.05rem 0 1.05rem 3rem;
  border-bottom: 1px solid var(--line);
  font-size: 1.02rem; line-height: 1.55;
  overflow-wrap: anywhere;
  counter-increment: ref;
}
.refs li::before {
  content: counter(ref, decimal-leading-zero);
  position: absolute; left: 0; top: 1.15rem;
  font-family: var(--serif-display); font-size: .85rem; letter-spacing: .05em;
  color: var(--ink-soft);
}
.refs li[hidden] { display: none; }
.refs a { color: var(--ink-2); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.refs a:hover { text-decoration-thickness: 2px; }
.refs-empty { text-align: center; font-style: italic; color: var(--ink-soft); padding: 2rem 0; }

/* ---------- Assinaturas ---------- */
.sign-card {
  display: grid; gap: 1.8rem; justify-items: center; text-align: center;
  padding: clamp(1.8rem, 1.2rem + 3vw, 3.2rem);
  border: 1.5px dashed var(--ink); border-radius: var(--radius);
  background: var(--sheet);
}

.sign-seal { width: 150px; }
.seal-line { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.seal-text { font-family: var(--serif-display); font-size: 12.5px; letter-spacing: .1em; fill: var(--ink); }
.sign-seal .seal-text { transform-origin: 100px 100px; animation: spin 60s linear infinite; }
.seal-icon { color: var(--ink); }

.form-slot { max-width: 34rem; }
.form-slot h3 { font-size: clamp(1.35rem, 1.2rem + .8vw, 1.8rem); margin-bottom: .8rem; }
.form-slot p { color: var(--ink-soft); }
.form-slot .btn { margin-top: .4rem; }
.soon {
  display: inline-block; margin-bottom: 1rem !important;
  padding: .3rem .9rem; border: 1.5px solid var(--ink); border-radius: 4px;
  font-family: var(--serif-display); font-size: .78rem; letter-spacing: .22em; text-transform: uppercase;
  color: var(--ink) !important; transform: rotate(-3deg);
}
.form-embed { width: 100%; }
.form-embed iframe { width: 100%; min-height: 900px; border: 0; border-radius: 8px; background: #fff; }

@media (min-width: 760px) {
  .sign-card { grid-template-columns: auto 1fr; text-align: left; justify-items: start; align-items: center; gap: 2.5rem; }
  .sign-card.has-form { grid-template-columns: 1fr; justify-items: stretch; }
}

.signers { margin-top: 3rem; }
.signers-title { font-size: 1.35rem; text-align: center; margin-bottom: 1.4rem; }
.signers-list {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .8rem;
  margin: 0; padding: 0; list-style: none;
}
.signer-ghost {
  display: grid; gap: .45rem; padding: 1rem 1.1rem;
  border: 1px solid var(--line); border-radius: 10px; background: rgba(250, 249, 241, .6);
}
.signer-ghost span { display: block; height: 10px; border-radius: 6px; background: var(--paper-2); }
.signer-ghost span:first-child { width: 70%; height: 12px; }
.signer-ghost span:last-child { width: 45%; }
.signers-count { text-align: center; font-family: var(--serif-display); font-size: 1.05rem; letter-spacing: .08em; margin: -.6rem 0 1.4rem; }
.signer { display: grid; gap: .15rem; padding: .9rem 1.1rem; border: 1px solid var(--line); border-radius: 10px; background: var(--sheet); }
.signer strong { font-family: var(--serif-display); font-weight: 400; font-size: 1.02rem; }
.signer span { font-size: .92rem; color: var(--ink-soft); }
.panel-intro a, .site-foot p a { text-underline-offset: 3px; }
.signers-note { margin-top: 1.2rem; text-align: center; font-style: italic; color: var(--ink-soft); }

/* ---------- Rodapé ---------- */
.site-foot { border-top: 1.5px solid var(--ink); padding-block: 2.2rem 2.6rem; }
.site-foot-inner { display: grid; justify-items: center; gap: 1rem; text-align: center; }
.site-foot img { width: 64px; height: 64px; border-radius: 50%; mix-blend-mode: multiply; }
.site-foot p { margin: 0; color: var(--ink-soft); }
.site-foot strong { font-family: var(--serif-display); font-weight: 400; color: var(--ink); letter-spacing: .04em; }
.foot-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.4rem; }
.foot-nav a { font-family: var(--serif-display); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; text-underline-offset: 4px; }

@media (min-width: 760px) {
  .site-foot-inner { grid-template-columns: auto 1fr auto; text-align: left; justify-items: start; }
}

/* ---------- Animações ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes stamp { 0% { opacity: 0; transform: scale(1.32) rotate(-6deg); } 60% { opacity: 1; transform: scale(1.15) rotate(1deg); } 100% { transform: scale(1.18); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Impressão: só a carta ---------- */
@media print {
  body { background: #fff; }
  .masthead, .hero, .letter-actions, .share-feedback, .site-foot, .skip-link, .panel:not(#carta) { display: none !important; }
  .panel { padding: 0; }
  .letter-sheet { border: 0; box-shadow: none; padding: 0; background: none; }
  .letter-sheet::before { display: none; }
  .letter-body p { font-size: 11.5pt; }
}

/* Formulário embutido ocupa o cartão inteiro */
.sign-card.has-form .form-slot { max-width: none; width: 100%; }
.sign-card.has-form .form-slot h3 { text-align: center; }


/* ---------- Contato ---------- */
.contact-cards { display: grid; gap: 1rem; }
@media (min-width: 640px) { .contact-cards { grid-template-columns: 1fr 1fr; } }
.contact-card {
  display: grid; justify-items: center; gap: .5rem; text-align: center;
  padding: 2.2rem 1.4rem;
  border: 1.5px solid var(--ink); border-radius: var(--radius);
  background: var(--sheet); text-decoration: none;
  transition: background-color .25s, color .25s, transform .3s var(--ease);
}
.contact-card:hover { background: var(--ink); color: var(--paper); transform: translateY(-3px); }
.contact-icon {
  display: grid; place-items: center; width: 64px; height: 64px; margin-bottom: .4rem;
  border: 1.5px solid currentColor; border-radius: 50%;
  box-shadow: 0 0 0 4px var(--sheet), 0 0 0 5.5px currentColor;
}
.contact-card:hover .contact-icon { box-shadow: 0 0 0 4px var(--ink), 0 0 0 5.5px currentColor; }
.contact-icon .icon { width: 26px; height: 26px; }
.contact-label { font-family: var(--serif-display); font-size: .78rem; letter-spacing: .22em; text-transform: uppercase; opacity: .8; }
.contact-value { font-family: var(--serif-display); font-size: clamp(1.05rem, .95rem + .5vw, 1.3rem); overflow-wrap: anywhere; }

.signers--solo { margin-top: 0; }
