/* ===============================
   🎯 BLOG POST - INAB CONSULTING
   =============================== */

/* Variables específicas para posts */
:root {
  --post-primary: var(--primary, #2563eb);
  --post-secondary: var(--secondary, #64748b);
  --post-accent: #f59e0b;
  --post-success: #10b981;
  --post-info: #06b6d4;
  --post-warning: #f59e0b;
  --post-danger: #ef4444;
  
  --post-bg: var(--white, #ffffff);
  --post-bg-alt: #f8fafc;
  --post-text: var(--text-primary, #1f2937);
  --post-text-light: var(--text-secondary, #6b7280);
  --post-border: #e5e7eb;
  
  --post-content-width: 800px;
  --post-sidebar-width: 280px;
  --post-spacing: 1.5rem;
}

/* Layout general del post */
.blog-post {
  min-height: 100vh;
  padding-top: 100px;
}

/* ===============================
   🧭 BREADCRUMB
   =============================== */
.breadcrumb {
  background: var(--post-bg-alt);
  padding: 1rem 0;
  border-bottom: 1px solid var(--post-border);
}

.breadcrumb-list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
}

.breadcrumb-list li {
  display: flex;
  align-items: center;
}

.breadcrumb-list li:not(:last-child)::after {
  content: '›';
  margin-left: 0.5rem;
  color: var(--post-text-light);
}

.breadcrumb-list a {
  color: var(--post-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.breadcrumb-list a:hover {
  color: #1d4ed8;
  text-decoration: underline;
}

.breadcrumb-list li[aria-current="page"] {
  color: var(--post-text-light);
  font-weight: 500;
}

/* ===============================
   📄 POST HEADER
   =============================== */
.post-header {
  background: linear-gradient(135deg, var(--post-primary) 0%, #1e40af 100%);
  color: white;
  padding: var(--post-spacing) 0 0;
  position: relative;
  overflow: hidden;
}

.post-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.post-header__content {
  position: relative;
  z-index: 2;
  padding-bottom: var(--post-spacing);
}

.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  opacity: 0.9;
}

.post-meta span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.post-meta a {
  color: inherit;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.post-meta a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

.post-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
  background: linear-gradient(45deg, #ffffff, #e2e8f0);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.post-excerpt {
  font-size: clamp(1rem, 2.5vw, 1.125rem);
  line-height: 1.6;
  margin-bottom: 2rem;
  opacity: 0.9;
  max-width: 800px;
}

.post-author {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  backdrop-filter: blur(10px);
}

.author-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(255, 255, 255, 0.2);
}

.author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.author-info {
  flex: 1;
}

.author-name {
  display: block;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.author-title {
  display: block;
  font-size: 0.875rem;
  opacity: 0.8;
  margin-bottom: 0.5rem;
}

.author-social {
  display: flex;
  gap: 0.75rem;
}

.author-social a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.125rem;
  transition: all 0.2s ease;
}

.author-social a:hover {
  color: white;
  transform: translateY(-2px);
}

.post-image {
  position: relative;
  margin-top: 2rem;
}

.post-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: 12px 12px 0 0;
}

.image-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  padding: 2rem 1.5rem 1.5rem;
  border-radius: 0 0 12px 12px;
}

.image-stats {
  display: flex;
  gap: 1.5rem;
  color: white;
  font-size: 0.875rem;
}

.image-stats span {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ===============================
   📖 POST CONTENT
   =============================== */
.post-content {
  padding: 3rem 0;
  background: var(--post-bg);
}

.content-wrapper {
  display: grid;
  grid-template-columns: var(--post-sidebar-width) 1fr;
  gap: 3rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* Table of Contents */
.toc {
  position: relative;
}

.toc-sticky {
  position: sticky;
  top: 120px;
  background: var(--post-bg-alt);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--post-border);
}

.toc h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--post-text);
  margin: 0 0 1rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.toc h3::before {
  content: '📑';
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.toc-list li {
  margin-bottom: 0.5rem;
}

.toc-list a {
  color: var(--post-text-light);
  text-decoration: none;
  font-size: 0.875rem;
  line-height: 1.4;
  transition: all 0.2s ease;
  display: block;
  padding: 0.25rem 0;
}

.toc-list a:hover {
  color: var(--post-primary);
  padding-left: 0.5rem;
}

.toc-list a.active {
  color: var(--post-primary);
  font-weight: 500;
  padding-left: 0.5rem;
  border-left: 2px solid var(--post-primary);
}

/* Main Post Body */
.post-body {
  max-width: var(--post-content-width);
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--post-text);
}

.post-body h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--post-text);
  margin: 3rem 0 1.5rem 0;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--post-primary);
}

.post-body h3 {
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--post-text);
  margin: 2.5rem 0 1rem 0;
}

