/* ==========================================================================
   O CATÓLICO — sistema de design
   Direção: "vitral noturno" — base escura de catedral à noite, ouro como
   acento precioso, e cores litúrgicas que identificam cada seção.
   Edite as variáveis abaixo para mudar a identidade do site inteiro.
   ========================================================================== */

:root {
  /* --- Cores base --- */
  --ink:        #0C0B10;   /* fundo: noite de catedral (preto quente) */
  --ink-2:      #14121C;   /* superfícies elevadas */
  --ink-3:      #1D1A28;   /* bordas / cartões */
  --bone:       #ECE5D6;   /* texto claro sobre escuro */
  --bone-soft:  #B7AE9C;   /* texto secundário sobre escuro */
  --parchment:  #F7F1E3;   /* superfície de leitura (artigos) */
  --parchment-ink: #1B1813;/* texto sobre pergaminho */

  /* --- Ouro (acento da marca) --- */
  --gold:       #C9A24B;
  --gold-soft:  #E0C079;
  --gold-deep:  #8C6E2E;

  /* --- Cores litúrgicas (uma por seção) --- */
  --maria:      #4E74D6;   /* azul mariano */
  --jesus:      #B6862C;   /* ouro-âmbar (Cristo Rei) */
  --santos:     #B23A36;   /* sanguíneo (mártires) */
  --morte:      #6B4FA0;   /* violeta (luto / penitência) */
  --outros:     #3F8F7A;   /* verde (tempo comum) */

  /* --- Tipografia --- */
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Bricolage Grotesque", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  /* --- Medidas --- */
  --maxw: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --radius: 14px;
  --radius-lg: 26px;

  /* cor de acento "ativa" da página (sobrescrita por data-theme) */
  --accent: var(--gold);
}

/* Temas por seção: troque o atributo data-theme no <body> */
[data-theme="maria"]  { --accent: var(--maria);  }
[data-theme="jesus"]  { --accent: var(--jesus);  }
[data-theme="santos"] { --accent: var(--santos); }
[data-theme="morte"]  { --accent: var(--morte);  }
[data-theme="outros"] { --accent: var(--outros); }

/* ==========================================================================
   Reset e base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  background: var(--ink);
  color: var(--bone);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

::selection { background: var(--gold); color: var(--ink); }

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

.wrap { width: min(100% - var(--gutter)*2, var(--maxw)); margin-inline: auto; }
.narrow { width: min(100% - var(--gutter)*2, 720px); margin-inline: auto; }

.eyebrow {
  font-family: var(--sans);
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: .6em;
}
.eyebrow::before {
  content: "";
  width: 26px; height: 1px;
  background: currentColor;
  opacity: .7;
}

/* ==========================================================================
   Cabeçalho / navegação
   ========================================================================== */
.site-head {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--ink) 86%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ink-3);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 14px 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--bone);
}
.brand .mark { width: 30px; height: 30px; color: var(--gold); flex: none; }
.brand b { color: var(--gold); font-weight: 600; }

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(.8rem, 2vw, 1.6rem);
  list-style: none;
  padding: 0;
}
.nav-links a {
  font-family: var(--sans);
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--bone-soft);
  padding: 6px 2px;
  position: relative;
  transition: color .2s;
}
.nav-links a:hover { color: var(--bone); }
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--gold);
  transition: width .25s ease;
}
.nav-links a:hover::after { width: 100%; }

