/* ══════════════════════════════════════════════════════════════
   pages.css — Estilos compartidos añadidos en la mejora SEO
   Se carga DESPUÉS de components/sections para poder sobrescribir.
   Contiene:
     1. Utilidades globales (skip-link, sr-only, scroll-margin)
     2. Botones usados como <a> (enlaces rastreables por Google)
     3. Navbar extra (dropdown de servicios)
     4. Footer ampliado (sitemap + NAP)
     5. Páginas interiores: hero, breadcrumbs, prose, cards, TOC
   ══════════════════════════════════════════════════════════════ */

/* ── 1. Utilidades globales ─────────────────────────────────── */

/* Los anclas deben quedar bajo la navbar sticky al saltar */
:target,
section[id],
article[id],
h2[id], h3[id] {
  scroll-margin-top: 96px;
}

/* Sin JavaScript el contenido con .reveal debe verse igual (usuarios y bots) */
html:not(.js) .reveal {
  opacity: 1 !important;
  transform: 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;
}

.skip-link {
  position: absolute;
  top: -100px; left: 12px;
  z-index: 999;
  background: var(--grad-main);
  color: #fff;
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  padding: 10px 18px;
  border-radius: 0 0 10px 10px;
  transition: top .2s ease;
}
.skip-link:focus { top: 0; }

/* Foco visible accesible en todo el sitio */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── 2. Botones que ahora son <a> ───────────────────────────── */
a.btn-primary,
a.btn-ghost,
a.btn-nav-cta,
a.btn-price,
a.btn-services-price,
a.btn-cta-submit {
  display: inline-block;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}
a.btn-services-price {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
a.btn-price { width: 100%; }

/* Tarjetas de servicio convertidas en enlaces rastreables */
a.svc-card {
  display: block;
  color: inherit;
  text-decoration: none;
}
a.svc-card:hover h3 { color: var(--indigo-light); }
a.svc-card h3 { transition: color var(--transition); }

/* Pregunta de FAQ envuelta en <h3> por jerarquía de encabezados */
.faq-q-wrap {
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}

/* Ítem de nav visible solo en móvil (sustituye al desplegable) */
.nav-only-mobile { display: none; }

/* Enlaces y código dentro de las respuestas del FAQ */
.faq-answer p a {
  color: var(--indigo-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(129,140,248,.45);
  transition: color var(--transition);
}
.faq-answer p a:hover { color: var(--cyan); }
.faq-answer p code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  background: var(--surface-3);
  border: 0.5px solid var(--border-soft);
  border-radius: 5px;
  padding: 1px 6px;
  color: var(--muted);
}

/* ── 3. Navbar: menú desplegable de servicios ───────────────── */
.nav-item-drop { position: relative; }
.nav-drop-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dim);
  background: none;
  padding: 0 0 2px;
  transition: color var(--transition);
}
.nav-drop-toggle svg { transition: transform .25s ease; }
.nav-item-drop:hover .nav-drop-toggle,
.nav-item-drop:focus-within .nav-drop-toggle { color: var(--text); }
.nav-item-drop:hover .nav-drop-toggle svg,
.nav-item-drop:focus-within .nav-drop-toggle svg { transform: rotate(180deg); }

.nav-drop {
  position: absolute;
  top: calc(100% + 14px); left: 50%;
  transform: translateX(-50%) translateY(-6px);
  min-width: 268px;
  background: var(--nav-bg-scrolled);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
  z-index: 120;
}
.nav-item-drop:hover .nav-drop,
.nav-item-drop:focus-within .nav-drop {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.nav-drop a {
  display: block;
  padding: 9px 12px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--muted);
  transition: background var(--transition), color var(--transition);
}
.nav-drop a::after { display: none; }
.nav-drop a strong {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.nav-drop a span { font-size: 11.5px; color: var(--dim); }
.nav-drop a:hover { background: var(--indigo-dim); }

/* ── 4. Footer ampliado ─────────────────────────────────────── */
.footer {
  display: block;
  padding: 56px 48px 28px;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.2fr;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 0.5px solid var(--border-soft);
}
.fcol-title {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--indigo-light);
  margin-bottom: 16px;
}
.fcol ul { display: flex; flex-direction: column; gap: 10px; }
.fcol a,
.fcol address {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--dim);
  font-style: normal;
  line-height: 1.6;
  transition: color var(--transition);
}
.fcol a:hover { color: var(--indigo-light); }
.footer-about {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--dim);
  line-height: 1.75;
  max-width: 320px;
  margin: 14px 0 18px;
}
.fcol--brand .footer-social { justify-content: flex-start; }
.fcontact { display: flex; flex-direction: column; gap: 12px; }
.fcontact-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--dim);
  line-height: 1.6;
}
.fcontact-row svg { flex-shrink: 0; margin-top: 2px; color: var(--indigo-light); }
.fcontact-row a { color: var(--muted); transition: color var(--transition); }
.fcontact-row a:hover { color: var(--indigo-light); }

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 22px;
}
.footer-legal { display: flex; gap: 18px; flex-wrap: wrap; }
.footer-legal a {
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--dimmer);
  transition: color var(--transition);
}
.footer-legal a:hover { color: var(--muted); }

