/* ===== TEMA PROFESIONAL PYTHON CON MODO NOCTURNO ===== */

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

/* ===== VARIABLES (Modo claro por defecto) ===== */
:root {
  --bg: #FFFFFF;
  --bg-secondary: #F8FAFC;
  --text: #1E293B;
  --text-light: #64748B;
  --border: #E2E8F0;
  --accent: #3776AB;
  --accent-light: #5B9BC5;
  --accent-dark: #2C5A7A;
  --card-bg: #FFFFFF;
  --code-bg: #F1F5F9;
}

/* ===== MODO NOCTURNO ===== */
[data-theme="dark"] {
  --bg: #0F172A;
  --bg-secondary: #1E293B;
  --text: #E2E8F0;
  --text-light: #94A3B8;
  --border: #334155;
  --accent: #5B9BC5;
  --accent-light: #7BB3D9;
  --accent-dark: #3776AB;
  --card-bg: #1E293B;
  --code-bg: #0F172A;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Fira Code', monospace;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 18px;
  transition: background 0.3s ease, color 0.3s ease;
}

/* ===== BOTÓN DE MODO NOCTURNO ===== */
.theme-toggle {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 50%;
  width: 52px;
  height: 52px;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  z-index: 1000;
  transition: transform 0.2s, background 0.2s;
}

.theme-toggle:hover {
  transform: scale(1.1);
  background: var(--accent-dark);
}

/* ===== LAYOUT PRINCIPAL ===== */
.main-layout {
  display: flex;
  justify-content: center;
  gap: 2rem;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 2rem;
  height: fit-content;
  padding: 2rem 0;
}

.logo {
  text-align: center;
  margin-bottom: 1.5rem;
}

.logo img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--accent);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.sidebar h2 {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 0.5rem;
}

.descripcion p {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 1.5rem;
}

.sidebar nav ul {
  list-style: none;
}

.sidebar nav li {
  margin-bottom: 0.5rem;
}

.sidebar nav a {
  display: block;
  padding: 0.6rem 0.75rem;
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.9rem;
  border-radius: 10px;
  transition: all 0.2s;
}

.sidebar nav a:hover {
  background: var(--bg-secondary);
  color: var(--accent);
  transform: translateX(5px);
}

.sidebar nav i {
  width: 28px;
  margin-right: 8px;
  color: var(--accent);
}

.sidebar-socials {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.sidebar-socials h3 {
  font-size: 0.7rem;
  letter-spacing: 2px;
  color: var(--text-light);
  margin-bottom: 1rem;
  font-weight: 600;
}

.sidebar-socials a {
  display: block;
  padding: 0.5rem 0;
  text-decoration: none;
  color: var(--text-light);
  font-size: 0.85rem;
  transition: color 0.2s;
}

.sidebar-socials a:hover {
  color: var(--accent);
}

.sidebar-socials i {
  width: 28px;
  margin-right: 8px;
}

/* ===== CONTENIDO PRINCIPAL ===== */
.contenido {
  flex: 1;
  max-width: 680px;
  min-width: 0;
  padding: 2rem 0 4rem;
}

.posts-list {
  list-style: none;
}

.post-item {
  margin-bottom: 3rem;
  padding: 1.5rem;
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid var(--border);
  transition: transform 0.2s, box-shadow 0.2s;
}

.post-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0,0,0,0.1);
}

.post-title {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

.post-title a {
  text-decoration: none;
  color: var(--text);
  transition: color 0.2s;
}

.post-title a:hover {
  color: var(--accent);
}

.post-date {
  font-size: 0.75rem;
  color: var(--text-light);
  margin-bottom: 0.75rem;
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: var(--bg-secondary);
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.post-excerpt {
  color: var(--text-light);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ===== PUBLICIDAD ===== */
.publicidad {
  width: 260px;
  flex-shrink: 0;
  position: sticky;
  top: 2rem;
  height: fit-content;
  padding: 2rem 0;
}

.ad-space {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  margin-bottom: 1rem;
}

.ad-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-light);
  margin-bottom: 0.75rem;
}

.ad-content {
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.85rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .publicidad {
    display: none;
  }
}

@media (max-width: 768px) {
  .main-layout {
    flex-direction: column;
    padding: 0;
  }
  
  .sidebar {
    width: 100%;
    position: static;
    padding: 1.5rem;
  }
  
  .sidebar nav ul {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
  }
  
  .sidebar nav li {
    margin-bottom: 0;
  }
  
  .sidebar nav a {
    padding: 0.5rem;
  }
  
  .sidebar nav a:hover {
    transform: none;
  }
  
  .sidebar-socials {
    text-align: center;
  }
  
  .sidebar-socials a {
    display: inline-block;
    margin: 0 0.75rem;
  }
  
  .contenido {
    padding: 1.5rem;
  }
  
  .publicidad {
    display: block;
    width: 100%;
    position: static;
    padding: 0 1.5rem 2rem;
  }
  
  .theme-toggle {
    bottom: 1rem;
    right: 1rem;
    width: 44px;
    height: 44px;
    font-size: 1.2rem;
  }
}

img {
  max-width: 100%;
  height: auto;
}

/* Scrollbar personalizada */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: var(--accent);
  border-radius: 4px;
}
