/* Wise Brasil — weekend-edition, warm-earth, compact-news */

:root {
  --primary: #6B3E26;
  --accent: #C27B4F;
  --bg: #FDF6EF;
  --text: #2F2018;
  --muted: #9E7C67;
  --border: #E8D4C2;
  --surface: #FFFCF8;
  --white: #FFFFFF;
  --space-xs: 12px;
  --space-sm: 24px;
  --space-md: 36px;
  --space-lg: 48px;
  --space-xl: 72px;
  --radius: 14px;
  --radius-sm: 12px;
  --container: 960px;
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --line-tight: 1.3;
  --line-body: 1.55;
  --transition: 0.2s ease;
}

*,
*::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.875rem;
  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,
a:focus-visible {
  color: var(--primary);
}

ul,
ol {
  list-style: none;
}

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

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

h1 { font-size: 1.625rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.0625rem; }
h4 { font-size: 0.9375rem; }

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

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

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

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

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

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

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

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

.btn {
  display: inline-block;
  padding: 10px 20px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  background: transparent;
  border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

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

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

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

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

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

/* Header — centered-logo */
.site-header {
  padding: var(--space-sm) 0 0;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  padding-bottom: var(--space-xs);
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--primary);
  text-decoration: none;
  line-height: 1.2;
}

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

.site-tagline {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: 4px;
}

.nav-toggle {
  position: absolute;
  top: 0;
  right: 0;
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--primary);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.nav-toggle:hover {
  border-color: var(--accent);
}

/* Navigation — category-tags-row */
.nav-tags {
  border-top: 1px solid var(--border);
  padding: var(--space-xs) 0;
}

.nav-tags ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px var(--space-xs);
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-sm);
}

.nav-tags a {
  display: inline-block;
  padding: 6px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  transition: background var(--transition), border-color var(--transition);
}

.nav-tags a:hover,
.nav-tags a:focus-visible,
.nav-tags a[aria-current="page"] {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

@media (max-width: 767px) {
  .nav-tags {
    display: none;
    padding: var(--space-sm);
    background: var(--surface);
    border-top: 1px solid var(--border);
  }

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

  .nav-tags ul {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-tags a {
    text-align: center;
    border-radius: var(--radius-sm);
  }
}

/* Hero — stacked-headlines-no-image */
.hero-stack {
  margin-bottom: var(--space-lg);
}

.hero-stack__lead {
  padding-bottom: var(--space-sm);
  margin-bottom: var(--space-sm);
  border-bottom: 2px solid var(--border);
}

.hero-stack__lead h2 {
  font-size: 1.5rem;
  margin: var(--space-xs) 0;
}

.hero-stack__lead h2 a {
  color: var(--primary);
  text-decoration: none;
}

.hero-stack__lead h2 a:hover {
  color: var(--accent);
}

.hero-stack__lead .deck {
  font-size: 0.9375rem;
  color: var(--text);
  margin-bottom: var(--space-xs);
}

.hero-stack__secondary {
  display: grid;
  gap: var(--space-sm);
}

@media (min-width: 600px) {
  .hero-stack__secondary {
    grid-template-columns: 1fr 1fr;
  }
}

.hero-stack__item h3 {
  font-size: 1rem;
  margin: 6px 0;
}

.hero-stack__item a {
  text-decoration: none;
  color: inherit;
}

.hero-stack__item a:hover h3 {
  color: var(--accent);
}

/* Mosaic tiles — 8-col-asymmetric */
.mosaic {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

@media (min-width: 600px) {
  .mosaic {
    grid-template-columns: repeat(8, 1fr);
  }

  .mosaic__tile--wide { grid-column: span 5; }
  .mosaic__tile--narrow { grid-column: span 3; }
  .mosaic__tile--half { grid-column: span 4; }
  .mosaic__tile--full { grid-column: span 8; }
}

/* Cards — stacked-text-below */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  transition: box-shadow var(--transition);
}

.card:hover {
  box-shadow: 0 6px 24px rgba(107, 62, 38, 0.1);
}

.card__image {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--border);
}

.card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0;
}

