/* ══════════════════════════════════════════════
   SCDM — Estilos partilhados por todas as páginas
   (reset, variáveis, header/nav, hero interior,
   layout com sidebar, tipografia de secção, footer)
   ══════════════════════════════════════════════ */

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

:root {
  --green:       #186a44;
  --green-dark:  #0f4a2f;
  --green-light: #e8f4ee;
  --green-mid:   #2d8a5a;
  --text:        #1e2b26;
  --text-muted:  #5a6b63;
  --border:      #d3e4da;
  --white:       #ffffff;
  --bg:          #f7fbf9;
  --bg2:         #eef6f1;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Source Sans 3', sans-serif;
  color: var(--text);
  background: var(--white);
  font-size: 16px;
  line-height: 1.7;
}

/* ── SKIP LINK (acessibilidade) ──
   Fica escondido fora do ecrã até receber foco (Tab), permitindo a
   quem navega por teclado/leitor de ecrã saltar o menu e ir direto
   para o conteúdo principal (#main-content em cada página). */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 2000;
  background: var(--green-dark);
  color: var(--white);
  padding: 10px 18px;
  border-radius: 0 0 8px 0;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus { left: 0; }

/* ── HEADER ── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.97);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.header-inner {
  max-width: 1200px; margin: 0 auto;
  padding: 0 1.5rem; height: 68px;
  display: flex; align-items: center; gap: 1.5rem;
}

.logo-wrap {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; flex-shrink: 0;
}

.logo-wrap img { height: 44px; width: auto; }

.logo-wrap .logo-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem; font-weight: 700;
  color: var(--green-dark); letter-spacing: -0.02em; line-height: 1.2;
}

.logo-wrap .logo-sub {
  font-size: 0.7rem; color: var(--text-muted);
  font-weight: 400; display: block; letter-spacing: 0.03em;
}

.main-nav {
  flex: 1; display: flex; align-items: center;
  justify-content: flex-end; gap: 0.25rem;
}

.main-nav a {
  font-size: 0.83rem; font-weight: 500; color: var(--text);
  text-decoration: none; padding: 6px 11px; border-radius: 6px;
  transition: background 0.18s, color 0.18s; white-space: nowrap;
}

.main-nav a:hover, .main-nav a.active {
  background: var(--green-light); color: var(--green-dark);
}

.main-nav a.home-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; font-size: 1rem;
}

.nav-toggle {
  display: none; background: none;
  border: 1px solid var(--border); border-radius: 6px;
  padding: 6px 10px; cursor: pointer;
  color: var(--green-dark); font-size: 1.25rem; line-height: 1;
}

@media (max-width: 900px) {
  .nav-toggle { display: flex; align-items: center; margin-left: auto; }
  .main-nav {
    display: none; position: fixed;
    top: 68px; left: 0; right: 0;
    background: var(--white); border-bottom: 1px solid var(--border);
    flex-direction: column; align-items: stretch;
    padding: 1rem 1.5rem 1.5rem; gap: 0.25rem;
    z-index: 999; box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 10px 14px; border-radius: 8px; font-size: 0.95rem; }
  .main-nav a.home-btn { width: auto; justify-content: flex-start; gap: 8px; }
}

/* ── PAGE HERO (páginas interiores) ── */
.page-hero {
  margin-top: 68px;
  background: linear-gradient(160deg, var(--bg2) 0%, var(--white) 60%);
  padding: 56px 1.5rem 48px;
  border-bottom: 1px solid var(--border);
}

.page-hero-inner { max-width: 1200px; margin: 0 auto; }

.breadcrumb {
  display: flex; align-items: center; gap: 6px;
  font-size: 0.8rem; color: var(--text-muted);
  margin-bottom: 1rem; list-style: none;
}

.breadcrumb a { color: var(--green); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb li+li::before { content: '/'; margin-right: 6px; }

.page-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  font-weight: 700; color: var(--green-dark);
  line-height: 1.25; letter-spacing: -0.02em; margin-bottom: 0.75rem;
}

.page-hero p {
  font-size: 1rem; color: var(--text-muted);
  max-width: 700px; line-height: 1.75;
}

