/* Mercado Azul — pescabr.digital | muted-green | local-newspaper */

:root {
  --ma-bg: #f0f3ef;
  --ma-surface: #fafbf9;
  --ma-ink: #1a241c;
  --ma-ink-muted: #4f6354;
  --ma-ink-faint: #7a8f7f;
  --ma-green: #4d6f58;
  --ma-green-dark: #2f4536;
  --ma-green-light: #9ab5a0;
  --ma-green-muted: #d8e3da;
  --ma-accent: #3a5f47;
  --ma-accent-hover: #2d4a38;
  --ma-border: #c9d5cb;
  --ma-border-light: #dde5de;
  --ma-shadow: 0 2px 12px rgba(26, 36, 28, 0.06);

  --ma-space-xs: 8px;
  --ma-space-sm: 16px;
  --ma-space-md: 24px;
  --ma-space-lg: 32px;
  --ma-space-xl: 48px;

  --ma-radius: 10px;
  --ma-radius-sm: 6px;
  --ma-container: 720px;
  --ma-line-tight: 1.2;
  --ma-line-body: 1.55;
  --ma-font-display: "Georgia", "Times New Roman", serif;
  --ma-font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

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

body {
  margin: 0;
  font-family: var(--ma-font-body);
  font-size: 0.9375rem;
  line-height: var(--ma-line-body);
  color: var(--ma-ink);
  background: var(--ma-bg);
  -webkit-font-smoothing: antialiased;
}

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

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

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

.container {
  width: min(100% - var(--ma-space-md), var(--ma-container));
  margin-inline: auto;
}

/* —— Stacked header —— */
.site-header {
  background: var(--ma-surface);
  border-bottom: 2px solid var(--ma-green-dark);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-top {
  text-align: center;
  padding: var(--ma-space-sm) var(--ma-space-md) var(--ma-space-xs);
  border-bottom: 1px solid var(--ma-border-light);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--ma-space-xs);
  text-decoration: none;
  color: var(--ma-ink);
}

.brand-mark {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.brand-name {
  font-family: var(--ma-font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: var(--ma-line-tight);
  display: block;
}

.brand-tagline {
  font-size: 0.65rem;
  color: var(--ma-ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  display: block;
  margin-top: 2px;
}

.header-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--ma-space-xs) var(--ma-space-md);
  position: relative;
}

.nav-toggle {
  display: none;
  position: absolute;
  left: var(--ma-space-md);
  background: none;
  border: 1px solid var(--ma-border);
  border-radius: var(--ma-radius-sm);
  padding: 6px 12px;
  cursor: pointer;
  font-size: 0.8rem;
  color: var(--ma-ink-muted);
  font-family: inherit;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: var(--ma-space-md);
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--ma-space-sm);
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ma-ink-muted);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: var(--ma-green-dark);
  border-bottom-color: var(--ma-green);
}

.header-date {
  font-size: 0.7rem;
  color: var(--ma-ink-faint);
  letter-spacing: 0.04em;
}

/* —— Vertical mobile drawer —— */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 36, 28, 0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
  z-index: 150;
}

.nav-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

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

  .header-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: min(280px, 85vw);
    height: 100vh;
    background: var(--ma-green-dark);
    flex-direction: column;
    align-items: stretch;
    padding: var(--ma-space-xl) var(--ma-space-md) var(--ma-space-md);
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 200;
    gap: var(--ma-space-lg);
  }

  .header-nav.is-open { transform: translateX(0); }

  .nav-links {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-links a {
    color: var(--ma-green-muted);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding: var(--ma-space-sm) 0;
    font-size: 0.95rem;
    text-transform: none;
    letter-spacing: 0;
  }

  .nav-links a:hover,
  .nav-links a.is-active {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.15);
  }

  .header-date { color: var(--ma-green-light); }
}

/* —— Hero stacked headlines no image —— */
.hero-stack {
  padding: var(--ma-space-lg) 0 var(--ma-space-md);
  border-bottom: 1px solid var(--ma-border);
}

.hero-stack .edition {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ma-green);
  margin: 0 0 var(--ma-space-xs);
}

.hero-stack h1 {
  font-family: var(--ma-font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  line-height: var(--ma-line-tight);
  letter-spacing: -0.02em;
  margin: 0 0 var(--ma-space-sm);
  color: var(--ma-green-dark);
}

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

.hero-stack h1 a:hover { color: var(--ma-accent); }

.hero-stack .dek {
  font-size: 1rem;
  color: var(--ma-ink-muted);
  margin: 0 0 var(--ma-space-sm);
  max-width: 38em;
}

.hero-stack .hero-meta {
  font-size: 0.8rem;
  color: var(--ma-ink-faint);
}

.hero-secondary {
  padding: var(--ma-space-md) 0;
  border-bottom: 1px solid var(--ma-border-light);
}

.hero-secondary h2 {
  font-family: var(--ma-font-display);
  font-size: 1.1rem;
  line-height: 1.3;
  margin: 0 0 4px;
}

.hero-secondary h2 a {
  text-decoration: none;
  color: var(--ma-ink);
}

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

.hero-secondary p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ma-ink-muted);
}

