/* ============================================================
   Infografía: Auditoría SEO
   ============================================================ */

/* 1. CSS Custom Properties de BigLobster */
:root {
  --bg-base: #F7F8FA;
  --bg-surface: #FFFFFF;
  --bg-subtle: #EEF0F4;
  --text-primary: #111318;
  --text-secondary: #4A5063;
  --text-muted: #8A91A4;
  --accent: #B8391C;
  --accent-hover: #9C2F16;
  --accent-teal: #D4622A;
  --accent-light: #FAECEA;
  --border: #DDE1E9;

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --radius-sm: 4px;
  --radius-md: 8px;

  --ease: cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --bg-base: #0E1117;
  --bg-surface: #161B26;
  --bg-subtle: #1D2333;
  --text-primary: #EDF0F7;
  --text-secondary: #9BA3B8;
  --text-muted: #5A6278;
  --accent: #D94F2E;
  --accent-hover: #B8391C;
  --accent-teal: #E07A50;
  --accent-light: #2A1410;
  --border: #252D3F;
}

/* 2. Reset básico */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 62.5%; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 1.6rem;
  line-height: 1.65;
  color: var(--text-secondary);
  background: var(--bg-base);
  transition: background .3s var(--ease), color .3s var(--ease);
  overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; font: inherit; border: none; background: none; }

/* 3. Clases de utilidad */
.hidden { display: none !important; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 4. Contenedor principal de la infografía */
.infografia-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 5. Navegación de secciones */
.infografia-nav {
  position: fixed;
  top: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  gap: .8rem;
  background: color-mix(in srgb, var(--bg-surface) 85%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: .8rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,.08);
  transition: background .3s var(--ease), border-color .3s var(--ease);
}

.nav-btn {
  padding: .6rem 1.2rem;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  transition: color .2s, background .2s;
  white-space: nowrap;
}
.nav-btn:hover { color: var(--text-secondary); }
.nav-btn[aria-selected="true"] {
  background: var(--accent);
  color: white;
  font-weight: 600;
}
.nav-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* 6. Contenedor de secciones */
.infografia-main {
  flex: 1;
  position: relative;
}

/* 7. Cada sección ocupa toda la pantalla */
.infografia-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem 8rem;
  position: relative;
  opacity: 1;
  transition: opacity 0.4s var(--ease);
}
.infografia-section[aria-hidden="true"] {
  display: none;
  opacity: 0;
}

.section-number {
  position: absolute;
  top: 4rem;
  left: 2rem;
  font-size: 8rem;
  font-weight: 200;
  color: var(--text-muted);
  opacity: 0.15;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  z-index: 0;
  transition: color .3s var(--ease);
}

/* 8. Sección HERO */
.hero-block {
  text-align: center;
  max-width: 72rem;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.hero-icon {
  font-size: 8rem;
  margin-bottom: 2.4rem;
  line-height: 1;
  animation: float 6s ease-in-out infinite;
  display: block;
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(3.2rem, 5vw, 4.8rem);
  line-height: 1.1;
  color: var(--text-primary);
  letter-spacing: -.02em;
  margin-bottom: 1.2rem;
}

.hero-subtitle {
  font-size: clamp(1.8rem, 2.5vw, 2.2rem);
  font-weight: 300;
  color: var(--accent-teal);
  margin-bottom: 2.4rem;
}

.hero-annotation {
  font-size: 1.6rem;
  font-style: italic;
  max-width: 48rem;
  margin: 0 auto;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 1.6rem;
}

/* 9. Sección 2: Grid de 3 pilares */
.section-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 3.5vw, 3.2rem);
  color: var(--text-primary);
  letter-spacing: -.02em;
  margin-bottom: 3.2rem;
  text-align: center;
}

.pilares-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.4rem;
  max-width: 96rem;
  margin: 0 auto 2.4rem;
}
@media (min-width: 768px) {
  .pilares-grid { grid-template-columns: repeat(3, 1fr); }
}

.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 2.4rem;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  border-color: var(--accent);
}

.card-icon {
  font-size: 4.8rem;
  margin-bottom: 1.6rem;
  line-height: 1;
}

.card-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
}

.card-list {
  display: flex;
  flex-direction: column;
  gap: .8rem;
}
.card-list li {
  font-size: 1.4rem;
  color: var(--text-secondary);
  padding-left: 1.2rem;
  position: relative;
}
.card-list li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent-teal);
}

.section-annotation {
  font-size: 1.5rem;
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
  max-width: 64rem;
  margin: 0 auto;
}

/* 10. Sección 3: 8 checks y métrica destacada */
.metric-highlight {
  text-align: center;
  margin: 0 auto 3.2rem;
  padding: 2.4rem;
  background: var(--accent-light);
  border-radius: var(--radius-md);
  border: 2px solid var(--accent);
  max-width: 32rem;
}

.metric-value {
  display: block;
  font-size: 5.6rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: .8rem;
}

.metric-label {
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .08em;
}

.checks-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.2rem;
  max-width: 64rem;
  margin: 0 auto 2.4rem;
}
@media (min-width: 640px) {
  .checks-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1024px) {
  .checks-grid { grid-template-columns: repeat(4, 1fr); }
}

