/* ==========================================================
   Páginas de servicio y guías (SEO local).
   Se cargan después de styles.css y reutilizan sus tokens
   (--bg, --text, --grad…), .button y .section-eyebrow.
   Nada de aquí depende de script.js: el contenido tiene que
   leerse entero en el HTML servido, sin JavaScript.
   ========================================================== */

/* ---------- cabecera ---------- */

.sp-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 0.9rem 1.1rem;
}

.sp-header__bar {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 0.5rem 0.5rem 0.5rem 1.2rem;
  border-radius: 999px;
  background: var(--nav-glass);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
}

.sp-header__logo {
  display: flex;
  align-items: center;
  margin-right: auto;
}

.sp-header__logo img {
  height: 1.3rem;
  width: auto;
}

.logo--light {
  display: none;
}

:root[data-theme="light"] .logo--dark {
  display: none;
}

:root[data-theme="light"] .logo--light {
  display: block;
}

.sp-header__nav {
  display: flex;
  gap: 1.4rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--muted);
}

.sp-header__nav a:hover,
.sp-header__nav a[aria-current="page"] {
  color: var(--text);
}

.sp-header__cta {
  height: 2.7rem;
  padding: 0 1.2rem;
}

.sp-header__cta .button__inner {
  font-size: 0.78rem;
}

@media (max-width: 860px) {
  .sp-header__nav {
    display: none;
  }
}

@media (max-width: 380px) {
  .sp-header__cta {
    display: none;
  }
}

/* ---------- cuerpo ---------- */

.sp-main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 5rem;
}

.sp-hero {
  max-width: 54rem;
  padding: 2.5rem 0 3.5rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-bottom: 1.8rem;
  font-size: 0.85rem;
  color: var(--muted-2);
}

.breadcrumb a:hover {
  color: var(--text);
}

.sp-hero h1 {
  font-size: clamp(2.2rem, 5.2vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.01em;
  text-transform: uppercase;
}

.grad {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sp-meta {
  margin-top: 1.2rem;
  font-size: 0.86rem;
  color: var(--muted-2);
}

.sp-answer {
  margin-top: 1.6rem;
  font-size: clamp(1.08rem, 1.7vw, 1.28rem);
  line-height: 1.65;
  color: var(--text);
}

.sp-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 2rem;
}

.button--ghost {
  background: transparent;
  border: 1px solid var(--border);
}

.button--ghost .button__inner {
  color: var(--text);
}

@media (max-width: 480px) {
  .sp-actions .button {
    width: 100%;
    white-space: normal;
    text-align: center;
  }
}

.sp-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16rem;
  gap: 3.5rem;
  align-items: start;
}

@media (max-width: 960px) {
  .sp-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .sp-toc {
    display: none;
  }
}

.sp-toc {
  position: sticky;
  top: 5.8rem;
  max-height: calc(100vh - 7rem);
  overflow: auto;
  padding: 1.3rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card-2);
  font-size: 0.88rem;
}

.sp-toc p {
  margin-bottom: 0.8rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--orange);
}

.sp-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sp-toc li + li {
  margin-top: 0.55rem;
}

.sp-toc a {
  color: var(--muted);
  line-height: 1.4;
}

.sp-toc a:hover {
  color: var(--text);
}

.sp-section {
  padding: 2.8rem 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 6rem;
}

.sp-section:first-child {
  padding-top: 0;
  border-top: none;
}

.sp-section h2 {
  margin-bottom: 1rem;
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.15;
}

.sp-section h3 {
  margin: 1.6rem 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.3;
}

.sp-section p {
  font-size: 1.02rem;
  line-height: 1.75;
  color: var(--muted);
}

.sp-section p + p {
  margin-top: 0.9rem;
}

/* primera frase de cada bloque: la respuesta directa que puede citar un buscador */
.sp-section p.sp-lead {
  font-size: 1.1rem;
  color: var(--text);
}

.sp-section strong {
  color: var(--text);
}

.sp-section a:not(.sp-card),
.sp-cta a:not(.button),
.sp-note a {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--orange);
  text-underline-offset: 3px;
}