/* ── LAYOUT COM SIDEBAR (credenciamento, comite, scdm, repositorio, AC raiz) ── */
.content-layout {
  max-width: 1200px; margin: 0 auto; padding: 0 1.5rem;
  display: grid; grid-template-columns: 220px 1fr;
  gap: 3rem; align-items: start;
}

@media (max-width: 860px) {
  .content-layout { grid-template-columns: 1fr; gap: 0; }
}

.sidebar { position: sticky; top: 88px; padding: 2rem 0; }

@media (max-width: 860px) {
  .sidebar {
    position: static; padding: 1.5rem 0 0;
    border-bottom: 1px solid var(--border); margin-bottom: 2rem;
  }
}

.sidebar-title {
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 0.75rem;
}

.sidebar-nav { list-style: none; }
.sidebar-nav li { border-bottom: 1px solid var(--border); }
.sidebar-nav li:last-child { border-bottom: none; }

.sidebar-nav a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 0; font-size: 0.88rem; font-weight: 500;
  color: var(--text-muted); text-decoration: none; transition: color 0.18s;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
  background: var(--green-light); color: var(--green-dark);
  font-weight: 600; border-radius: 6px; padding-left: 8px;
}

.sidebar-nav a i { font-size: 0.85rem; }

.main-content { padding: 2.5rem 0; }
.content-section { margin-bottom: 3.5rem; }
.content-section:last-child { margin-bottom: 0; }

/* ── LAYOUT SEM SIDEBAR (legislacao, lsc) ── */
.main-area {
  max-width: 1200px; margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

/* ── TIPOGRAFIA DE SECÇÃO ── */
.section-label {
  display: inline-block; font-size: 0.72rem; font-weight: 700;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--green); margin-bottom: 0.6rem;
}

.section-heading {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem; font-weight: 700; color: var(--green-dark);
  line-height: 1.3; margin-bottom: 1rem; letter-spacing: -0.02em;
}

.prose {
  font-size: 0.96rem; color: var(--text-muted);
  line-height: 1.8; margin-bottom: 1rem;
}

.prose:last-child { margin-bottom: 0; }

/* ── IMAGEM ENQUADRADA ── */
.img-wrap {
  margin: 1.5rem 0; border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden;
}

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

/* ── SEPARADOR ── */
.divider { border: none; border-top: 1px solid var(--border); margin: 2.5rem 0; }

/* ── FOOTER ── */
.site-footer {
  background: var(--green-dark); color: rgba(255,255,255,0.8);
  padding: 3rem 1.5rem 2rem; margin-top: 4rem;
}

.footer-inner {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2.5rem; padding-bottom: 2rem;
  border-bottom: 1px solid rgba(255,255,255,0.12); margin-bottom: 1.5rem;
}

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

@media (max-width: 480px) { .footer-inner { grid-template-columns: 1fr; } }

.footer-brand .brand-name {
  font-family: 'Playfair Display', serif; font-size: 1.5rem;
  font-weight: 700; color: var(--white); margin-bottom: 0.6rem; display: block;
}

.footer-brand p { font-size: 0.85rem; line-height: 1.6; margin-bottom: 0.5rem; }

.footer-col h4 {
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--white); margin-bottom: 1rem;
}

.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }

.footer-col ul a {
  font-size: 0.85rem; color: rgba(255,255,255,0.65);
  text-decoration: none; transition: color 0.18s;
}

.footer-col ul a:hover { color: var(--white); }

.footer-bottom {
  max-width: 1200px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.8rem; color: rgba(255,255,255,0.45); flex-wrap: wrap; gap: 0.5rem;
}

/* ── SCROLL TO TOP ── */
.scroll-top {
  position: fixed; right: 1.25rem; bottom: 1.25rem;
  width: 42px; height: 42px; background: var(--green); color: var(--white);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  text-decoration: none; font-size: 1.1rem;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s; z-index: 900;
}

.scroll-top.show { opacity: 1; pointer-events: auto; }
.scroll-top:hover { transform: translateY(-3px); }
