/* Verde Aberto — matabr.info | forest-sage civic-watchdog */

:root {
  --forest: #2a4a3f;
  --forest-dark: #1e3530;
  --sage: #7a9e72;
  --sage-light: #b5cdb0;
  --sage-muted: #e8efe6;
  --cream: #f6f8f4;
  --text: #1a2b26;
  --text-muted: #4a5f57;
  --border: #d4dfd0;
  --white: #ffffff;
  --radius-soft: 8px;
  --radius-img: 10px;
  --container: 960px;
  --font: "DM Sans", system-ui, -apple-system, sans-serif;
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 4rem;
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

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

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

a {
  color: var(--forest);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover { color: var(--sage); }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  max-width: var(--container);
  margin: 0 auto;
}

.logo {
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--forest);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo span { color: var(--sage); }

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-soft);
  padding: 8px 10px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--forest);
  transition: transform 0.2s;
}

.site-nav {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  background: var(--white);
  border-left: 1px solid var(--border);
  padding: var(--space-lg) var(--space-md);
  transition: right 0.3s ease;
  z-index: 200;
  overflow-y: auto;
}

.site-nav.is-open { right: 0; }

.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26, 43, 38, 0.4);
  z-index: 150;
}

.nav-overlay.is-visible { display: block; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.site-nav a {
  display: block;
  padding: var(--space-xs) 0;
  text-decoration: none;
  font-weight: 500;
  color: var(--text);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--forest);
}

.nav-close {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

@media (min-width: 768px) {
  .nav-toggle, .nav-close, .nav-overlay { display: none; }

  .site-nav {
    position: static;
    width: auto;
    height: auto;
    border: none;
    padding: 0;
    overflow: visible;
  }

  .site-nav ul {
    flex-direction: row;
    gap: var(--space-md);
  }

  .site-nav a { padding: 0; }
}

/* Hero — text-only lead */
.hero-lead {
  padding: var(--space-lg) 0 var(--space-md);
  border-bottom: 1px solid var(--border);
}

.hero-lead .eyebrow {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sage);
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.hero-lead h1 {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  line-height: 1.2;
  margin: 0 0 var(--space-sm);
  color: var(--forest-dark);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-lead .dek {
  font-size: 1.125rem;
  color: var(--text-muted);
  margin: 0;
  max-width: 42rem;
}

/* Cards — flat */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-soft);
  padding: var(--space-md);
}

.card-flat { box-shadow: none; }

/* Tags */
.tag {
  display: inline-block;
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  color: var(--sage);
  margin-bottom: var(--space-xs);
}

/* Buttons — subtle ghost */
.btn {
  display: inline-block;
  padding: 0.5rem 1.125rem;
  font-family: var(--font);
  font-size: 0.9375rem;
  font-weight: 500;
  border-radius: var(--radius-soft);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--forest);
}

.btn-ghost:hover {
  background: var(--sage-muted);
  border-color: var(--sage-light);
  color: var(--forest-dark);
}

/* Homepage layout */
.home-grid {
  display: grid;
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
}

.lead-story .card {
  padding: 0;
  overflow: hidden;
}

.lead-story .card-body { padding: var(--space-md); }

.lead-story h2 {
  font-size: 1.5rem;
  margin: 0 0 var(--space-sm);
  line-height: 1.3;
}

.lead-story h2 a {
  color: var(--forest-dark);
  text-decoration: none;
}

.lead-story h2 a:hover { text-decoration: underline; }

.lead-story .meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.lead-story p { margin: 0 0 var(--space-sm); }

.thumb-wrap {
  border-radius: var(--radius-img) var(--radius-img) 0 0;
  overflow: hidden;
  background: var(--sage-muted);
}

.thumb-wrap img,
.thumb-wrap svg { width: 100%; aspect-ratio: 16/9; object-fit: cover; }

/* Numbered article list */
.article-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: feed;
}

.article-list li {
  counter-increment: feed;
  display: grid;
  grid-template-columns: 2.5rem 1fr;
  gap: var(--space-sm);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.article-list li::before {
  content: counter(feed, decimal-leading-zero);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--sage-light);
  line-height: 1.2;
}

.article-list h3 {
  font-size: 1.0625rem;
  margin: 0 0 0.25rem;
  line-height: 1.35;
}

.article-list h3 a {
  color: var(--forest-dark);
  text-decoration: none;
}

.article-list h3 a:hover { text-decoration: underline; }

.article-list .meta {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.section-title {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  margin: 0 0 var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--forest);
}

/* Article split layout */
.article-layout {
  display: grid;
  gap: var(--space-lg);
  padding: var(--space-lg) 0;
}

@media (min-width: 768px) {
  .article-layout {
    grid-template-columns: 1fr 260px;
    align-items: start;
  }
}