/* ── 5. Páginas interiores ──────────────────────────────────── */

/* Breadcrumbs */
.breadcrumbs {
  padding: 20px 48px 0;
  max-width: calc(var(--container) + 96px);
  margin: 0 auto;
}
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 12px;
  color: var(--dimmer);
}
.breadcrumbs li { display: flex; align-items: center; gap: 8px; }
.breadcrumbs a { color: var(--dim); transition: color var(--transition); }
.breadcrumbs a:hover { color: var(--indigo-light); }
.breadcrumbs li[aria-current] { color: var(--muted); }
.breadcrumbs .bc-sep { color: var(--dimmer); }

/* Hero de página interior */
.page-hero {
  position: relative;
  padding: 56px 48px 60px;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 12% 20%, rgba(99,102,241,.16) 0%, transparent 62%),
    radial-gradient(ellipse 40% 50% at 88% 0%, rgba(34,211,238,.08) 0%, transparent 60%);
  pointer-events: none;
}
.page-hero > .container { position: relative; }
.page-hero h1 {
  font-family: var(--font-ui);
  font-size: clamp(32px, 4.2vw, 52px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -1.8px;
  color: var(--text);
  max-width: 860px;
  margin-bottom: 18px;
}
.page-hero .page-lead {
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 300;
  line-height: 1.75;
  color: var(--muted);
  max-width: 640px;
  margin-bottom: 28px;
}
.page-hero .hero-btns { margin-bottom: 0; }
/* Evita el doble espaciado hero + sección siguiente */
.page-hero + .section-pad { padding-top: 44px; }

.page-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: rgba(99,102,241,.1);
  border: 0.5px solid rgba(129,140,248,.35);
  border-radius: 20px;
  padding: 5px 16px;
  font-family: var(--font-body);
  font-size: 12px;
  color: #A5B4FC;
  margin-bottom: 20px;
}

/* Kicker semántico dentro del H1 del home */
.hero-kicker {
  display: block;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .6px;
  text-transform: uppercase;
  color: var(--indigo-light);
  margin-bottom: 12px;
}

/* Contraste del badge/kicker en modo claro (el color base es para fondo oscuro) */
:root[data-theme="light"] .hero-badge,
:root[data-theme="light"] .page-kicker {
  color: #4338CA;
  background: rgba(99,102,241,.08);
  border-color: rgba(99,102,241,.3);
}
:root[data-theme="light"] .hero-kicker { color: #4338CA; }

/* Contenido editorial (prose) */
.prose {
  max-width: 760px;
  font-family: var(--font-body);
  color: var(--muted);
}
.prose > * + * { margin-top: 18px; }
.prose h2 {
  font-family: var(--font-ui);
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 800;
  letter-spacing: -.8px;
  color: var(--text);
  line-height: 1.25;
  margin-top: 46px;
}
.prose h3 {
  font-family: var(--font-ui);
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-top: 32px;
}
.prose p,
.prose li { font-size: 15px; line-height: 1.85; }
.prose strong { color: var(--text); font-weight: 600; }
.prose a {
  color: var(--indigo-light);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(129,140,248,.45);
  transition: color var(--transition);
}
.prose a:hover { color: var(--cyan); }
.prose ul, .prose ol {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-left: 4px;
}
.prose ul li { position: relative; padding-left: 22px; }
.prose ul li::before {
  content: '';
  position: absolute;
  left: 2px; top: 11px;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--indigo-light), var(--cyan));
}
.prose ol { counter-reset: p-ol; }
.prose ol li { position: relative; padding-left: 30px; counter-increment: p-ol; }
.prose ol li::before {
  content: counter(p-ol);
  position: absolute;
  left: 0; top: 2px;
  width: 21px; height: 21px;
  border-radius: 6px;
  background: var(--indigo-dim);
  border: 0.5px solid var(--indigo-border);
  color: var(--indigo-light);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.prose blockquote {
  border-left: 2.5px solid var(--indigo-light);
  background: var(--surface-2);
  padding: 16px 20px;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 15px;
  line-height: 1.8;
  color: var(--muted);
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  display: block;
  overflow-x: auto;
}
.prose thead th {
  text-align: left;
  font-family: var(--font-ui);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--indigo-light);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.prose tbody td {
  padding: 13px 14px;
  border-bottom: 0.5px solid var(--border-soft);
  color: var(--muted);
  line-height: 1.6;
}
.prose tbody tr:hover td { background: var(--surface-2); }

/* Índice de contenidos */
.toc {
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 8px;
}
.toc-title {
  font-family: var(--font-ui);
  font-size: 12px; font-weight: 700;
  letter-spacing: 1.4px; text-transform: uppercase;
  color: var(--indigo-light);
  margin-bottom: 14px;
}
.toc ol { display: flex; flex-direction: column; gap: 9px; counter-reset: toc; }
.toc li { counter-increment: toc; padding-left: 0; }
.toc li::before { content: none; }
.toc a {
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--dim);
  text-decoration: none;
  transition: color var(--transition);
}
.toc a::before { content: counter(toc) ". "; color: var(--dimmer); }
.toc a:hover { color: var(--indigo-light); }