.nav-cta {
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 600;
  white-space: nowrap;
  color: var(--ink);
  background: var(--gold);
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid var(--gold);
  transition: transform .15s, background .2s;
}
.nav-cta:hover { background: var(--gold-soft); transform: translateY(-1px); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--ink-3);
  border-radius: 10px;
  padding: 8px 10px;
  color: var(--bone);
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    position: fixed;
    inset: 0 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--ink-2);
    border-bottom: 1px solid var(--ink-3);
    padding: 72px var(--gutter) 20px;
    transform: translateY(-100%);
    transition: transform .3s ease, visibility .3s;
    visibility: hidden;
  }
  .nav-links.open { transform: translateY(0); visibility: visible; }
  .nav-links a { padding: 14px 0; border-bottom: 1px solid var(--ink-3); }
  .nav-links a::after { display: none; }
  .nav-links .nav-cta { margin-top: 12px; text-align: center; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero {
  position: relative;
  padding: clamp(48px, 9vw, 110px) 0 clamp(40px, 7vw, 84px);
  overflow: hidden;
}
.hero::before { /* halo de luz de vela atrás da rosácea */
  content: "";
  position: absolute;
  top: -10%; right: -6%;
  width: 60vw; height: 60vw; max-width: 720px; max-height: 720px;
  background: radial-gradient(circle, color-mix(in srgb, var(--gold) 22%, transparent) 0%, transparent 62%);
  pointer-events: none;
  z-index: 0;
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.6rem, 7vw, 5.2rem);
  line-height: 0.98;
  letter-spacing: -0.025em;
  color: var(--bone);
  margin-bottom: 1.1rem;
}
.hero h1 em {
  font-style: italic;
  color: var(--gold);
}
.hero .lead {
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  color: var(--bone-soft);
  max-width: 46ch;
  margin-bottom: 1.8rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--sans);
  font-weight: 600;
  font-size: .92rem;
  padding: 13px 22px;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: transform .15s, background .2s, border-color .2s;
}
.btn-primary { background: var(--gold); color: var(--ink); }
.btn-primary:hover { background: var(--gold-soft); transform: translateY(-2px); }
.btn-ghost { border-color: var(--ink-3); color: var(--bone); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-soft); }

/* Rosácea (elemento-assinatura) */
.rose-wrap {
  display: grid;
  place-items: center;
  position: relative;
}
.rose {
  width: min(100%, 440px);
  color: var(--gold);
  filter: drop-shadow(0 0 28px color-mix(in srgb, var(--gold) 30%, transparent));
}
.rose .spin { transform-origin: 100px 100px; animation: roseSpin 90s linear infinite; }
.rose .breathe { animation: roseBreathe 7s ease-in-out infinite; transform-origin: 100px 100px; }
.rose .draw {
  stroke-dasharray: 1;
  stroke-dashoffset: 1;
  pathLength: 1;
  animation: roseDraw 2.4s ease forwards;
}
@keyframes roseSpin { to { transform: rotate(360deg); } }
@keyframes roseBreathe {
  0%, 100% { opacity: .85; }
  50%      { opacity: 1; }
}
@keyframes roseDraw { to { stroke-dashoffset: 0; } }

/* ==========================================================================
   Seções genéricas
   ========================================================================== */
.section { padding: clamp(48px, 8vw, 96px) 0; }
.section-head { margin-bottom: clamp(28px, 4vw, 44px); max-width: 60ch; }
.section-head h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: .5rem 0 .6rem;
  color: var(--bone);
}
.section-head p { color: var(--bone-soft); font-size: 1.02rem; }

/* Divisória com mini-rosácea */
.rule {
  display: flex; align-items: center; gap: 1rem;
  color: var(--ink-3);
  margin: clamp(40px, 6vw, 72px) 0;
}
.rule::before, .rule::after { content: ""; flex: 1; height: 1px; background: var(--ink-3); }
.rule svg { width: 26px; height: 26px; color: var(--gold); flex: none; opacity: .8; }

/* ==========================================================================
   Portais das seções (home)
   ========================================================================== */
.portals { display: grid; gap: 14px; }
.portal {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: clamp(16px, 3vw, 32px);
  padding: clamp(22px, 3.4vw, 34px) clamp(20px, 3vw, 36px);
  background: var(--ink-2);
  border: 1px solid var(--ink-3);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .25s ease, border-color .25s ease, background .25s;
}
.portal::before { /* faixa de cor litúrgica à esquerda */
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--portal-color, var(--gold));
}
.portal:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--portal-color, var(--gold)) 55%, var(--ink-3));
  background: color-mix(in srgb, var(--portal-color, var(--gold)) 8%, var(--ink-2));
}
.portal .num {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  color: var(--portal-color, var(--gold));
  opacity: .9;
  min-width: 2ch;
}
.portal-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  line-height: 1.1;
  color: var(--bone);
  margin-bottom: .25rem;
  letter-spacing: -0.01em;
}
.portal-desc { color: var(--bone-soft); font-size: .96rem; max-width: 56ch; }
.portal .go {
  width: 46px; height: 46px;
  border-radius: 999px;
  border: 1px solid var(--ink-3);
  display: grid; place-items: center;
  color: var(--portal-color, var(--gold));
  flex: none;
  transition: background .2s, transform .2s;
}
.portal:hover .go { background: var(--portal-color, var(--gold)); color: var(--ink); transform: translateX(2px); }
.portal .go svg { width: 20px; height: 20px; }