.article-main h1 {
  font-size: clamp(1.625rem, 3.5vw, 2rem);
  line-height: 1.25;
  margin: 0 0 var(--space-sm);
  color: var(--forest-dark);
}

.article-main .meta {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border);
}

.article-main .featured-img {
  border-radius: var(--radius-img);
  overflow: hidden;
  margin-bottom: var(--space-md);
  background: var(--sage-muted);
}

.article-main p { margin: 0 0 var(--space-sm); }

.article-main h2 {
  font-size: 1.25rem;
  margin: var(--space-md) 0 var(--space-sm);
  color: var(--forest);
}

.article-main blockquote {
  margin: var(--space-md) 0;
  padding: var(--space-sm) var(--space-md);
  border-left: 3px solid var(--sage);
  background: var(--sage-muted);
  font-style: italic;
  color: var(--text-muted);
}

/* Sidebar — author bio box only */
.sidebar .author-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-soft);
  padding: var(--space-md);
  position: sticky;
  top: 5rem;
}

.author-box .author-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: var(--space-sm);
  background: var(--sage-muted);
}

.author-box h3 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
  color: var(--forest-dark);
}

.author-box .role {
  font-size: 0.8125rem;
  color: var(--sage);
  margin-bottom: var(--space-sm);
}

.author-box p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
  line-height: 1.5;
}

/* Related articles */
.related {
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

.related h2 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 var(--space-md);
}

.related-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-sm);
}

.related-list a {
  text-decoration: none;
  font-weight: 500;
  color: var(--forest-dark);
}

.related-list a:hover { text-decoration: underline; }

/* Page content */
.page-header {
  padding: var(--space-lg) 0 var(--space-md);
  border-bottom: 1px solid var(--border);
}

.page-header h1 {
  font-size: clamp(1.5rem, 3vw, 1.875rem);
  margin: 0;
  color: var(--forest-dark);
}

.page-content {
  padding: var(--space-lg) 0;
  max-width: 42rem;
}

.page-content.wide { max-width: none; }

.page-content h2 {
  font-size: 1.125rem;
  margin: var(--space-md) 0 var(--space-sm);
  color: var(--forest);
}

.page-content p { margin: 0 0 var(--space-sm); }

.page-content ul, .page-content ol {
  margin: 0 0 var(--space-sm);
  padding-left: 1.25rem;
}

/* Articles index */
.articles-grid {
  display: grid;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
}

.article-card {
  display: grid;
  gap: var(--space-sm);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-soft);
  overflow: hidden;
}

@media (min-width: 600px) {
  .article-card {
    grid-template-columns: 200px 1fr;
  }
}

.article-card .thumb-wrap { border-radius: 0; }

.article-card-body { padding: var(--space-md); }

.article-card h2 {
  font-size: 1.125rem;
  margin: 0 0 var(--space-xs);
}

.article-card h2 a {
  color: var(--forest-dark);
  text-decoration: none;
}

.article-card h2 a:hover { text-decoration: underline; }

/* Contact form */
.contact-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: 0.625rem 0.75rem;
  font-family: var(--font);
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-soft);
  background: var(--white);
  margin-bottom: var(--space-sm);
}

.contact-form textarea { min-height: 140px; resize: vertical; }

/* Footer — stacked links */
.site-footer {
  background: var(--forest-dark);
  color: var(--sage-light);
  padding: var(--space-lg) 0 var(--space-md);
  margin-top: var(--space-xl);
}

.footer-inner { max-width: var(--container); margin: 0 auto; padding: 0 var(--space-md); }

.footer-brand {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--white);
  margin-bottom: var(--space-sm);
}

.footer-brand span { color: var(--sage-light); }

.footer-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  margin-bottom: var(--space-md);
}

.footer-links a {
  color: var(--sage-light);
  text-decoration: none;
  font-size: 0.9375rem;
}

.footer-links a:hover { color: var(--white); text-decoration: underline; }

.footer-meta {
  font-size: 0.8125rem;
  color: rgba(181, 205, 176, 0.7);
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: var(--space-md);
}

.cookie-note {
  margin-top: var(--space-sm);
  padding: var(--space-sm);
  background: rgba(0,0,0,0.15);
  border-radius: var(--radius-soft);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.cookie-note.is-hidden { display: none; }

.cookie-note button {
  margin-top: var(--space-xs);
  padding: 0.375rem 0.75rem;
  font-family: var(--font);
  font-size: 0.8125rem;
  background: transparent;
  border: 1px solid var(--sage-light);
  color: var(--sage-light);
  border-radius: var(--radius-soft);
  cursor: pointer;
}

.cookie-note button:hover {
  background: rgba(255,255,255,0.1);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}
