/* =====================
   1. VARIABLES Y RESET
   ===================== */
:root {
  --bg-main: #101017;
  --bg-box: #181826;
  --text-main: #eaeaf2;
  --text-secondary: #b2b2c3;
  --text-link: #8ab4f8;
  --divider: #232337;
  --accent: #ff5ac8;
  --font-main: 'Inter', 'Segoe UI', 'Arial', sans-serif;
}

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

body {
  background: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-main);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  line-height: 1.7;
}

/* =====================
   2. NAVEGACIÓN
   ===================== */
.main-nav {
  background: #19192b;
  width: 100%;
  box-shadow: 0 1px 8px rgba(0,0,0,0.07);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  position: relative;
  padding: 0.7rem 1.2rem;
  justify-content: center;
}

.nav-logo img {
  height: 48px;
  max-width: 180px;
  display: block;
}

.nav-logo {
  flex: 1;
  display: flex;
  justify-content: center;
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  letter-spacing: 1px;
  text-decoration: none;
  transition: color 0.2s;
}
.nav-links a:hover {
  color: #a3a3ff;
}

/* Hamburguesa y menú para móvil */
.nav-toggle {
  background: none;
  border: none;
  display: none;
  align-items: center;
  cursor: pointer;
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
}
.hamburger {
  width: 28px;
  height: 3px;
  background: #fff;
  position: relative;
  border-radius: 2px;
  margin-right: 9px;
  transition: all 0.25s;
  display: inline-block;
}
.hamburger::before, .hamburger::after {
  content: '';
  width: 28px;
  height: 3px;
  background: #fff;
  position: absolute;
  left: 0;
  border-radius: 2px;
  transition: all 0.25s;
}
.hamburger::before { top: -8px; }
.hamburger::after { top: 8px; }
.menu-text {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  letter-spacing: 1px;
}

@media (max-width: 800px) {
  .nav-inner {
    justify-content: center;
    padding: 0.8rem 0.5rem;
  }
  .nav-logo img {
    max-width: 130px;
    height: 38px;
  }
  .nav-links {
    position: fixed;
    top: 0;
    right: -100vw;
    width: 70vw;
    max-width: 320px;
    height: 100vh;
    background: #19192b;
    flex-direction: column;
    align-items: flex-start;
    padding: 4rem 2rem 2rem 2rem;
    gap: 2.2rem;
    box-shadow: -4px 0 16px rgba(0,0,0,0.13);
    transition: right 0.3s;
    z-index: 50;
  }
  .nav-links.open {
    right: 0;
  }
  .nav-toggle {
    display: flex;
  }
}

@media (max-width: 480px) {
  .nav-links {
    width: 94vw;
    max-width: none;
    padding: 4rem 1rem 1rem 1rem;
    gap: 1.7rem;
  }
}

/* =====================
   3. LAYOUT PRINCIPALES
   ===================== */
.main-grid {
  max-width: 1200px;
  margin: 3vw auto;
  padding: 3rem 2rem 2rem 2rem;
}
.main-post {
  max-width: 800px;
  margin: 10px auto;
  background: var(--bg-box);
  border-radius: 10px;
  box-shadow: 0 4px 32px rgba(0,0,0,0.25);
  padding: 20px;
}

.main-page {
    max-width: 1000px;
    margin: 10px auto;
    background: var(--bg-box);
    border-radius: 10px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.25);
    padding: 20px;
}
.main-page h2 {
  font-size: 22px;
  font-weight: 600;
  color: #ffffff;
}

.main-page h3 {
  font-size: 18px;
  font-weight: 600;
  color: #ffffff;
  
}

/* =====================
   4. FEATURED IMAGE (POST DESTACADA)
   ===================== */
.featured-image-outer {
  max-width: 900px;
  margin: 10px auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.featured-image {
  width: 800px;
  height: 420px;
  border-radius: 20px;
  overflow: hidden;
  background: #232337;
  box-shadow: 0 6px 32px rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}
.featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 20px;
  aspect-ratio: 800/420;
}

/* =====================
   5. GRID DE POSTS Y TARJETAS
   ===================== */
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 2rem;
  max-width: 1200px;
  margin: 2.5rem auto 3rem auto;
  padding: 0 1rem;
}
.post-card {
  background: #fff;
  border-radius: 10px 10px 0 0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.07);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: box-shadow 0.18s, transform 0.18s;
}

/*
.post-card:hover {
  box-shadow: 0 6px 32px rgba(0,0,0,0.14);
  transform: translateY(-2px) scale(1.012);
}
*/

