/* =========================================================
   Fuera Papeleo — Sistema de diseño editorial
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Paleta */
  --paper: #F4EFE4;
  --paper-alt: #EDE7D8;
  --ink: #1B1A17;
  --ink-soft: #3D3B36;
  --muted: #6B6862;
  --divider: #DDD7C8;
  --accent: #2D4A3E;        /* Verde botella profundo */
  --accent-hover: #1F3428;
  --highlight: #C89B3C;      /* Mostaza - uso muy contenido */
  --danger: #8B3A2F;
  --success: #4A6B3E;

  /* Tipografía */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Espaciado */
  --container: 1140px;
  --container-narrow: 720px;
  --radius: 2px;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* =========================================================
   Tipografía
   ========================================================= */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.015em;
  color: var(--ink);
}

h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); font-weight: 600; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin-top: 2.5rem; margin-bottom: 1rem; }
h3 { font-size: 1.35rem; margin-top: 2rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.1rem; font-weight: 600; margin-top: 1.5rem; margin-bottom: 0.5rem; font-family: var(--font-body); }

p { margin-bottom: 1.1rem; }
p a { color: var(--accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
p a:hover { color: var(--accent-hover); text-decoration-thickness: 2px; }

strong { font-weight: 600; color: var(--ink); }

ul, ol { margin: 1rem 0 1.4rem 1.4rem; }
li { margin-bottom: 0.5rem; }

/* =========================================================
   Navegación
   ========================================================= */
.site-header {
  border-bottom: 1px solid var(--divider);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
  background-color: rgba(244, 239, 228, 0.92);
}

.nav-wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}

.brand-mark {
  color: var(--accent);
  font-style: italic;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
}

.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: color 0.15s;
}

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

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  color: var(--ink);
}

@media (max-width: 780px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--paper);
    flex-direction: column;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--divider);
    gap: 1rem;
  }
  .nav-links.open { display: flex; }
  .mobile-toggle { display: block; }
}

/* =========================================================
   Hero editorial (home)
   ========================================================= */
.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 5rem 1.5rem 4rem;
  border-bottom: 1px solid var(--divider);
}

.hero-eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  display: block;
}

.hero-title {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  font-weight: 500;
  line-height: 1.05;
  margin-bottom: 1.5rem;
  max-width: 900px;
  letter-spacing: -0.03em;
}

.hero-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 400;
}

.hero-lead {
  font-size: 1.2rem;
  color: var(--ink-soft);
  max-width: 620px;
  line-height: 1.55;
}

/* =========================================================
   Grid de artículos
   ========================================================= */
.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: 4rem 1.5rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid var(--divider);
  padding-bottom: 1rem;
}

.section-title {
  font-size: 1.6rem;
  font-weight: 500;
}

.section-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.section-link:hover { text-decoration: underline; }

.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2.5rem 2rem;
}

.article-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border-top: 2px solid var(--ink);
  padding-top: 1rem;
  transition: border-color 0.2s;
}

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

.article-category {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.article-card h3 {
  font-size: 1.35rem;
  margin: 0.5rem 0 0.75rem;
  line-height: 1.2;
}

.article-card p {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

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

/* =========================================================
   Categorías destacadas
   ========================================================= */
.categories {
  background: var(--paper-alt);
  padding: 4rem 0;
  border-top: 1px solid var(--divider);
  border-bottom: 1px solid var(--divider);
}

.categories .section { padding-top: 0; padding-bottom: 0; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.cat-card {
  background: var(--paper);
  border: 1px solid var(--divider);
  padding: 2rem 1.5rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.2s;
  display: block;
}

.cat-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.cat-num {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 400;
  color: var(--accent);
  font-style: italic;
  line-height: 1;
  display: block;
  margin-bottom: 0.5rem;
}

.cat-card h3 {
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}

.cat-card p {
  color: var(--muted);
  font-size: 0.9rem;
  margin: 0;
}

/* =========================================================
   Contenido de artículo (prose)
   ========================================================= */
.article-wrap {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.article-header {
  margin-bottom: 3rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--divider);
}

.article-header .article-category {
  margin-bottom: 1rem;
}

.article-header h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.1;
  margin-bottom: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.article-lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  line-height: 1.6;
  margin-bottom: 2rem;
}

.article-byline {
  font-size: 0.85rem;
  color: var(--muted);
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.article-byline strong { color: var(--ink); font-weight: 600; }

/* Índice */
.toc {
  background: var(--paper-alt);
  border-left: 3px solid var(--accent);
  padding: 1.5rem 1.75rem;
  margin: 2.5rem 0;
}

.toc-title {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1rem;
}

.toc ol {
  margin: 0;
  padding-left: 1.5rem;
}

.toc li { margin-bottom: 0.4rem; font-size: 0.95rem; }
.toc a { color: var(--ink); text-decoration: none; }
.toc a:hover { color: var(--accent); text-decoration: underline; }

/* Prose */
.prose p, .prose ul, .prose ol {
  max-width: 100%;
  font-size: 1.05rem;
  line-height: 1.75;
}

.prose h2 {
  padding-top: 1rem;
  scroll-margin-top: 5rem;
}

.prose h3 { scroll-margin-top: 5rem; }

.prose blockquote {
  border-left: 3px solid var(--highlight);
  background: var(--paper-alt);
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  font-style: italic;
  color: var(--ink-soft);
}

.prose blockquote strong { color: var(--ink); font-style: normal; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}

.prose th, .prose td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--divider);
}

.prose th {
  background: var(--paper-alt);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.prose tr:hover { background: rgba(45, 74, 62, 0.03); }

/* Callouts */
.callout {
  border: 1px solid var(--divider);
  border-left: 3px solid var(--accent);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--paper);
  font-size: 0.95rem;
  border-radius: var(--radius);
}

.callout.warning { border-left-color: var(--highlight); }
.callout.tip { border-left-color: var(--success); }

.callout-label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.4rem;
}

