/* ==========================================================================
   ONG Vida Preciosa — folha de estilo única
   --------------------------------------------------------------------------
   Tokens de cor extraídos do flyer oficial da campanha (ver docs/DESIGN.md).
   Todo par de cor usado em texto foi medido em contraste WCAG; os valores
   estão anotados ao lado de cada token. Dourado e laranja NÃO passam sobre
   fundo claro e por isso só aparecem sobre painel escuro ou como
   preenchimento de forma.
   ========================================================================== */

:root {
  /* superfícies */
  --bg:            #F9F3EC;  /* creme da marca */
  --surface:       #FFFDF9;  /* card */
  --line:          #E4D9C8;  /* hairline decorativa */
  --line-strong:   #CDBFA8;

  /* texto */
  --ink:           #2E2733;  /* 13.11:1 sobre creme — corpo */
  --ink-soft:      #5A5162;  /*  6.84:1 sobre creme — secundário */

  /* marca */
  --purple:        #3E0A3F;  /* 14.44:1 sobre creme — títulos */
  --purple-panel:  #200927;  /* painel escuro */
  --green:         #01892D;  /*  4.13:1 — traço, ícone, texto grande */
  --green-deep:    #082F0E;  /* 13.39:1 — painel e rodapé */
  --green-cta:     #0B6B26;  /*  6.68:1 com texto branco — botão */
  --red:           #A00200;  /*  7.61:1 sobre creme — números */
  --red-cta:       #8A0200;  /* 10.05:1 com texto branco — botão doar */
  --gold:          #F1BD08;  /* só sobre escuro (10.64:1 no roxo) */
  --orange:        #D27E02;  /* só preenchimento de forma */

  /* forma */
  --radius:        14px;
  --radius-lg:     22px;
  --shadow:        0 1px 2px rgba(46, 39, 51, .06), 0 8px 24px rgba(46, 39, 51, .07);
  --shadow-lift:   0 2px 4px rgba(46, 39, 51, .08), 0 16px 40px rgba(46, 39, 51, .12);
  --measure:       68ch;
  --container:     1140px;

  /* tipografia */
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
}

/* --------------------------------------------------------------- reset ---- */

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--purple); text-decoration-thickness: .08em; text-underline-offset: .18em; }
a:hover { color: var(--red); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--purple);
  line-height: 1.15;
  margin: 0 0 .6em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.1rem, 5.4vw, 3.5rem); letter-spacing: -.015em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.35rem); }
h3 { font-size: clamp(1.18rem, 2vw, 1.42rem); }

p { margin: 0 0 1.1em; max-width: var(--measure); }
ul, ol { max-width: var(--measure); }

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
  border-radius: 4px;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}

.skip-link {
  position: absolute; left: 1rem; top: -3.5rem;
  z-index: 100; padding: .6rem 1rem;
  background: var(--purple); color: #fff;
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none; transition: top .18s ease;
}
.skip-link:focus { top: 0; color: #fff; }

/* ----------------------------------------------------------- estrutura ---- */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.1rem, 4vw, 2.5rem);
}

.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section--tight { padding-block: clamp(2.2rem, 4.5vw, 3.4rem); }
.section + .section { border-top: 1px solid var(--line); }

