/* Pulse Brasil — pulsebr.click */

:root {
  --primary: #4A4E69;
  --accent: #9A8C98;
  --bg: #F7F4F8;
  --text: #22223B;
  --muted: #C9ADA7;
  --white: #ffffff;
  --border: #E2D9DF;
  --tag-economia: #6B705C;
  --tag-setores: #4A4E69;
  --tag-sentimento: #9A8C98;
  --tag-local: #C9ADA7;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --space-xs: 8px;
  --space-sm: 16px;
  --space-md: 24px;
  --space-lg: 32px;
  --space-xl: 48px;
  --container: 1140px;
  --font-sans: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --header-height: 108px;
  --header-shrink: 64px;
  --transition: 0.25s ease;
}

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

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

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

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

ul,
ol {
  list-style: none;
}

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

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

h1 { font-size: 1.875rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.0625rem; }

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

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

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

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

.text-small {
  font-size: 0.875rem;
}

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

main {
  flex: 1;
}

/* Header — double-row-nav, sticky shrink */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}

.site-header.is-shrunk {
  box-shadow: 0 2px 12px rgba(34, 34, 59, 0.08);
}

.header-top {
  border-bottom: 1px solid var(--border);
  transition: padding var(--transition);
}

.site-header.is-shrunk .header-top {
  padding-top: 0;
  padding-bottom: 0;
}

.header-top-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  gap: var(--space-sm);
  transition: padding var(--transition);
}

.site-header.is-shrunk .header-top-inner {
  padding: var(--space-xs) 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  color: var(--primary);
}

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

.brand-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  transition: width var(--transition), height var(--transition);
}

.site-header.is-shrunk .brand-icon {
  width: 30px;
  height: 30px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-name {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  transition: font-size var(--transition);
}

.site-header.is-shrunk .brand-name {
  font-size: 1.125rem;
}

.brand-tagline {
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 500;
  transition: opacity var(--transition), max-height var(--transition);
  max-height: 1.5em;
  overflow: hidden;
}

.site-header.is-shrunk .brand-tagline {
  opacity: 0;
  max-height: 0;
}

.header-meta {
  display: none;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: right;
}

.header-meta a {
  color: var(--accent);
}

.header-nav {
  background: var(--bg);
}

.header-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-xs) 0;
  transition: padding var(--transition);
}

.site-header.is-shrunk .header-nav-inner {
  padding: 4px 0;
}

.main-nav {
  display: none;
  gap: 4px;
}

.main-nav a {
  padding: var(--space-xs) var(--space-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
}

.main-nav a:hover,
.main-nav a:focus-visible {
  background: rgba(74, 78, 105, 0.08);
  color: var(--primary);
  outline: none;
}

.main-nav a.active {
  color: var(--primary);
  background: rgba(154, 140, 152, 0.15);
}

.nav-date {
  font-size: 0.8125rem;
  color: var(--muted);
  font-weight: 500;
}

.menu-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-xs);
  margin-left: auto;
}

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

.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mobile-nav {
  display: none;
  flex-direction: column;
  background: var(--white);
  border-top: 1px solid var(--border);
}

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

.mobile-nav a {
  padding: var(--space-sm);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  color: var(--text);
}

.mobile-nav a.active {
  color: var(--primary);
}

/* Hero — full-width overlay */
.hero-banner {
  position: relative;
  min-height: 320px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  margin-bottom: var(--space-lg);
}

.hero-banner__media {
  position: absolute;
  inset: 0;
}

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

.hero-banner__overlay {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: var(--space-xl) var(--space-sm);
  background: linear-gradient(to top, rgba(34, 34, 59, 0.88) 0%, rgba(34, 34, 59, 0.35) 60%, transparent 100%);
}

.hero-banner__inner {
  max-width: var(--container);
  margin: 0 auto;
  color: var(--white);
}

.hero-banner__inner h1 {
  color: var(--white);
  font-size: 1.75rem;
  margin-bottom: var(--space-sm);
  max-width: 36rem;
}

.hero-banner__inner .lead {
  color: rgba(255, 255, 255, 0.9);
  max-width: 32rem;
  margin-bottom: var(--space-md);
}

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

.hero-banner__meta a {
  color: var(--white);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Tags — pill-colored */
.tag {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: var(--space-xs);
}

.tag--economia { background: var(--tag-economia); }
.tag--setores { background: var(--tag-setores); }
.tag--sentimento { background: var(--tag-sentimento); }
.tag--local { background: var(--tag-local); color: var(--text); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-sm);
}

/* Buttons — subtle-ghost */
.btn {
  display: inline-block;
  padding: var(--space-xs) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 500;
  color: var(--primary);
  background: transparent;
  transition: background var(--transition), border-color var(--transition);
}

.btn:hover,
.btn:focus-visible {
  background: rgba(74, 78, 105, 0.06);
  border-color: var(--accent);
  outline: none;
}

/* 8-col asymmetric grid */
.grid-8 {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: var(--space-md);
}

.col-main {
  grid-column: span 8;
}

.col-sidebar {
  grid-column: span 8;
}

