/* style-blog-post.css — refreshed article styles, preserving header/footer/FAQ */

/* =============================
   Variables y Reseteo Básico
   ============================= */
@font-face {
  font-family: Inter;
  src: url(/static/fonts/Inter.woff2);
}

:root {
  --bg-color: #0a0a0a;
  --text-color: #e7e7e7;
  --muted-text: #b9b9b9;
  --primary-color: #A855F7;
  --primary-hover: #C084FC;
  --card-bg: #141414;
  --surface-2: #1b1b1b;
  --border: rgba(255,255,255,.08);
  --accent-color: #e74c3c;
  --punch-color: #f39c12;

  /* Tipografía y ritmo vertical */
  --font-body: clamp(1.05rem, 1.2vw + .8rem, 1.25rem);
  --font-lead: clamp(1.05rem, 1.2vw + .8rem, 1.25rem);
 /* --font-lead: clamp(1.2rem, 1.3vw + 1rem, 1.45rem);*/
  --font-h1: clamp(2.2rem, 4vw + 1.4rem, 3.5rem);
  --font-h2: clamp(1.6rem, 2vw + 1rem, 2.2rem);
  --font-h3: clamp(1.25rem, 1.2vw + 1rem, 1.6rem);
  --measure: 72ch;
  --leading: 1.75;
  --leading-tight: 1.2;
  --space-1: .375rem;
  --space-2: .75rem;
  --space-3: 1.125rem;
  --space-4: 1.75rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --radius: 12px;
  --radius-lg: 16px;

  --font-huge: clamp(3rem, 12vw, 10rem); /* (usado por CTA) */
  --font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, 'Helvetica Neue', Arial, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: var(--leading);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* =============================
   Header (SIN CAMBIOS)
   ============================= */
.main-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem 8%;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 100;
  background: linear-gradient(180deg, rgba(10, 10, 10, 0.8) 0%, rgba(10, 10, 10, 0) 100%);
}

.main-header .logo {
  font-weight: 900;
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--text-color);
}

.main-header nav a {
  color: var(--text-color);
  text-decoration: none;
  margin-left: 2rem;
  font-weight: 700;
  transition: color 0.3s ease;
}

.main-header nav a.active-link {
  color: var(--text-color);
  font-weight: 900;
}

.main-header nav a:hover { color: var(--primary-color); }

.main-header nav a.cta-nav {
  background-color: var(--primary-color);
  padding: 0.5rem 1rem;
  border-radius: 50px;
  color: var(--bg-color);
  font-weight: 900;
}

.cta-nav:hover { background-color: var(--primary-hover); color: var(--bg-color); }

.lang { position:relative; margin-left:auto; }
.lang[open] > .lang-menu{ display:block; }
.lang-toggle{
  list-style:none; display:flex; align-items:center; gap:.4rem;
  border:1px solid currentColor; background:transparent;
  padding:.4rem .6rem; border-radius:.5rem; cursor:pointer; user-select:none;
}
.lang-toggle::-webkit-details-marker{ display:none; }
.caret{ line-height:1; }
.lang-menu{
  display:none; position:absolute; right:0; top:calc(100% + .4rem);
  list-style:none; margin:0; padding:.25rem; min-width:12rem;
  border:1px solid rgba(255, 255, 255, 0.1); border-radius:.6rem; background:var(--bg-color);
  box-shadow:0 8px 24px rgba(0,0,0,.2); z-index:1000;
}
.lang-menu li a{ display:block; padding:.55rem .75rem; text-decoration:none; color:inherit; }
.lang-menu li a:hover, .lang-menu li a:focus{ background:var(--card-bg); color:var(--primary-color); outline:none; }

/* =============================
   Contenido — Artículo (LIMPIO)
   ============================= */

main { padding-top: 8rem; }

.blog-post-content {
  max-width: var(--measure);
  margin-inline: auto;
  padding: var(--space-6) clamp(1rem, 4vw, 2rem);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  text-wrap: pretty;
}

.blog-post-content header {
  text-align: center;
  margin-bottom: var(--space-5);
}

