/* Estilo de las páginas legales (/legal/*): el mismo papel, tinta y
   tipografías que la landing. Las páginas las genera «npm run legal». */
:root {
  --papel: #f6f1e7;
  --papel-claro: #fbf8f1;
  --papel-linea: #d9cfba;
  --tinta: #1e2a3a;
  --tinta-suave: #51616f;
  --azul-sello: #867f22;
  --rojo-boli: #c43b2e;
  --sombra: 0 2px 6px rgba(30, 42, 58, 0.08), 0 12px 28px rgba(30, 42, 58, 0.07);
  --radio: 14px;
  --f-display: "Outfit", system-ui, -apple-system, sans-serif;
  --f-cuerpo: "Inter", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--f-cuerpo);
  color: var(--tinta);
  background:
    radial-gradient(ellipse at 15% -10%, rgba(134, 127, 34, 0.08), transparent 50%),
    repeating-linear-gradient(0deg, transparent 0 27px, rgba(30, 42, 58, 0.022) 27px 28px),
    var(--papel);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}
a { color: inherit; }
.envoltorio { max-width: 900px; margin: 0 auto; padding: 0 20px; }

/* ---------- Cabecera ---------- */
.cabecera { border-bottom: 1px solid var(--papel-linea); background: rgba(246, 241, 231, 0.92); }
.cabecera .envoltorio { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 14px; padding-bottom: 14px; }
.marca { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--f-display); font-weight: 700; font-size: 20px; letter-spacing: 0.5px; }
.marca img { width: 30px; height: 30px; object-fit: contain; }
.acceso { font-size: 14px; font-weight: 600; text-decoration: none; padding: 8px 14px; border: 1px solid var(--papel-linea); border-radius: 999px; background: #fff; }
.acceso:hover { border-color: var(--tinta); }

/* ---------- Pestañas de los cuatro textos ---------- */
.pestanas { border-bottom: 1px solid var(--papel-linea); }
.pestanas .envoltorio { display: flex; gap: 4px; overflow-x: auto; padding-top: 10px; padding-bottom: 0; scrollbar-width: none; }
.pestanas a {
  flex-shrink: 0;
  padding: 8px 12px 10px;
  font-size: 14px;
  font-weight: 500;
  color: var(--tinta-suave);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.pestanas a:hover { color: var(--tinta); }
.pestanas a[aria-current="page"] { color: var(--tinta); font-weight: 600; border-bottom-color: var(--azul-sello); }

/* ---------- Documento ---------- */
main { padding-top: 28px; padding-bottom: 48px; }
.documento {
  background: var(--papel-claro);
  border: 1px solid var(--papel-linea);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 40px 48px;
}
.documento h1, .documento h2, .documento h3 { font-family: var(--f-display); color: var(--tinta); line-height: 1.25; scroll-margin-top: 16px; }
.documento h1 { font-size: 32px; margin: 0 0 24px; }
.documento h2 { font-size: 22px; margin: 40px 0 12px; padding-top: 20px; border-top: 1px solid var(--papel-linea); }
.documento h3 { font-size: 17px; margin: 28px 0 8px; }
.documento p, .documento ul, .documento ol { margin: 0 0 14px; }
.documento ul, .documento ol { padding-left: 22px; }
.documento li { margin-bottom: 6px; }
.documento a { color: var(--azul-sello); text-underline-offset: 2px; overflow-wrap: anywhere; }
.documento code { font-size: 0.92em; background: rgba(30, 42, 58, 0.06); padding: 1px 5px; border-radius: 4px; }
.documento em { color: var(--tinta-suave); }

/* Tablas: se desplazan en horizontal dentro de su caja en pantallas estrechas. */
.tabla-scroll { overflow-x: auto; margin: 0 0 18px; border: 1px solid var(--papel-linea); border-radius: 10px; background: #fff; }
.documento table { border-collapse: collapse; width: 100%; font-size: 14px; }
.documento th, .documento td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--papel-linea); }
.documento th { background: var(--papel); font-weight: 600; }
.documento tr:last-child td { border-bottom: none; }
.documento td:first-child { min-width: 140px; }

/* Índice plegable de los documentos largos */
.indice { margin: 0 0 24px; padding: 12px 16px; border: 1px solid var(--papel-linea); border-radius: 10px; background: #fff; }
.indice summary { cursor: pointer; font-family: var(--f-display); font-weight: 600; }
.indice ol { list-style: none; padding: 0; margin: 12px 0 4px; columns: 2; column-gap: 24px; font-size: 14px; }
.indice li { break-inside: avoid; margin-bottom: 4px; }
.indice a { text-decoration: none; color: var(--tinta-suave); }
.indice a:hover { color: var(--tinta); text-decoration: underline; }

.imprimir { margin: 32px 0 0; }
.imprimir button {
  font-family: var(--f-cuerpo);
  font-size: 14px;
  font-weight: 600;
  padding: 9px 16px;
  border: 1px solid var(--papel-linea);
  border-radius: 999px;
  background: #fff;
  color: var(--tinta);
  cursor: pointer;
}
.imprimir button:hover { border-color: var(--tinta); }

/* ---------- Pie ---------- */
.pie-legal { border-top: 1px solid var(--papel-linea); padding: 24px 0 32px; font-size: 13px; color: var(--tinta-suave); }
.pie-legal p { margin: 0 0 8px; }
.pie-legal nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.pie-legal a { color: var(--tinta-suave); }
.pie-legal a:hover { color: var(--tinta); }

@media (max-width: 640px) {
  .documento { padding: 24px 18px; border-radius: 10px; }
  .documento h1 { font-size: 25px; }
  .documento h2 { font-size: 19px; }
  .indice ol { columns: 1; }
  .documento table { font-size: 13px; }
  .documento th, .documento td { padding: 8px 10px; }
  .documento td:first-child { min-width: 96px; }
  .marca { font-size: 18px; }
}

@media print {
  body { background: #fff; font-size: 11pt; }
  .cabecera, .pestanas, .pie-legal, .indice, .imprimir { display: none; }
  main { padding: 0; }
  .documento { border: none; box-shadow: none; padding: 0; background: #fff; }
  .documento h2 { break-after: avoid; }
  .tabla-scroll { overflow: visible; }
}