/* Layout artículo + aside */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 56px;
  align-items: start;
}
.article-aside { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 20px; }
.aside-card {
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.aside-card h2,
.aside-card h3 {
  font-family: var(--font-ui);
  font-size: 15px; font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}
.aside-card p {
  font-family: var(--font-body);
  font-size: 13px; color: var(--dim); line-height: 1.7;
  margin-bottom: 16px;
}
.aside-links { display: flex; flex-direction: column; gap: 10px; }
.aside-links a {
  font-family: var(--font-body);
  font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 8px;
  transition: color var(--transition);
}
.aside-links a:hover { color: var(--indigo-light); }

/* Metadatos de artículo */
.article-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-family: var(--font-body);
  font-size: 12.5px;
  color: var(--dim);
  margin-bottom: 6px;
}
.article-meta .dot-sep { color: var(--dimmer); }

/* Tarjetas de listado (blog / servicios) */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 22px;
}
.link-card {
  display: flex;
  flex-direction: column;
  background: var(--surface-2);
  border: 0.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 24px;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}
.link-card:hover {
  transform: translateY(-4px);
  border-color: var(--indigo-border);
  box-shadow: var(--shadow-soft);
}
.link-card .lc-tag {
  display: inline-block;
  align-self: flex-start;
  background: rgba(99,102,241,.1);
  border: 0.5px solid rgba(99,102,241,.22);
  border-radius: 5px;
  padding: 3px 10px;
  font-family: var(--font-body);
  font-size: 11px;
  color: var(--indigo-light);
  margin-bottom: 14px;
}
.link-card h2,
.link-card h3 {
  font-family: var(--font-ui);
  font-size: 17px; font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 9px;
}
.link-card p {
  font-family: var(--font-body);
  font-size: 13.5px; color: var(--dim); line-height: 1.75;
  margin-bottom: 18px;
  flex: 1;
}
.lc-more {
  font-family: var(--font-body);
  font-size: 13px; font-weight: 600;
  color: var(--indigo-light);
  display: inline-flex; align-items: center; gap: 6px;
}
.link-card:hover .lc-more svg { transform: translateX(3px); }
.lc-more svg { transition: transform var(--transition); }

/* Bloque "incluye" en páginas de servicio */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}
.feature-item {
  display: flex;
  gap: 12px;
  background: var(--surface-2);
  border: 0.5px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 18px;
}
.feature-item svg { flex-shrink: 0; margin-top: 2px; }
.feature-item h3 {
  font-family: var(--font-ui);
  font-size: 14px; font-weight: 700;
  color: var(--text); margin-bottom: 5px;
}
.feature-item p {
  font-family: var(--font-body);
  font-size: 12.5px; color: var(--dim); line-height: 1.7;
}

/* Enlaces relacionados al pie del contenido */
.related {
  border-top: 0.5px solid var(--border-soft);
  margin-top: 56px;
  padding-top: 32px;
}
.related h2 {
  font-family: var(--font-ui);
  font-size: 18px; font-weight: 700;
  color: var(--text); margin-bottom: 18px;
}

/* Página 404 */
.error-page {
  min-height: 62vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 48px;
}
.error-code {
  font-family: var(--font-ui);
  font-size: clamp(72px, 14vw, 140px);
  font-weight: 800;
  letter-spacing: -6px;
  line-height: 1;
  background: var(--grad-text);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  .article-layout { grid-template-columns: 1fr; gap: 40px; }
  .article-aside { position: static; }
  .footer-inner { grid-template-columns: 1fr 1fr; gap: 32px; }
}
@media (max-width: 768px) {
  /* El CTA de navbar es <a>: hay que re-ocultarlo en móvil */
  a.btn-nav-cta { display: none; }
  .nav-only-mobile { display: block; }

  .page-hero { padding: 40px 20px 48px; }
  .breadcrumbs { padding: 16px 20px 0; }
  .footer { padding: 44px 20px 24px; }
  .footer-inner { grid-template-columns: 1fr; gap: 30px; }
  .footer-about { max-width: none; }
  .nav-item-drop { display: none; }
  .prose h2 { margin-top: 36px; }
  .toc { padding: 18px 18px; }
}
