/* Documentos públicos · Imprenta Festiva
 * La analítica web vive en un módulo aparte y solo carga tras consentimiento. */

@font-face {
  font-family: "Alfa Slab One";
  src: url("/fonts/AlfaSlabOne-Regular.ttf") format("truetype");
  font-display: swap;
}

@font-face {
  font-family: "Archivo";
  src: url("/fonts/Archivo-Variable.ttf") format("truetype-variations");
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --papel: #f4eddc;
  --papel-claro: #fff9eb;
  --tinta: #26221e;
  --noche: #20242f;
  --rosa: #ff48b0;
  --azul: #0078bf;
  --verde: #00a95c;
  --amarillo: #ffe800;
  --rojo: #f15060;
  --sombra: #11131a;
}

* { box-sizing: border-box; }

html {
  background: var(--noche);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 280px;
  padding: 0 22px 56px;
  background:
    linear-gradient(90deg, transparent 0 48%, rgba(255, 255, 255, .025) 48% 52%, transparent 52%) 0 0 / 9px 9px,
    var(--noche);
  color: var(--tinta);
  font-family: "Archivo", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.68;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--rosa);
  color: var(--tinta);
}

a {
  color: #005e98;
  font-weight: 700;
  overflow-wrap: anywhere;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

a:hover { text-decoration-thickness: 4px; }

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--rosa);
  outline-offset: 4px;
}

.cabecera-sitio,
footer {
  width: min(1120px, 100%);
  margin-inline: auto;
}

.cabecera-sitio {
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--papel);
}

.marca {
  display: inline-flex;
  min-height: 48px;
  align-items: baseline;
  gap: 8px;
  color: var(--papel);
  font-family: "Alfa Slab One", Georgia, serif;
  font-size: clamp(17px, 2.2vw, 24px);
  font-weight: 400;
  letter-spacing: .015em;
  line-height: 1;
  text-decoration: none;
}

.marca::before {
  content: "←";
  color: var(--rosa);
  font-family: "Archivo", sans-serif;
  font-size: 1.15em;
  font-weight: 900;
  transition: transform 160ms ease;
}

.marca:hover::before { transform: translateX(-4px); }
.marca strong { color: var(--rosa); font-weight: 400; }

.seccion-sitio {
  border: 2px solid var(--papel);
  padding: 7px 11px;
  color: var(--papel);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .13em;
  line-height: 1.2;
  text-transform: uppercase;
  transform: rotate(1deg);
}

.pagina-legal {
  --acento: var(--azul);
  --folio: "01";
  --documento: "PRIVACIDAD";
}

.legal-terminos {
  --acento: var(--amarillo);
  --folio: "02";
  --documento: "TÉRMINOS";
}

.legal-normas {
  --acento: var(--verde);
  --folio: "03";
  --documento: "COMUNIDAD";
}

.legal-condiciones {
  --acento: var(--rosa);
  --folio: "04";
  --documento: "PUBLICACIÓN";
}

.legal-borrar {
  --acento: var(--rojo);
  --folio: "05";
  --documento: "TU CUENTA";
}

.legal-contacto {
  --acento: var(--azul);
  --folio: "06";
  --documento: "CONTACTO";
}

.hoja {
  position: relative;
  width: min(1120px, 100%);
  margin: 0 auto 34px;
  padding: clamp(30px, 5vw, 62px);
  overflow: clip;
  border: 3px solid var(--tinta);
  background: var(--papel);
  box-shadow: 11px 11px 0 var(--sombra);
}

.hoja::before {
  position: absolute;
  inset: 0 0 auto;
  height: 12px;
  background: linear-gradient(90deg, var(--azul) 0 28%, var(--rosa) 28% 56%, var(--amarillo) 56% 79%, var(--verde) 79%);
  content: "";
}

.documento {
  display: grid;
  grid-template-columns: minmax(180px, 230px) minmax(0, 720px);
  column-gap: clamp(36px, 6vw, 76px);
  justify-content: center;
}

.documento > *:not(.pie) { grid-column: 2; }

h1 {
  position: relative;
  margin: 4px 0 8px;
  font-family: "Alfa Slab One", Georgia, serif;
  font-size: clamp(42px, 6.4vw, 72px);
  font-weight: 400;
  letter-spacing: -.025em;
  line-height: .98;
  text-wrap: balance;
}