.section--dark {
  background: var(--green-deep);
  color: #F2EFE7;
  border-top: 0;
}
.section--dark h2, .section--dark h3 { color: #FFFFFF; }
.section--dark a { color: var(--gold); }
.section--dark a:hover { color: #FFFFFF; }

.section--plum { background: var(--purple-panel); color: #F2EFE7; border-top: 0; }
.section--plum h2, .section--plum h3 { color: #FFFFFF; }
.section--plum a { color: var(--gold); }

.eyebrow {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--green);
  margin: 0 0 .8rem;
}
.section--dark .eyebrow, .section--plum .eyebrow { color: var(--gold); }

.lead { font-size: clamp(1.1rem, 2vw, 1.28rem); color: var(--ink-soft); }
.section--dark .lead, .section--plum .lead { color: #DCD6CB; }

/* -------------------------------------------------------------- header ---- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(249, 243, 236, .92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 76px;
}

.brand {
  display: inline-flex; align-items: center; gap: .7rem;
  text-decoration: none; color: var(--purple);
  margin-right: auto;
}
.brand__mark { width: 46px; height: auto; flex: none; }
.brand__text { display: flex; flex-direction: column; line-height: 1.05; }
.brand__name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5rem;
  letter-spacing: .005em;
}
.brand__kicker {
  font-size: .62rem; font-weight: 700;
  letter-spacing: .17em; text-transform: uppercase;
  color: var(--green);
}

.nav-toggle {
  display: none;
  align-items: center; gap: .5rem;
  background: var(--surface); color: var(--purple);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: .55rem .8rem;
  font: inherit; font-size: .92rem; font-weight: 600;
  cursor: pointer;
}

.nav { display: flex; align-items: center; gap: .35rem; }
.nav a {
  display: inline-block;
  padding: .5rem .7rem;
  border-radius: 10px;
  font-size: .95rem; font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}
.nav a:hover { background: rgba(1, 137, 45, .1); color: var(--green-deep); }
.nav a[aria-current="page"] {
  color: var(--green-deep);
  background: rgba(1, 137, 45, .13);
}

/* -------------------------------------------------------------- botões ---- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .5rem;
  padding: .78rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: inherit; font-weight: 700; font-size: .98rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.btn:hover { transform: translateY(-1px); }

.btn--donate { background: var(--red-cta); color: #FFFFFF; box-shadow: var(--shadow); }
.btn--donate:hover { background: #740200; color: #FFFFFF; box-shadow: var(--shadow-lift); }

.btn--primary { background: var(--green-cta); color: #FFFFFF; box-shadow: var(--shadow); }
.btn--primary:hover { background: #08551D; color: #FFFFFF; box-shadow: var(--shadow-lift); }

.btn--ghost {
  background: transparent; color: var(--purple);
  border-color: var(--line-strong);
}
.btn--ghost:hover { background: var(--surface); color: var(--purple); border-color: var(--purple); }

.section--dark .btn--ghost, .section--plum .btn--ghost {
  color: #FFFFFF; border-color: rgba(255, 255, 255, .45);
}
.section--dark .btn--ghost:hover, .section--plum .btn--ghost:hover {
  background: rgba(255, 255, 255, .12); color: #FFFFFF; border-color: #FFFFFF;
}

/* Dentro de painel escuro, `.section--dark a` / `.section--plum a` pinta todo
   link de dourado e tem especificidade maior que `.btn--donate`. Sem estas
   regras o texto do botão sai dourado sobre vermelho, não branco. */
.section--dark .btn--donate, .section--plum .btn--donate,
.section--dark .btn--primary, .section--plum .btn--primary,
.section--dark .btn--donate:hover, .section--plum .btn--donate:hover,
.section--dark .btn--primary:hover, .section--plum .btn--primary:hover {
  color: #FFFFFF;
}

.btn-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.6rem; }

/* ---------------------------------------------------------------- hero ---- */

.hero { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.hero__grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(1.8rem, 4vw, 3.4rem);
  align-items: center;
}
.hero__claim { max-width: 20ch; }
.hero p { max-width: 46ch; }

.hero__figure { margin: 0; }
.hero__figure img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
}
.hero__figure figcaption {
  margin-top: .7rem;
  font-size: .85rem;
  color: var(--ink-soft);
}

.signature {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: .55rem;
  margin: 0 0 1.4rem;
  padding: 0;
  list-style: none;
  font-size: .78rem; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--green);
}
.signature li { display: inline-flex; align-items: center; gap: .55rem; }
.signature li + li::before {
  content: ""; width: 6px; height: 6px;
  border-radius: 50%; background: var(--red);
}

/* --------------------------------------------------------------- cards ---- */

.grid { display: grid; gap: clamp(1rem, 2.2vw, 1.6rem); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: clamp(1.2rem, 2.4vw, 1.8rem);
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: .45rem; }
.card p:last-child, .card ul:last-child { margin-bottom: 0; }
.card__note {
  margin-top: 1rem;
  padding-top: .9rem;
  border-top: 1px solid var(--line);
  font-size: .88rem;
  color: var(--ink-soft);
}

.section--dark .card, .section--plum .card {
  background: rgba(255, 255, 255, .07);
  border-color: rgba(255, 255, 255, .17);
  color: #EFEBE3;
  box-shadow: none;
}
.section--dark .card__note, .section--plum .card__note {
  border-color: rgba(255, 255, 255, .17);
  color: #C9C2B6;
}

.card__icon { width: 40px; height: 40px; margin-bottom: .9rem; }

/* -------------------------------------------------------------- número ---- */

.stat { display: flex; flex-direction: column; gap: .1rem; }
.stat__value {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--red);
}
.section--dark .stat__value, .section--plum .stat__value { color: var(--gold); }
.stat__label { font-size: .9rem; color: var(--ink-soft); }
.section--dark .stat__label, .section--plum .stat__label { color: #C9C2B6; }

/* ------------------------------------------------------------- galeria ---- */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .8rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.gallery li { margin: 0; }
.gallery img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* --------------------------------------------------------------- listas --- */

.checklist { list-style: none; padding: 0; margin: 0 0 1.1em; }
.checklist li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: .55rem;
}
.checklist li::before {
  content: "";
  position: absolute; left: 0; top: .55em;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--green);
}
.section--dark .checklist li::before, .section--plum .checklist li::before { background: var(--gold); }

