/* CPCJ Ribeira Grande — folha de estilos principal */

:root {
  --navy: #1d3769;
  --navy-700: #16295a;
  --navy-050: #eef2f9;
  --yellow: #f4b400;
  --yellow-100: #fff4d1;
  --text: #1c2433;
  --muted: #56607a;
  --bg: #fbfaf6;
  --surface: #ffffff;
  --border: #e3e6ee;
  --radius: 14px;
  --shadow: 0 1px 2px rgb(20 30 60 / .06), 0 6px 20px rgb(20 30 60 / .06);
  --max: 1120px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

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

a { color: var(--navy); text-underline-offset: .18em; }
a:hover { color: var(--navy-700); text-decoration-thickness: 2px; }

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

h1, h2, h3 { line-height: 1.2; color: var(--navy-700); text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 1.3rem + 2.6vw, 3rem); margin: 0 0 .5rem; letter-spacing: -.01em; }
h2 { font-size: clamp(1.35rem, 1.15rem + .8vw, 1.7rem); margin: 2.4rem 0 .75rem; }
h3 { font-size: 1.2rem; margin: 0 0 .5rem; }

.container { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: 16px; }
@media (min-width: 640px) { .container { padding-inline: 24px; } }

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

/* ---------- Cabeçalho ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; padding-block: .75rem; }
.brand img { width: auto; height: auto; max-width: 190px; max-height: 76px; }
@media (min-width: 900px) { .brand img { max-width: 220px; max-height: 88px; } }

.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.site-nav a {
  display: block; padding: .55rem .85rem; border-radius: 999px;
  text-decoration: none; font-weight: 600; color: var(--navy);
}
.site-nav a:hover { background: var(--navy-050); }
.site-nav a[aria-current="page"] { background: var(--navy); color: #fff; }

.nav-toggle { display: none; }

@media (max-width: 859px) {
  .js .nav-toggle {
    display: inline-flex; align-items: center; gap: .55rem;
    font: inherit; font-weight: 600; color: var(--navy);
    background: var(--navy-050); border: 0; border-radius: 999px; padding: .55rem 1rem; cursor: pointer;
  }
  .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
    display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; position: relative;
  }
  .nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
  .nav-toggle-bars::before { top: -6px; }
  .nav-toggle-bars::after { top: 6px; }

  .site-nav { width: 100%; }
  .js .site-nav { display: none; }
  .js .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; padding-bottom: .5rem; }
  .site-nav a { border-radius: 10px; }
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: .7rem 1.3rem; border-radius: 999px;
  font-weight: 700; text-decoration: none; border: 2px solid transparent;
}
.btn-accent { background: var(--yellow); color: #1c2433; }
.btn-accent:hover { background: #ffc629; color: #1c2433; }
.btn-ghost { border-color: rgb(255 255 255 / .8); color: #fff; }
.btn-ghost:hover { background: rgb(255 255 255 / .12); color: #fff; }
.btn-light { background: #fff; color: var(--navy-700); }
.btn-light:hover { background: var(--yellow-100); color: var(--navy-700); }

/* ---------- Hero ---------- */
.hero { position: relative; isolation: isolate; color: #fff; background: var(--navy); overflow: hidden; }
.hero-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 60% 30%; z-index: -2; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(90deg, rgb(22 41 90 / .94) 0%, rgb(22 41 90 / .82) 45%, rgb(22 41 90 / .25) 100%);
}
@media (max-width: 799px) { .hero::after { background: rgb(22 41 90 / .84); } }
.hero-content { padding-block: clamp(3.5rem, 8vw, 7rem); max-width: var(--max); }
.hero-content > * { max-width: 36rem; }
.hero h1 { color: #fff; }
.hero .eyebrow { color: var(--yellow); }
.lead { font-size: clamp(1.1rem, 1rem + .4vw, 1.3rem); margin: 0 0 1.75rem; opacity: .95; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem; }

.eyebrow { margin: 0 0 .5rem; font-size: .85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

/* ---------- Secções ---------- */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section-alt { background: var(--navy-050); }
.section-title { margin-top: 0; }

.cards { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.card {
  display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow);
  border: 1px solid var(--border); transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgb(20 30 60 / .12); color: inherit; }
.card img { aspect-ratio: 3 / 2; object-fit: cover; width: 100%; }
.card-body { padding: 1.25rem 1.35rem 1.5rem; display: flex; flex-direction: column; flex: 1; }
.card-body p { margin: 0 0 1rem; color: var(--muted); }
.card-more { margin-top: auto; font-weight: 700; color: var(--navy); }
.card-more::after, .link-arrow::after { content: " →"; }
.link-arrow { font-weight: 700; }

.split { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 860px) { .split { grid-template-columns: 1.3fr 1fr; gap: 3rem; } }

.contact-box { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); border-top: 5px solid var(--yellow); }
.contact-box dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: .4rem 1rem; }
.contact-box dt { font-weight: 700; color: var(--muted); }
.contact-box dd { margin: 0; overflow-wrap: break-word; }

