/* style-improved.css - Versión optimizada para legibilidad y comodidad visual */

/* --- PALETA DE COLORES SUAVIZADA --- */
:root {
  --bg-primary: #0f0f11;          /* Negro suave para el fondo */
  --bg-secondary: #1a1a1f;        /* Gris oscuro para tarjetas */
  --bg-sidebar: #141418;          /* Gris oscuro para la barra lateral */
  --accent-primary: #4a9eff;      /* Azul suave en lugar de cian vibrante */
  --accent-secondary: #9d4edd;    /* Púrpura suave en lugar de magenta */
  --text-primary: #e4e4e7;        /* Blanco roto para texto principal */
  --text-secondary: #a1a1aa;      /* Gris claro para texto secundario */
  --text-muted: #71717a;          /* Gris más apagado */
  --border-color: #27272a;        /* Gris para bordes sutiles */
  --card-bg: rgba(26, 26, 31, 0.7); /* Fondo de tarjetas más suave */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* --- IMPORTACIÓN DE FUENTE (INTER) --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- ESTILOS GLOBALES Y RESET --- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  overflow-x: hidden;
  /* Fondo más sutil y estático para reducir distracciones */
  background-image:
    radial-gradient(at 27% 37%, hsla(215, 98%, 61%, 0.03) 0px, transparent 50%),
    radial-gradient(at 97% 21%, hsla(125, 98%, 72%, 0.03) 0px, transparent 50%);
  background-size: cover;
  background-attachment: fixed;
}

/* --- SCROLLBAR PERSONALIZADA --- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* --- LAYOUT PRINCIPAL (GRID) --- */
.site-wrapper {
  display: grid;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
}

/* --- BARRA LATERAL (SIDEBAR) --- */
#sidebar {
  background-color: var(--bg-sidebar);
  padding: 2.5rem 2rem;
  border-right: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile {
  text-align: center;
  margin-bottom: 3rem;
}

.profile-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  border: 4px solid transparent;
  background: linear-gradient(var(--bg-sidebar), var(--bg-sidebar)) padding-box,
              linear-gradient(135deg, var(--accent-primary), var(--accent-secondary)) border-box;
  margin-bottom: 1.5rem;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.profile-photo:hover {
    transform: scale(1.03);
}

.profile h2 {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-primary), var(--text-primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.profile .tagline {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-top: 0.5rem;
  font-weight: 400;
}

.sidebar-section {
  margin-bottom: 2.5rem;
}

.sidebar-section h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-primary);
  margin-bottom: 1.2rem;
}

.sidebar-section p, .sidebar-section li {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.sidebar-section ul {
  list-style: none;
}

.sidebar-section a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.sidebar-section a:hover {
  color: var(--accent-primary);
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 1.2rem;
  font-size: 1.5rem;
}

.social-links a {
    transition: transform 0.2s ease, color 0.2s ease;
}
.social-links a:hover {
    transform: translateY(-3px);
    color: var(--accent-primary);
}

/* --- CONTENIDO PRINCIPAL --- */
#content {
  padding: 3rem 4rem;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
}

#content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* --- TARJETAS DE ENTRADAS --- */
.post-list {
  display: grid;
  gap: 0.5rem;
}

.post-list article {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 16px;
  padding: 2rem;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.post-list article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.post-list article:hover::before {
    transform: translateX(0);
}

.post-list article:hover {
  transform: translateY(-5px);
  border-color: var(--accent-primary);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.post-list h2 {
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.post-list h2 a {
  color: var(--text-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.post-list h2 a:hover {
  color: var(--accent-primary);
}

.post-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.post-excerpt {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  line-height: 1.8;
  font-size: 1.05rem;
}

.post-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background-color: rgba(74, 158, 255, 0.1);
    color: var(--accent-primary);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(74, 158, 255, 0.2);
    transition: all 0.2s ease;
}

.tag:hover {
    background-color: rgba(74, 158, 255, 0.2);
    transform: scale(1.05);
}

.read-more {
  color: var(--accent-primary);
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: gap 0.2s ease;
}

.read-more:hover {
  gap: 0.8rem;
}

/* --- ESTILOS PARA LA PÁGINA DE ENTRADA (post.html) --- */
.post-content {
    max-width: 800px;
    margin: 0 auto;
}

.post-header {
  margin-bottom: 2rem;
}

.post-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.post-body {
  margin-top: 2.5rem;
  font-size: 1.1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.post-body h2 {
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.5rem;
}

.post-body p {
  margin-bottom: 1.5rem;
}

.post-body ul, .post-body ol {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}
.post-body li {
    margin-bottom: 0.5rem;
}

.post-body strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* --- BLOQUES DE CÓDIGO ESTILO IDE --- */
.post-body pre {
  background: #1e1e1e;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  box-shadow: inset 0 0 10px rgba(0,0,0,0.5);
}

.post-body code {
  font-family: 'Fira Code', 'Consolas', monospace;
}

.post-body :not(pre) > code {
  background-color: rgba(74, 158, 255, 0.1);
  color: var(--accent-primary);
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

.post-body pre code {
    background: none;
    padding: 0;
    color: #d4d4d4; /* Color de texto VS Code Dark+ */
}

/* --- TABLA DE CONTENIDOS --- */
.table-of-contents {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}

.table-of-contents h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--accent-primary);
}

.table-of-contents ul {
  list-style: none;
}

.table-of-contents li {
  margin-bottom: 0.5rem;
}

.table-of-contents a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.table-of-contents a:hover {
  color: var(--accent-primary);
}

.post-footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

/* --- MENÚ HAMBURGESA Y RESPONSIVE --- */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.8rem;
  cursor: pointer;
  z-index: 1001;
  transition: color 0.2s ease;
}

.menu-toggle:hover {
    color: var(--accent-primary);
}

.mobile-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-overlay.is-open {
    display: block;
    opacity: 1;
}

@media (max-width: 768px) {
  .site-wrapper { grid-template-columns: 1fr; }
  #sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    z-index: 1000;
    transform: translateX(-100%);
  }
  #sidebar.is-open { transform: translateX(0); }
  #content {
    padding: 1rem 0.5rem;
    max-width: 100vw;
    margin: 0 auto;
  }
  .menu-toggle { display: block; }
  #content h1 { font-size: 2rem; }
  .content-header { margin-bottom: 2rem; }
  .post-excerpt { font-size: 1rem; }
}

/* Estilos para elementos adicionales */
.post-separator {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-color), transparent);
  margin: 1rem 0;
}

.post-header {
  margin-bottom: 2rem;
}

.post-title {
  font-size: 2.2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.post-meta {
  display: flex;
  gap: 1.5rem;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.post-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.table-of-contents {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--border-color);
}

.table-of-contents h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--accent-primary);
}

.table-of-contents ul {
  list-style: none;
}

.table-of-contents li {
  margin-bottom: 0.5rem;
}

.table-of-contents a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.table-of-contents a:hover {
  color: var(--accent-primary);
}

