/* FUENTE Y RESETEO */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
body {
    font-family: 'Inter', sans-serif;
    background: #f4f5f9;
    margin: 0;
    color: #1e1e1e;
}

/* HEADER MODERNO */
.main-header {
    background: linear-gradient(135deg, #0a0a2a, #111155, #0a0a2a);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-container {
    max-width: 1200px;
    margin: auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.logo {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -1px;
}
.logo span {
    color: #3b82f6;
}
.nav a {
    color: #e0e0e0;
    text-decoration: none;
    margin-left: 2rem;
    font-weight: 500;
    transition: color 0.3s;
}
.nav a:hover {
    color: #3b82f6;
}

/* LAYOUT */
.layout {
    display: grid;
    grid-template-columns: 1fr minmax(auto, 900px) 1fr;
    gap: 2rem;
    padding: 2rem;
}

/* SIDEBARS (para anuncios) */
.sidebar {
    min-width: 160px;
}
.sidebar.left, .sidebar.right {
    display: flex;
    justify-content: center;
}

/* CONTENIDO */
.content {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
}

/* INTRO */
.intro {
    text-align: center;
    background: white;
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.intro h1 {
    font-size: 2rem;
    color: #111155;
}
.intro p {
    color: #555;
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

/* CONTENEDOR GRID DE TARJETAS */
.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

/* ARTÍCULOS */
.card {
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.card:hover {
    transform: translateY(-6px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}
.card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}
.card .info {
    padding: 1.5rem 2rem;
}
.card h2 a {
    color: #111155;
    text-decoration: none;
}
.card .date {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 0.6rem;
}
.card p {
    color: #444;
    line-height: 1.6;
}
.read-more {
    color: #3b82f6;
    text-decoration: none;
    font-weight: 600;
    display: inline-block;
    margin-top: 1rem;
}

/* FOOTER */
footer {
    background: #0a0a2a;
    color: #aaa;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

/* ARTÍCULOS PROFESIONALES */
.article-box {
  background: #fff;
  padding: 2rem;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  margin-bottom: 3rem;
  transition: transform 0.3s, box-shadow 0.3s;
}
.article-box:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 24px rgba(0,0,0,0.12);
}
.article-header h1 {
  font-size: 2.2rem;
  margin-bottom: 0.5rem;
  color: #0a0f1f;
}
.article-meta {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 1.5rem;
}
.article-main-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 2rem;
}
.article-main-placeholder {
  width: 100%;
  height: 300px;
  background: linear-gradient(135deg, #f0f2f5, #d9e2f3);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-style: italic;
  font-size: 1.1rem;
  margin-bottom: 2rem;
  text-align: center;
}

.article-body {
  line-height: 1.8;
  font-size: 1.05rem;
  color: #222;
}
.article-body h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  color: #0a0f1f;
}
.article-body h3 {
  font-size: 1.3rem;
  margin: 1.5rem 0 0.8rem;
  color: #1c2440;
}
.article-body p {
  margin-bottom: 1rem;
}
.article-body img {
  max-width: 100%;
  border-radius: 12px;
  margin: 1.5rem 0;
}
.article-body ul, .article-body ol {
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
}
.article-body a {
  color: #00b8ff;
  text-decoration: underline;
}
.article-body a:hover {
  color: #0094cc;
}

/* BLOQUES DESTACADOS */
.article-body .highlight {
  background: #e0f2ff;
  border-left: 4px solid #3b82f6;
  padding: 1rem 1.5rem;
  border-radius: 8px;
  margin: 1.5rem 0;
  font-style: normal;
}

/* BLOQUES DE CÓDIGO */
.article-body pre {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  white-space: pre;
  padding: 1rem;
  border-radius: 12px;
  background: #1e1e2f;
  color: #d1d1ff;
  font-family: 'Fira Code', monospace;
  margin: 1.5rem 0;
}

/* RESPONSIVE */
@media (max-width: 1000px) {
    .layout {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }
    .sidebar {
        display: none;
    }
    .header-container {
        flex-direction: column;
        gap: 1rem;
    }
    .card-container {
        grid-template-columns: 1fr; /* 1 columna en tablet/móvil */
    }
}
@media (max-width: 600px) {
    .article-box {
        padding: 1rem;
    }
    .article-header h1 {
        font-size: 1.6rem;
    }
    .article-body h2 {
        font-size: 1.3rem;
    }
    .article-body h3 {
        font-size: 1.1rem;
    }
    .article-body p,
    .article-body li {
        font-size: 1rem;
    }
    .article-main-image {
        max-height: none;
        height: auto;
    }
    .article-body .highlight {
        padding: 0.8rem 1rem;
    }
    .article-body pre {
        font-size: 0.85rem;
    }
}

/* Botón para mostrar código */
.toggle-code {
  display: inline-block;
  background: linear-gradient(135deg, #3b82f6, #60a5fa);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  transition: background 0.3s, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.toggle-code:hover {
  background: linear-gradient(135deg, #2563eb, #3b82f6);
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.2);
}
.article-body pre {
    display: none;
}
