/* =========================================
   BLOG PROGRAMACIÓN
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Ultra-Modern Light Theme */
  --bg-color: #f0f2f5;
  --surface-color: #ffffff;
  --text-main: #111111;
  --text-muted: #666666;
  --border-color: #e4e6eb;
  --accent-color: #0066ff;
  --accent-glow: rgba(0, 102, 255, 0.1);
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 8px 16px rgba(0,0,0,0.08);

  --max-width: 1200px; /* Reduced width */
  --header-height: 70px; /* Smaller header */
  --radius-md: 12px;
  --radius-lg: 20px;
}

[data-theme="dark"] {
  --bg-color: #030303;
  --surface-color: #111111;
  --text-main: #ffffff;
  --text-muted: #a0a0a0;
  --border-color: #262626;
  --accent-color: #33b5e5;
  --accent-glow: rgba(51, 181, 229, 0.15);
  --shadow-sm: 0 4px 12px rgba(0,0,0,0.8);
  --shadow-md: 0 12px 32px rgba(0,0,0,0.9);
}

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

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: 'Inter', system-ui, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.03em; }

a { text-decoration: none; color: inherit; transition: 0.2s ease; }
a:hover { color: var(--accent-color); }

/* --- HEADER --- */
.header {
  position: sticky;
  top: 0;
  background-color: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4%;
  z-index: 1000;
  transition: background-color 0.3s ease, border-color 0.3s;
}

[data-theme="dark"] .header {
  background-color: rgba(20, 20, 20, 0.8);
}

.brand-logo { font-size: 1.3rem; font-weight: 800; }

.nav {
  display: flex;
  gap: 1.2rem;
  align-items: center;
  overflow-x: auto;
}
.nav a { font-weight: 600; font-size: 0.95rem; color: var(--text-muted); transition: color 0.2s ease; }
.nav a:hover, .nav a.active { color: var(--accent-color); }

/* --- THEME TOGGLE BUTTON --- */
.theme-btn {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}
.theme-btn:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}
.theme-icon { font-size: 1.1rem; }

/* --- CONTAINERS --- */
.dashboard-container, .main-wrapper {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 4%; /* Compact padding */
}

/* --- HERO PRESENTATION --- */
.presentation-section { margin-bottom: 3rem; width: 100%; }

.presentation-card {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  background: var(--surface-color);
  padding: 2.5rem 5%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.avatar-frame .avatar-img {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg-color);
  box-shadow: var(--shadow-sm);
}

.presentation-info { flex: 1; }
.presentation-title { font-size: 2.5rem; margin-bottom: 0.5rem; line-height: 1.1; }
.presentation-desc { font-size: 1.1rem; color: var(--text-muted); margin-bottom: 1.5rem; max-width: 600px; }

.presentation-links { display: flex; gap: 1.5rem; }
.btn-link {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--accent-color);
  background: var(--accent-glow);
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
}
.btn-link:hover { opacity: 0.8; transform: translateY(-2px); }

/* --- CONTENT HEADER --- */
.content-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.section-headline { font-size: 1.8rem; }

.search-pill {
  display: flex;
  align-items: center;
  background-color: var(--surface-color);
  border-radius: 50px;
  padding: 0.6rem 1.2rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}
.search-pill input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--text-main);
  margin-left: 0.6rem;
  font-size: 0.95rem;
  width: 200px;
}

/* --- RESPONSIVE COMPACT GRID --- */
.posts-grid, .grid {
  display: grid;
  /* Smaller grid sizes for less huge cards */
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.post-card, .card {
  background-color: var(--surface-color);
  padding: 1.5rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.post-card:hover, .card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent-color);
}

.post-title, .card h3 { font-size: 1.3rem; margin-bottom: 0.8rem; color: var(--text-main); }
.post-desc, .card p { color: var(--text-muted); font-size: 0.95rem; margin-bottom: 1.5rem; flex: 1; }

.post-link, .card-link { 
  font-weight: 600; 
  font-size: 0.95rem; 
  color: #ffffff; 
  background-color: var(--accent-color);
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  display: inline-flex;
  align-self: flex-start;
  align-items: center;
  margin-top: auto;
  box-shadow: 0 4px 10px var(--accent-glow);
  transition: all 0.3s ease;
}
.post-link:hover, .card-link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 14px var(--accent-glow);
  opacity: 0.95;
  color: #ffffff;
}