.post-body h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--post-text);
  margin: 2rem 0 0.75rem 0;
}

.post-body p {
  margin-bottom: 1.5rem;
  text-align: justify;
}

.post-body ul,
.post-body ol {
  margin-bottom: 1.5rem;
  padding-left: 1.5rem;
}

.post-body li {
  margin-bottom: 0.5rem;
}

.post-body strong {
  font-weight: 600;
  color: var(--post-text);
}

.post-body a {
  color: var(--post-primary);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.post-body a:hover {
  border-bottom-color: var(--post-primary);
}

/* ===============================
   📦 CONTENT BOXES
   =============================== */
.highlight-box,
.info-box,
.warning-box {
  padding: 1.5rem;
  border-radius: 8px;
  margin: 2rem 0;
  border-left: 4px solid;
}

.highlight-box {
  background: linear-gradient(135deg, #fef3c7, #fbbf24);
  border-left-color: var(--post-warning);
  color: #92400e;
}

.info-box {
  background: linear-gradient(135deg, #dbeafe, #60a5fa);
  border-left-color: var(--post-info);
  color: #1e3a8a;
}

.warning-box {
  background: linear-gradient(135deg, #fef2f2, #f87171);
  border-left-color: var(--post-danger);
  color: #991b1b;
}

.highlight-box h4,
.info-box h4,
.warning-box h4 {
  margin: 0 0 0.75rem 0;
  font-weight: 600;
}

.highlight-box p,
.info-box p,
.warning-box p {
  margin: 0;
  font-weight: 500;
}

/* ===============================
   🎨 VISUAL COMPONENTS
   =============================== */

/* Trends Grid */
.trends-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.trend-card {
  background: var(--post-bg);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--post-border);
  text-align: center;
  transition: all 0.3s ease;
}

.trend-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.trend-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.trend-card h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  color: var(--post-text);
}

.trend-card p {
  font-size: 0.875rem;
  color: var(--post-text-light);
  margin: 0;
}

/* Code Examples */
.code-example {
  background: #1e293b;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 2rem 0;
  overflow: hidden;
}

.code-example h4 {
  color: #e2e8f0;
  margin: 0 0 1rem 0;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.code-example h4::before {
  content: '💻';
}

.code-example pre {
  margin: 0;
  overflow-x: auto;
}

.code-example code {
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.5;
}

/* Architecture Diagram */
.architecture-diagram {
  background: var(--post-bg-alt);
  padding: 2rem;
  border-radius: 12px;
  margin: 2rem 0;
  border: 1px solid var(--post-border);
}

.architecture-diagram h4 {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--post-text);
}

.diagram-comparison {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.diagram-section {
  text-align: center;
}

.diagram-section h5 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--post-text);
}

.flow-diagram {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  font-family: monospace;
  font-size: 0.75rem;
  border: 1px solid var(--post-border);
  margin-bottom: 0.5rem;
}

.latency-indicator {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 600;
}

.latency-indicator.high {
  background: #fef2f2;
  color: #dc2626;
}

.latency-indicator.low {
  background: #dcfce7;
  color: #16a34a;
}

/* Implementation Steps */
.implementation-steps {
  margin: 2rem 0;
}

.step {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  align-items: flex-start;
}

.step-number {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  background: var(--post-primary);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.step-content {
  flex: 1;
}

.step-content h4 {
  margin: 0 0 0.5rem 0;
  color: var(--post-text);
}

.step-content p {
  margin: 0;
  color: var(--post-text-light);
}

/* Comparison Table */
.serverless-comparison {
  margin: 2rem 0;
  overflow-x: auto;
}

.comparison-table table {
  width: 100%;
  border-collapse: collapse;
  background: var(--post-bg);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.comparison-table th,
.comparison-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--post-border);
}

.comparison-table th {
  background: var(--post-primary);
  color: white;
  font-weight: 600;
}

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr:nth-child(even) {
  background: var(--post-bg-alt);
}

/* Case Studies */
.case-studies {
  display: grid;
  gap: 2rem;
  margin: 2rem 0;
}

.case-study {
  background: var(--post-bg);
  border: 1px solid var(--post-border);
  border-radius: 12px;
  padding: 2rem;
  transition: all 0.3s ease;
}

.case-study:hover {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.case-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.case-header h3 {
  margin: 0;
  color: var(--post-text);
}

.case-industry {
  background: var(--post-primary);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 16px;
  font-size: 0.75rem;
  font-weight: 500;
}

.case-content p {
  color: var(--post-text-light);
  margin-bottom: 1.5rem;
}

.case-results {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1rem;
}

.result {
  text-align: center;
  padding: 1rem;
  background: var(--post-bg-alt);
  border-radius: 8px;
}

.result strong {
  display: block;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--post-primary);
  margin-bottom: 0.25rem;
}

.result span {
  font-size: 0.875rem;
  color: var(--post-text-light);
}

/* Roadmap */
.roadmap {
  margin: 2rem 0;
}

.roadmap-phase {
  background: var(--post-bg);
  border: 1px solid var(--post-border);
  border-radius: 12px;
  padding: 2rem;
  margin-bottom: 2rem;
  position: relative;
}

.roadmap-phase::before {
  content: '';
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--post-primary);
  border-radius: 2px;
}