/* —— Layout with right rail —— */
.page-layout {
  display: grid;
  gap: var(--ma-space-lg);
  padding: var(--ma-space-md) 0 var(--ma-space-xl);
}

@media (min-width: 768px) {
  .page-layout {
    grid-template-columns: 1fr 200px;
    align-items: start;
  }
}

.main-column { min-width: 0; }

/* —— Numbered article list —— */
.section-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ma-green);
  margin: 0 0 var(--ma-space-sm);
  padding-bottom: var(--ma-space-xs);
  border-bottom: 1px solid var(--ma-border);
}

.numbered-list {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: feed;
}

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

.numbered-list > li::before {
  content: counter(feed, decimal-leading-zero);
  font-family: var(--ma-font-display);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ma-green-light);
  line-height: 1;
}

.feed-card { display: flex; flex-direction: column; gap: 6px; }

.feed-card h2, .feed-card h3 {
  margin: 0;
  font-family: var(--ma-font-display);
  font-size: 1.05rem;
  line-height: 1.3;
}

.feed-card h2 a, .feed-card h3 a {
  text-decoration: none;
  color: var(--ma-ink);
}

.feed-card h2 a:hover, .feed-card h3 a:hover {
  color: var(--ma-accent);
  text-decoration: underline;
}

.feed-card .excerpt {
  margin: 0;
  color: var(--ma-ink-muted);
  font-size: 0.875rem;
}

.feed-meta {
  font-size: 0.75rem;
  color: var(--ma-ink-faint);
}

/* —— Stacked text-below cards —— */
.card-stack {
  display: flex;
  flex-direction: column;
  gap: var(--ma-space-md);
  margin-bottom: var(--ma-space-lg);
}

.card-item {
  background: var(--ma-surface);
  border: 1px solid var(--ma-border-light);
  border-radius: var(--ma-radius);
  overflow: hidden;
}

.card-item .card-img {
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--ma-green-muted);
}

.card-item .card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-item .card-body {
  padding: var(--ma-space-sm);
}

.card-item h3 {
  margin: 0 0 4px;
  font-family: var(--ma-font-display);
  font-size: 1rem;
  line-height: 1.3;
}

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

.card-item h3 a:hover { color: var(--ma-accent); }

/* —— Tags underline-text —— */
.tag {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ma-green);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

