/* Solar Blog Styles - WordPress Version */

/* CSS Variables - Solar Energy Theme */
:root {
  /* Core Colors */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  
  /* Solar Brand Colors */
  --solar-primary: #0EA5E9;
  --solar-primary-glow: #38BDF8;
  --solar-secondary: #059669;
  --solar-secondary-light: #D1FAE5;
  --solar-accent: #F59E0B;
  --solar-accent-light: #FEF3C7;
  
  /* System Colors */
  --border-color: #E2E8F0;
  --shadow-light: 0 4px 20px -2px rgba(14, 165, 233, 0.1);
  --shadow-medium: 0 8px 30px -4px rgba(14, 165, 233, 0.15);
  --shadow-strong: 0 20px 60px -8px rgba(14, 165, 233, 0.2);
  
  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #0EA5E9 0%, #059669 100%);
  --gradient-card: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
  --gradient-cta: linear-gradient(135deg, #F59E0B 0%, #DC2626 100%);
  
  /* Spacing */
  --radius: 12px;
  --container-max: 1200px;
  --sidebar-width: 320px;
}

/* Dark Mode Variables */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --gradient-card: linear-gradient(145deg, #1e293b 0%, #334155 100%);
  }
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* Reading Progress Bar */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--border-color);
  z-index: 1000;
}

.progress-bar {
  height: 100%;
  background: var(--gradient-hero);
  width: 0%;
  transition: width 0.3s ease;
}

/* Hero Section */
.solar-hero {
  position: relative;
  height: 70vh;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  color: white;
}

.hero-image-container {
  position: absolute;
  inset: 0;
}

.hero-bg-image,
.hero-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.4) 100%);
}

.back-btn {
  position: absolute;
  top: 2rem;
  left: 2rem;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  z-index: 10;
}

.back-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  text-decoration: none;
  transform: translateY(-2px);
}

.hero-content {
  position: relative;
  z-index: 5;
  padding: 2rem;
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
}

.hero-meta {
  margin-bottom: 1.5rem;
}

.category-badge {
  background: rgba(14, 165, 233, 0.2);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(14, 165, 233, 0.3);
  backdrop-filter: blur(10px);
  margin-bottom: 1rem;
  display: inline-block;
}

.meta-info {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
  opacity: 0.9;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  margin: 0;
  max-width: 1000px;
}

/* Blog Layout */
.blog-container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 2rem 1rem;
}

.blog-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 2rem;
}

/* Main Content */
.main-content {
  min-width: 0;
}

/* Action Bar */
.action-bar-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

.action-btn,
.share-btn {
  background: transparent;
  border: none;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.3s ease;
}

.action-btn:hover,
.share-btn:hover {
  background: var(--solar-primary);
  color: white;
  transform: translateY(-2px);
}

.action-btn.liked {
  background: #ef4444;
  color: white;
}

.action-btn.bookmarked {
  background: var(--solar-primary);
  color: white;
}

/* Article Content */
.article-content {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 3rem;
}

.article-content h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 2rem 0 1rem 0;
}

.article-content h3 {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 1.5rem 0 0.75rem 0;
}

.article-content p {
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.article-content ul,
.article-content ol {
  margin: 1.5rem 0;
  padding-left: 2rem;
}

.article-content li {
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.article-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* Author Card */
.author-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.author-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.author-avatar img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
}

.author-name {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.25rem 0;
  color: var(--text-primary);
}

.author-bio {
  color: var(--text-secondary);
  margin: 0;
  font-size: 0.95rem;
}

.author-actions {
  display: flex;
  gap: 0.75rem;
}

/* Buttons */
.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.btn-outline:hover {
  border-color: var(--solar-primary);
  color: var(--solar-primary);
  text-decoration: none;
}

/* CTA Card */
.cta-card {
  background: var(--gradient-cta);
  color: white;
  padding: 3rem;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: var(--shadow-strong);
  margin-bottom: 2rem;
}

.cta-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.9;
}

.cta-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0 0 1rem 0;
}

.cta-description {
  font-size: 1.1rem;
  margin: 0 0 2rem 0;
  opacity: 0.9;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-primary {
  background: white;
  color: var(--solar-accent);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.btn-primary:hover {
  background: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  text-decoration: none;
}

/* Sidebar */
.blog-sidebar {
  position: sticky;
  top: 2rem;
  height: fit-content;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.sidebar-header2 {
  text-align: center;
  margin-bottom: 1rem;
}

.sidebar-title2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.sidebar-subtitle2 {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Sidebar Cards */
.sidebar-card {
  background: var(--gradient-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-light);
  overflow: hidden;
  display: flow-root; /* evita margin collapse */
  animation: fadeInUp 0.6s ease-out;
}

.sidebar-card h1,
.sidebar-card h2,
.sidebar-card h3,
.sidebar-card h4,
.sidebar-card h5,
.sidebar-card h6 {
  margin: 0; /* reset margenes superiores */
}

.widget-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
 
  min-width: 0;     /* necesario en flexbox para evitar overflow */
  flex-wrap: wrap;
  box-sizing: border-box;
  word-wrap: break-word;
}

.widget-title i {
  color: var(--solar-primary);
  flex-shrink: 0;
}

.widget-text {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Topic Tags */
.topic-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.topic-tag {
  background: var(--solar-secondary-light);
  color: var(--solar-secondary);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.topic-tag:hover {
  background: var(--solar-secondary);
  color: white;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  gap: 1rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.stat-icon {
  width: 40px;
  height: 40px;
  background: rgba(14, 165, 233, 0.1);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--solar-primary);
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--solar-primary);
  line-height: 1;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

/* Contact Info */
.contact-info {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.contact-item i {
  color: var(--solar-primary);
  width: 16px;
}

/* Recent Posts */
.recent-posts {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.recent-post-item {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.recent-post-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.recent-post-title {
  font-weight: 500;
  color: var(--text-primary);
  text-decoration: none;
  display: block;
  margin-bottom: 0.25rem;
  line-height: 1.4;
}

.recent-post-title:hover {
  color: var(--solar-primary);
  text-decoration: none;
}

.recent-post-date {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .blog-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .blog-sidebar {
    position: static;
    margin-top: 1rem;
  }
  
  :root {
    --sidebar-width: 100%;
  }
}

@media (max-width: 768px) {
  .hero-content {
    padding: 1.5rem;
  }
  
  .back-btn {
    top: 1rem;
    left: 1rem;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
  }
  
  .meta-info {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .action-bar-card {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }
  
  .action-buttons {
    justify-content: center;
  }
  
  .author-card {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
  
  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .blog-container {
    padding: 1rem;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .action-buttons {
    flex-wrap: wrap;
  }
  
  .action-btn,
  .share-btn {
    font-size: 0.8rem;
    padding: 0.5rem 0.75rem;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.sidebar-card:nth-child(2) { animation-delay: 0.1s; }
.sidebar-card:nth-child(3) { animation-delay: 0.2s; }
.sidebar-card:nth-child(4) { animation-delay: 0.3s; }
.sidebar-card:nth-child(5) { animation-delay: 0.4s; }
.sidebar-card:nth-child(6) { animation-delay: 0.5s; }

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

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

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

::-webkit-scrollbar-thumb {
  background: rgba(14, 165, 233, 0.3);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(14, 165, 233, 0.5);
}