:root {
  --bg: #fbf8f3;
  --surface: #ffffff;
  --ink: #1d1f24;
  --muted: #5d6270;
  --line: #e7e1d6;
  --accent: #1f5f4a;
  --accent-soft: #e6f0ec;
  --warm: #b4562e;
  --radius: 14px;
  --serif: "Fraunces", Georgia, serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161a;
    --surface: #1c1f25;
    --ink: #ecebe7;
    --muted: #a3a8b3;
    --line: #2d313a;
    --accent: #6fc2a3;
    --accent-soft: #1b2e28;
    --warm: #e38a62;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 80px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* Cabecera */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 64px; }
.brand { font: 700 1.25rem var(--serif); color: var(--ink); text-decoration: none; }
.brand span { color: var(--warm); }
nav { display: flex; gap: 20px; }
nav a { color: var(--muted); text-decoration: none; font-size: .95rem; font-weight: 500; }
nav a:hover { color: var(--ink); }

/* Portada del artículo */
.hero { padding: 72px 0 48px; border-bottom: 1px solid var(--line); }
.ad-slot { margin: 0 0 32px; }
.ad-slot:empty, .ad-slot ins[data-ad-status="unfilled"] { display: none !important; }
.kicker { text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 600; color: var(--warm); margin: 0 0 12px; }
h1 { font: 700 clamp(2rem, 5vw, 3.4rem)/1.12 var(--serif); margin: 0 0 20px; max-width: 22ch; letter-spacing: -.01em; }
.lede { font-size: 1.22rem; color: var(--muted); max-width: 62ch; margin: 0 0 16px; }
.meta { font-size: .88rem; color: var(--muted); margin: 0; }

/* Índice lateral + contenido */
.layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 56px; padding: 48px 0 72px; }
.toc { position: sticky; top: 96px; align-self: start; }
.toc-title { font-weight: 600; font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--line); }
.toc li a { display: block; padding: 6px 0 6px 14px; color: var(--muted); text-decoration: none; font-size: .93rem; }
.toc li a:hover { color: var(--accent); }

.content { max-width: 720px; }
.content section + section { margin-top: 56px; }
h2 { font: 600 clamp(1.5rem, 3vw, 2rem)/1.25 var(--serif); margin: 0 0 16px; }
h3 { font-size: 1.08rem; font-weight: 600; margin: 0 0 8px; }
p { margin: 0 0 16px; }

.callout {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 18px 22px; margin-top: 24px;
}
.callout p { margin: 0; }

/* Tarjetas de vías */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; display: flex; flex-direction: column; }
.card p { font-size: .96rem; color: var(--muted); }
.card-num { font: 700 .85rem var(--serif); color: var(--warm); margin-bottom: 6px; }
.card .form { margin: auto 0 0; padding-top: 10px; border-top: 1px dashed var(--line); font-size: .85rem; font-weight: 600; color: var(--accent); }

/* Pasos */
.steps { counter-reset: paso; list-style: none; padding: 0; margin: 24px 0 0; }
.steps li { counter-increment: paso; position: relative; padding: 0 0 26px 60px; }
.steps li::before {
  content: counter(paso);
  position: absolute; left: 0; top: 0;
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--bg); font-weight: 600;
}
.steps li:not(:last-child)::after { content: ""; position: absolute; left: 19px; top: 44px; bottom: 4px; width: 2px; background: var(--line); }
.steps p { color: var(--muted); }

/* Tabla */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); margin: 20px 0; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 14px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
tr:last-child td { border-bottom: 0; }
.note { font-size: .93rem; color: var(--muted); }

/* Derechos y deberes */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.two-col > div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.two-col ul { list-style: none; padding: 0; margin: 0; }
.two-col li { position: relative; padding: 6px 0 6px 28px; font-size: .96rem; }
.check li::before { content: "✓"; position: absolute; left: 0; color: var(--accent); font-weight: 700; }
.dash li::before { content: "!"; position: absolute; left: 4px; color: var(--warm); font-weight: 700; }

/* Preguntas frecuentes */
.faq details { border-bottom: 1px solid var(--line); padding: 16px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 1.3rem; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 12px 0 0; color: var(--muted); }

.disclaimer { margin-top: 48px; padding: 20px 22px; border: 1px solid var(--line); border-radius: var(--radius); font-size: .9rem; color: var(--muted); }
.disclaimer p { margin: 0; }

.site-footer { border-top: 1px solid var(--line); padding: 28px 0; font-size: .88rem; color: var(--muted); }
.site-footer p { margin: 0; }

/* Móvil: el índice se esconde y todo va a una columna */
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding-top: 32px; }
  .toc { display: none; }
  .two-col { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 32px; }
}
@media (max-width: 520px) {
  nav { display: none; }
  .steps li { padding-left: 52px; }
}