/* —— Buttons filled-accent —— */
.btn {
  display: inline-block;
  padding: 8px 18px;
  background: var(--ma-accent);
  color: #fff;
  border: none;
  border-radius: var(--ma-radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.btn:hover {
  background: var(--ma-accent-hover);
  color: #fff;
}

/* —— Right rail sidebar —— */
.sidebar-rail { display: flex; flex-direction: column; gap: var(--ma-space-md); }

.sidebar-block {
  padding-bottom: var(--ma-space-sm);
  border-bottom: 1px solid var(--ma-border-light);
}

.sidebar-block:last-child { border-bottom: none; }

.sidebar-block h3 {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ma-green);
  margin: 0 0 var(--ma-space-sm);
}

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

.sidebar-list li {
  margin-bottom: var(--ma-space-xs);
  font-size: 0.85rem;
  line-height: 1.4;
}

.sidebar-list a {
  text-decoration: none;
  color: var(--ma-ink);
}

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

.sidebar-list .meta {
  display: block;
  font-size: 0.7rem;
  color: var(--ma-ink-faint);
  margin-top: 2px;
}

/* —— Prose / narrow reading —— */
.prose { max-width: 38em; }

.prose .lead {
  font-size: 1.05rem;
  color: var(--ma-ink-muted);
  line-height: 1.6;
}

.prose h2 {
  font-family: var(--ma-font-display);
  font-size: 1.15rem;
  color: var(--ma-green-dark);
  margin: var(--ma-space-lg) 0 var(--ma-space-sm);
}

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

.prose ul, .prose ol {
  margin: 0 0 var(--ma-space-sm);
  padding-left: var(--ma-space-md);
}

.prose li { margin-bottom: 6px; }

.page-hero {
  padding: var(--ma-space-lg) 0 var(--ma-space-md);
  border-bottom: 1px solid var(--ma-border);
}

.page-hero h1 {
  font-family: var(--ma-font-display);
  font-size: clamp(1.4rem, 3.5vw, 1.85rem);
  line-height: var(--ma-line-tight);
  margin: 0 0 var(--ma-space-xs);
  color: var(--ma-green-dark);
}

.page-hero .lead {
  margin: 0;
  color: var(--ma-ink-muted);
  font-size: 1rem;
}

/* —— Article narrow reading —— */
.article-header {
  padding: var(--ma-space-lg) 0 var(--ma-space-md);
  border-bottom: 1px solid var(--ma-border);
  max-width: 38em;
}

.article-header h1 {
  font-family: var(--ma-font-display);
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  line-height: var(--ma-line-tight);
  letter-spacing: -0.02em;
  margin: var(--ma-space-xs) 0 var(--ma-space-sm);
  color: var(--ma-green-dark);
}

.article-byline {
  font-size: 0.8rem;
  color: var(--ma-ink-faint);
  display: flex;
  flex-wrap: wrap;
  gap: var(--ma-space-sm);
  margin: 0;
}

.article-body {
  padding: var(--ma-space-md) 0 var(--ma-space-xl);
  max-width: 38em;
}

.article-body figure {
  margin: var(--ma-space-md) 0;
  border-radius: var(--ma-radius);
  overflow: hidden;
}

.article-body figure img {
  width: 100%;
  border-radius: var(--ma-radius);
}

.article-body figcaption {
  font-size: 0.75rem;
  color: var(--ma-ink-faint);
  margin-top: 6px;
  text-align: center;
}

/* —— Articles listing —— */
.article-grid {
  display: flex;
  flex-direction: column;
  gap: var(--ma-space-md);
}

.article-list-item {
  display: flex;
  flex-direction: column;
  gap: var(--ma-space-xs);
  padding-bottom: var(--ma-space-md);
  border-bottom: 1px solid var(--ma-border-light);
}

.article-list-item .thumb {
  aspect-ratio: 4 / 3;
  border-radius: var(--ma-radius);
  overflow: hidden;
  max-width: 280px;
}

.article-list-item h2 {
  font-family: var(--ma-font-display);
  font-size: 1.1rem;
  margin: 0;
  line-height: 1.3;
}

.article-list-item h2 a {
  text-decoration: none;
  color: var(--ma-ink);
}

.article-list-item h2 a:hover { color: var(--ma-accent); }

/* —— Form —— */
.form-group { margin-bottom: var(--ma-space-sm); }

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--ma-ink-muted);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--ma-border);
  border-radius: var(--ma-radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--ma-surface);
}

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

/* —— Editorial masthead footer —— */
.site-footer {
  background: var(--ma-green-dark);
  color: var(--ma-green-muted);
  margin-top: auto;
}

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

.footer-masthead .masthead-name {
  font-family: var(--ma-font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  margin: 0 0 4px;
}

.footer-masthead .masthead-edition {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ma-green-light);
  margin: 0 0 var(--ma-space-xs);
}

.footer-masthead .masthead-tagline {
  font-size: 0.85rem;
  color: var(--ma-green-muted);
  margin: 0;
  max-width: 32em;
  margin-inline: auto;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--ma-space-sm) var(--ma-space-md);
  padding: var(--ma-space-md);
}

.footer-nav a {
  color: var(--ma-green-muted);
  text-decoration: none;
  font-size: 0.8rem;
}

.footer-nav a:hover { color: #fff; text-decoration: underline; }

.footer-bottom {
  padding: var(--ma-space-sm) var(--ma-space-md) var(--ma-space-md);
  border-top: 1px solid rgba(255,255,255,0.08);
  text-align: center;
}

.footer-bottom .copyright {
  font-size: 0.75rem;
  color: var(--ma-green-light);
  margin: 0 0 var(--ma-space-sm);
}

/* —— Inline footer cookie note —— */
.cookie-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--ma-space-sm);
  font-size: 0.75rem;
  color: var(--ma-green-light);
  max-width: 36em;
  margin-inline: auto;
}

.cookie-note p { margin: 0; }

.cookie-note a { color: #fff; }

.cookie-dismiss {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.3);
  color: #fff;
  padding: 4px 12px;
  border-radius: var(--ma-radius-sm);
  font-size: 0.75rem;
  cursor: pointer;
  font-family: inherit;
}

.cookie-dismiss:hover { background: rgba(255,255,255,0.1); }

.cookie-note.is-hidden { display: none; }

/* —— Author cards (about page) —— */
.author-card {
  display: flex;
  gap: var(--ma-space-sm);
  margin-bottom: var(--ma-space-md);
  padding-bottom: var(--ma-space-md);
  border-bottom: 1px solid var(--ma-border-light);
}

.author-card img {
  width: 56px;
  height: 56px;
  border-radius: var(--ma-radius-sm);
  flex-shrink: 0;
}

.author-card h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.author-card .role {
  font-size: 0.8rem;
  color: var(--ma-ink-faint);
  margin: 0 0 6px;
}

.author-card p:last-child {
  margin: 0;
  font-size: 0.875rem;
  color: var(--ma-ink-muted);
}