.card-image {
  width: 100%;
  aspect-ratio: 16/9;
 /* background: linear-gradient(120deg, #c471f5 0%, #fa71cd 100%); */
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  display: block;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.card-content {
  padding: 1.1rem 1.5rem 1.1rem 1.5rem;
}
.post-card h2 {
  font-size: 18px;
  font-weight: 800;
  color: #22253b;
  margin: 0 0 0.5rem 0;
  line-height: 1.1;
  letter-spacing: -1px;
}
.card-date {
  font-size: 14px;
  color: #68718a;
  font-weight: 500;
  margin-bottom: 0;
}

/* =====================
   6. TIPOGRAFÍA Y ENCABEZADOS
   ===================== */
h1 {
  text-align: center;
  font-weight: 800;
  font-size: 28px;
  margin: 0 0 0.8em 0;
  letter-spacing: -1px;
}
h2 {
  font-size: 24px;
  margin: 2em 0 0.5em 0;
  font-weight: 700;
}
h3 {
  font-size: 18px;
  margin: 2em 0 0.5em 0;
  font-weight: 600;
}

/* =====================
   7. META Y AUTOR DE POST
   ===================== */
.post-meta {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  letter-spacing: 1px;
}
.post-author {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  margin: 1em 0 0.5em 0;
}
.post-author img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--divider);
}

/* =====================
   8. CONTENIDO Y LISTAS
   ===================== */
.blog-content {
  margin: 2rem 0;
}
ul, ol {
  margin-left: 1.2em;
}
ul {
  list-style: disc outside;
}
li {
  margin-bottom: 0.5em;
}

/* =====================
   9. LINKS
   ===================== 
a {
  color: var(--text-link);
  text-decoration: underline;
  transition: color 0.2s;
}
a:hover {
  color: var(--accent);
  text-decoration: underline;
}
  */

/* =====================
   10. HR DIVIDER
   ===================== */
hr {
  border: 0;
  border-top: 1px solid var(--divider);
  margin: 2.5em 0;
}

/* =====================
   11. FOOTER
   ===================== */
footer {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0; /* Modificado para sticky footer */
  padding: 20px 0;
  border-top: 1px solid var(--divider);
  background: var(--bg-box);
}
footer a {
  color: var(--text-link);
  margin: 0 0.6em;
  text-decoration: none;
  font-weight: 500;
}
footer a:hover {
  color: var(--accent);
}

/* =====================
   12. MEDIA QUERIES
   ===================== */

/* Featured image y navegación responsive */
@media (max-width: 850px) {
  .featured-image {
    width: 100%;
    max-width: 100vw;
    height: auto;
    aspect-ratio: 800/420;
  }
  .featured-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 800/420;
  }
  .featured-image-outer {
    padding: 1rem 0.5rem 0.5rem 0.5rem;
  }
  .main-nav ul {
    gap: 1rem;
    font-size: 0.97rem;
  }
}

/* Main layouts */
@media (max-width: 1300px) {
  .main-grid { max-width: 98vw; }
}
@media (max-width: 800px) {
  .main-post, .main-grid {
    /* padding: 1.5rem 0.5rem; */
    max-width: 100vw;
  }
  main {
    padding: 1.5rem 0.5rem;
  }
  h1 {
    font-size: 1.3rem;
  }
  h2 {
    font-size: 1.05rem;
  }
}

/* Grid responsive: 2 columnas en tablet, 1 en móvil */
@media (max-width: 1000px) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 650px) {
  .post-grid {
    grid-template-columns: 1fr;
    padding: 0 0.5rem;
  }
  .card-content {
    padding: 1rem;
  }
  .post-card h2 {
    font-size: 1.3rem;
  }
}

/* =====================
   13. FOOTER SIEMPRE ABAJO (FLEXBOX LAYOUT)
   ===================== */
html, body {
  height: 100%;
  min-height: 100vh;
}
body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
main, .main-grid, .main-post {
  flex: 1 0 auto;
}
footer {
  flex-shrink: 0;
}

.ad-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 32px 0;
  width: 100%;
}

.ad-center {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gpt-ad {
  display: block;
  max-width: 728px;
  min-width: 200px;
  min-height: 90px;
  margin: 0 auto;
  box-sizing: border-box;
  background: none !important;
  border-radius: 0 !important;
  width: auto !important;
}

.ad-label {
  font-size: 1.15em;
  font-weight: 600;
  margin-top: 12px;
  text-align: center;
}

.video-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 0 22px 0;
}

.video-container {
  position: relative;
  width: 95vw;
  max-width: 350px;
  margin-bottom: 8px;
}

video {
  width: 100%;
  height: auto;
  max-height: 260px;
  border-radius: 12px;
  background: #000;
  display: block;
}

.play-overlay-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 75px;
  height: 75px;
  background: rgba(0,0,0,0.55);
  border-radius: 50%;
  border: 2.5px solid #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 3;
  transition: background 0.2s;
}

