/* privex.es — hoja de estilos única.
   Sin recursos externos: la tipografía se sirve desde /fuentes/.
   Los nombres de las variables de color los lee herramientas/comprobar.py (regla `contraste`). */

@font-face {
  font-family: "Archivo";
  src: url("/fuentes/archivo-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;

  --papel: #ffffff;
  --papel-2: #f2f4f8;
  --tinta: #14161b;
  --tinta-suave: #4b5160;
  --acento: #d4a04b;
  --sobre-acento: #14161b;
  --filete: #d5d9e0;

  --ancho: 68rem;
  --lectura: 40rem;
  --margen: clamp(1.25rem, 5vw, 3rem);
  --aire: clamp(3.5rem, 9vw, 6.5rem);

  --familia: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --papel: #14161b;
    --papel-2: #1c1f26;
    --tinta: #f2f4f8;
    --tinta-suave: #b4bac6;
    --filete: #343945;
  }
}

/* ---------------------------------------------------------------- base */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  /* Lo que ocupa la cabecera fija: un salto a una sección no deja su título debajo. */
  scroll-padding-top: 4.5rem;
}

body {
  margin: 0;
  background: var(--papel);
  color: var(--tinta);
  font-family: var(--familia);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.15;
  text-wrap: balance;
}

p,
ol,
ul,
dl,
dd,
table {
  margin: 0;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
  text-decoration-color: var(--acento);
}

:focus-visible {
  outline: 3px solid var(--tinta);
  outline-offset: 3px;
  border-radius: 2px;
}

.saltar {
  position: absolute;
  left: var(--margen);
  top: -6rem;
  padding: 0.6rem 1rem;
  background: var(--tinta);
  color: var(--papel);
  font-weight: 600;
}

.saltar:focus {
  top: 0.75rem;
  z-index: 3;
}

.ancho {
  max-width: var(--ancho);
  margin-inline: auto;
  padding-inline: var(--margen);
}

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

/* Se queda arriba al desplazarse, para saltar de una sección a otra desde cualquier punto. */
.cabecera {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--papel);
  border-bottom: 1px solid var(--filete);
}

.cabecera .ancho {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  padding-block: 1rem;
}

.marca {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-decoration: none;
}

.marca img {
  display: block;
  width: 2rem;
  height: 2rem;
}

.secciones {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-size: 0.95rem;
}

.secciones a {
  padding-block: 0.35rem;
  text-decoration: none;
}

.secciones a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--acento);
}

/* -------------------------------------------------------------- portada */

.entrada {
  padding-block: var(--aire);
}

.entrada h1 {
  max-width: 17ch;
  font-size: clamp(2.3rem, 7.2vw, 4.6rem);
  font-weight: 750;
  line-height: 1.02;
  letter-spacing: -0.025em;
}

.entrada p {
  max-width: var(--lectura);
  margin-top: 2rem;
  font-size: clamp(1.15rem, 2.2vw, 1.4rem);
  line-height: 1.5;
  color: var(--tinta-suave);
}

.seccion {
  padding-block: var(--aire);
  border-top: 1px solid var(--filete);
}

.seccion > .ancho > h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.3rem);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.seccion > .ancho > h2 + * {
  margin-top: 2.5rem;
}

/* Los cinco pasos son una secuencia: van numerados. */
.pasos {
  padding: 0;
  list-style: none;
  counter-reset: paso;
}

.pasos li {
  counter-increment: paso;
  display: grid;
  grid-template-columns: 3.25rem minmax(0, 1fr);
  column-gap: 1rem;
  padding-block: 1.6rem;
  border-top: 1px solid var(--filete);
}

.pasos li:last-child {
  border-bottom: 1px solid var(--filete);
}

.pasos li::before {
  content: counter(paso);
  grid-row: 1 / span 2;
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pasos h3 {
  font-size: 1.3rem;
  font-weight: 650;
}

.pasos p {
  max-width: var(--lectura);
  margin-top: 0.5rem;
  color: var(--tinta-suave);
}

/* El único gesto fuerte de la página: dónde se queda el material. */
.equipo {
  padding-block: var(--aire);
  background: var(--acento);
  color: var(--sobre-acento);
}

.equipo h2 {
  font-size: 1rem;
  font-weight: 650;
}

.equipo .principal {
  max-width: 22ch;
  margin-top: 1.25rem;
  font-size: clamp(1.9rem, 5.2vw, 3.3rem);
  font-weight: 750;
  line-height: 1.06;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.equipo .principal + p {
  max-width: var(--lectura);
  margin-top: 2rem;
  font-size: 1.15rem;
}

.equipo :focus-visible {
  outline-color: var(--sobre-acento);
}

/* Dos bloques iguales: ninguna edición es «la buena». */
.ediciones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 2.5rem clamp(2rem, 6vw, 4.5rem);
}

.ediciones > div {
  padding-top: 1.4rem;
  border-top: 3px solid var(--tinta);
}

.ediciones h3 {
  font-size: 1.4rem;
  font-weight: 700;
}

.ediciones p {
  margin-top: 0.8rem;
}

.ediciones + p {
  max-width: var(--lectura);
  margin-top: 2.5rem;
  color: var(--tinta-suave);
}

.empresa .ancho > p {
  max-width: var(--lectura);
  font-size: 1.15rem;
}

.datos {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  gap: 0.6rem 2rem;
  max-width: 48rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--filete);
}