h1::before {
  display: block;
  margin-bottom: 18px;
  color: var(--acento);
  content: var(--folio) " · " var(--documento);
  font-family: "Archivo", sans-serif;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
  line-height: 1;
}

.fecha {
  width: fit-content;
  margin: 8px 0 32px;
  padding: 6px 10px;
  border: 2px solid var(--tinta);
  background: var(--papel-claro);
  box-shadow: 3px 3px 0 var(--tinta);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .1em;
  line-height: 1.35;
  text-transform: uppercase;
}

.fecha + p {
  margin-top: 0;
  font-size: clamp(18px, 2.1vw, 21px);
  font-weight: 560;
  line-height: 1.55;
}

p { margin: .55rem 0 1rem; }
strong { font-weight: 850; }

h2 {
  margin: 46px 0 15px;
  padding: 0 0 10px;
  border-bottom: 4px solid var(--tinta);
  font-family: "Archivo", sans-serif;
  font-size: clamp(20px, 2.6vw, 27px);
  font-weight: 900;
  letter-spacing: -.015em;
  line-height: 1.12;
  text-wrap: balance;
}

h2::after {
  display: block;
  width: 76px;
  height: 7px;
  margin: 10px 0 -17px;
  background: var(--acento);
  content: "";
}

h3 {
  margin: 30px 0 7px;
  font-size: 17px;
  font-weight: 900;
  letter-spacing: .06em;
  line-height: 1.25;
  text-transform: uppercase;
}

ul,
ol {
  margin: 12px 0 22px;
  padding-left: 1.45rem;
}

li { margin: 7px 0; padding-left: 4px; }
li::marker { color: var(--acento); font-weight: 900; }

code {
  padding: 2px 5px;
  border: 1px solid rgba(38, 34, 30, .28);
  background: rgba(38, 34, 30, .08);
  font-size: .88em;
  overflow-wrap: anywhere;
}

table {
  display: block;
  width: 100%;
  margin: 22px 0 30px;
  overflow-x: auto;
  border-collapse: collapse;
  border: 3px solid var(--tinta);
  background: var(--papel-claro);
  box-shadow: 6px 6px 0 var(--tinta);
  font-size: 14px;
  line-height: 1.45;
}

tbody { display: table; width: 100%; border-collapse: collapse; }

th,
td {
  min-width: 150px;
  padding: 12px 13px;
  border: 2px solid var(--tinta);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--tinta);
  color: var(--papel);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.aviso {
  position: relative;
  margin: 28px 0;
  padding: 25px 24px 18px;
  border: 3px solid var(--tinta);
  background: color-mix(in srgb, var(--acento) 13%, var(--papel-claro));
  box-shadow: 6px 6px 0 var(--tinta);
}

.aviso::before {
  position: absolute;
  top: -14px;
  left: 16px;
  padding: 4px 9px;
  border: 2px solid var(--tinta);
  background: var(--acento);
  color: var(--tinta);
  content: "IMPORTANTE";
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .13em;
  line-height: 1;
}

.aviso p:last-child { margin-bottom: 0; }

.mayor {
  display: inline-flex;
  min-width: 52px;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  margin-right: 5px;
  border: 2px solid var(--tinta);
  background: var(--rojo);
  box-shadow: 3px 3px 0 var(--tinta);
  color: var(--papel-claro);
  font-weight: 900;
  letter-spacing: .06em;
  transform: rotate(-2deg);
}

nav.pie {
  position: sticky;
  top: 24px;
  grid-column: 1;
  grid-row: 1 / span 999;
  align-self: start;
  margin: 0;
  padding: 22px 16px 16px;
  border: 3px solid var(--tinta);
  background: var(--papel-claro);
  box-shadow: 6px 6px 0 var(--tinta);
}

nav.pie::before {
  display: block;
  margin: 0 0 15px;
  padding-bottom: 11px;
  border-bottom: 3px solid var(--tinta);
  content: "LOS PAPELES DE LA MESA";
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  line-height: 1.25;
}

nav.pie a {
  display: block;
  min-height: 44px;
  margin: 2px 0;
  padding: 9px 8px;
  color: var(--tinta);
  font-size: 13px;
  font-weight: 760;
  line-height: 1.25;
  text-decoration: none;
}

nav.pie a::before {
  display: inline-block;
  width: 18px;
  color: var(--acento);
  content: "→";
  font-weight: 900;
}

nav.pie a:hover { background: rgba(38, 34, 30, .07); }