@media (max-width: 620px) {
  .portal { grid-template-columns: auto 1fr; }
  .portal .go { display: none; }
}

/* ==========================================================================
   Cartões de artigo (grade de "últimas")
   ========================================================================== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: clamp(16px, 2.4vw, 26px);
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--ink-2);
  border: 1px solid var(--ink-3);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .2s, border-color .2s;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--gold) 40%, var(--ink-3)); }
.card .thumb {
  aspect-ratio: 16 / 10;
  background:
    radial-gradient(120% 120% at 80% 0%, color-mix(in srgb, var(--accent) 30%, transparent), transparent 60%),
    var(--ink-3);
  position: relative;
  display: grid; place-items: center;
}
.card .thumb svg { width: 40px; height: 40px; color: color-mix(in srgb, var(--accent) 70%, var(--bone)); opacity: .55; }
.card .body { padding: 20px 20px 24px; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.card .tag {
  font-family: var(--sans);
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--accent);
}
.card h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.22rem;
  line-height: 1.18;
  color: var(--bone);
  letter-spacing: -0.01em;
}
.card p { color: var(--bone-soft); font-size: .92rem; }
.card .meta {
  margin-top: auto;
  font-size: .76rem;
  color: var(--bone-soft);
  display: flex; gap: .6rem; align-items: center;
  padding-top: .4rem;
}

/* ==========================================================================
   Bloco "manifesto" / chamada
   ========================================================================== */
.manifesto {
  background:
    radial-gradient(90% 120% at 100% 0%, color-mix(in srgb, var(--gold) 14%, transparent), transparent 55%),
    var(--ink-2);
  border: 1px solid var(--ink-3);
  border-radius: var(--radius-lg);
  padding: clamp(32px, 6vw, 72px);
  text-align: center;
}
.manifesto h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.8rem, 4.5vw, 3.2rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: var(--bone);
  margin-bottom: 1rem;
}
.manifesto h2 em { font-style: italic; color: var(--gold); }
.manifesto p { color: var(--bone-soft); max-width: 60ch; margin: 0 auto 1.6rem; font-size: 1.05rem; }

/* ==========================================================================
   Newsletter
   ========================================================================== */
.signup { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; max-width: 460px; margin: 0 auto; }
.signup input {
  flex: 1 1 220px;
  background: var(--ink);
  border: 1px solid var(--ink-3);
  border-radius: 999px;
  padding: 13px 20px;
  color: var(--bone);
  font: inherit;
}
.signup input::placeholder { color: var(--bone-soft); }
.signup input:focus { border-color: var(--gold); outline: none; }

/* ==========================================================================
   Slot de publicidade (AdSense). NÃO disfarce o anúncio como conteúdo.
   ========================================================================== */
.ad-slot {
  margin: clamp(28px, 5vw, 48px) auto;
  max-width: 970px;
  border: 1px dashed var(--ink-3);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--ink-2) 60%, transparent);
  text-align: center;
  padding: 14px;
}
.ad-slot .ad-label {
  font-family: var(--sans);
  font-size: .62rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--bone-soft);
  display: block;
  margin-bottom: 8px;
}
.ad-slot .ad-box {
  min-height: 90px;
  display: grid; place-items: center;
  color: var(--bone-soft);
  font-size: .8rem;
}
/* slot claro para dentro do artigo (sobre pergaminho) */
.article .ad-slot { border-color: #d9cfb6; background: rgba(0,0,0,.02); }
.article .ad-slot .ad-label,
.article .ad-slot .ad-box { color: #8a7f63; }

/* ==========================================================================
   Páginas de leitura (artigos + páginas institucionais) sobre pergaminho
   ========================================================================== */
.page-hero {
  padding: clamp(48px, 8vw, 92px) 0 clamp(28px, 4vw, 44px);
  position: relative;
}
.page-hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.2rem, 5.5vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--bone);
  max-width: 18ch;
}
.page-hero h1 em { font-style: italic; color: var(--accent); }
.page-hero .kicker { color: var(--bone-soft); margin-top: 1rem; max-width: 56ch; }
.byline {
  display: flex; flex-wrap: wrap; gap: .6rem 1.2rem; align-items: center;
  margin-top: 1.4rem;
  font-size: .82rem; color: var(--bone-soft);
  font-family: var(--sans);
}
.byline .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }

