/* Fulfillment Brasil — research-publication / academic-stone */

/* 1. :root tokens */
:root {
  --primary: #5C4B3A;
  --accent: #A69076;
  --bg: #F5F0EB;
  --text: #2C2418;
  --muted: #8A7B6B;
  --border: #D4C8BC;
  --surface: #FAF7F4;
  --white: #FFFFFF;

  --space-xs: 12px;
  --space-sm: 24px;
  --space-md: 36px;
  --space-lg: 48px;
  --space-xl: 72px;

  --radius: 1px;
  --container: 1140px;
  --reading: 680px;

  --font-serif: Georgia, "Times New Roman", Times, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --transition: 180ms ease;
}

/* 2. reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
}

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

ul,
ol {
  margin: 0;
  padding: 0;
}

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

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

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

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

/* 3. typography */
h1 { font-size: clamp(1.875rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: var(--space-md); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.5rem); margin-top: var(--space-sm); }

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

.eyebrow {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

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

/* 4. 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; }

/* 5. components */

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

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

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

.site-logo:hover,
.site-logo:focus-visible {
  color: var(--primary);
}

.site-tagline {
  font-size: 0.8125rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* nav — horizontal-underline */
.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs) var(--space-sm);
  list-style: none;
}

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

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--primary);
  border-bottom-color: var(--accent);
}

.site-nav a[aria-current="page"] {
  border-bottom-color: var(--primary);
  font-weight: 600;
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  padding: 8px 14px;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  color: var(--text);
  cursor: pointer;
  border-radius: var(--radius);
}

/* hero — text-only-lead */
.hero {
  padding: var(--space-lg) 0 var(--space-md);
  border-bottom: 1px solid var(--border);
}

.hero-lead {
  max-width: 780px;
  margin: var(--space-xs) auto 0;
  text-align: center;
}

.hero-lead h1 {
  margin: var(--space-xs) 0;
}

.hero-meta {
  margin-top: var(--space-sm);
  font-size: 0.875rem;
  color: var(--muted);
}

/* featured story */
.featured-story {
  padding: var(--space-lg) 0;
}

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

.featured-card h2 {
  margin-top: var(--space-xs);
}

.featured-card h2 a {
  color: inherit;
  text-decoration: none;
}

.featured-card h2 a:hover,
.featured-card h2 a:focus-visible {
  color: var(--primary);
}

/* numbered-list — article feed */
.numbered-feed {
  padding: var(--space-md) 0 var(--space-lg);
}

.numbered-feed ol {
  list-style: none;
  counter-reset: feed;
}

.numbered-feed li {
  counter-increment: feed;
  border-bottom: 1px solid var(--border);
  padding: var(--space-sm) 0;
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: var(--space-xs);
  align-items: start;
}

.numbered-feed li::before {
  content: counter(feed, decimal-leading-zero);
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--accent);
  line-height: 1.2;
}

.feed-item-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  margin: 0 0 6px;
}

.feed-item-title a {
  color: var(--text);
  text-decoration: none;
}

.feed-item-title a:hover,
.feed-item-title a:focus-visible {
  color: var(--primary);
  text-decoration: underline;
}

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

/* cards — bordered */
.card {
  border: 1px solid var(--border);
  background: var(--surface);
  padding: var(--space-sm);
  border-radius: var(--radius);
}

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

/* tag — bracket-label */
.tag {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

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

/* button — text-link-only */
.btn-link {
  display: inline-block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 4px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.btn-link:hover,
.btn-link:focus-visible {
  color: var(--accent);
}

/* author — minimal-name-only */
.author-name {
  font-size: 0.875rem;
  color: var(--muted);
}

/* article — pull-quote-led */
.article-header {
  padding: var(--space-lg) 0 var(--space-md);
  border-bottom: 1px solid var(--border);
}

.article-header h1 {
  max-width: var(--reading);
  margin-bottom: var(--space-xs);
}

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

.pull-quote {
  font-family: var(--font-serif);
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  line-height: 1.45;
  color: var(--primary);
  border-left: 3px solid var(--accent);
  padding: var(--space-xs) 0 var(--space-xs) var(--space-sm);
  margin: var(--space-md) 0;
  max-width: 620px;
}

.article-body {
  padding: var(--space-md) 0 var(--space-lg);
}

.article-body p {
  max-width: var(--reading);
}

.article-body h2,
.article-body h3 {
  max-width: var(--reading);
}

.article-body ul,
.article-body ol {
  max-width: var(--reading);
  margin: 0 0 var(--space-sm) var(--space-sm);
  padding-left: var(--space-sm);
}

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

/* sidebar — sticky-toc */
.article-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.toc-sidebar {
  order: -1;
}

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

.toc-nav h2 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin: 0 0 var(--space-xs);
  color: var(--muted);
}

.toc-nav ol {
  list-style: none;
}

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

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

.toc-nav a:hover,
.toc-nav a:focus-visible,
.toc-nav a.is-active {
  color: var(--primary);
  border-left-color: var(--accent);
}

/* page sections */
.page-section {
  padding: var(--space-lg) 0;
}

.page-section--narrow {
  max-width: 720px;
}

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

/* articles listing */
.articles-list .card {
  margin-bottom: var(--space-sm);
}

.articles-list h2 {
  margin-top: 0;
  font-size: 1.375rem;
}

.articles-list h2 a {
  color: inherit;
  text-decoration: none;
}

.articles-list h2 a:hover {
  color: var(--primary);
}

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

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

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--font-sans);
  font-size: 1rem;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: var(--radius);
  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;
}

/* footer — editorial-masthead */
.site-footer {
  border-top: 2px solid var(--primary);
  background: var(--surface);
  padding: var(--space-lg) 0 var(--space-md);
  margin-top: var(--space-xl);
}

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

.masthead-name {
  font-family: var(--font-serif);
  font-size: 1.375rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
}

.masthead-desc {
  font-size: 0.9375rem;
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto;
}

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

.footer-col h3 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 var(--space-xs);
}

.footer-col ul {
  list-style: none;
}

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

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

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

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: var(--space-sm);
  text-align: center;
  font-size: 0.8125rem;
  color: var(--muted);
}

/* cookie — inline-footer-note */
.cookie-note {
  margin-top: var(--space-xs);
  font-size: 0.75rem;
  line-height: 1.5;
  color: var(--muted);
}

.cookie-note a {
  color: var(--primary);
}

/* 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; }

.thumb-minimal {
  width: 100%;
  max-width: 120px;
  opacity: 0.7;
}

.related-articles {
  border-top: 1px solid var(--border);
  padding-top: var(--space-md);
  margin-top: var(--space-md);
}

.related-articles h2 {
  font-size: 1.125rem;
  margin-top: 0;
}

.related-articles ul {
  list-style: none;
}

.related-articles li {
  margin-bottom: var(--space-xs);
}

.related-articles a {
  text-decoration: none;
  font-family: var(--font-serif);
}

.related-articles a:hover {
  text-decoration: underline;
}

/* 7. media queries */
@media (min-width: 480px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .article-layout {
    grid-template-columns: 240px 1fr;
    gap: var(--space-lg);
  }

  .toc-sidebar {
    order: 0;
  }

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

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

  .card-grid--articles {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 1024px) {
  .article-layout {
    grid-template-columns: 260px 1fr;
  }

  .numbered-feed li {
    grid-template-columns: 64px 1fr;
  }

  .featured-card {
    padding: var(--space-lg);
  }
}

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

  .site-nav ul {
    display: none;
    flex-direction: column;
    width: 100%;
    padding-top: var(--space-xs);
  }

  .site-nav.is-open ul {
    display: flex;
  }
}
