/* ==========================================================================
   Librerial — design system
   Direção: editorial, biblioteca, sóbrio. Navy escuro + azul de destaque.
   Tipografia: Fraunces (display) + Inter (corpo).
   ========================================================================== */

:root {
  /* Paleta (hex exatos do brief) */
  --bg:              #FFFFFF;
  --bg-alt:          #F4F6F8;
  --text:            #14181F;
  --text-soft:       #5A6573;
  --border:          #E1E5EA;
  --navy:            #1A2B4A;
  --accent:          #2C4A7C;
  --accent-soft:     #EAF0F8;

  /* Tipografia */
  --font-display: "Fraunces", "Libre Baskerville", Georgia, serif;
  --font-body:    "Inter", "Source Sans 3", system-ui, -apple-system, sans-serif;

  /* Escala de espaçamento */
  --s-1: 4px;  --s-2: 8px;  --s-3: 16px; --s-4: 24px;
  --s-5: 32px; --s-6: 48px; --s-7: 64px;

  /* Refinamentos */
  --radius: 5px;
  --t: 0.18s ease;
  --shadow: 0 1px 3px rgba(0,0,0,.06);
  --maxw: 1120px;
  --read: 65ch;
}

/* ---------- Reset enxuto ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; transition: color var(--t); }
a:hover { color: var(--navy); text-decoration: underline; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--text);
  line-height: 1.18;
  font-weight: 600;
  margin: 0 0 var(--s-3);
  letter-spacing: -0.01em;
}
h1 { font-size: 2.35rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.25rem; }
p { margin: 0 0 var(--s-3); }

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

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--s-4);
}

.visually-hidden {
  position: absolute; 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: var(--s-3); top: -60px;
  background: var(--navy); color: #fff; padding: var(--s-2) var(--s-3);
  border-radius: var(--radius); z-index: 200; transition: top var(--t);
}
.skip-link:focus { top: var(--s-3); }

/* ==========================================================================
   Header (navy, NÃO fixed/sticky)
   ========================================================================== */
.site-header {
  background: var(--navy);
  color: #fff;
  border-bottom: 3px solid var(--accent);
}
.site-header a { color: #fff; }
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4); min-height: 72px;
}
.brand {
  display: flex; align-items: center; gap: var(--s-2);
  font-family: var(--font-display); font-weight: 600; font-size: 1.35rem;
  letter-spacing: -0.01em;
}
.brand:hover { text-decoration: none; }
.brand img { height: 34px; width: auto; }

.nav-desktop ul {
  display: flex; align-items: center; gap: var(--s-4);
  list-style: none; margin: 0; padding: 0;
}
.nav-desktop a {
  display: inline-block; padding: var(--s-2) 0;
  font-size: 0.95rem; border-bottom: 2px solid transparent;
  transition: border-color var(--t), color var(--t);
}
.nav-desktop a:hover { text-decoration: none; border-bottom-color: var(--accent-soft); }
.nav-desktop a[aria-current="page"] { border-bottom-color: #fff; }

.header-tools { display: flex; align-items: center; gap: var(--s-3); }

.lang-select {
  background: rgba(255,255,255,.08);
  color: #fff;
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius);
  padding: var(--s-2) var(--s-3);
  font-family: var(--font-body); font-size: 0.9rem;
  cursor: pointer;
  scale: 0.8;
  margin-left: 5px; 
}
.lang-select option { color: var(--text); }

.menu-toggle {
  display: none;
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: var(--radius);
  padding: var(--s-2) var(--s-3);
  font-family: var(--font-body); font-size: 0.9rem; cursor: pointer;
}
.menu-toggle:hover { background: rgba(255,255,255,.1); }

