/* Klarwahl — Editorial Stylesheet */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: #fafaf9;
  color: #1c1917;
  font-family: Charter, Georgia, "Times New Roman", serif;
  font-size: 1.0625rem;
  line-height: 1.7;
}

h1, h2, h3, h4, h5, h6 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  color: #1c1917;
  line-height: 1.25;
  margin-top: 0;
  font-weight: 700;
}

h1 { font-size: 2.25rem; margin-bottom: 1rem; }
h2 { font-size: 1.5rem; margin-bottom: 0.75rem; margin-top: 2rem; }
h3 { font-size: 1.2rem; margin-bottom: 0.5rem; margin-top: 1.5rem; }

p { margin: 0 0 1.25rem; }

a {
  color: #1e40af;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

figure {
  margin: 1.5rem 0;
}

figcaption {
  font-size: 0.875rem;
  color: #57534e;
  margin-top: 0.5rem;
  font-style: italic;
}

/* Header */
.site-header {
  background-color: #ffffff;
  border-bottom: 1px solid #e7e5e4;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-logo {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: #1c1917;
  letter-spacing: -0.01em;
}

.site-logo:hover {
  text-decoration: none;
}

.site-tagline {
  font-size: 0.875rem;
  color: #57534e;
  margin-top: 0.15rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
}

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.main-nav a {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  font-size: 0.9375rem;
  color: #1c1917;
}

/* Main containers */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.article-container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* Hero */
.hero {
  padding: 3rem 1.5rem 2rem;
  max-width: 1100px;
  margin: 0 auto;
  border-bottom: 1px solid #e7e5e4;
}

.hero h1 {
  font-size: 2.5rem;
  max-width: 800px;
  margin-bottom: 0.75rem;
}

.hero p {
  font-size: 1.125rem;
  color: #57534e;
  max-width: 720px;
}

/* Article grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}

.article-card {
  background-color: #ffffff;
  border: 1px solid #e7e5e4;
  padding: 1.5rem;
}

.article-card h2 {
  font-size: 1.15rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
  line-height: 1.35;
}

.article-card h2 a {
  color: #1c1917;
}

.article-card h2 a:hover {
  color: #1e40af;
  text-decoration: none;
}

.article-card .meta {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  font-size: 0.8125rem;
  color: #57534e;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.article-card p {
  font-size: 0.9375rem;
  color: #57534e;
  margin-bottom: 0;
}

/* Section blocks (Sobre/Metodologia resumidos) */
.info-blocks {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid #e7e5e4;
}

.info-block {
  background-color: #ffffff;
  border: 1px solid #e7e5e4;
  padding: 2rem;
}

.info-block h2 {
  margin-top: 0;
}

/* Article page */
article header.article-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e7e5e4;
}

article header.article-header h1 {
  font-size: 2.25rem;
  margin-bottom: 0.75rem;
}

article .meta {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  font-size: 0.875rem;
  color: #57534e;
}

article time {
  font-variant-numeric: tabular-nums;
}

article p {
  margin-bottom: 1.35rem;
}

article ul,
article ol {
  margin-bottom: 1.35rem;
  padding-left: 1.5rem;
}

article li {
  margin-bottom: 0.5rem;
}

.related {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e7e5e4;
}

.related h2 {
  font-size: 1.15rem;
}

.related ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.related li {
  margin-bottom: 0.5rem;
}

.back-home {
  margin-top: 2rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  font-size: 0.9375rem;
}

/* Footer */
.site-footer {
  background-color: #1c1917;
  color: #d6d3d1;
  margin-top: 4rem;
  padding: 2.5rem 1.5rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  font-size: 0.9375rem;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
}

.site-footer h3 {
  color: #fafaf9;
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.site-footer a {
  color: #d6d3d1;
}

.site-footer a:hover {
  color: #ffffff;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li {
  margin-bottom: 0.4rem;
}

.footer-bottom {
  max-width: 1100px;
  margin: 2rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid #44403c;
  font-size: 0.8125rem;
  color: #a8a29e;
}

/* Tables (methodology, etc.) */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}

th, td {
  text-align: left;
  padding: 0.75rem;
  border-bottom: 1px solid #e7e5e4;
}

th {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, sans-serif;
  background-color: #f5f5f4;
}

/* Responsive */
@media (max-width: 1024px) {
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .article-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .info-blocks {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }

  .hero {
    padding: 2rem 1.5rem 1.5rem;
  }

  .hero h1 {
    font-size: 1.85rem;
  }

  h1 {
    font-size: 1.85rem;
  }

  .header-inner {
    flex-direction: column;
    align-items: flex-start;
  }

  .main-nav ul {
    gap: 1rem;
  }
}
