/* Good Brasil — community-journal, muted-green, bento-grid */

:root {
  --primary: #386641;
  --accent: #F2CC8F;
  --bg: #F7FBF0;
  --text: #1F2F20;
  --muted: #8AA26E;
  --white: #ffffff;
  --overlay: rgba(31, 47, 32, 0.62);
  --container: 1140px;
  --radius-pill: 28px;
  --radius-soft: 12px;
  --space-xs: 6px;
  --space-sm: 14px;
  --space-md: 22px;
  --space-lg: 36px;
  --space-xl: 52px;
  --space-xxl: 80px;
  --font-serif: Georgia, "Times New Roman", serif;
  --font-sans: "Segoe UI", system-ui, -apple-system, sans-serif;
  --transition: 180ms ease;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

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

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--transition);
}

a:hover, a:focus-visible { color: #2a4d32; }

.container {
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
}

/* Typography — spacious-magazine */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); margin-bottom: var(--space-md); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); margin-bottom: var(--space-sm); }
h3 { font-size: 1.35rem; margin-bottom: var(--space-xs); }

.lead {
  font-size: 1.2rem;
  line-height: 1.65;
  color: #2d3f2e;
  max-width: 38em;
}

.prose p { margin-bottom: 1.15em; }
.prose p:last-child { margin-bottom: 0; }
.prose ul, .prose ol { margin: 1em 0 1.15em 1.4em; }
.prose li { margin-bottom: 0.45em; }
.prose blockquote {
  border-left: 4px solid var(--accent);
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-lg) 0;
  font-family: var(--font-serif);
  font-size: 1.18rem;
  font-style: italic;
  background: rgba(242, 204, 143, 0.18);
  border-radius: 0 var(--radius-soft) var(--radius-soft) 0;
}

.prose code {
  font-size: 0.9em;
  background: rgba(56, 102, 65, 0.1);
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

/* Stacked header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid rgba(56, 102, 65, 0.12);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: var(--space-md) 0 var(--space-sm);
  gap: var(--space-xs);
}

.brand {
  text-decoration: none;
  color: var(--text);
}

.brand__name {
  display: block;
  font-family: var(--font-serif);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.brand__tagline {
  display: block;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--muted);
  margin-top: 2px;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding-bottom: var(--space-sm);
}

.header-meta {
  font-size: 0.85rem;
  color: var(--muted);
}

.header-meta time { color: var(--text); font-weight: 500; }

.header-link {
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.menu-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

/* Category tags row nav */
.nav-tags-row {
  border-top: 1px solid rgba(56, 102, 65, 0.08);
  background: rgba(247, 251, 240, 0.95);
}

.nav-tags-row__inner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  padding: var(--space-sm) 0;
  justify-content: center;
}

.nav-tags-row a {
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35em 0.95em;
  border-radius: var(--radius-pill);
  color: var(--primary);
  background: transparent;
  transition: background var(--transition), color var(--transition);
}

.nav-tags-row a:hover,
.nav-tags-row a:focus-visible,
.nav-tags-row a.is-active {
  background: var(--primary);
  color: var(--white);
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: var(--space-sm);
  padding: var(--space-md) 0 var(--space-lg);
  border-top: 1px solid rgba(56, 102, 65, 0.1);
}

.mobile-nav a {
  text-decoration: none;
  font-weight: 600;
  padding: var(--space-xs) 0;
}

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

/* Hero — full-width image + overlay */
.hero-fullbleed {
  position: relative;
  margin-bottom: var(--space-xl);
  border-radius: 0 0 var(--radius-pill) var(--radius-pill);
  overflow: hidden;
  min-height: 340px;
}

.hero-fullbleed__img {
  width: 100%;
  height: 100%;
  min-height: 340px;
  object-fit: cover;
}

.hero-fullbleed__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--overlay) 0%, rgba(56, 102, 65, 0.45) 100%);
  display: flex;
  align-items: flex-end;
  padding: var(--space-xl) var(--space-lg);
}

