/* Sustenta Revista — terracotta-warm editorial */
:root {
  --primary: #7C4A2D;
  --accent: #D6A15F;
  --bg: #FAF2E8;
  --text: #3A2418;
  --muted: #B6855B;
  --white: #FFFCF8;
  --border: rgba(124, 74, 45, 0.18);
  --shadow: 0 2px 12px rgba(58, 36, 24, 0.08);
  --shadow-hover: 0 6px 20px rgba(58, 36, 24, 0.12);
  --radius: 6px;
  --container: 1140px;
  --font-serif: Georgia, "Times New Roman", Times, serif;
  --font-sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --transition: 0.2s ease;
}

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

html {
  scroll-behavior: smooth;
}

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

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

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

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

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.25;
  margin: 0 0 0.5em;
  font-weight: 700;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); }
h3 { font-size: 1.15rem; }

p {
  margin: 0 0 1em;
}

ul, ol {
  margin: 0 0 1em;
  padding-left: 1.25em;
}

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

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}

.col-8 { grid-column: span 8; }
.col-4 { grid-column: span 4; }
.col-12 { grid-column: span 12; }

/* Header */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  max-width: var(--container);
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text);
}

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

.logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.1;
}

.logo-tagline {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

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

.main-nav ul {
  display: flex;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.main-nav a {
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text);
}

.main-nav a:hover,
.main-nav a[aria-current="page"] {
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: var(--accent);
}

/* Mobile drawer */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(58, 36, 24, 0.4);
  z-index: 200;
}

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

.mobile-drawer {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100%;
  background: var(--white);
  z-index: 201;
  padding: 24px 20px;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.mobile-drawer.is-open {
  right: 0;
}

.drawer-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  margin-bottom: 20px;
  padding: 0;
  line-height: 1;
}

.mobile-drawer nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.mobile-drawer nav a {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  font-size: 1rem;
}

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

/* Hero carousel */
.hero-carousel {
  position: relative;
  margin-bottom: 24px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--white);
}

.carousel-track {
  position: relative;
  min-height: 280px;
}

.carousel-slide {
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.carousel-slide.is-active {
  display: grid;
}

.carousel-image {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg);
}

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

.carousel-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.carousel-content .tag {
  margin-bottom: 8px;
}

.carousel-content h2 {
  margin-bottom: 12px;
}

.carousel-content h2 a {
  color: var(--text);
  text-decoration: none;
}

.carousel-content h2 a:hover {
  color: var(--primary);
}

.carousel-content p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 16px;
}

.carousel-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 12px;
  background: var(--white);
  border-top: 1px solid var(--border);
}

.carousel-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: var(--text);
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}

.carousel-btn:hover {
  background: var(--bg);
  border-color: var(--primary);
}

.carousel-dots {
  display: flex;
  gap: 8px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  cursor: pointer;
  padding: 0;
}

.carousel-dot.is-active {
  background: var(--primary);
}

/* Tags */
.tag {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
  font-weight: 500;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 8px 18px;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--transition);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(214, 161, 95, 0.1);
}

/* Article cards */
.article-stream {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 16px;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow var(--transition);
}

.article-card:hover {
  box-shadow: var(--shadow-hover);
}

.card-thumb {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg);
}

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

.card-body {
  padding: 14px 14px 14px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.card-body h3 {
  margin-bottom: 8px;
}

.card-body h3 a {
  color: var(--text);
  text-decoration: none;
}

.card-body h3 a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.card-excerpt {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* Section headers */
.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
}

.section-header h2 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}

/* Page hero */
.page-hero {
  padding: 32px 0 24px;
}

.page-hero h1 {
  margin-bottom: 12px;
}

.page-hero .lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 640px;
}

/* Article layout */
.article-layout {
  padding: 24px 0 40px;
}

.article-header {
  margin-bottom: 24px;
}

.article-header .tag {
  margin-bottom: 10px;
}

.article-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 12px;
}

.article-hero-image {
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

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

.article-content {
  font-size: 1.05rem;
  line-height: 1.7;
}

.article-content h2 {
  margin-top: 1.5em;
  font-size: 1.35rem;
}

.article-content blockquote {
  margin: 1.5em 0;
  padding: 16px 20px;
  border-left: 3px solid var(--accent);
  background: rgba(214, 161, 95, 0.12);
  font-family: var(--font-serif);
  font-style: italic;
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 72px;
}

.author-widget {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.author-widget .avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  margin-bottom: 12px;
  background: var(--bg);
}

.author-widget .avatar img,
.author-widget .avatar svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-widget h3 {
  font-size: 1rem;
  margin-bottom: 4px;
}

.author-widget .role {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.author-widget p {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0;
  line-height: 1.5;
}

/* Footer author note */
.article-footer-author {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--muted);
}

.article-footer-author strong {
  color: var(--text);
}

/* Related */
.related-articles {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 2px solid var(--border);
}

.related-articles h2 {
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.related-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.related-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.related-list a {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

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

/* Prose pages */
.prose {
  max-width: 720px;
  padding: 24px 0 40px;
}

.prose h2 {
  margin-top: 1.5em;
  font-size: 1.25rem;
}

/* Contact */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  padding: 24px 0 40px;
}

.contact-info {
  background: var(--white);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.contact-form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 4px;
}

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

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

/* Footer */
.site-footer {
  background: var(--primary);
  color: var(--white);
  padding: 32px 0 20px;
  margin-top: 40px;
}

.footer-stack {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.footer-brand .logo-text {
  color: var(--white);
  font-size: 1.15rem;
}

.footer-brand p {
  font-size: 0.88rem;
  opacity: 0.85;
  margin: 8px 0 0;
  max-width: 400px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
}

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

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

.footer-bottom {
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 0.8rem;
  opacity: 0.75;
}

.cookie-note {
  font-size: 0.78rem;
  opacity: 0.7;
  margin-top: 12px;
  line-height: 1.5;
}

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

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

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

.mb-24 {
  margin-bottom: 24px;
}

/* Responsive */
@media (max-width: 900px) {
  .col-8,
  .col-4 {
    grid-column: span 12;
  }

  .carousel-slide {
    grid-template-columns: 1fr;
  }

  .carousel-image {
    max-height: 220px;
  }

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

  .card-body {
    padding: 0 14px 14px;
  }

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

  .sidebar {
    position: static;
    margin-top: 24px;
  }
}

@media (max-width: 768px) {
  .nav-toggle {
    display: block;
  }

  .main-nav {
    display: none;
  }
}
