/* Terra de Quintal — compostagembr.digital | muted-green neighborhood bulletin */
:root {
  --sage-950: #182016;
  --sage-900: #243222;
  --sage-800: #334430;
  --sage-700: #455a42;
  --sage-600: #5a7354;
  --sage-500: #6f8a68;
  --sage-400: #93a88c;
  --sage-300: #b5c4ad;
  --sage-200: #d4dfd0;
  --sage-100: #e8efe6;
  --sage-50: #f4f7f3;
  --accent: #4a6b44;
  --accent-hover: #385233;
  --text: #1c241a;
  --text-muted: #4a5c46;
  --text-light: #6d7f68;
  --border: #c2d0bc;
  --border-light: #dde5d8;
  --bg: #f6f8f5;
  --bg-card: #ffffff;
  --white: #ffffff;
  --container: 720px;
  --sidebar-width: 220px;
  --radius: 8px;
  --font-serif: "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-body: Georgia, "Iowan Old Style", "Times New Roman", serif;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.5rem;
  --space-2xl: 2rem;
  --space-3xl: 3rem;
  --transition: 0.2s ease;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}

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

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.25;
  color: var(--sage-900);
}

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

.container--wide {
  max-width: calc(var(--container) + var(--sidebar-width) + var(--space-2xl));
}

/* Stacked header */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-xl) 0 var(--space-md);
}

.header-stack {
  text-align: center;
}

.brand {
  display: inline-block;
  text-decoration: none;
  color: inherit;
}

.brand:hover { color: inherit; }

.brand-name {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 600;
  color: var(--sage-900);
  letter-spacing: -0.02em;
}

.brand-tagline {
  display: block;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: var(--space-xs);
  font-style: italic;
}

.header-meta {
  margin-top: var(--space-sm);
  font-size: 0.8125rem;
  color: var(--text-light);
}

.header-meta time { font-variant-numeric: tabular-nums; }

/* Horizontal underline nav */
.nav-bar {
  margin-top: var(--space-lg);
  border-top: 1px solid var(--border-light);
  padding-top: var(--space-md);
  position: relative;
}

.nav-toggle {
  display: none;
  margin: 0 auto var(--space-sm);
  padding: var(--space-sm) var(--space-lg);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm) var(--space-xl);
  list-style: none;
}

.nav-list a {
  display: inline-block;
  padding: var(--space-xs) 0;
  font-size: 0.9375rem;
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.nav-list a:hover,
.nav-list a.is-active {
  color: var(--sage-900);
  border-bottom-color: var(--accent);
}

/* Main layout */
.page-main {
  padding: var(--space-2xl) 0 var(--space-3xl);
}

/* Text-only hero lead */
.hero-lead {
  margin-bottom: var(--space-3xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid var(--border-light);
}

.hero-lead .edition-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: var(--space-md);
}

.hero-lead h1 {
  font-size: clamp(1.5rem, 4vw, 2rem);
  margin-bottom: var(--space-lg);
}

.hero-lead .lead-text {
  font-size: 1.0625rem;
  color: var(--text-muted);
  max-width: 38em;
}

/* Bracket labels */
.tag {
  font-family: var(--font-serif);
  font-size: 0.8125rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.tag::before { content: "["; }
.tag::after { content: "]"; }

/* Numbered article stream */
.stream-section-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-light);
  margin-bottom: var(--space-xl);
}

.article-stream {
  list-style: none;
  counter-reset: stream;
}

.article-stream > li {
  counter-increment: stream;
  margin-bottom: var(--space-3xl);
  padding-bottom: var(--space-3xl);
  border-bottom: 1px solid var(--border-light);
}

.article-stream > li:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

/* Stacked text-below cards */
.stream-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.stream-card-header {
  display: flex;
  gap: var(--space-lg);
  align-items: flex-start;
}

.stream-number {
  flex-shrink: 0;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 600;
  color: var(--sage-300);
  line-height: 1;
  min-width: 2rem;
}

.stream-number::before {
  content: counter(stream, decimal-leading-zero);
}

.stream-card-body { flex: 1; min-width: 0; }

.stream-card .tag { margin-bottom: var(--space-sm); display: inline-block; }

.stream-card h2 {
  font-size: 1.375rem;
  margin-bottom: var(--space-sm);
}

.stream-card h2 a {
  color: var(--sage-900);
  text-decoration: none;
}

.stream-card h2 a:hover { color: var(--accent); }

.stream-meta {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-bottom: var(--space-md);
}

.stream-excerpt {
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.text-link {
  font-size: 0.9375rem;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.text-link:hover { color: var(--accent-hover); }

.stream-card-media img {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--sage-100);
}

/* Article layout — narrow reading + right rail */
.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
}

@media (min-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr var(--sidebar-width);
    gap: var(--space-3xl);
  }
}

.article-narrow { max-width: var(--container); }

.article-header {
  margin-bottom: var(--space-2xl);
}

.article-header .tag { margin-bottom: var(--space-md); display: inline-block; }