.card__body {
  padding: var(--space-sm);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card__title {
  font-size: 1rem;
  line-height: var(--line-tight);
}

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

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

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

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

.teaser-row {
  padding: var(--space-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.teaser-row h3 {
  font-size: 1rem;
}

.teaser-row h3 a {
  color: var(--primary);
  text-decoration: none;
}

.teaser-row h3 a:hover {
  color: var(--accent);
}

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

/* Magazine columns — article list */
.magazine-columns {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .magazine-columns {
    grid-template-columns: 1fr 1fr;
  }
}

.magazine-columns .card {
  flex-direction: column;
}

/* Prose sections */
.prose-section {
  margin-bottom: var(--space-md);
}

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

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

.article-content h2:first-child {
  margin-top: 0;
}

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

.article-content ul {
  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-sm) var(--space-md);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
  color: var(--primary);
}

/* Article — wide-magazine + left-rail */
.page-header {
  margin-bottom: var(--space-md);
  max-width: 720px;
}

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

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

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

@media (min-width: 900px) {
  .article-magazine {
    grid-template-columns: 200px 1fr;
    gap: var(--space-lg);
  }
}

.sidebar-left {
  order: -1;
}

@media (min-width: 900px) {
  .sidebar-left {
    order: 0;
  }
}

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

.sidebar-box h3 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-xs);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

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

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

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

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

.related-list a {
  font-size: 0.8125rem;
  color: var(--text);
  text-decoration: none;
  line-height: 1.4;
}

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

/* Author — card-with-avatar */
.author-card {
  display: flex;
  gap: var(--space-xs);
  align-items: flex-start;
}

.author-card__avatar {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--border);
}

.author-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-card__name {
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--primary);
}

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

.author-card__text {
  font-size: 0.75rem;
  color: var(--text);
  line-height: 1.45;
}

.authors-grid {
  display: grid;
  gap: var(--space-sm);
}

@media (min-width: 600px) {
  .authors-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.author-profile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-sm);
}

.author-profile .author-card {
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.author-profile .author-card__avatar {
  width: 72px;
  height: 72px;
}

.article-main {
  max-width: 100%;
}

.article-hero-image {
  margin-bottom: var(--space-md);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--border);
}

.article-hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Contact form */
.contact-form {
  max-width: 480px;
}

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

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

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

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

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

.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mt-sm { margin-top: var(--space-sm); }

/* Footer — two-column */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: var(--space-lg) 0 var(--space-md);
}

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

@media (min-width: 600px) {
  .footer-two-col {
    grid-template-columns: 1.4fr 1fr;
    gap: var(--space-lg);
  }
}

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

.footer-brand p {
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.5;
}

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

.footer-links ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 16px;
}

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

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

.footer-bottom {
  padding-top: var(--space-sm);
  border-top: 1px solid var(--border);
}

.footer-bottom p {
  font-size: 0.75rem;
  color: var(--muted);
  line-height: 1.5;
}

.footer-disclaimer {
  margin-top: var(--space-xs);
  font-size: 0.6875rem;
  color: var(--muted);
  line-height: 1.45;
  max-width: 60ch;
}

/* Cookie — corner-popup */
.cookie-popup {
  position: fixed;
  bottom: var(--space-sm);
  right: var(--space-sm);
  left: var(--space-sm);
  max-width: 340px;
  margin-left: auto;
  padding: var(--space-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 10px 40px rgba(47, 32, 24, 0.15);
  z-index: 1000;
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

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

.cookie-popup p {
  font-size: 0.8125rem;
  color: var(--text);
  margin-bottom: var(--space-xs);
  line-height: 1.45;
}

.cookie-popup__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cookie-popup .btn {
  padding: 8px 16px;
  font-size: 0.75rem;
}

code {
  font-size: 0.8125rem;
  padding: 2px 6px;
  background: var(--border);
  border-radius: 4px;
  color: var(--primary);
}

.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;
}