.phase-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.phase-number {
  background: var(--post-primary);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 16px;
  font-weight: 600;
  font-size: 0.875rem;
}

.phase-header h4 {
  margin: 0;
  flex: 1;
  min-width: 200px;
}

.phase-duration {
  background: var(--post-bg-alt);
  color: var(--post-text-light);
  padding: 0.25rem 0.75rem;
  border-radius: 16px;
  font-size: 0.875rem;
}

.phase-tasks {
  list-style: none;
  padding: 0;
  margin: 0;
}

.phase-tasks li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--post-border);
  position: relative;
  padding-left: 1.5rem;
}

.phase-tasks li:last-child {
  border-bottom: none;
}

.phase-tasks li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--post-success);
  font-weight: bold;
}

/* Key Takeaways */
.key-takeaways {
  background: var(--post-bg-alt);
  padding: 2rem;
  border-radius: 12px;
  border-left: 4px solid var(--post-primary);
  margin: 2rem 0;
}

.key-takeaways h3 {
  margin: 0 0 1rem 0;
  color: var(--post-text);
}

.key-takeaways ul {
  margin: 0;
  padding-left: 1.5rem;
}

.key-takeaways li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

/* Next Steps */
.next-steps {
  background: linear-gradient(135deg, var(--post-primary), #1e40af);
  color: white;
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  margin: 3rem 0;
}

.next-steps h3 {
  margin: 0 0 1rem 0;
  color: white;
}

.next-steps p {
  margin-bottom: 2rem;
  opacity: 0.9;
}

.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.cta-buttons .btn {
  padding: 0.75rem 2rem;
  border-radius: 6px;
  font-weight: 500;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.2s ease;
}

.btn-primary {
  background: white;
  color: var(--post-primary);
}

.btn-primary:hover {
  background: #f8fafc;
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* ===============================
   🏷️ POST FOOTER
   =============================== */
.post-footer {
  background: var(--post-bg-alt);
  border-top: 1px solid var(--post-border);
  padding: 3rem 0;
}

.post-footer .container > div {
  margin-bottom: 3rem;
}

.post-footer .container > div:last-child {
  margin-bottom: 0;
}

/* Tags */
.post-tags h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--post-text);
  margin-bottom: 1rem;
}