/* ---------- Páginas interiores ---------- */
.page-header { background: var(--navy); color: #fff; padding-block: clamp(2.25rem, 5vw, 3.5rem); margin-bottom: 1rem; position: relative; }
.page-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--yellow); }
.page-header h1 { color: #fff; margin: 0; }
.page-header .eyebrow { color: var(--yellow); }

.prose { padding-bottom: 3.5rem; }
.prose > * { max-width: 46rem; }
.prose ul, .prose ol { padding-left: 1.3rem; }
.prose li { margin-bottom: .45rem; }
.prose li::marker { color: var(--navy); }
ol.alpha { list-style: lower-alpha; }
.source { font-size: .95rem; color: var(--muted); }

.toc { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; margin-top: 1.5rem; }
.toc ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.toc li { margin: 0; }
.toc a { font-weight: 600; }

.callout { background: var(--yellow-100); border-left: 5px solid var(--yellow); border-radius: 0 var(--radius) var(--radius) 0; padding: 1.25rem 1.5rem; margin: 2.25rem 0; }
.callout h3 { margin-top: 0; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }

.figure { margin: 1.75rem 0; }
.figure img { border-radius: var(--radius); width: 100%; }
.figure figcaption { font-size: .92rem; color: var(--muted); margin-top: .5rem; }

.preview-bar {
  position: sticky; top: 0; z-index: 60; background: #7a1f5c; color: #fff; text-align: center;
  padding: .55rem 16px; font-size: .95rem;
}
.preview-bar a { color: #fff; font-weight: 700; margin-left: .5rem; }

.plain { list-style: none; padding: 0 !important; margin: 0 0 1rem; }
.plain li { margin-bottom: .35rem; overflow-wrap: break-word; }

.doc {
  display: flex; align-items: center; gap: 1rem; padding: 1rem 1.25rem; margin: .75rem 0;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  text-decoration: none; color: inherit; box-shadow: var(--shadow);
}
.doc:hover { border-color: var(--navy); color: inherit; }
.doc strong { color: var(--navy); }
.doc small { color: var(--muted); }
.doc-icon {
  flex: none; display: grid; place-items: center; width: 48px; height: 56px; border-radius: 6px;
  background: #c62828; color: #fff; font-size: .8rem; font-weight: 800; letter-spacing: .04em;
}

.contact-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 1.5rem; }
.contact-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.35rem 1.5rem; box-shadow: var(--shadow); }
.contact-item h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 .25rem; }
.contact-item p { margin: 0 0 1.1rem; font-size: 1.1rem; overflow-wrap: break-word; }
.contact-item p:last-child { margin-bottom: 0; }

/* ---------- Emergência e rodapé ---------- */
.emergency { background: var(--yellow); color: #1c2433; }
.emergency-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; padding-block: 1.25rem; }
.emergency p { margin: 0; font-size: 1.1rem; }
.emergency a:not(.btn) { color: inherit; font-weight: 800; }

.site-footer { background: var(--navy-700); color: #dfe5f2; font-size: .98rem; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--yellow); }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); padding-block: 2.75rem 1.5rem; }
.footer-grid p { margin: 0 0 .75rem; }
.footer-title { font-size: 1rem; color: #fff; margin: 0 0 .75rem; text-transform: uppercase; letter-spacing: .06em; }
.footer-bottom { border-top: 1px solid rgb(255 255 255 / .12); padding-block: 1rem 1.5rem; font-size: .9rem; color: #b7c1d8; }
.footer-bottom p { margin: 0; }

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

@media print {
  .site-nav, .nav-toggle, .emergency, .hero picture, .skip-link { display: none !important; }
  .hero, .page-header { background: none; color: #000; }
  .hero h1, .page-header h1 { color: #000; }
  body { background: #fff; }
}