/* ---------- Sidebar mobile ---------- */
.mobile-nav {
  position: fixed; inset: 0 0 0 auto;
  width: min(320px, 84vw);
  background: var(--navy); color: #fff;
  transform: translateX(100%);
  transition: transform 0.22s ease;
  z-index: 120; padding: var(--s-5) var(--s-4);
  overflow-y: auto;
  box-shadow: -8px 0 24px rgba(0,0,0,.25);
}
[dir="rtl"] .mobile-nav { inset: 0 auto 0 0; transform: translateX(-100%); }
.mobile-nav.open { transform: translateX(0); }
.mobile-nav ul { list-style: none; margin: var(--s-4) 0 0; padding: 0; }
.mobile-nav li { border-bottom: 1px solid rgba(255,255,255,.12); }
.mobile-nav a { display: block; padding: var(--s-3) 0; font-size: 1.05rem; color:#fff; }
.mobile-nav a:hover { text-decoration: none; color: var(--accent-soft); }
.mobile-nav-head { display: flex; justify-content: space-between; align-items: center; }
.mobile-nav-close {
  background: transparent; border: 1px solid rgba(255,255,255,.3);
  color: #fff; border-radius: var(--radius);
  padding: var(--s-1) var(--s-3); cursor: pointer; font-family: var(--font-body);
}
.scrim {
  position: fixed; inset: 0; background: rgba(20,24,31,.5);
  opacity: 0; visibility: hidden; transition: opacity var(--t); z-index: 110;
}
.scrim.open { opacity: 1; visibility: visible; }

/* ==========================================================================
   Hero / home
   ========================================================================== */
.hero {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  padding: var(--s-7) 0;
}
.hero-eyebrow {
  font-family: var(--font-body); font-size: 0.8rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
  margin-bottom: var(--s-3);
}
.hero h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); max-width: 16ch; }
.hero p { color: var(--text-soft); max-width: 56ch; font-size: 1.15rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-5); }

/* ==========================================================================
   Botões (texto escrito, sem ícones/SVG)
   ========================================================================== */
.btn {
  display: inline-block;
  font-family: var(--font-body); font-size: 0.95rem; font-weight: 600;
  padding: var(--s-3) var(--s-4);
  border-radius: var(--radius);
  border: 1px solid var(--accent);
  background: var(--accent); color: #fff;
  cursor: pointer; transition: background var(--t), color var(--t), border-color var(--t);
  line-height: 1;
}
.btn:hover { background: var(--navy); border-color: var(--navy); color: #fff; text-decoration: none; }
.btn-ghost {
  background: transparent; color: var(--accent);
}
.btn-ghost:hover { background: var(--accent-soft); color: var(--navy); }
.btn-sm { padding: var(--s-2) var(--s-3); font-size: 0.875rem; }

/* ==========================================================================
   Seções e grids
   ========================================================================== */
.section { padding: var(--s-7) 0; }
.section-alt { background: var(--bg-alt); }
.section-head { margin-bottom: var(--s-5); }
.section-head h2 {
  display: inline-block; padding-bottom: var(--s-2);
  border-bottom: 3px solid var(--accent);
}
.section-head p { color: var(--text-soft); margin-top: var(--s-3); }

.grid {
  display: grid; gap: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-4);
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
  display: flex; flex-direction: column;
}
.card:hover { border-color: var(--accent); box-shadow: var(--shadow); }
.card h3 { margin-bottom: var(--s-2); }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); text-decoration: none; }
.card p { color: var(--text-soft); font-size: 0.95rem; margin-bottom: var(--s-3); }
.card .card-meta { margin-top: auto; font-size: 0.82rem; color: var(--text-soft); }
.card-tag {
  display: inline-block; background: var(--accent-soft); color: var(--accent);
  font-size: 0.74rem; font-weight: 600; letter-spacing: 0.04em;
  text-transform: uppercase; padding: var(--s-1) var(--s-2);
  border-radius: var(--radius); margin-bottom: var(--s-3);
}

/* ==========================================================================
   Breadcrumb
   ========================================================================== */
.breadcrumb {
  font-size: 0.86rem; color: var(--text-soft);
  padding: var(--s-4) 0; border-bottom: 1px solid var(--border);
}
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0; padding: 0; }
.breadcrumb li::after { content: "/"; margin-left: var(--s-2); color: var(--border); }
.breadcrumb li:last-child::after { content: ""; }

/* ==========================================================================
   Post
   ========================================================================== */
