/* ==========================================================================
   ONCE México Blog - Estilos estilo Neil Patel
   Layout limpio con sidebar derecho y share buttons flotantes
   ========================================================================== */

:root {
  /* Colores principales - ONCE México Brand (azul) */
  --color-primary: #00B4D8;
  --color-primary-dark: #0096B4;
  --color-primary-light: #e0f7fa;
  --color-secondary: #1e3a5f;

  /* Color para botones CTA (naranja) */
  --color-cta: #f97316;
  --color-cta-dark: #ea580c;

  /* Textos */
  --color-text: #1f2937;
  --color-text-light: #4b5563;
  --color-text-muted: #9ca3af;

  /* Fondos */
  --color-bg: #ffffff;
  --color-bg-light: #f9fafb;
  --color-bg-dark: #111827;

  /* Bordes */
  --color-border: #e5e7eb;

  /* Layout */
  --max-width: 1200px;
  --content-width: 680px;
  --sidebar-width: 320px;
  --header-height: 80px;

  /* Tipografía */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ==========================================================================
   Article Header (sin hero oscuro - estilo Neil Patel)
   ========================================================================== */
.article-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem 2rem 0;
  padding-top: calc(var(--header-height) + 3rem);
}

/* Breadcrumbs simples */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumbs a {
  color: var(--color-text-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--color-primary);
}

.breadcrumbs span {
  color: var(--color-text-muted);
}

/* Título del artículo */
.article-header h1 {
  font-family: var(--font-sans);
  font-size: 2.5rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--color-text);
  margin: 0 0 1.5rem 0;
  max-width: 800px;
}

/* Info del autor - estilo Neil Patel */
.author-box {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-border);
}

.author-avatar {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
}

.author-avatar-placeholder {
  width: 56px;
  height: 56px;
  border-radius: 4px;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.25rem;
  flex-shrink: 0;
}

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

.author-text a {
  color: var(--color-primary);
  font-weight: 600;
  text-decoration: none;
}

.author-text a:hover {
  text-decoration: underline;
}

.author-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.25rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Layout Principal - Contenido + Sidebar Derecho
   ========================================================================== */
.article-layout {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: 4rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2rem;
  position: relative;
}

/* ==========================================================================
   Contenido del Artículo
   ========================================================================== */
.article-content {
  max-width: var(--content-width);
}

.article-content p {
  font-size: 1.125rem;
  line-height: 1.8;
  color: var(--color-text-light);
  margin-bottom: 1.5rem;
}

.article-content h2 {
  font-family: var(--font-sans);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 3rem 0 1.5rem 0;
  line-height: 1.3;
}

.article-content h3 {
  font-family: var(--font-sans);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 2.5rem 0 1rem 0;
  line-height: 1.4;
}

.article-content a {
  color: var(--color-primary);
  text-decoration: none;
}

.article-content a:hover {
  text-decoration: underline;
}

/* Listas con bullets naranjas */
.article-content ul,
.article-content ol {
  margin: 1.5rem 0;
  padding-left: 0;
  list-style: none;
}

.article-content li {
  position: relative;
  padding-left: 1.75rem;
  margin-bottom: 1rem;
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--color-text-light);
}

.article-content ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6rem;
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 2px;
}

.article-content ol {
  counter-reset: list-counter;
}

.article-content ol li {
  counter-increment: list-counter;
}

.article-content ol li::before {
  content: counter(list-counter) ".";
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--color-primary);
}

/* ==========================================================================
   Article Images
   ========================================================================== */
.article-image {
  margin: 2rem 0;
  padding: 0;
}

.article-image img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.article-image figcaption {
  margin-top: 0.75rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-align: center;
  font-style: italic;
}

/* CTA Banner */
.cta-banner-link {
  display: block;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-banner-link:hover {
  transform: translateY(-2px);
}

.cta-banner-link:hover .cta-banner img {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.cta-banner {
  margin: 2.5rem 0;
}

/* ==========================================================================
   Key Takeaways - Estilo Neil Patel
   ========================================================================== */
.key-takeaways {
  margin: 2rem 0;
  padding: 0;
  background: none;
  border: none;
}

.key-takeaways-title {
  font-family: var(--font-sans);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 1.25rem 0;
}

.key-takeaways ul {
  margin: 0;
  padding: 0;
}

.key-takeaways li {
  padding-left: 1.75rem;
  margin-bottom: 1rem;
}

.key-takeaways li::before {
  background: var(--color-primary);
}

/* ==========================================================================
   Tablas
   ========================================================================== */
.table-container {
  margin: 2rem 0;
  overflow-x: auto;
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

thead {
  background: var(--color-bg-dark);
  color: white;
}

th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
}

td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  color: var(--color-text-light);
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--color-bg-light);
}