.callout.warning .callout-label { color: var(--highlight); }
.callout.tip .callout-label { color: var(--success); }

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

/* Pasos numerados */
.step {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 1.5rem;
  margin: 2rem 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--divider);
}

.step-num {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 400;
  color: var(--accent);
  font-style: italic;
  line-height: 1;
}

.step-body h3 {
  margin-top: 0;
  font-size: 1.25rem;
}

.step-body p:last-child { margin-bottom: 0; }

/* FAQ */
.faq {
  margin: 2rem 0;
}

.faq-item {
  border-bottom: 1px solid var(--divider);
  padding: 1.25rem 0;
}

.faq-item:first-child { border-top: 1px solid var(--divider); }

.faq-q {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.faq-a {
  color: var(--ink-soft);
  margin: 0;
}

/* Artículo relacionado */
.related-articles {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 2px solid var(--ink);
}

/* =========================================================
   Página estática (legales, sobre mí, contacto)
   ========================================================= */
.static-page {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.static-page h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin-bottom: 1rem;
  font-weight: 600;
}

.static-page .article-lead {
  font-size: 1.05rem;
  margin-bottom: 2.5rem;
}

.static-page h2 {
  font-size: 1.4rem;
  margin-top: 2.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--divider);
}

.static-page h3 { font-size: 1.15rem; }

/* Formulario contacto */
.contact-form {
  display: grid;
  gap: 1rem;
  max-width: 520px;
  margin-top: 2rem;
}

.contact-form label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
  display: block;
  margin-bottom: 0.3rem;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--divider);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  border-radius: var(--radius);
  transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

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

.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--paper);
  padding: 0.85rem 1.75rem;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.2s;
  letter-spacing: 0.02em;
}

.btn:hover { background: var(--accent-hover); }

/* =========================================================
   Categoría (hub)
   ========================================================= */
.category-hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: 4rem 1.5rem 2.5rem;
  border-bottom: 1px solid var(--divider);
}

.category-hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 1rem;
}

.category-hero p {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 640px;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  background: var(--ink);
  color: var(--paper);
  padding: 4rem 1.5rem 2rem;
  margin-top: 4rem;
}

.footer-wrap {
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

@media (max-width: 780px) {
  .footer-wrap { grid-template-columns: 1fr 1fr; gap: 2rem; }
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--paper);
  margin-bottom: 0.75rem;
}

.footer-brand em { color: var(--highlight); font-style: italic; }

.footer-tagline {
  color: rgba(244, 239, 228, 0.65);
  font-size: 0.9rem;
  max-width: 320px;
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--highlight);
  margin-bottom: 1rem;
}

.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 0.6rem; }
.footer-col a {
  color: rgba(244, 239, 228, 0.75);
  text-decoration: none;
  font-size: 0.9rem;
}
.footer-col a:hover { color: var(--paper); text-decoration: underline; }

.footer-bottom {
  max-width: var(--container);
  margin: 0 auto;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(244, 239, 228, 0.15);
  color: rgba(244, 239, 228, 0.5);
  font-size: 0.82rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