nav.pie a[aria-current="page"] {
  border: 2px solid var(--tinta);
  background: var(--rosa);
  box-shadow: 3px 3px 0 var(--tinta);
  font-weight: 900;
  transform: translateX(-4px) rotate(-1deg);
}

nav.pie a[aria-current="page"]::before { content: "●"; color: var(--tinta); }

footer {
  padding: 18px 0 2px;
  color: #d8d2c4;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: .1em;
  text-align: center;
  text-transform: uppercase;
}

/* 404: la misma imprenta, sin el índice lateral. */
.pagina-error header {
  width: min(760px, 100%);
  margin: auto;
  padding: 42px 0 16px;
  color: var(--papel);
}

.pagina-error header a { color: var(--rosa); }
.pagina-error .hoja { width: min(760px, 100%); }
.pagina-error .marca-error { margin: 0 0 5px; color: var(--papel); font-family: "Alfa Slab One"; font-size: 22px; }
.pagina-error .ceja-error { margin: 4px 0 16px; color: var(--rojo); font-size: 12px; font-weight: 900; letter-spacing: .15em; }
.pagina-error h1::before { display: none; }

.pagina-error .boton-error {
  display: inline-flex;
  min-height: 54px;
  align-items: center;
  margin-top: 12px;
  padding: 10px 18px;
  border: 3px solid var(--tinta);
  background: var(--rosa);
  box-shadow: 5px 5px 0 var(--tinta);
  color: var(--tinta);
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

@media (max-width: 760px) {
  body { padding: 0 12px 38px; font-size: 16px; }

  .cabecera-sitio {
    min-height: 92px;
    align-items: center;
  }

  .marca { flex-wrap: wrap; gap: 4px 7px; max-width: 190px; }
  .seccion-sitio { max-width: 135px; padding: 6px 8px; font-size: 9px; text-align: center; }

  .hoja {
    padding: 30px clamp(18px, 5vw, 28px) 28px;
    box-shadow: 7px 7px 0 var(--sombra);
  }

  .documento { display: block; }
  h1 { font-size: clamp(36px, 12vw, 54px); }
  h1::before { margin-bottom: 14px; }
  h2 { margin-top: 38px; font-size: 21px; }
  .fecha + p { font-size: 17px; }

  nav.pie {
    position: static;
    margin-top: 42px;
    padding: 19px 14px 14px;
    box-shadow: 5px 5px 0 var(--tinta);
  }

  nav.pie a[aria-current="page"] { transform: rotate(-.5deg); }

  table {
    display: block;
    width: 100%;
    margin: 22px 0 30px;
    overflow: visible;
  }

  tbody,
  tr,
  td { display: block; width: 100%; }

  tr:first-child { display: none; }

  tr {
    padding: 13px 14px 9px;
    border-bottom: 3px solid var(--tinta);
  }

  tr:last-child { border-bottom: 0; }

  td {
    min-width: 0;
    padding: 5px 0 9px;
    border: 0;
  }

  td::before {
    display: block;
    margin-bottom: 2px;
    color: color-mix(in srgb, var(--acento) 72%, var(--tinta));
    font-size: 10px;
    font-weight: 900;
    letter-spacing: .1em;
    line-height: 1.3;
    text-transform: uppercase;
  }

  .legal-privacidad td:nth-child(1)::before { content: "Qué se guarda"; }
  .legal-privacidad td:nth-child(2)::before { content: "Para qué"; }
  .legal-privacidad td:nth-child(3)::before { content: "Base legal"; }
  .legal-normas td:nth-child(1)::before { content: "Situación"; }
  .legal-normas td:nth-child(2)::before { content: "Consecuencia"; }
  .legal-borrar td:nth-child(1)::before { content: "Cuándo"; }
  .legal-borrar td:nth-child(2)::before { content: "Qué pasa"; }
  .legal-contacto td:nth-child(1)::before { content: "Para qué"; }
  .legal-contacto td:nth-child(2)::before { content: "Dónde"; }
  .legal-contacto td:nth-child(3)::before { content: "Plazo"; }
  .aviso { padding: 24px 17px 16px; }
}

@media (max-width: 380px) {
  .cabecera-sitio { gap: 10px; }
  .marca { font-size: 16px; }
  .seccion-sitio { max-width: 112px; }
  .hoja { padding-inline: 16px; }
  h1 { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .marca::before { transition: none; }
}