.post {
  padding: var(--s-6) 0 var(--s-7);
}
.post-header { max-width: var(--read); margin-bottom: var(--s-5); }
.post-header h1 { font-size: clamp(2rem, 4vw, 2.9rem); }
.post-meta {
  font-size: 0.88rem; color: var(--text-soft);
  display: flex; flex-wrap: wrap; gap: var(--s-3); margin-top: var(--s-3);
}
.post-actions {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  padding: var(--s-4) 0; margin: var(--s-4) 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.post-body {
  max-width: var(--read);
  font-size: 1.1rem; line-height: 1.75;
}
.post-body h2 { margin-top: var(--s-6); }
.post-body h3 { margin-top: var(--s-5); }
.post-body img { border-radius: var(--radius); margin: var(--s-4) 0; }
.post-body blockquote {
  margin: var(--s-4) 0; padding: var(--s-3) var(--s-4);
  border-left: 3px solid var(--accent); background: var(--accent-soft);
  color: var(--text); border-radius: 0 var(--radius) var(--radius) 0;
}
.post-tags { margin-top: var(--s-5); display: flex; flex-wrap: wrap; gap: var(--s-2); }
.post-tags a {
  font-size: 0.82rem; background: var(--bg-alt); border: 1px solid var(--border);
  padding: var(--s-1) var(--s-3); border-radius: var(--radius); color: var(--text-soft);
}
.post-tags a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

.disclaimer {
  max-width: var(--read);
  margin-top: var(--s-6); padding: var(--s-4);
  background: var(--bg-alt); border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem; color: var(--text-soft);
}
.disclaimer strong { color: var(--text); display: block; margin-bottom: var(--s-1); }

/* ==========================================================================
   Busca
   ========================================================================== */
.search-form { display: flex; gap: var(--s-2); max-width: 560px; margin: var(--s-5) 0; }
.search-input {
  flex: 1; padding: var(--s-3); font-family: var(--font-body); font-size: 1rem;
  border: 1px solid var(--border); border-radius: var(--radius); color: var(--text);
}
.search-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }

/* ==========================================================================
   Página institucional
   ========================================================================== */
.page-content { max-width: var(--read); padding: var(--s-6) 0 var(--s-7); }
.page-content h2 { margin-top: var(--s-5); }

/* ==========================================================================
   Paginação
   ========================================================================== */
.pagination {
  display: flex; flex-wrap: wrap; gap: var(--s-2);
  margin-top: var(--s-6); align-items: center;
}
.pagination a, .pagination span {
  padding: var(--s-2) var(--s-3); border: 1px solid var(--border);
  border-radius: var(--radius); font-size: 0.9rem; color: var(--text-soft);
}
.pagination a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.pagination .current { background: var(--navy); color: #fff; border-color: var(--navy); }
.pagination .disabled { opacity: 0.4; }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--navy); color: #fff;
  padding: var(--s-7) 0 var(--s-5); margin-top: var(--s-7);
}
.site-footer a { color: #fff; opacity: 0.85; }
.site-footer a:hover { opacity: 1; color: var(--accent-soft); }
.footer-grid {
  display: grid; gap: var(--s-5);
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  padding-bottom: var(--s-5); border-bottom: 1px solid rgba(255,255,255,.15);
}
.footer-col h4 {
  color: #fff; font-family: var(--font-body); font-size: 0.8rem;
  text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: var(--s-3);
  opacity: 0.7;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: var(--s-2); font-size: 0.92rem; }
.footer-brand { font-family: var(--font-display); font-size: 1.3rem; margin-bottom: var(--s-2); }
.footer-bottom {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: center; gap: var(--s-3); padding-top: var(--s-4);
  font-size: 0.85rem; opacity: 0.75;
}
.to-top {
  background: transparent; border: 1px solid rgba(255,255,255,.3);
  color: #fff; padding: var(--s-2) var(--s-3); border-radius: var(--radius);
  cursor: pointer; font-family: var(--font-body); font-size: 0.85rem;
  transition: background var(--t);
}
.to-top:hover { background: rgba(255,255,255,.12); }

/* ==========================================================================
   Cookie banner
   ========================================================================== */
.cookie-banner {
  position: fixed; left: var(--s-4); right: var(--s-4); bottom: var(--s-4);
  max-width: 640px; margin: 0 auto;
  background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,.12);
  padding: var(--s-4); z-index: 90;
  display: flex; flex-wrap: wrap; gap: var(--s-3); align-items: center;
  justify-content: space-between;
}
.cookie-banner p { margin: 0; font-size: 0.9rem; color: var(--text-soft); flex: 1 1 320px; }
.cookie-actions { display: flex; gap: var(--s-2); }
.cookie-banner.hidden { display: none; }

/* ==========================================================================
   Estado vazio / mensagens
   ========================================================================== */
.empty {
  text-align: center; padding: var(--s-7) var(--s-4);
  color: var(--text-soft);
}
.empty h2 { color: var(--text); }

/* ==========================================================================
   Responsivo
   ========================================================================== */
@media (max-width: 860px) {
  .nav-desktop { display: none; }
  .menu-toggle { display: inline-block; }
  h1 { font-size: 2rem; }
  .section { padding: var(--s-6) 0; }
  .hero { padding: var(--s-6) 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
