/*
 * Agenda Pastoral — identidade visual (a mesma da Escuta Sinodal)
 * Paleta derivada do logotipo (traço preto sobre branco, linhas finas, caixa-alta espaçada):
 * tinta ardósia profunda + papel quente + dourado envelhecido como acento discreto.
 * Todos os pares texto/fundo atendem WCAG 2.1 AA (contraste >= 4.5:1).
 * Sem estilo inline nas páginas: a CSP é "style-src 'self'".
 */

@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin-400-italic.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin-600-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Source Serif 4';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/source-serif-4-latin-700-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/inter-latin-400-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/inter-latin-500-normal.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/inter-latin-600-normal.woff2') format('woff2');
}

:root {
  --ink: #1d2733; /* texto principal (15.6:1 sobre --paper) */
  --ink-soft: #4a5562; /* texto secundário (7.4:1) */
  --ink-muted: #5f6b78; /* legendas (5.4:1) */
  --slate: #24364b; /* primária */
  --slate-hover: #1a293a;
  --slate-tint: #e9eef4;
  --gold: #8a6a2f; /* acento (5.2:1 sobre branco) */
  --gold-soft: #f4ecdd;
  --paper: #faf8f4;
  --surface: #ffffff;
  --line: #e2ddd3;
  --line-strong: #c9c2b4;
  --success: #2f6b46;
  --success-bg: #e8f3ec;
  --danger: #a3302a;
  --danger-bg: #fbecea;
  --warning: #7a5a12;
  --warning-bg: #fbf3df;
  --focus: #2f6fb3;

  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(29, 39, 51, 0.06), 0 4px 16px rgba(29, 39, 51, 0.05);
  --measure: 68ch;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 1.5rem;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

a {
  color: var(--slate);
  text-underline-offset: 0.18em;
}
a:hover {
  color: var(--slate-hover);
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--slate);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 100;
}
.skip-link:focus {
  top: 1rem;
  color: #fff;
}

/* ---------- Estrutura ---------- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: var(--ink);
}
.brand img {
  width: 52px;
  height: 52px;
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}
.brand__name {
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
}
.brand__sub {
  font-size: 0.8rem;
  color: var(--ink-muted);
}
.site-header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

main {
  flex: 1;
  width: 100%;
}
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
}
.container--narrow {
  max-width: 760px;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--ink-muted);
  font-size: 0.85rem;
  text-align: center;
  padding: 1.5rem 1rem 2rem;
}

/* ---------- Tipografia ---------- */

h1,
h2,
h3 {
  font-family: var(--font-serif);
  color: var(--ink);
  line-height: 1.25;
  font-weight: 600;
}
h1 {
  font-size: clamp(1.75rem, 1.3rem + 2vw, 2.4rem);
  margin: 0 0 0.75rem;
}
h2 {
  font-size: clamp(1.3rem, 1.1rem + 0.9vw, 1.6rem);
  margin: 0 0 1rem;
}
h3 {
  font-size: 1.15rem;
  margin: 1.75rem 0 0.6rem;
}
p {
  margin: 0 0 1rem;
}
.lead {
  font-size: 1.1rem;
  color: var(--ink-soft);
}
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.muted {
  color: var(--ink-muted);
}
.small {
  font-size: 0.88rem;
}