.hero-fullbleed__content {
  max-width: 640px;
  color: var(--white);
}

.hero-fullbleed__content h1 {
  color: var(--white);
  margin-bottom: var(--space-sm);
}

.hero-fullbleed__content .lead {
  color: rgba(255, 255, 255, 0.92);
  margin-bottom: var(--space-md);
}

.hero-fullbleed__content .tag {
  margin-bottom: var(--space-sm);
}

/* Tags — pill-colored */
.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.3em 0.85em;
  border-radius: var(--radius-pill);
  background: var(--accent);
  color: var(--text);
  text-decoration: none;
}

.tag--green { background: rgba(56, 102, 65, 0.15); color: var(--primary); }
.tag--muted { background: rgba(138, 162, 110, 0.25); color: #4a5f3c; }

a.tag:hover { filter: brightness(0.95); }

/* Buttons — filled-accent */
.btn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.65em 1.5em;
  border-radius: var(--radius-pill);
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), transform var(--transition);
}

.btn--accent {
  background: var(--accent);
  color: var(--text);
}

.btn--accent:hover,
.btn--accent:focus-visible {
  background: #e8bc7a;
  color: var(--text);
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--primary);
  color: var(--white);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: #2d5235;
  color: var(--white);
}

/* Bento grid — mixed-magazine homepage */
.bento {
  display: grid;
  gap: var(--space-md);
  margin-bottom: var(--space-xxl);
}

.bento__item { min-height: 0; }

.bento__item--wide { grid-column: span 2; }
.bento__item--tall { grid-row: span 2; }

/* Cards — image-overlay, pill-cards */
.card-overlay {
  position: relative;
  border-radius: var(--radius-pill);
  overflow: hidden;
  min-height: 220px;
  display: flex;
  text-decoration: none;
  color: var(--white);
  transition: transform var(--transition);
}

.card-overlay:hover,
.card-overlay:focus-visible {
  transform: scale(1.015);
  color: var(--white);
}

.card-overlay__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-overlay__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(31, 47, 32, 0.88) 0%, rgba(31, 47, 32, 0.2) 55%);
}

.card-overlay__body {
  position: relative;
  z-index: 1;
  margin-top: auto;
  padding: var(--space-md) var(--space-lg);
}

.card-overlay__meta {
  font-size: 0.78rem;
  opacity: 0.85;
  margin-bottom: var(--space-xs);
}

.card-overlay h3 {
  font-size: 1.2rem;
  color: var(--white);
  margin-bottom: var(--space-xs);
}

.card-overlay--lg { min-height: 380px; }
.card-overlay--md { min-height: 280px; }
.card-overlay--sm { min-height: 200px; }

/* Compact dense list */
.dense-list {
  list-style: none;
  border-top: 2px solid var(--primary);
}

.dense-list li {
  border-bottom: 1px solid rgba(56, 102, 65, 0.14);
}

.dense-list a {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--space-sm);
  padding: var(--space-sm) 0;
  text-decoration: none;
  color: var(--text);
  align-items: center;
  transition: background var(--transition);
}

.dense-list a:hover,
.dense-list a:focus-visible {
  background: rgba(56, 102, 65, 0.05);
  color: var(--primary);
}

.dense-list__thumb {
  width: 72px;
  height: 54px;
  border-radius: var(--radius-soft);
  object-fit: cover;
}

.dense-list__title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.35;
}

.dense-list__meta {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

/* Section blocks — mixed-asymmetric spacing */
.section {
  margin-bottom: var(--space-xxl);
}

.section--offset { margin-left: clamp(0px, 4vw, 48px); }
.section--narrow { max-width: 720px; }

.section__label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--muted);
  margin-bottom: var(--space-sm);
}

.section__header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

/* Author card with avatar */
.author-card {
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  padding: var(--space-md);
  background: var(--white);
  border-radius: var(--radius-pill);
  border: 1px solid rgba(56, 102, 65, 0.1);
  margin: var(--space-lg) 0;
}

.author-card__avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