.article-header h1 {
  font-size: clamp(1.625rem, 4vw, 2.125rem);
  margin-bottom: var(--space-lg);
}

.article-deck {
  font-size: 1.125rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: var(--space-lg);
}

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

.article-hero {
  margin-bottom: var(--space-2xl);
}

.article-hero img {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-body h2 {
  font-size: 1.25rem;
  margin: var(--space-2xl) 0 var(--space-md);
}

.article-body h3 {
  font-size: 1.0625rem;
  margin: var(--space-xl) 0 var(--space-sm);
}

.article-body p {
  margin-bottom: var(--space-lg);
}

.article-body ul, .article-body ol {
  margin: 0 0 var(--space-lg) var(--space-xl);
}

.article-body li { margin-bottom: var(--space-sm); }

.article-body figure {
  margin: var(--space-2xl) 0;
}

.article-body figure img {
  width: 100%;
  border-radius: var(--radius);
}

.article-body figcaption {
  font-size: 0.8125rem;
  color: var(--text-light);
  margin-top: var(--space-sm);
  font-style: italic;
}

/* Footer author note */
.author-note {
  margin-top: var(--space-3xl);
  padding-top: var(--space-xl);
  border-top: 1px solid var(--border);
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.author-note strong {
  color: var(--sage-800);
  font-weight: 600;
}

/* Right sidebar */
.sidebar-rail {
  font-size: 0.9375rem;
}

.sidebar-block {
  margin-bottom: var(--space-2xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border-light);
}

.sidebar-block:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.sidebar-title {
  font-family: var(--font-serif);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-light);
  margin-bottom: var(--space-md);
}

.sidebar-links {
  list-style: none;
}

.sidebar-links li {
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 1px dotted var(--border-light);
}

.sidebar-links li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.sidebar-links a {
  color: var(--text);
  text-decoration: none;
}

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

.sidebar-author {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
}

.sidebar-author img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius);
  flex-shrink: 0;
}

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

/* Articles listing page */
.articles-page .article-stream > li { scroll-margin-top: 2rem; }

/* Prose pages */
.prose-page h1 {
  font-size: 1.75rem;
  margin-bottom: var(--space-lg);
}

.prose-page h2 {
  font-size: 1.25rem;
  margin: var(--space-2xl) 0 var(--space-md);
}

.prose-page p,
.prose-page ul {
  margin-bottom: var(--space-lg);
  color: var(--text-muted);
}

.prose-page ul {
  margin-left: var(--space-xl);
}

/* Contact form */
.contact-form {
  max-width: 28rem;
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  margin-bottom: var(--space-sm);
  color: var(--text);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: var(--space-md);
  font-family: var(--font-body);
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  color: var(--text);
}

.form-group textarea { min-height: 8rem; resize: vertical; }

.form-notice {
  margin-top: var(--space-md);
  padding: var(--space-md);
  background: var(--sage-100);
  border-radius: var(--radius);
  font-size: 0.9375rem;
  color: var(--sage-800);
}

.form-notice[hidden] { display: none; }

/* Two-column footer */
.site-footer {
  background: var(--sage-900);
  color: var(--sage-200);
  padding: var(--space-3xl) 0 var(--space-2xl);
  margin-top: var(--space-3xl);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-2xl);
  margin-bottom: var(--space-2xl);
}

@media (min-width: 600px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-3xl);
  }
}

.footer-col h2 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--sage-400);
  margin-bottom: var(--space-md);
  font-weight: 600;
}

.footer-col p,
.footer-col address {
  font-size: 0.9375rem;
  font-style: normal;
  line-height: 1.6;
  color: var(--sage-300);
}

.footer-col a {
  color: var(--sage-200);
  text-decoration: underline;
  text-underline-offset: 2px;
}

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

.footer-links {
  list-style: none;
}

.footer-links li { margin-bottom: var(--space-sm); }

.footer-bottom {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--sage-700);
  font-size: 0.8125rem;
  color: var(--sage-400);
}

/* Inline footer cookie note */
.cookie-note {
  margin-top: var(--space-lg);
  padding: var(--space-md) var(--space-lg);
  background: var(--sage-800);
  border-radius: var(--radius);
  font-size: 0.8125rem;
  color: var(--sage-300);
  line-height: 1.5;
}

.cookie-note[hidden] { display: none; }

.cookie-note a {
  color: var(--sage-100);
  text-decoration: underline;
}

.cookie-note button {
  display: inline;
  margin-left: var(--space-sm);
  padding: 0;
  background: none;
  border: none;
  font-family: var(--font-body);
  font-size: inherit;
  color: var(--sage-100);
  text-decoration: underline;
  cursor: pointer;
}

.cookie-note button:hover { color: var(--white); }

/* Mobile nav */
@media (max-width: 640px) {
  .nav-toggle { display: block; }

  .nav-list {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    padding-bottom: var(--space-md);
  }

  .nav-list.is-open { display: flex; }
}