/* ==========================================================================
   CTA Box Inline - Con foto del autor (estilo Neil Patel)
   ========================================================================== */
.cta-inline {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 2rem;
  margin: 3rem 0;
  background: var(--color-bg-light);
  border-radius: 8px;
  border: 1px solid var(--color-border);
}

.cta-inline-image {
  width: 120px;
  height: auto;
  border-radius: 4px;
  flex-shrink: 0;
}

.cta-inline-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.75rem 0;
}

.cta-inline-content h3 span {
  color: var(--color-primary);
}

.cta-inline-content p {
  font-size: 0.95rem;
  color: var(--color-text-light);
  margin: 0 0 0.5rem 0;
  line-height: 1.6;
}

.cta-inline-content ul {
  margin: 0.75rem 0;
  padding: 0;
  list-style: none;
}

.cta-inline-content li {
  font-size: 0.95rem;
  padding-left: 0;
  margin-bottom: 0.25rem;
}

.cta-inline-content li::before {
  display: none;
}

.cta-inline-content li strong {
  color: var(--color-primary);
}

/* ==========================================================================
   Sidebar Derecho
   ========================================================================== */
.sidebar {
  position: sticky;
  top: calc(var(--header-height) + 2rem);
  height: fit-content;
}

/* CTA Box en Sidebar */
.sidebar-cta {
  background: linear-gradient(135deg, #1e3a5f 0%, #0f172a 100%);
  color: white;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  margin-bottom: 2rem;
}

.sidebar-cta h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem 0;
  color: white;
}

.sidebar-cta h3 span {
  display: block;
  color: white;
}

.sidebar-cta p {
  font-size: 0.95rem;
  margin: 0 0 1.5rem 0;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.5;
}

.sidebar-cta-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.sidebar-cta-input {
  width: 100%;
  padding: 0.875rem 1rem;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  background: white;
}

.sidebar-cta-input::placeholder {
  color: var(--color-text-muted);
}

.sidebar-cta-btn {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--color-cta);
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.sidebar-cta-btn:hover {
  background: var(--color-cta-dark);
}

/* Table of Contents en Sidebar */
.sidebar-toc {
  background: white;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
}

.sidebar-toc-title {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 1rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--color-primary);
  display: inline-block;
}

.sidebar-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-toc li {
  margin-bottom: 0.75rem;
  padding-left: 1.25rem;
  position: relative;
}

.sidebar-toc li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  width: 6px;
  height: 6px;
  background: var(--color-primary);
  border-radius: 1px;
}

.sidebar-toc a {
  color: var(--color-text-light);
  text-decoration: none;
  font-size: 0.9rem;
  line-height: 1.5;
  transition: color 0.2s ease;
}

.sidebar-toc a:hover,
.sidebar-toc a.active {
  color: var(--color-primary);
}

/* ==========================================================================
   FAQ Section
   ========================================================================== */
.faq-section {
  margin-top: 3rem;
}

.faq-section h2 {
  margin-bottom: 1.5rem;
}

.faq-item {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-bottom: 1rem;
  overflow: hidden;
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  background: white;
  cursor: pointer;
  transition: background 0.2s ease;
}

.faq-question:hover {
  background: var(--color-bg-light);
}

.faq-question h3 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--color-text);
  padding-right: 1rem;
}

.faq-icon {
  font-size: 1.5rem;
  color: var(--color-primary);
  font-weight: 300;
  transition: transform 0.3s ease;
  flex-shrink: 0;
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
  max-height: 500px;
}

.faq-answer-content {
  padding: 0 1.5rem 1.5rem;
}

.faq-answer-content p {
  margin: 0;
  font-size: 1rem;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 968px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .sidebar {
    position: relative;
    top: 0;
    order: -1;
  }

  .sidebar-cta {
    display: none;
  }

  .article-header h1 {
    font-size: 2rem;
  }
}

@media (max-width: 640px) {
  .article-header {
    padding: 1.5rem 1rem 0;
    padding-top: calc(var(--header-height) + 1rem);
  }

  .article-header h1 {
    font-size: 1.75rem;
  }

  .article-layout {
    padding: 1.5rem 1rem;
  }

  .article-content p,
  .article-content li {
    font-size: 1rem;
  }

  .article-content h2 {
    font-size: 1.5rem;
  }

  .author-box {
    flex-direction: column;
    align-items: flex-start;
  }

  .cta-inline {
    flex-direction: column;
    padding: 1.5rem;
  }

  .cta-inline-image {
    width: 100px;
  }

  .table-container {
    font-size: 0.875rem;
  }

  th, td {
    padding: 0.75rem;
  }
}

/* ==========================================================================
   Utilidades
   ========================================================================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Print */
@media print {
  .sidebar,
  .cta-inline {
    display: none;
  }

  .article-layout {
    display: block;
  }

  .article-content {
    max-width: 100%;
  }
}