.author-card__name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 2px;
}

.author-card__role {
  font-size: 0.82rem;
  color: var(--muted);
  margin-bottom: var(--space-xs);
}

.author-card__bio {
  font-size: 0.92rem;
  line-height: 1.55;
}

/* Article — wide-magazine */
.article-hero {
  margin-bottom: var(--space-xl);
}

.article-hero__img {
  width: 100%;
  border-radius: var(--radius-pill);
  margin-bottom: var(--space-lg);
}

.article-header {
  max-width: 820px;
  margin-bottom: var(--space-xl);
}

.article-header .byline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
  font-size: 0.88rem;
  color: var(--muted);
  margin: var(--space-md) 0;
}

.article-body {
  max-width: 720px;
  font-size: 1.08rem;
  line-height: 1.78;
}

.article-body--wide {
  max-width: 820px;
}

.article-updated {
  font-size: 0.82rem;
  color: var(--muted);
  font-style: italic;
  margin-top: var(--space-md);
}

.related-stories {
  margin-top: var(--space-xxl);
  padding-top: var(--space-lg);
  border-top: 2px solid var(--primary);
}

.related-stories h2 { font-size: 1.35rem; }

/* Page layouts */
.page-header {
  padding: var(--space-xl) 0 var(--space-lg);
}

.page-header h1 { margin-bottom: var(--space-sm); }

/* Contact form */
.contact-form {
  display: grid;
  gap: var(--space-md);
  max-width: 520px;
  margin-top: var(--space-lg);
}

.contact-form label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: var(--space-xs);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.7em 1em;
  border: 1px solid rgba(56, 102, 65, 0.25);
  border-radius: var(--radius-soft);
  font-family: inherit;
  font-size: 1rem;
  background: var(--white);
}

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

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Footer — editorial-masthead */
.site-footer {
  background: var(--primary);
  color: rgba(255, 255, 255, 0.9);
  padding: var(--space-xxl) 0 var(--space-lg);
  margin-top: var(--space-xxl);
}

.footer-masthead {
  text-align: center;
  margin-bottom: var(--space-xl);
}

.footer-masthead__name {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: var(--space-xs);
}

.footer-masthead__tagline {
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
  text-align: left;
}

.footer-grid h3 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 0.4em; }

.footer-grid a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 0.92rem;
}

.footer-grid a:hover,
.footer-grid a:focus-visible { color: var(--white); text-decoration: underline; }

.footer-bottom {
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.65);
  padding-top: var(--space-lg);
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

/* Cookie corner popup */
.cookie-popup {
  position: fixed;
  bottom: var(--space-md);
  right: var(--space-md);
  max-width: 340px;
  padding: var(--space-md);
  background: var(--white);
  border-radius: var(--radius-pill);
  box-shadow: 0 8px 32px rgba(31, 47, 32, 0.18);
  border: 1px solid rgba(56, 102, 65, 0.12);
  z-index: 200;
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 250ms ease, transform 250ms ease;
  pointer-events: none;
}

.cookie-popup.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.cookie-popup p {
  font-size: 0.88rem;
  line-height: 1.5;
  margin-bottom: var(--space-sm);
}

.cookie-popup a { font-size: 0.88rem; }

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

.text-muted { color: var(--muted); }

.contact-note { margin-top: 2rem; }

/* Media queries */
@media (min-width: 768px) {
  .bento {
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(200px, auto);
  }

  .hero-fullbleed { min-height: 420px; }
  .hero-fullbleed__img { min-height: 420px; }
}

@media (max-width: 767px) {
  .header-row { padding-top: var(--space-xs); }

  .menu-toggle { display: flex; }

  .nav-tags-row { display: none; }

  .bento__item--wide { grid-column: span 1; }
  .bento__item--tall { grid-row: span 1; }

  .footer-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .section--offset { margin-left: 0; }

  .cookie-popup {
    left: var(--space-sm);
    right: var(--space-sm);
    max-width: none;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .article-body { font-size: 1.12rem; }
}