.check-item {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.6rem;
  display: flex;
  align-items: center;
  gap: 1.2rem;
  transition: border-color .2s, background .2s;
}
.check-item:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.check-num {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--accent-light);
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.check-text {
  font-size: 1.4rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* 11. Sección 4: Timeline de 5 pasos */
.timeline {
  max-width: 72rem;
  margin: 0 auto 2.4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
}
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 1.6rem;
  width: 2px;
  background: var(--border);
  z-index: 0;
}
@media (min-width: 640px) {
  .timeline::before { left: 50%; transform: translateX(-1px); }
}

.timeline-step {
  position: relative;
  z-index: 1;
}
@media (min-width: 640px) {
  .timeline-step:nth-child(odd) {
    align-self: flex-start;
    max-width: calc(50% - 3.2rem);
    margin-right: auto;
    text-align: right;
  }
  .timeline-step:nth-child(even) {
    align-self: flex-end;
    max-width: calc(50% - 3.2rem);
    margin-left: auto;
    text-align: left;
  }
  .timeline-step:nth-child(odd) .timeline-number { left: auto; right: -4.4rem; }
  .timeline-step:nth-child(even) .timeline-number { left: -4.4rem; }
}

.timeline-number {
  position: absolute;
  top: 0;
  left: -4.4rem;
  width: 3.2rem;
  height: 3.2rem;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 1.4rem;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  z-index: 2;
}

.timeline-content {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.6rem 2rem;
}
.timeline-content h5 {
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: .6rem;
}
.timeline-content p {
  font-size: 1.4rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 12. Sección 5: Grid de herramientas */
.tools-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2.4rem;
  max-width: 96rem;
  margin: 0 auto 2.4rem;
}
@media (min-width: 768px) {
  .tools-grid { grid-template-columns: repeat(5, 1fr); }
}

.tool-card {
  text-align: center;
}
.tool-card:hover {
  transform: scale(1.05);
}

.tool-icon {
  font-size: 3.6rem;
  margin-bottom: 1rem;
  display: block;
}

.tool-name {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: .4rem;
}

.tool-use {
  font-size: 1.2rem;
  color: var(--text-muted);
  display: block;
}

/* 13. Sección 6: CTA final */
.cta-content {
  max-width: 72rem;
  margin: 0 auto;
  text-align: center;
}

.cta-visual {
  margin-bottom: 2.4rem;
}

.cta-emoji {
  font-size: 6.4rem;
  animation: pulse 3s ease-in-out infinite;
  display: inline-block;
}
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.9; }
}

.cta-title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 3.5vw, 3.2rem);
  color: var(--text-primary);
  letter-spacing: -.02em;
  margin-bottom: 1.6rem;
}

.cta-description {
  font-size: 1.8rem;
  font-weight: 300;
  color: var(--text-secondary);
  margin-bottom: 2.4rem;
  max-width: 56rem;
  margin-left: auto;
  margin-right: auto;
}

.cta-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2rem;
  margin-bottom: 3.2rem;
}

.cta-feature {
  font-size: 1.4rem;
  color: var(--text-secondary);
  background: var(--bg-subtle);
  padding: .8rem 1.2rem;
  border-radius: var(--radius-sm);
}

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

.cta-btn {
  padding: 1.2rem 2.4rem;
  font-size: 1.5rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: background .2s, transform .15s, box-shadow .2s;
  white-space: nowrap;
}
.cta-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.cta-btn.primary {
  background: var(--accent);
  color: white;
}
.cta-btn.primary:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 35%, transparent);
}

.cta-btn.secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.cta-btn.secondary:hover {
  background: var(--bg-subtle);
  transform: translateY(-1px);
  border-color: var(--text-muted);
}

/* 14. Barra de progreso */
.infografia-progress {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 6px;
  background: transparent;
  z-index: 100;
}

.progress-bar {
  height: 100%;
  background: var(--bg-subtle);
  position: relative;
}

.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: var(--accent);
  width: 16.666%; /* 1/6 */
  transition: width 0.4s var(--ease);
}

.progress-label {
  position: absolute;
  bottom: 8px;
  right: 2rem;
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: opacity 0.3s;
}

/* 15. Animaciones de entrada */
[data-animation] {
  opacity: 0;
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}

.infografia-section.active [data-animation] {
  opacity: 1;
}

[data-animation="fadeIn"] {
  transform: translateY(0);
}
[data-animation="slideIn"] {
  transform: translateY(20px);
}
[data-animation="scaleIn"] {
  transform: scale(0.9);
}

.infografia-section.active [data-animation="fadeIn"] {
  transform: translateY(0);
}
.infografia-section.active [data-animation="slideIn"] {
  transform: translateY(0);
}
.infografia-section.active [data-animation="scaleIn"] {
  transform: scale(1);
}

/* Delay animations when data-delay is set via CSS custom property fallback */
[data-delay] {
  transition-delay: calc(var(--delay, 0) * 1ms);
}

/* 16. Responsive mobile-first */
@media (max-width: 767px) {
  .infografia-nav {
    top: auto;
    bottom: 8rem;
    flex-wrap: wrap;
    justify-content: center;
  }
  .section-number {
    top: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 6rem;
  }
  .timeline-step {
    margin-left: 4.4rem;
  }
  .timeline-number {
    left: -4.4rem;
  }
}

/* 17. Tema oscuro mejoras */
[data-theme="dark"] .card {
  background: var(--bg-surface);
}
[data-theme="dark"] .tool-card:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,.3);
}

/* 18. Reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .infografia-section { transition: none; }
  [data-animation] { opacity: 1; transform: none !important; transition: none !important; }
  .progress-fill { transition: none; }
  .hero-icon { animation: none; }
  .cta-emoji { animation: none; }
}