@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
  --mps-page-bg-bottom: #b5bcc7;
  --mps-page-bg-top: #f3f5fa;

  --mps-black: #111111;
  --mps-gray-dark: #2a2a2a;
  --mps-gray-mid: #6b7280;
  --mps-gray-light: #d1d5db;

  --mps-accent: #9ca3af;
}

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

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  font-family: "Source Sans 3", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  color: var(--mps-black);

  background: linear-gradient(
    to top,
    var(--mps-page-bg-bottom),
    var(--mps-page-bg-top)
  );

  min-height: 100vh;
}

/* =========================
   Caixa branca central
   ========================= */

.page-wrapper {
  max-width: 960px;
  margin: 3rem auto;

  background: #ffffff;
  border: 2px solid var(--mps-gray-light);

  padding: 2.8rem 2.6rem;

  box-shadow:
    0 16px 40px rgba(0,0,0,0.06),
    0 0 60px rgba(255,255,255,0.6);
}

/* =========================
   HEADER
   Logo esquerda / menu direita
   alinhado pela BASE do brasão
   ========================= */

header {
  display: flex;
  align-items: flex-end;   /* alinhamento pela base */
  justify-content: space-between;

  gap: 2rem;

  padding-top: 0.9rem;
  padding-bottom: 0.9rem;

  margin-bottom: 2.4rem;

  border-bottom: 1px solid var(--mps-gray-light);
}

/* Branding */

.branding {
  display: flex;
  align-items: center;
}

.brand-logo {
  width: clamp(120px, 12vw, 160px);   /* Configuração B */
  height: auto;
  display: block;
}

/* Navegação */

nav {
  padding-bottom: 0.15rem;   /* evita parecer “caindo” */
}

nav ul {
  list-style: none;
  margin: 0;
  padding: 0;

  display: flex;
  gap: 1.3rem;
}

nav a {
  font-size: 0.98rem;
  font-weight: 500;

  letter-spacing: 0.02em;

  text-decoration: none;
  color: var(--mps-gray-dark);

  padding: 0.35rem 0.6rem;

  transition:
    color 0.18s ease,
    background-color 0.18s ease,
    border-color 0.18s ease;
}

/* Hover */

nav a:hover {
  color: var(--mps-black);
  background-color: rgba(209,213,219,0.45);
  border-radius: 3px;
}

/* Item ativo */

nav a.active {
  color: var(--mps-black);
  background-color: rgba(229,231,235,0.6);
  border-bottom: 2px solid currentColor;
  border-radius: 3px 3px 0 0;
}

/* =========================
   Conteúdo
   ========================= */

main {
  max-width: 720px;
  margin: 0 auto;
}

/* Tipografia */

h1, h2, h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.22;
}

h1 {
  font-size: 1.9rem;
  margin-bottom: 1.2rem;
}

h2 {
  font-size: 1.4rem;
  margin-top: 2.2rem;
  margin-bottom: 1rem;
}

p {
  color: var(--mps-gray-dark);
  line-height: 1.68;
  letter-spacing: -0.005em;
  margin-bottom: 1.05rem;
}

/* Avisos */

.notice {
  margin: 2rem 0;
  padding: 1.2rem 1.4rem;

  background: #f9fafb;
  border-left: 3px solid var(--mps-accent);

  font-size: 0.93rem;
  color: var(--mps-gray-dark);
}

/* =========================
   Publications layout
   (mais respiro entre itens)
   ========================= */

/* Caso o motor use lista (ul/ol) */
main ul, main ol {
  padding-left: 1.15rem; /* mantém recuo legível */
}

main ul li,
main ol li {
  margin: 0 0 1.15rem 0;
  padding: 0 0 1.15rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

/* Não desenhar “linha de trincheira” no último item */
main ul li:last-child,
main ol li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* Caso o motor use divs/articles por item */
.publication,
.pub-item,
.pub-entry,
.publication-item,
.publications-item,
.entry,
.entry-item,
article.publication,
article.pub-item {
  margin: 0 0 1.15rem 0;
  padding: 0 0 1.15rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.publication:last-child,
.pub-item:last-child,
.pub-entry:last-child,
.publication-item:last-child,
.publications-item:last-child,
.entry:last-child,
.entry-item:last-child,
article.publication:last-child,
article.pub-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* Evita que parágrafos “internos” empurrem demais e criem bloco gordo */
.publication p:last-child,
.pub-item p:last-child,
.pub-entry p:last-child,
.entry p:last-child {
  margin-bottom: 0;
}

/* =========================
   Admin: manter espaçamento, remover linhas
   ========================= */

body.admin main ul li,
body.admin main ol li,
body.admin .publication,
body.admin .pub-item,
body.admin .pub-entry,
body.admin .publication-item,
body.admin .publications-item,
body.admin .entry,
body.admin .entry-item,
body.admin article.publication,
body.admin article.pub-item {
  border-bottom: none;
}

/* =========================
   Admin: tabelas-guia
   ========================= */

.rank-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.7rem;
  font-size: 0.92rem;
}

.rank-table th,
.rank-table td {
  text-align: left;
  padding: 0.45rem 0.6rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  vertical-align: top;
}

.rank-table thead th {
  font-weight: 600;
  color: var(--mps-black);
}

.rank-table tbody tr:last-child td {
  border-bottom: none;
}

/* =========================
   Rodapé
   ========================= */

footer {
  margin-top: 3.2rem;
  padding-top: 1.8rem;

  border-top: 1px solid var(--mps-gray-light);

  font-size: 0.85rem;
  text-align: center;
  color: var(--mps-gray-mid);
}

/* Links externos */

.external-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 1.2rem;
}

.ext-icon {
  background-color: #e5e7eb;
  border: 1px solid #cbd5e1;

  color: var(--mps-gray-dark);

  padding: 0.4rem 0.7rem;
  font-size: 0.85rem;

  text-decoration: none;

  transition:
    background-color 0.18s ease,
    border-color 0.18s ease,
    color 0.18s ease;
}

.ext-icon:hover {
  background-color: #d1d5db;
  border-color: var(--mps-black);
  color: var(--mps-black);
}

/* Editorial note */

footer .editorial-note {
  font-size: 0.8rem;
  line-height: 1.4;

  margin-top: 0.8rem;

  opacity: 0.75;
  font-style: italic;

  max-width: 750px;
  margin-left: auto;
  margin-right: auto;
}

footer p {
  margin: 0.3rem 0;
}

footer .external-links {
  margin-bottom: 1rem;
}

/* =========================
   Corps layout
   ========================= */

.corps-card { margin-bottom: 1.25rem; }
.corps-card h3 { margin-bottom: 0.25rem; }
.corps-card .corps-meta { margin: 0.15rem 0; }
.corps-card .corps-bio { margin: 0.25rem 0; line-height: 1.45; }
.corps-card .corps-links { margin-top: 0.25rem; margin-bottom: 0; }

/* =========================
   Responsivo
   ========================= */

@media (max-width: 768px) {

  header {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .brand-logo {
    width: clamp(110px, 28vw, 150px);
  }

  nav ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 1rem;
  }

  .page-wrapper {
    margin: 1.6rem auto;
    padding: 2rem 1.6rem;
  }

  .external-links {
    gap: 0.6rem 0.8rem;
  }
}

@media (max-width: 480px) {

  h1 { font-size: 1.6rem; }
  h2 { font-size: 1.25rem; }

  p, li { font-size: 0.95rem; }

}