/* ============================================
   Forecast Brasil — style.css
   ============================================ */

/* --- :root --- */
:root {
  --primary: #2F3E46;
  --accent: #52796F;
  --bg: #F8F9F7;
  --text: #1B2630;
  --muted: #84A98C;
  --border: #D4DCD0;
  --white: #FFFFFF;
  --space-xs: 12px;
  --space-sm: 24px;
  --space-md: 36px;
  --space-lg: 48px;
  --space-xl: 72px;
  --radius: 2px;
  --container: 1140px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", Times, serif;
  --line-tight: 1.35;
  --line-body: 1.6;
  --transition: 0.2s ease;
}

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

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

body {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: var(--line-body);
  color: var(--text);
  background-color: var(--bg);
  overflow-x: hidden;
}

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

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

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

ul,
ol {
  list-style: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* --- typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: var(--line-tight);
  color: var(--primary);
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }
h4 { font-size: 1rem; }

p {
  margin-bottom: var(--space-xs);
}

p:last-child {
  margin-bottom: 0;
}

.lead {
  font-size: 1.0625rem;
  line-height: var(--line-body);
  color: var(--primary);
}

.muted {
  color: var(--muted);
  font-size: 0.8125rem;
}

.tag {
  display: inline-block;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent);
}

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

.text-link {
  display: inline;
  font-weight: 600;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

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

/* --- layout --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-sm);
}

.col-main { grid-column: span 12; }
.col-sidebar { grid-column: span 12; }

.site-header {
  border-bottom: 1px solid var(--border);
  padding: var(--space-sm) 0;
  background: var(--white);
}

.header-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
}

.site-logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-logo:hover {
  color: var(--accent);
}

.site-tagline {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
}

.site-nav a {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  padding-bottom: 4px;
  border-bottom: 2px solid transparent;
  transition: border-color var(--transition), color var(--transition);
}

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

.nav-toggle {
  display: none;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  padding: var(--space-xs);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.site-main {
  padding: var(--space-md) 0 var(--space-xl);
}

.page-header {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
}

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

/* --- components --- */
.hero-lead {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-md);
}

.hero-lead h1 {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.hero-lead .lead {
  max-width: 42rem;
}

.featured-story {
  margin-bottom: var(--space-lg);
}

.featured-story .card-editorial {
  border-top: 3px solid var(--primary);
}

.card-editorial {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  overflow: hidden;
  transition: border-color var(--transition);
}

.card-editorial:hover {
  border-color: var(--accent);
}

.card-editorial__image {
  aspect-ratio: 3 / 2;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

.card-editorial__image img,
.card-editorial__image svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-editorial__body {
  padding: var(--space-sm);
}

.card-editorial__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
  margin-bottom: var(--space-xs);
}

.card-editorial__title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
}

.card-editorial__title a {
  color: var(--primary);
  text-decoration: none;
}

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

.card-editorial__excerpt {
  font-size: 0.875rem;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
}

.article-columns {
  column-count: 1;
  column-gap: var(--space-sm);
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.article-content {
  font-size: 0.9375rem;
}

.article-content h2 {
  margin: var(--space-md) 0 var(--space-xs);
}

.article-content h3 {
  margin: var(--space-sm) 0 var(--space-xs);
}

.article-content ul,
.article-content ol {
  margin: var(--space-xs) 0 var(--space-xs) var(--space-sm);
  list-style: disc;
}

.article-content ol {
  list-style: decimal;
}

.article-content li {
  margin-bottom: 6px;
}

.article-content blockquote {
  margin: var(--space-sm) 0;
  padding: var(--space-xs) var(--space-sm);
  border-left: 3px solid var(--accent);
  background: var(--white);
  font-style: italic;
  color: var(--primary);
}

.article-hero-image {
  aspect-ratio: 3 / 2;
  margin-bottom: var(--space-sm);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
}

.article-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  align-items: center;
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border);
  font-size: 0.8125rem;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.sidebar-sticky {
  position: static;
}