.article {
  background: var(--parchment);
  color: var(--parchment-ink);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  margin-top: clamp(24px, 4vw, 40px);
  padding: clamp(34px, 6vw, 80px) 0 clamp(48px, 7vw, 90px);
}
.article .prose { width: min(100% - 40px, 680px); margin-inline: auto; }
.article .prose > * + * { margin-top: 1.15em; }
.article .prose p,
.article .prose li {
  font-family: var(--serif);
  font-size: 1.16rem;
  line-height: 1.75;
  color: #2a2620;
}
.article .prose h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 3.4vw, 2.1rem);
  line-height: 1.15;
  margin-top: 1.8em;
  color: #1b1813;
  letter-spacing: -0.01em;
}
.article .prose h3 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.18rem;
  margin-top: 1.5em;
  color: #1b1813;
}
.article .prose a { color: var(--gold-deep); text-decoration: underline; text-underline-offset: 3px; }
.article .prose blockquote {
  border-left: 3px solid var(--accent);
  padding: .3em 0 .3em 1.2em;
  font-style: italic;
  color: #4a443a;
}
.article .prose ul, .article .prose ol { padding-left: 1.3em; }
/* Capitular iluminada */
.article .prose > p:first-of-type::first-letter {
  font-family: var(--serif);
  font-weight: 600;
  float: left;
  font-size: 4.4rem;
  line-height: .8;
  padding: .05em .12em 0 0;
  color: var(--accent);
}
.article hr {
  border: none; height: 1px; background: #ddd2b8; margin: 2.4em 0;
}

/* páginas institucionais (sobre/contato/legais) usam a mesma base de leitura */
.doc .prose h2 { margin-top: 1.6em; }
.doc .prose h2:first-child { margin-top: 0; }
.doc .prose > p:first-of-type::first-letter { all: unset; } /* sem capitular em páginas legais */

/* ==========================================================================
   Formulário de contato
   ========================================================================== */
.form-grid { display: grid; gap: 16px; max-width: 620px; }
.field { display: grid; gap: 6px; }
.field label { font-family: var(--sans); font-weight: 600; font-size: .85rem; color: #3a352c; }
.field input, .field textarea {
  font: inherit;
  font-family: var(--sans);
  background: #fff;
  border: 1px solid #d8cdb2;
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--parchment-ink);
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); }
.form-submit {
  background: var(--gold); color: var(--ink);
  border: none; border-radius: 999px;
  padding: 13px 26px; font-weight: 700; font-family: var(--sans);
  justify-self: start;
  transition: background .2s, transform .15s;
}
.form-submit:hover { background: var(--gold-deep); color: var(--parchment); transform: translateY(-1px); }

/* ==========================================================================
   Rodapé
   ========================================================================== */
.site-foot {
  background: var(--ink);
  border-top: 1px solid var(--ink-3);
  padding: clamp(44px, 6vw, 72px) 0 28px;
}
.foot-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: clamp(24px, 4vw, 48px);
  margin-bottom: 40px;
}
.foot-brand .brand { font-size: 1.5rem; margin-bottom: .8rem; }
.foot-brand p { color: var(--bone-soft); font-size: .9rem; max-width: 34ch; }
.foot-col h4 {
  font-family: var(--sans);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1rem;
}
.foot-col ul { list-style: none; padding: 0; display: grid; gap: .6rem; }
.foot-col a { color: var(--bone-soft); font-size: .9rem; transition: color .2s; }
.foot-col a:hover { color: var(--bone); }
.foot-bottom {
  border-top: 1px solid var(--ink-3);
  padding-top: 22px;
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  align-items: center; justify-content: space-between;
  font-size: .8rem; color: var(--bone-soft);
}
.foot-bottom a { color: var(--bone-soft); }
.foot-bottom a:hover { color: var(--gold-soft); }

@media (max-width: 760px) {
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}

/* ==========================================================================
   Animações de entrada (scroll reveal)
   ========================================================================== */
/* Conteúdo é visível por padrão. A animação só liga quando há JS (html.js),
   então se o JavaScript falhar nada fica invisível. */
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s ease, transform .7s ease; }
html.js .reveal.in { opacity: 1; transform: none; }

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

/* hero responsivo */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .rose-wrap { order: -1; }
  .rose { width: min(72%, 320px); }
}
