:root {
  --azul: #00a1ca;
  --amarelo: #ffd000;
  --marinho: #0e2b57;
  --ink: #0b1220;
  --cinza: #6b7280;
  --radius: 14px;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ===================== Reset ===================== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body {
  margin: 0; padding: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
  color: #1a1a2e; line-height: 1.6; background: #fafbfc;
}

/* ===================== Links ===================== */
a { color: var(--azul); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--marinho); }

.container { width: min(1100px, 92%); margin: auto; }

/* ===================== Font Scale ===================== */
.fs-090 { font-size: 90%; } .fs-100 { font-size: 100%; }
.fs-110 { font-size: 110%; } .fs-120 { font-size: 120%; }

/* ================= Header ================ */
/* O topo é parte da página, não uma barra presa: desce a página e ele sai de
   cena junto com o resto; volta ao início e ele está lá. Nada de reaparecer no
   meio da leitura — foi decisão do dono do site, para a tela ficar limpa.
   O z-index é para o menu do celular, que abre por cima do conteúdo. */
.header { position: relative; z-index: 1000; }

/* Barra utilitária */
.utilbar { background: #111; color: #e5e7eb; font-size: 0.88rem; }
.utilwrap { display: flex; justify-content: space-between; align-items: center; padding: 5px 0; }
.fs-btn {
  border: 1px solid #333; background: transparent; color: #d1d5db;
  padding: 2px 8px; border-radius: 6px; cursor: pointer; margin-right: 4px;
  transition: background var(--transition);
}
.fs-btn:hover { background: #1f2937; }
.btn-ghost {
  display: inline-block; border: 1px solid #333; color: #d1d5db;
  padding: 3px 10px; border-radius: 8px; text-decoration: none; margin-right: 6px;
  transition: background var(--transition);
}
.btn-ghost:hover { background: #1f2937; color: #fff; }

/* Busca utilbar desativada */
.busca-min { display: none !important; }

/* Faixa azul com logo */
.brandbar {
  background: linear-gradient(180deg, var(--marinho), #173a73);
  border-bottom: 4px solid var(--amarelo);
  position: relative; overflow: hidden;
}
.brandbar::before {
  content: ''; position: absolute; inset: 0;
  background: url('../img/barco_topo.png') center bottom / auto 100% no-repeat;
  mix-blend-mode: screen; opacity: .5; pointer-events: none;
}
.brandwrap { display: flex; justify-content: center; align-items: center; padding: 20px 0; }
.brandlink { display: flex; align-items: center; gap: 14px; color: #fff; text-decoration: none; }
.brandlogo {
  max-height: 170px; height: auto; width: auto; object-fit: contain;
  image-rendering: -webkit-optimize-contrast; image-rendering: crisp-edges;
  filter: drop-shadow(0 3px 8px rgba(0,0,0,0.3));
}

/* Barra de navegação */
.navbar { background: #fff; border-bottom: 1px solid #e5e7eb; box-shadow: 0 1px 4px rgba(0,0,0,0.04); }
.navwrap { position: relative; display: flex; align-items: center; gap: 12px; padding: 6px 0; }
.menu { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; flex: 1; justify-content: center; flex-wrap: wrap; }
.menu a {
  display: inline-block; padding: 10px 12px; font-weight: 600; color: #374151;
  border-bottom: 3px solid transparent; text-decoration: none; border-radius: 6px 6px 0 0;
  transition: all var(--transition); font-size: 0.92rem;
}
.menu a:hover { border-bottom-color: var(--amarelo); background: #f8fafc; color: var(--marinho); }
.busca-desktop input {
  padding: 8px 14px; border: 1.5px solid #e2e8f0; border-radius: 10px;
  min-width: 200px; transition: border-color var(--transition), box-shadow var(--transition);
  font-size: 0.9rem;
}
.busca-desktop input:focus { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(0,161,202,0.12); outline: none; }

@media (max-width: 900px) {
  .brandlogo { max-height: 110px; }
  .busca-desktop { display: none; }
}

/* =================== Cards =================== */
.grid { display: grid; gap: 22px; }
.grid.g3 { grid-template-columns: repeat(3, 1fr); }
.grid.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid.g3, .grid.g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .grid.g3, .grid.g4 { grid-template-columns: 1fr; } }

.card {
  border: 1px solid #e8ecf1; border-radius: var(--radius); overflow: hidden;
  background: #fff; box-shadow: var(--shadow-sm);
  transition: transform var(--transition), box-shadow var(--transition);
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.card .thumb { background: #f2f2f2; overflow: hidden; }
.card .thumb img { display: block; width: 100%; height: auto; transition: transform 0.4s ease; }
.card:hover .thumb img { transform: scale(1.03); }
.card .body { padding: 16px; }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; color: #1a1a2e; }
.card h3 a { color: inherit; }
.card h3 a:hover { color: var(--azul); }
.muted { color: var(--cinza); font-size: 0.88rem; }

/* =================== Seções =================== */
.section { padding: 36px 0; }
.section h2 {
  margin: 0 0 18px; font-size: 1.35rem; font-weight: 700;
  border-left: 5px solid var(--amarelo); padding-left: 12px; color: var(--marinho);
}

/* CTA Ajude-nos */
.cta-ajude {
  background: linear-gradient(135deg, #f0f9ff 0%, #fefce8 100%);
  border: 2px solid #e0f2fe; border-radius: 16px; padding: 24px;
  transition: box-shadow var(--transition);
}
.cta-ajude:hover { box-shadow: var(--shadow-md); }

.btn {
  display: inline-block; background: var(--azul); color: #fff; border-radius: 10px;
  padding: 10px 18px; font-weight: 700; border: 0; cursor: pointer;
  transition: all var(--transition); font-size: 0.92rem;
}
.btn:hover { background: var(--marinho); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,161,202,0.3); }

/* =================== Rodapé =================== */
.footer { margin-top: 40px; background: var(--ink); color: #dbeafe; }
.footer .cols { display: grid; gap: 24px; grid-template-columns: 2fr 1fr; }
@media (max-width: 700px) { .footer .cols { grid-template-columns: 1fr; } }
.footer .copy {
  border-top: 1px solid rgba(255,255,255,0.06); margin-top: 18px;
  padding: 14px 0; color: #7b92b2; font-size: 0.85rem;
}
.badge {
  background: var(--amarelo); color: #111; padding: 4px 12px;
  border-radius: 999px; font-size: 0.82rem; font-weight: 700;
  transition: transform var(--transition);
}
.badge:hover, .badge:focus { color: #111 !important; text-decoration: none; transform: translateY(-1px); }

.footer a { color: var(--azul); text-decoration: none; transition: color var(--transition); }
.footer a:hover { color: var(--amarelo); }

/* =================== Utilities =================== */
.texto-justificado { text-align: justify; }

/* =================== Social =================== */
.social-icons a {
  display: inline-block; margin-right: 10px; color: var(--azul);
  transition: color var(--transition), transform var(--transition);
}
.social-icons a:hover { color: var(--amarelo); transform: translateY(-3px); }

/* =================== Contato =================== */
.contact-card { border: 1px solid #e5e7eb; border-radius: 16px; background: #fff; padding: 24px; box-shadow: var(--shadow-sm); }
.contato-grid { display: grid; gap: 24px; }
@media (min-width: 900px) { .contato-grid { grid-template-columns: 1fr 1fr; align-items: start; } }
.form-grid { display: grid; gap: 12px; max-width: 560px; }
.campo {
  padding: 11px 14px; border: 1.5px solid #e2e8f0; border-radius: 10px; width: 100%;
  outline: none; font-family: inherit; font-size: 0.95rem; color: #111;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.campo::placeholder { color: #9ca3af; }
.campo:focus { border-color: var(--azul); box-shadow: 0 0 0 3px rgba(0,161,202,0.12); }
.form-actions { margin-top: 8px; }

.alert-erro { color: #b91c1c; background: #fee2e2; border: 1px solid #fecaca; padding: 10px 14px; border-radius: 10px; margin-bottom: 10px; }
.alert-ok { color: #065f46; background: #d1fae5; border: 1px solid #a7f3d0; padding: 10px 14px; border-radius: 10px; margin-bottom: 10px; }
.honeypot { position: absolute; left: -5000px; top: -5000px; }
.mapa iframe { width: 100%; height: 360px; border: 1px solid #e5e7eb; border-radius: 12px; }
@media (max-width: 500px) { .form-actions .btn { width: 100%; } }

.contato-top { display: grid; gap: 24px; }
@media (min-width: 900px) { .contato-top { grid-template-columns: 1fr 1fr; align-items: start; } }
.contato-bottom { margin-top: 18px; padding-top: 14px; border-top: 1px solid #e5e7eb; text-align: center; }
.contato-bottom h3 { margin: 0 0 6px; }
.social-icons.center { margin-top: 8px; }
.social-icons.center a { margin: 0 8px; }

/* =================== Busca =================== */
.card-result .body { padding: 16px; }
.result-meta { display: flex; align-items: center; gap: 10px; color: var(--cinza); font-size: 0.82rem; margin-bottom: 6px; }
.tag-pill {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px 10px; line-height: 1.8; font-size: 0.72rem; font-weight: 700;
  border: 1px solid var(--azul); color: var(--azul); background: #fff;
  border-radius: 999px; text-transform: uppercase; white-space: nowrap;
}

/* =================== Hamburger =================== */
.nav-toggle {
  display: none; background: transparent; border: 0; padding: 8px;
  margin-right: 6px; cursor: pointer;
}
.nav-toggle:focus { outline: 2px solid var(--azul); outline-offset: 2px; }
.nav-toggle-bar {
  display: block; width: 24px; height: 3px; background: #374151;
  border-radius: 2px; margin: 5px 0; transition: transform 0.25s, opacity 0.25s;
}
.nav-toggle.is-open .nav-toggle-bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle.is-open .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .nav-toggle-bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 900px) {
  .navwrap { justify-content: space-between; }
  .nav-toggle { display: block; }
  .menu[data-collapsible] {
    position: absolute; left: 0; right: 0; top: 100%;
    background: #fff; border-bottom: 1px solid #e5e7eb;
    display: grid; gap: 0; transform-origin: top;
    transform: scaleY(0); opacity: 0; pointer-events: none;
    transition: transform 0.22s, opacity 0.22s; z-index: 1001;
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
  }
  .menu[data-collapsible].is-open { transform: scaleY(1); opacity: 1; pointer-events: auto; }
  .menu[data-collapsible] li { border-top: 1px solid #f1f5f9; }
  .menu[data-collapsible] a { display: block; padding: 13px 18px; border-bottom: 0 !important; border-radius: 0; }
  .menu-search { display: block; padding: 12px 16px; border-top: 1px solid #f1f5f9; margin-bottom: 8px; }
  .menu-search form { display: block; width: 100%; }
  .menu-search input { width: 100%; padding: 11px 14px; border: 1.5px solid #e2e8f0; border-radius: 10px; font-size: 0.95rem; }
}
@media (min-width: 901px) {
  .menu[data-collapsible] { position: static; transform: none; opacity: 1; pointer-events: auto; display: flex; }
  .menu-search { display: none; }
}
body.no-scroll { overflow: hidden; }

/* =================== LIGHTBOX =================== */
.gl-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.92); display: none; z-index: 9999; backdrop-filter: blur(4px); }
.gl-overlay.open { display: flex; align-items: center; justify-content: center; }
.gl-stage { max-width: min(92vw, 1200px); max-height: 86vh; position: relative; padding: 32px; }
.gl-img { max-width: 100%; max-height: 70vh; display: block; margin: 0 auto; border-radius: 12px; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.gl-caption { color: #fff; text-align: center; margin-top: 12px; opacity: 0.9; }
.gl-close, .gl-prev, .gl-next {
  position: absolute; top: 16px;
  background: rgba(255,255,255,0.1); border: 0; color: #fff;
  width: 44px; height: 44px; border-radius: 999px; cursor: pointer;
  font-size: 18px; display: flex; align-items: center; justify-content: center;
  backdrop-filter: saturate(120%) blur(6px); transition: background var(--transition);
}
.gl-close { right: 16px; }
.gl-prev, .gl-next { top: 50%; transform: translateY(-50%); font-weight: 600; }
.gl-prev { left: 10px; } .gl-next { right: 10px; }
.gl-counter { position: absolute; left: 50%; top: 16px; transform: translateX(-50%); color: #fff; opacity: 0.7; }
.gl-close:hover, .gl-prev:hover, .gl-next:hover { background: rgba(255,255,255,0.25); }

/* =================== Paginação =================== */
.pager { display: flex; gap: 6px; justify-content: center; align-items: center; margin-top: 24px; flex-wrap: wrap; }
.page-btn, .page-btn:is(a) {
  display: inline-block; padding: 8px 13px; border: 1px solid #e5e7eb; border-radius: 10px;
  background: #fff; color: #111; text-decoration: none; font-weight: 600;
  transition: all var(--transition); font-size: 0.9rem;
}
.page-btn:hover { border-color: var(--azul); color: var(--azul); }
.page-btn.is-current { background: var(--azul); color: #fff; border-color: var(--azul); }
.page-btn.is-disabled { opacity: 0.4; pointer-events: none; }

/* =================== Detalhe =================== */
.formacao-cover, .carisma-cover, .apostolado-cover {
  background: #f2f2f2; border-radius: 16px; overflow: hidden; margin: 10px 0 16px;
}
.formacao-cover img, .carisma-cover img, .apostolado-cover img {
  width: 100%; height: auto !important; object-fit: contain !important; display: block;
}
.conteudo { margin-top: 10px; line-height: 1.7; }

/* =================== Galerias =================== */
.galerias-list .card .thumb {
  position: relative; width: 100%; padding-top: 56.25%;
  background: #f2f2f2; overflow: hidden;
}
.galerias-list .card .thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center top; display: block;
}
.formacoes-list .card .thumb {
  position: relative; width: 100%; padding-top: 56.25%;
  background: #f2f2f2; overflow: hidden;
}
.formacoes-list .card .thumb img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center top; display: block;
}

/* =================== HERO =================== */
.hero .hero-slide { pointer-events: none !important; z-index: 0 !important; opacity: 0 !important; }
.hero .layer {
  position: absolute; inset: 0; transition: opacity .6s ease; opacity: 0;
  z-index: 2; pointer-events: none;
}
.hero .layer.show { opacity: 1; z-index: 5; pointer-events: auto; }
.hero .layer.show a { position: relative; z-index: 6; display: block; width: 100%; height: 100%; }
.hero .layer img { width: 100%; height: 100%; object-fit: contain; display: block; }
.hero .hero-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  border: 0; background: rgba(14,43,87,.6); color: #fff; font-size: 28px; line-height: 1;
  width: 44px; height: 44px; border-radius: 999px; display: grid; place-items: center;
  cursor: pointer; transition: all var(--transition); opacity: .9;
  z-index: 10; pointer-events: auto;
}
.hero .hero-arrow:hover { opacity: 1; background: rgba(14,43,87,.85); transform: translateY(-50%) scale(1.05); }
.hero .hero-arrow.left { left: 12px; } .hero .hero-arrow.right { right: 12px; }
.hero::before, .hero::after { content: none !important; display: none !important; }

/* Hero dots */
.hero-dots {
  position: absolute; bottom: 14px; left: 50%; transform: translateX(-50%);
  z-index: 10; display: flex; gap: 8px;
}
.hero-dots .dot {
  width: 10px; height: 10px; border-radius: 50%; background: rgba(255,255,255,0.4);
  border: 2px solid rgba(255,255,255,0.6); cursor: pointer;
  transition: all var(--transition);
}
.hero-dots .dot.active { background: var(--amarelo); border-color: var(--amarelo); transform: scale(1.2); }

/* Thumb link */
.card .thumb a { display: block; width: 100%; height: 100%; }

/* =================== Conteúdo vindo do editor do admin ===================
   Garante que imagens, tabelas e listas inseridas pelo editor de textos
   (admin/editor.php) não estourem o layout nem fiquem sem estilo. */
.conteudo img,
.content img,
.texto-justificado img { max-width: 100%; height: auto; border-radius: 10px; }

.conteudo table,
.content table,
.texto-justificado table {
  width: 100%; border-collapse: collapse; margin: 14px 0;
  display: block; overflow-x: auto; /* rola no mobile em vez de estourar */
}
.conteudo table td, .conteudo table th,
.content table td, .content table th,
.texto-justificado table td, .texto-justificado table th {
  border: 1px solid #dcdcdc; padding: 8px 10px; text-align: left; vertical-align: top;
}
.conteudo table th, .content table th, .texto-justificado table th { background: #f5f6f8; font-weight: 600; }

.conteudo ul, .conteudo ol,
.content ul, .content ol,
.texto-justificado ul, .texto-justificado ol { padding-left: 22px; margin: 10px 0; }

.conteudo p, .content p, .texto-justificado p { margin: 0 0 12px; }
.conteudo a, .content a, .texto-justificado a { color: var(--azul-claro, #00a1ca); }
.conteudo hr, .content hr, .texto-justificado hr { border: 0; border-top: 1px solid #e3e3e3; margin: 18px 0; }