.section {
  padding: var(--space-lg) 0;
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-xs);
  border-bottom: 2px solid var(--primary);
}

.section-title {
  font-size: 1.125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Cards — bordered, vertical, 3:2 */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition);
}

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

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

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

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

.card-title {
  font-size: 1.125rem;
  margin-bottom: var(--space-xs);
}

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

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

.card-excerpt {
  font-size: 0.9375rem;
  color: var(--text);
  margin-bottom: var(--space-sm);
}

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

/* Article stream — vertical cards */
.article-stream {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.stream-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-sm);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color var(--transition);
}

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

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

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

.stream-card__body {
  padding: var(--space-md);
}

.stream-card__title {
  font-size: 1.25rem;
  margin-bottom: var(--space-xs);
}

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

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

/* Intro prose block */
.prose-block {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-lg);
}

.prose-block h2 {
  margin-bottom: var(--space-sm);
}

/* Article page — sidebar layout */
.article-layout {
  padding: var(--space-lg) 0 var(--space-xl);
}

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

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

.article-byline {
  font-size: 0.875rem;
  color: var(--muted);
  margin-bottom: var(--space-md);
}

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

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

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

.article-content h2 {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.article-content h3 {
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

.article-content ul,
.article-content ol {
  margin-bottom: var(--space-sm);
  padding-left: var(--space-md);
}

.article-content ul {
  list-style: disc;
}

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

.article-content li {
  margin-bottom: var(--space-xs);
}

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

.article-updated {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-top: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border);
}

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

.sidebar-author__avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: var(--space-sm);
}

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

.sidebar-author__name {
  font-size: 1rem;
  margin-bottom: 4px;
}

.sidebar-author__role {
  font-size: 0.8125rem;
  color: var(--muted);
  margin-bottom: var(--space-sm);
}

.sidebar-author__bio {
  font-size: 0.875rem;
  line-height: 1.55;
}

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

.related-grid {
  display: grid;
  gap: var(--space-md);
}

.related-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  background: var(--white);
}

.related-card h3 {
  font-size: 1rem;
}

.related-card h3 a {
  color: var(--primary);
}

/* Page templates */
.page-hero {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-lg);
}

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

.page-content {
  padding-bottom: var(--space-xl);
}

.page-content h2 {
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
}

.page-content h3 {
  margin-top: var(--space-md);
  margin-bottom: var(--space-xs);
}

.page-content ul {
  list-style: disc;
  padding-left: var(--space-md);
  margin-bottom: var(--space-sm);
}

.page-content li {
  margin-bottom: var(--space-xs);
}

/* Contact form */
.contact-grid {
  display: grid;
  gap: var(--space-lg);
}

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

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--primary);
}

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

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

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

.contact-info {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}

.contact-info h3 {
  margin-bottom: var(--space-sm);
}

/* Articles listing */
.articles-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.article-list-item {
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border);
}

.article-list-item:last-child {
  border-bottom: none;
}

.article-list-item h2 {
  font-size: 1.35rem;
  margin-bottom: var(--space-xs);
}

.article-list-item h2 a {
  color: var(--primary);
}

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

.site-footer a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.site-footer a:hover {
  color: var(--muted);
}

.footer-masthead {
  text-align: center;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-masthead__name {
  font-size: 1.625rem;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-xs);
}

.footer-masthead__edition {
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-xs);
}

.footer-masthead__tagline {
  font-size: 0.9375rem;
  color: rgba(255, 255, 255, 0.75);
  max-width: 28rem;
  margin: 0 auto;
}

.footer-grid {
  display: grid;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.footer-col__title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: var(--space-sm);
}

.footer-col__list li {
  margin-bottom: var(--space-xs);
}

.footer-col__list a {
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-col__list a:hover {
  text-decoration: underline;
}

/* Cookie — inline-footer-note */
.cookie-notice {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.8125rem;
  line-height: 1.55;
  margin-bottom: var(--space-md);
  display: none;
}

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

.cookie-notice button {
  background: none;
  border: none;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  font-size: 0.8125rem;
  margin-left: var(--space-xs);
}

.footer-bottom {
  text-align: center;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.5);
  padding-top: var(--space-md);
  border-top: 1px solid 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);
  white-space: nowrap;
  border: 0;
}

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

/* Responsive */
@media (min-width: 640px) {
  .stream-card {
    grid-template-columns: 240px 1fr;
  }

  .stream-card__image {
    aspect-ratio: auto;
    min-height: 100%;
  }

  .hero-banner {
    min-height: 400px;
  }

  .hero-banner__inner h1 {
    font-size: 2.25rem;
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

@media (min-width: 768px) {
  .header-meta {
    display: block;
  }

  .main-nav {
    display: flex;
  }

  .menu-toggle {
    display: none;
  }

  .col-main {
    grid-column: span 5;
  }

  .col-sidebar {
    grid-column: span 3;
  }

  .contact-grid {
    grid-template-columns: 1.2fr 1fr;
  }

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

@media (min-width: 1024px) {
  .stream-card {
    grid-template-columns: 280px 1fr;
  }

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