.sp-list {
  display: grid;
  gap: 0.65rem;
  margin: 1.1rem 0;
}

.sp-list li {
  position: relative;
  padding-left: 1.4rem;
  line-height: 1.65;
  color: var(--muted);
}

.sp-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--grad);
}

.sp-steps {
  display: grid;
  gap: 0.9rem;
  margin: 1.2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.sp-steps li {
  display: grid;
  grid-template-columns: 2.6rem minmax(0, 1fr);
  gap: 0.9rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  background: var(--card-2);
  line-height: 1.6;
  color: var(--muted);
  counter-increment: step;
}

.sp-steps li::before {
  content: counter(step, decimal-leading-zero);
  font-size: 1.3rem;
  font-weight: 900;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sp-steps strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--text);
}

.sp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(15rem, 100%), 1fr));
  gap: 1rem;
  margin: 1.3rem 0;
}

.sp-card {
  display: block;
  padding: 1.3rem 1.4rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card-2);
}

.sp-section .sp-card h3,
.sp-card h3 {
  margin: 0 0 0.45rem;
  font-size: 1.05rem;
}

.sp-section .sp-card p,
.sp-card p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
}

a.sp-card {
  transition: border-color 0.3s ease, transform 0.3s ease;
}

a.sp-card:hover {
  border-color: var(--purple);
  transform: translateY(-3px);
}

.sp-card__more {
  display: inline-block;
  margin-top: 0.7rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--orange);
}

.sp-table-wrap {
  margin: 1.3rem 0;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 1rem;
}

.sp-table {
  width: 100%;
  min-width: 36rem;
  border-collapse: collapse;
  font-size: 0.94rem;
}

.sp-table--narrow {
  min-width: 0;
}

.sp-table--wide {
  min-width: 52rem;
}

.sp-data {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(18rem, 100%), 1fr));
  gap: 1rem;
  align-items: start;
}

.sp-data .sp-table-wrap {
  margin: 1.3rem 0 0;
}

.sp-table caption {
  padding: 0.9rem 1rem 0;
  text-align: left;
  font-size: 0.85rem;
  color: var(--muted-2);
}

.sp-table th,
.sp-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
  color: var(--muted);
}

.sp-table thead th {
  background: var(--card-2);
  font-weight: 800;
  color: var(--text);
}

.sp-table tbody th {
  font-weight: 700;
  color: var(--text);
}

.sp-table td.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.sp-table tbody tr:last-child th,
.sp-table tbody tr:last-child td {
  border-bottom: none;
}

.sp-note {
  margin-top: 0.8rem;
  font-size: 0.86rem !important;
  line-height: 1.6 !important;
  color: var(--muted-2) !important;
}

.sp-author {
  display: grid;
  gap: 0.4rem;
  padding: 1.4rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--card-2);
}

/* ---------- llamada final y relacionadas ---------- */

.sp-cta {
  margin-top: 3.5rem;
  padding: clamp(1.8rem, 4vw, 3rem);
  border: 1px solid var(--border);
  border-radius: 1.4rem;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(177, 90, 248, 0.2), transparent 55%),
    radial-gradient(120% 140% at 0% 100%, rgba(255, 137, 81, 0.16), transparent 55%),
    var(--card-2);
}

.sp-cta h2 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.05;
  text-transform: uppercase;
}

.sp-cta p {
  max-width: 42rem;
  margin-top: 0.9rem;
  line-height: 1.7;
  color: var(--muted);
}

.sp-related {
  margin-top: 3rem;
}

.sp-related h2 {
  margin-bottom: 1rem;
  font-size: 1.1rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ---------- pie ---------- */

.sp-footer {
  padding: 2.4rem 1.5rem;
  border-top: 1px solid var(--border);
}

.sp-footer__inner {
  max-width: 72rem;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 1.4rem 3rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: var(--muted);
}

.sp-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.3rem;
  max-width: 34rem;
}

.sp-footer a:hover {
  color: var(--text);
}