.sidebar-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  padding: var(--space-sm);
}

.sidebar-box h3 {
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-xs);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
}

.toc-list li {
  margin-bottom: 8px;
}

.toc-list a {
  font-size: 0.8125rem;
  color: var(--text);
  text-decoration: none;
}

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

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

.author-bio__avatar {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  background: var(--bg);
}

.author-bio__name {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--primary);
  margin-bottom: 4px;
}

.author-bio__role {
  font-size: 0.75rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.author-bio__text {
  font-size: 0.8125rem;
  line-height: 1.5;
}

.related-list li {
  margin-bottom: var(--space-xs);
  padding-bottom: var(--space-xs);
  border-bottom: 1px solid var(--border);
}

.related-list li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.related-list a {
  font-size: 0.875rem;
  color: var(--primary);
  text-decoration: none;
  font-family: var(--font-serif);
}

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

.site-footer {
  border-top: 3px solid var(--primary);
  background: var(--white);
  padding: var(--space-md) 0 var(--space-sm);
}

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

.footer-masthead .site-logo {
  display: inline-block;
  margin-bottom: var(--space-xs);
}

.footer-masthead p {
  font-size: 0.8125rem;
  color: var(--muted);
  max-width: 32rem;
  margin: 0 auto;
}

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

.footer-col h4 {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-xs);
  color: var(--primary);
}

.footer-col ul li {
  margin-bottom: 6px;
}

.footer-col a {
  font-size: 0.8125rem;
  color: var(--text);
  text-decoration: none;
}

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  align-items: center;
  text-align: center;
  font-size: 0.75rem;
  color: var(--muted);
}

.cookie-notice {
  display: none;
  width: 100%;
  padding: var(--space-xs);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--text);
}

.cookie-notice.is-visible {
  display: block;
}

.cookie-notice button {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.contact-form label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--primary);
}

.contact-form .field {
  margin-bottom: var(--space-sm);
}

.contact-form input,
.contact-form textarea,
.contact-form select {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  color: var(--text);
}

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

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

.prose-section {
  margin-bottom: var(--space-md);
}

.prose-section h2 {
  margin-bottom: var(--space-xs);
}

.prose-section h3 {
  margin: var(--space-sm) 0 var(--space-xs);
}

.section-label {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-xs);
}

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: var(--space-md) 0;
}

/* --- 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-center { text-align: center; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mt-sm { margin-top: var(--space-sm); }

/* --- media queries --- */
@media (min-width: 480px) {
  h1 { font-size: 2rem; }
  .hero-lead h1 { font-size: 2.25rem; }
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 768px) {
  body { font-size: 1rem; }
  h1 { font-size: 2.25rem; }
  h2 { font-size: 1.5rem; }
  .hero-lead h1 { font-size: 2.5rem; }

  .nav-toggle { display: none; }

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

  .article-columns {
    column-count: 2;
  }

  .article-layout {
    grid-template-columns: 1fr 280px;
    align-items: start;
  }

  .sidebar-sticky {
    position: sticky;
    top: var(--space-sm);
  }

  .featured-story .grid-12 {
    align-items: stretch;
  }

  .featured-story .col-featured {
    grid-column: span 7;
  }

  .featured-story .col-secondary {
    grid-column: span 5;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
  }

  .footer-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

@media (min-width: 1024px) {
  .col-main { grid-column: span 8; }
  .col-sidebar { grid-column: span 4; }

  .article-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .card-editorial__title {
    font-size: 1.375rem;
  }

  .featured-story .col-featured .card-editorial__title {
    font-size: 1.625rem;
  }
}

@media (max-width: 767px) {
  .nav-toggle {
    display: block;
    margin-top: var(--space-xs);
  }

  .site-nav {
    display: none;
    width: 100%;
  }

  .site-nav.is-open {
    display: block;
  }

  .site-nav ul {
    flex-direction: column;
    align-items: center;
    padding: var(--space-xs) 0;
  }
}