.facts { margin: 0; }
.facts > div {
  display: grid;
  grid-template-columns: 15rem 1fr;
  gap: .5rem 1.5rem;
  padding: .85rem 0;
  border-bottom: 1px solid var(--line);
}
.facts > div:last-child { border-bottom: 0; }
.facts dt { font-weight: 700; color: var(--purple); }
.facts dd { margin: 0; }
.section--dark .facts > div { border-color: rgba(255, 255, 255, .17); }
.section--dark .facts dt { color: var(--gold); }

/* --------------------------------------------------------------- doação --- */

.pix {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .3rem 1.2rem;
  align-items: baseline;
  margin: 0 0 1.2rem;
  padding: 1.2rem 1.4rem;
  background: var(--surface);
  border: 2px solid var(--green);
  border-radius: var(--radius-lg);
}
.pix dt {
  font-size: .74rem; font-weight: 700;
  letter-spacing: .13em; text-transform: uppercase;
  color: var(--green);
}
.pix dd {
  margin: 0 0 .7rem;
  font-size: clamp(1.05rem, 2.4vw, 1.3rem);
  font-weight: 700;
  color: var(--purple);
  overflow-wrap: anywhere;
}
.pix dd:last-of-type { margin-bottom: 0; }

.callout {
  padding: 1.1rem 1.3rem;
  background: rgba(1, 137, 45, .08);
  border-left: 4px solid var(--green);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 0 0 1.4rem;
}
.callout p:last-child { margin-bottom: 0; }
.callout--warn {
  background: rgba(160, 2, 0, .07);
  border-left-color: var(--red);
}

/* --------------------------------------------------------------- rodapé --- */

.site-footer {
  background: var(--green-deep);
  color: #D7D1C6;
  padding-block: clamp(2.6rem, 5vw, 3.6rem);
  font-size: .94rem;
}
.site-footer h2, .site-footer h3 { color: #FFFFFF; font-size: 1.05rem; }
.site-footer a { color: #F3EFE7; }
.site-footer a:hover { color: var(--gold); }
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: clamp(1.5rem, 3vw, 2.5rem);
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: .45rem; }
.footer-legal {
  margin-top: 2.2rem;
  padding-top: 1.3rem;
  border-top: 1px solid rgba(255, 255, 255, .16);
  font-size: .86rem;
  color: #B9B2A6;
}
.footer-legal p { max-width: none; }

/* ------------------------------------------------------------ 404/erro ---- */

.error-page {
  display: grid;
  place-items: center;
  min-height: 62vh;
  text-align: center;
}
.error-page .container { max-width: 56ch; }
.error-page p { margin-inline: auto; }
.error-page .btn-row { justify-content: center; }

/* --------------------------------------------------------------- motion --- */

/* A revelação só esconde conteúdo quando há JavaScript (classe `.js` posta por
   assets/js-on.js antes do paint). Sem JS a página aparece inteira. */
.js .reveal { opacity: 0; transform: translateY(14px); }
.js .reveal.is-visible {
  opacity: 1; transform: none;
  transition: opacity .5s ease, transform .5s ease;
}

/* ----------------------------------------------------------- responsivo --- */

@media (max-width: 900px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__claim { max-width: none; }
  .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .facts > div { grid-template-columns: 1fr; gap: .15rem; }
}

@media (max-width: 720px) {
  /* O botão de menu só existe com JavaScript: app.js remove o `hidden`. Esta
     regra garante que o atributo continue valendo mesmo com o display de autor
     abaixo — sem ela, estilo de autor vence o `display:none` do navegador e
     apareceria um botão que não faz nada. */
  .nav-toggle { display: inline-flex; }
  .nav-toggle[hidden] { display: none; }

  /* O menu recolhido também depende de JavaScript. Sem a classe `.js` a
     navegação continua no fluxo, empilhada e sempre visível — o site precisa
     funcionar no celular de quem tem JavaScript desligado. */
  .js .nav {
    display: none;
    position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch;
    gap: .15rem;
    padding: .8rem clamp(1.1rem, 4vw, 2.5rem) 1.2rem;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .js .nav.is-open { display: flex; }

  html:not(.js) .header-inner { flex-wrap: wrap; }
  html:not(.js) .nav { flex-wrap: wrap; width: 100%; padding-bottom: .8rem; }

  .nav a { padding: .7rem .8rem; font-size: 1rem; }
  .site-header { position: relative; }
  .header-inner { position: relative; }
}

@media (max-width: 560px) {
  .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .btn { width: 100%; }
  .brand__name { font-size: 1.3rem; }
  /* A chave PIX é longa: em coluna única ela nunca aperta nem estoura. */
  .pix { grid-template-columns: 1fr; }
  .pix dt { margin-top: .5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

@media print {
  .site-header, .nav-toggle, .btn-row, .gallery { display: none; }
  body { background: #fff; color: #000; }
}