/* ---------- Componentes ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
}
.card + .card {
  margin-top: 1.25rem;
}
.card--quiet {
  box-shadow: none;
  background: transparent;
}
.card__title {
  margin-top: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font: inherit;
  font-weight: 600;
  font-size: 0.97rem;
  line-height: 1.2;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease;
}
.btn-primary {
  background: var(--slate);
  color: #fff;
}
.btn-primary:hover {
  background: var(--slate-hover);
  color: #fff;
}
.btn-secondary {
  background: var(--surface);
  color: var(--slate);
  border-color: var(--line-strong);
}
.btn-secondary:hover {
  border-color: var(--slate);
  color: var(--slate-hover);
}
.btn-ghost {
  background: transparent;
  color: var(--slate);
  padding-inline: 0.6rem;
}
.btn-danger {
  background: var(--surface);
  color: var(--danger);
  border-color: #e3b8b4;
}
.btn-small {
  padding: 0.45rem 0.8rem;
  min-height: 36px;
  font-size: 0.88rem;
}
.btn[disabled],
.btn[aria-disabled='true'] {
  opacity: 0.55;
  cursor: not-allowed;
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}
.btn-row--end {
  justify-content: flex-end;
}

.form-field {
  margin-bottom: 1.25rem;
}
.form-field label,
.label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
}
.hint {
  display: block;
  color: var(--ink-muted);
  font-size: 0.88rem;
  margin-top: 0.35rem;
}
input[type='text'],
input[type='password'],
input[type='search'],
input[type='date'],
select,
textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  min-height: 44px;
}
textarea {
  line-height: 1.5;
  resize: vertical;
  min-height: 6rem;
}
input:focus,
select:focus,
textarea:focus {
  border-color: var(--focus);
}
[aria-invalid='true'] {
  border-color: var(--danger) !important;
}
.checkbox {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  font-weight: 500;
}
.checkbox input {
  width: 1.2rem;
  height: 1.2rem;
  margin-top: 0.2rem;
  accent-color: var(--slate);
}

.alert {
  border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  margin: 0 0 1.25rem;
  border: 1px solid;
}
.alert-error {
  background: var(--danger-bg);
  border-color: #ecc4c0;
  color: #7d221d;
}
.alert-success {
  background: var(--success-bg);
  border-color: #bcdcc8;
  color: #1f4d31;
}
.alert-info {
  background: var(--slate-tint);
  border-color: #cfd9e5;
  color: var(--slate);
}
.alert-warning {
  background: var(--warning-bg);
  border-color: #ead9a8;
  color: var(--warning);
}
.alert p:last-child {
  margin-bottom: 0;
}
.card + .alert {
  margin-top: 1.25rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink-soft);
  white-space: nowrap;
}

/* ---------- Página inicial ---------- */

.hero {
  text-align: center;
  padding: 1rem 0 0.5rem;
}
.hero__logo {
  width: min(260px, 70vw);
  margin: 0 auto 0.5rem;
  display: block;
}
.hero h1 {
  margin-top: 0.5rem;
}
.pontos {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
}
.pontos li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.pontos li::before {
  content: '';
  flex: none;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--gold);
  margin-top: 0.55rem;
}

/* ---------- Área interna ---------- */

.user-chip {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
  text-align: right;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.menu-interno {
  background: var(--slate);
}
.menu-interno__inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  gap: 0.25rem;
  overflow-x: auto;
}
.menu-interno a {
  color: #dfe6ee;
  text-decoration: none;
  padding: 0.75rem 0.9rem;
  font-size: 0.93rem;
  font-weight: 500;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}
.menu-interno a:hover {
  color: #fff;
}
.menu-interno a[aria-current='page'] {
  color: #fff;
  border-bottom-color: #d8bd85;
}
.menu-interno a:focus-visible {
  outline-color: #fff;
  outline-offset: -3px;
}
.dados {
  margin: 0 0 1rem;
  display: grid;
  gap: 0.6rem;
}
.dados > div {
  display: grid;
  grid-template-columns: minmax(6rem, 9rem) 1fr;
  gap: 0.75rem;
}
.dados dt {
  color: var(--ink-muted);
  font-size: 0.9rem;
}
.dados dd {
  margin: 0;
  overflow-wrap: anywhere;
}
@media (max-width: 30rem) {
  .site-header__inner {
    flex-wrap: wrap;
  }
  .site-header__actions {
    margin-left: 0;
    width: 100%;
    justify-content: space-between;
  }
  .user-chip {
    text-align: left;
  }
}
@media print {
  .site-header,
  .site-footer,
  .skip-link {
    display: none !important;
  }
}