.punch-line {
  color: var(--punch-color);
  font-family: Inter;
  font-size: var(--font-h1);
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.post-meta {
  margin-top: var(--space-2);
  font-size: 0.95rem;
  color: var(--muted-text);
  display: flex;
  gap: .75rem;
  justify-content: center;
  flex-wrap: wrap;
}

.post-meta .author { font-weight: 600; }

/* Secciones del artículo (excluye FAQ al usar .post-section) */
.post-section {
  margin-top: var(--space-6);
}
.post-section:first-of-type {
  margin-top: var(--space-5);
}

/* Encabezados dentro del artículo */
.post-section h2 {
  margin-top: var(--space-4);
  margin-bottom: var(--space-4);
  font-size: var(--font-h2);
  line-height: var(--leading-tight);
  font-weight: 750;
  letter-spacing: -0.01em;
  padding-top: var(--space-2);
  scroll-margin-top: 7rem;
}
.post-section h3 {
  margin-top: var(--space-3);
  font-size: var(--font-h3);
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: -0.005em;
}

/* Cuerpo de texto */
.post-section p {
  font-size: var(--font-body);
  margin: var(--space-2) 0;
  color: var(--text-color);
}
.post-section p + p { margin-top: var(--space-2); }

/* Párrafo inicial (lead) de cada sección */
.post-section > p:first-of-type {
  font-size: var(--font-lead);
  line-height: 1.75;
}

/* Enlaces más sobrios */
.blog-post-content a {
  color: var(--primary-hover);
  text-decoration: underline;
  text-underline-offset: .18em;
  text-decoration-thickness: .08em;
  text-decoration-skip-ink: auto;
  transition: color .2s ease, text-decoration-color .2s ease;
}
.blog-post-content a:hover { color: var(--primary-color); }

/* Listas */
.post-section ul, .post-section ol {
  margin: var(--space-3) 0 var(--space-3) 1.2rem;
  padding-left: 1rem;
  font-size:var(--font-body);
}
.post-section ul { list-style: disc; }
.post-section ol { list-style: decimal; }
.post-section li { margin: .5rem 0; }
.post-section li::marker { color: var(--punch-color); }

/* Citas */
.post-section blockquote {
  margin: var(--space-4) 0;
  padding: .75rem 1rem;
  border-left: 3px solid var(--primary-color);
  background: var(--surface-2);
  border-radius: var(--radius);
  color: var(--muted-text);
}

/* Imágenes y figuras */
.post-section figure { margin: var(--space-4) 0; }
.post-section img, .post-section video {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  display: block;
}
.post-section figcaption {
  font-size: .95rem;
  color: var(--muted-text);
  text-align: center;
  margin-top: .5rem;
}

/* Tablas limpias (dentro de .post-section) */
.table-container-simple {
  width: 100%;
  overflow-x: auto;
  margin: var(--space-4) 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.table-container-simple table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}
.table-container-simple th,
.table-container-simple td {
  padding: .9rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.table-container-simple th {
  background-color: #222;
  color: var(--text-color);
  font-weight: 650;
  text-transform: none;
  font-size: 0.98rem;
  position: sticky;
  top: 0;
}
.table-container-simple tr:nth-child(even) { background-color: rgba(255,255,255,0.02); }
.table-container-simple tr:hover { background-color: rgba(255,255,255,0.04); }

.small-text {
  font-size: .9rem;
  color: var(--muted-text);
  text-align: center;
  margin-top: 1rem;
  font-style: italic;
}

/* Código */
.post-section pre, .post-section code, .post-section kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
.post-section code {
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: .15rem .35rem;
  border-radius: 6px;
  font-size: .95em;
}
.post-section pre {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: .98rem;
}
.post-section pre code { background: transparent; border: 0; padding: 0; }

/* Separadores suaves */
.post-section hr {
  border: 0;
  height: 1px;
  background: var(--border);
  margin: var(--space-5) 0;
}

/* Acentos tipográficos */
.post-section strong { color: var(--punch-color); font-weight: 750; }
.post-section em { color: var(--text-color); opacity: .9; }
.post-section sup, .post-section sub { line-height: 0; font-size: .8em; }

/* Mejores anclas al desplazarse */
.post-section :is(h2, h3, h4) { scroll-margin-top: 7rem; }

/* =============================
   FAQ (SIN CAMBIOS)
   ============================= */
.faq-section-minimal {
  margin-top: 40px;
  padding-top: 30px;
  border-top: none;
}
.faq-section-minimal .section-title {
  text-align: center;
  margin-bottom: 30px;
  font-size: 2em;
  color: var(--punch-color);
  border-bottom: none;
  padding-bottom: 0;
}
.faq-item {
  background-color: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.faq-question {
  display: block;
  padding: 18px 25px;
  cursor: pointer;
  font-weight: 600;
  color: var(--punch-color);
  position: relative;
  transition: background-color 0.3s ease;
  user-select: none;
  font-size: var(--font-body);
}
.faq-question::after {
  content: '+';
  position: absolute;
  right: 25px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5em;
  transition: transform 0.3s ease;
}
.faq-item[open] .faq-question::after {
  content: '−';
  transform: translateY(-50%) rotate(0deg);
}
.faq-item[open] .faq-question { background-color: #2b2b2b; }
.faq-answer {
  padding: 0 25px 20px;
  color: var(--text-color);
  animation: fadeIn 0.3s ease-out;
}
.faq-answer p { margin-bottom: 0; font-size:var(--font-body);}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* =============================
   CTA (SIN CAMBIOS)
   ============================= */
.cta-section {
  padding: 8rem 4%;
  text-align: center;
  background-color: var(--card-bg);
}
.cta-content { margin: 0 auto; }
.cta-section h2 {
  font-size: var(--font-huge);
  font-weight: 900;
  line-height: 0.9;
  letter-spacing: -4px;
  color: var(--text-color);
  margin-bottom: 1rem;
  border-bottom: none;
  padding-bottom: 0;
}
.cta-section p {
  font-size: var(--font-body);
  margin: 2rem 0;
  opacity: 0.8;
}
.cta-button-final {
  display: inline-block;
  color: var(--primary-color);
  font-size: clamp(1.5rem, 5vw, 3rem);
  font-weight: 700;
  text-decoration: none;
  transition: color 0.3s ease;
}
.cta-button-final:hover { color: var(--primary-hover); }

/* =============================
   Footer (SIN CAMBIOS)
   ============================= */
.main-footer {
  padding: 2rem 4%;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-color);
  background-color: var(--card-bg);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0.6;
}

/* =============================
   Responsive
   ============================= */
@media (max-width: 900px) {
  .blog-post-content { padding: var(--space-5) 1rem; }
}
@media (max-width: 768px) {
  .main-header {
    flex-direction: column;
    padding: 1rem;
    position: static;
    background: var(--bg-color);
  }
  .main-header nav { margin-top: 1rem; }
  .main-header nav a { margin: 0 0.5rem; }
  .punch-line { font-size: clamp(1.9rem, 8vw, 2.4rem); }
  .post-section h2 { border-top: none; }
}