.tags-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tag {
  background: var(--post-bg);
  color: var(--post-text);
  padding: 0.5rem 1rem;
  border-radius: 16px;
  font-size: 0.875rem;
  text-decoration: none;
  border: 1px solid var(--post-border);
  transition: all 0.2s ease;
}

.tag:hover {
  background: var(--post-primary);
  color: white;
  border-color: var(--post-primary);
}

/* Social Share */
.social-share h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--post-text);
  margin-bottom: 1rem;
}

.share-buttons {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.share-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.share-btn.linkedin {
  background: #0077b5;
  color: white;
}

.share-btn.twitter {
  background: #1da1f2;
  color: white;
}

.share-btn.facebook {
  background: #4267b2;
  color: white;
}

.share-btn.whatsapp {
  background: #25d366;
  color: white;
}

.share-btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* Related Posts */
.related-posts h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--post-text);
  margin-bottom: 2rem;
  text-align: center;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.related-post {
  background: var(--post-bg);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--post-border);
  transition: all 0.3s ease;
}

.related-post:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.related-post a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.related-image {
  aspect-ratio: 16/9;
  overflow: hidden;
}

.related-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.related-post:hover .related-image img {
  transform: scale(1.05);
}

.related-content {
  padding: 1.5rem;
}

.related-content h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--post-text);
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

.related-content p {
  color: var(--post-text-light);
  font-size: 0.875rem;
  margin: 0;
  line-height: 1.5;
}

/* ===============================
   📱 RESPONSIVE
   =============================== */
@media (max-width: 1024px) {
  .content-wrapper {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .toc {
    order: -1;
  }
  
  .toc-sticky {
    position: static;
  }
  
  .diagram-comparison {
    grid-template-columns: 1fr;
  }
  
  .case-results {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }
}

@media (max-width: 768px) {
  .blog-post {
    padding-top: 80px;
  }
  
  .content-wrapper {
    padding: 0 1rem;
  }
  
  .post-body {
    font-size: 1rem;
  }
  
  .post-author {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
  
  .author-social {
    justify-content: center;
  }
  
  .trends-grid {
    grid-template-columns: 1fr;
  }
  
  .phase-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .cta-buttons {
    flex-direction: column;
    align-items: center;
  }
  
  .cta-buttons .btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }
  
  .related-grid {
    grid-template-columns: 1fr;
  }
  
  .share-buttons {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .post-meta {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .post-image img {
    height: 250px;
  }
  
  .breadcrumb-list {
    font-size: 0.75rem;
  }
  
  .breadcrumb-list li:not(:last-child)::after {
    margin-left: 0.25rem;
    margin-right: 0.25rem;
  }
}

/* ===============================
   🌙 MODO OSCURO
   =============================== */
[data-theme="dark"] {
  --post-bg: #1f2937;
  --post-bg-alt: #111827;
  --post-text: #f9fafb;
  --post-text-light: #d1d5db;
  --post-border: #374151;
}

[data-theme="dark"] .post-header {
  background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
}

[data-theme="dark"] .code-example {
  background: #0f172a;
  border: 1px solid var(--post-border);
}

[data-theme="dark"] .comparison-table th {
  background: var(--post-primary);
}

[data-theme="dark"] .comparison-table tr:nth-child(even) {
  background: #374151;
}

[data-theme="dark"] .trend-card,
[data-theme="dark"] .case-study,
[data-theme="dark"] .related-post {
  background: var(--post-bg);
  border-color: var(--post-border);
}

[data-theme="dark"] .toc-sticky,
[data-theme="dark"] .key-takeaways,
[data-theme="dark"] .architecture-diagram {
  background: var(--post-bg);
  border-color: var(--post-border);
}

[data-theme="dark"] .flow-diagram {
  background: var(--post-bg-alt);
  border-color: var(--post-border);
  color: var(--post-text);
}