.datos dt {
  color: var(--tinta-suave);
}

.contacto dl {
  display: grid;
  gap: 1.6rem;
}

.contacto dt {
  color: var(--tinta-suave);
}

.contacto dd a {
  font-size: clamp(1.4rem, 4.4vw, 2.1rem);
  font-weight: 650;
  letter-spacing: -0.01em;
}

.contacto dl + p {
  max-width: var(--lectura);
  margin-top: 2.5rem;
  font-size: 0.95rem;
  color: var(--tinta-suave);
}

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

.pie {
  padding-block: 3rem;
  background: var(--papel-2);
  border-top: 1px solid var(--filete);
  font-size: 0.92rem;
  color: var(--tinta-suave);
}

.pie .ancho {
  display: grid;
  gap: 1.5rem;
}

.pie address {
  font-style: normal;
}

.pie address strong {
  color: var(--tinta);
  font-weight: 650;
}

.pie ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.75rem;
  padding: 0;
  list-style: none;
}

/* ------------------------------------------------- páginas de solo texto */

.texto {
  padding-block: clamp(2.5rem, 7vw, 4.5rem) var(--aire);
}

.texto > .ancho > * {
  max-width: 44rem;
}

.texto h1 {
  font-size: clamp(2rem, 5.5vw, 3rem);
  font-weight: 750;
  letter-spacing: -0.02em;
}

.texto h2 {
  margin-top: 2.75rem;
  font-size: 1.3rem;
  font-weight: 700;
}

.texto p,
.texto ul,
.texto table {
  margin-top: 1rem;
}

.texto ul {
  padding-left: 1.25rem;
}

.texto li + li {
  margin-top: 0.4rem;
}

.texto table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.96rem;
}

.texto th,
.texto td {
  padding: 0.7rem 0.9rem 0.7rem 0;
  border-top: 1px solid var(--filete);
  text-align: left;
  vertical-align: top;
}

.texto tr:last-child > * {
  border-bottom: 1px solid var(--filete);
}

.texto th {
  font-weight: 650;
}

.texto td > :first-child {
  margin-top: 0;
}

.texto td > ul {
  margin-top: 0.4rem;
}

.texto tbody th {
  width: 38%;
}

.texto .actualizado {
  margin-top: 3rem;
  font-size: 0.92rem;
  color: var(--tinta-suave);
}

/* ------------------------------------------------------ cabecera estrecha */
/* Cuando la marca y el índice no caben en una fila, el índice va debajo y es lo único que se
   queda fijo: la fila de la marca (1rem de margen y 2rem de símbolo) sale por arriba. */

@media (max-width: 45rem) {
  html {
    scroll-padding-top: 3.5rem;
  }

  .cabecera {
    top: -3rem;
  }

  .cabecera .ancho {
    flex-direction: column;
    align-items: flex-start;
    padding-bottom: 0.5rem;
  }

  .marca {
    height: 2rem;
  }
}

/* Aquí el índice ocupa dos filas. */
@media (max-width: 32rem) {
  html {
    scroll-padding-top: 5.5rem;
  }

  .secciones {
    row-gap: 0;
  }

  .secciones a {
    padding-block: 0.25rem;
  }
}

/* ---------------------------------------------------------------- móvil */

@media (max-width: 30rem) {
  .datos {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.1rem;
  }

  .datos dd + dt {
    margin-top: 0.9rem;
  }

  .pasos li {
    grid-template-columns: 2.4rem minmax(0, 1fr);
  }

  .pasos li::before {
    font-size: 2rem;
  }

  .texto table,
  .texto tbody,
  .texto tr,
  .texto th,
  .texto td {
    display: block;
    width: auto;
  }

  .texto thead {
    display: none;
  }

  .texto tbody th {
    width: auto;
  }

  .texto th + td,
  .texto td + td {
    padding-top: 0;
    border-top: 0;
  }

  .texto tr:last-child > :not(:last-child) {
    border-bottom: 0;
  }
}

/* ------------------------------------------------------------ impresión */

@media print {
  :root {
    --papel: #ffffff;
    --papel-2: #ffffff;
    --tinta: #000000;
    --tinta-suave: #000000;
    --filete: #999999;
  }

  .saltar,
  .secciones {
    display: none;
  }

  .cabecera {
    position: static;
  }

  body {
    font-size: 11pt;
  }

  .equipo {
    background: none;
    border-top: 1px solid var(--filete);
  }

  .texto h2 {
    break-after: avoid;
  }

  a {
    text-decoration: none;
  }
}