/* --- TOPIC PAGE LAYOUTS --- */
.section-group {
  margin-bottom: 3rem;
  background: var(--surface-color);
  padding: 2rem 4%;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}
.section-group:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-glow);
}
.subsection-title {
  font-size: 1.6rem;
  margin-bottom: 1.5rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 1rem;
}
.subsection-title::before {
  content: "";
  display: block;
  width: 8px;
  height: 24px;
  background: var(--accent-color);
  border-radius: 6px;
  box-shadow: 0 0 8px var(--accent-glow);
}

.topic-hero {
  text-align: center;
  padding: 3rem 4%;
  margin-bottom: 2.5rem;
  background: var(--surface-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
}
.topic-title { font-size: 2.5rem; margin-bottom: 0.5rem; }
.topic-desc { font-size: 1.1rem; color: var(--text-muted); }

.post-content {
  background: var(--surface-color);
  padding: 4rem 5%;
  border-radius: var(--radius-lg);
  box-shadow: none;
  border: none;
  border-top: 6px solid var(--accent-color);
  margin-top: 2rem;
  margin-bottom: 5rem;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.post-content h1 { 
  font-size: 3rem; 
  margin-bottom: 1.5rem; 
  line-height: 1.1;
  letter-spacing: -0.04em;
  color: var(--text-main);
}
.post-content .meta { 
  color: var(--accent-color); 
  font-weight: 700;
  margin-bottom: 2rem; 
  font-size: 0.95rem; 
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-body { font-size: 1.15rem; line-height: 1.8; color: var(--text-main); }
.post-body h2 { font-size: 2rem; margin: 3.5rem 0 1.5rem; letter-spacing: -0.02em; }
.post-body h3 { font-size: 1.5rem; margin: 2rem 0 1rem; }
.post-body p { margin-bottom: 1.8rem; }
.post-body blockquote {
  border-left: 0;
  background: var(--accent-glow);
  padding: 2rem 2.5rem;
  border-radius: var(--radius-md);
  margin: 3rem 0;
  font-style: italic;
  font-size: 1.3rem;
  color: var(--text-main);
  position: relative;
}
.post-body blockquote::before {
  content: "“";
  font-size: 5rem;
  position: absolute;
  top: -15px;
  left: -15px;
  color: var(--accent-color);
  opacity: 0.2;
  font-family: serif;
  line-height: 1;
}
.post-body pre { background: #1a1a1a; color: #fff; padding: 2.5rem 1.5rem 1.5rem 1.5rem; border-radius: 8px; overflow-x: auto; margin: 2rem 0;}
.post-body code { font-family: monospace; font-size: 0.95rem; }
[data-theme="dark"] .post-body pre { background: #000; border: 1px solid var(--border-color); }

.copy-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: var(--surface-color);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.2s ease;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}
.copy-btn:hover {
  background: var(--accent-color);
  color: #fff;
  border-color: var(--accent-color);
}

/* --- COMPONENTES ADICIONALES --- */
.back-link {
  display: flex;
  justify-content: center;
  margin-top: 3rem;
  margin-bottom: 1rem;
}

/* --- FOOTER --- */
.site-footer {
  border-top: 1px solid var(--border-color);
  background: var(--surface-color);
  padding: 2.5rem 4%;
  margin-top: 3rem;
}
.footer-content { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1.5rem; }
.footer-brand h3 { font-size: 1.3rem; margin-bottom: 0.2rem; }
.footer-brand p { color: var(--text-muted); font-size: 0.95rem; }
.footer-links { display: flex; gap: 1.2rem; }
.footer-btn { font-weight: 600; font-size: 0.95rem; color: var(--text-muted); }
.footer-btn:hover { color: var(--accent-color); }

/* --- RESPONSIVE CHECKS --- */
@media (max-width: 900px) {
  .presentation-card { flex-direction: column; text-align: center; gap: 1.5rem; padding: 2rem 5%; }
  .presentation-links { justify-content: center; }
  .presentation-title { font-size: 2rem; }
  .header { padding: 0 5%; gap: 1rem; }
  .nav { gap: 0.8rem; }
  .topic-title { font-size: 2rem; }
  .post-content { padding: 2rem 5%; }
}