.play-overlay-btn svg {
  width: 44px;
  height: 44px;
}

.play-overlay-btn:hover {
  background: rgba(255,255,255,0.14);
}

.cta-btn {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%,-50%);
  z-index: 10;
  background: #222;
  color: #fff;
  font-size: 1.1em;
  padding: 14px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  box-shadow: 0 4px 18px 0 rgba(0,0,0,0.16);
}

.video-blur {
  filter: blur(2px) grayscale(0.7) brightness(0.8);
}

@media (max-width: 900px) {
  .gpt-ad {
    max-width: 98vw;
  }
}

@media (max-width: 480px) {
  .video-container,
  .gpt-ad {
    max-width: 98vw;
  }
}

/* =====================
   14. OCULTAR IMAGEN DESTACADA EN PÁGINAS DE LISTADO
   ===================== */

.featured-image-outer {
  display: none !important;
}

/* =====================
   15. SECCIÓN RELACIONADA
   ===================== */

.related-section {
  margin: 20px auto;
  text-align: center;
}

.related-title {
    font-size: 18px;
    margin: 10px;
    font-weight: 600;
}

.related-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  justify-content: center;
}
.related-card {
  /* background: #fff;
  border: 4px solid #2226a5;
  border-radius: 16px; 
  box-shadow: 0 2px 12px rgba(50,50,50,0.07);
  */

  max-width: 340px;
  flex: 1 1 220px;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
}


.related-card:hover {
  transform: translateY(-4px) scale(1.03); 
 /* box-shadow: 0 8px 28px rgba(32,32,32,0.16);  */
}


.related-card-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  /*
  background: #f4f4f4;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 1rem;
  */
  
  display:flex;
  align-items:center;
  justify-content:center;
}
.related-card-img img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  object-fit: cover;
}
.related-card-title {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  margin-top: 0.5rem;
  text-align: center;
  min-height: 3.5em;
  display: flex;
  align-items: center;
  justify-content: center;
}

.link {
  color: white;
  text-decoration: underline;
  transition: color 0.3s ease;
}

.link:hover,
.link:active {
  color: #ccc; /* gris claro */
}

/* =====================
   16. TABLAS (AJUSTADO PARA #blog-content)
   ===================== */
#blog-content table,
.markdown-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2.5rem 0;
  font-size: 14px;
  color: #000;
}

#blog-content th,
.markdown-table th {
  background: #f1f1f1;
  font-weight: bold;
  text-align: center;
  padding: 1.2em 1em;
  border: none;
  color: #000;
  font-size: 16px;
}

#blog-content td,
.markdown-table td {
  padding: 1em 1.2em;
  border: none;
  font-size: 14px;
  font-weight: 400;
  color: #000;
}

#blog-content tr:nth-child(even),
.markdown-table tr:nth-child(even) {
  background: #f4f4f4;
}

#blog-content tr:nth-child(odd),
.markdown-table tr:nth-child(odd) {
  background: #fff;
}

#blog-content th,
#blog-content td,
.markdown-table th,
.markdown-table td {
  /* Elimina bordes de tabla nativos */
  border: none !important;
}

@media (max-width: 700px) {
  #blog-content table,
  .markdown-table {
    font-size: 14px;
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

#blog-content table,
.markdown-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2.5rem 0;
  font-size: 14px;
  color: #000;
  table-layout: fixed;         /* <-- Clave para forzar ajuste */
  word-break: break-word;      /* <-- Clave para cortar palabras largas */
}

#blog-content th,
.markdown-table th {
  background: #f1f1f1;
  font-weight: bold;
  text-align: center;
  padding: 1.2em 1em;
  border: none;
  color: #000;
  font-size: 16px;
}

#blog-content td,
.markdown-table td {
  padding: 1em 1.2em;
  border: none;
  font-size: 14px;
  font-weight: 400;
  color: #000;
  word-break: break-word;     /* <-- Clave en celdas */
  white-space: normal;        /* <-- Permite ajuste de línea */
}

#blog-content tr:nth-child(even),
.markdown-table tr:nth-child(even) {
  background: #f4f4f4;
}

#blog-content tr:nth-child(odd),
.markdown-table tr:nth-child(odd) {
  background: #fff;
}

#blog-content th,
#blog-content td,
.markdown-table th,
.markdown-table td {
  border: none !important;
}

/* Opcional: Responsive, fuente un poco más pequeña y sin scroll lateral */
@media (max-width: 700px) {
  #blog-content table,
  .markdown-table {
    font-size: 13px;
    /* Eliminar scroll y fuerza el ajuste */
    display: table;
    overflow-x: unset;
    white-space: normal;
  }
}