/* Varyonyx · páginas legales y 404
   Se carga después de /estilos.css y reutiliza sus temas, rejilla, riel y botones. */

/* ---------- Cabecera de documento (bloque negro con la V recortada) ---------- */
.leg-cab { padding-block: 48px 64px; }
.leg-cab .w { position: relative; z-index: 2; }
.leg-cab h1 { font-size: var(--t-xl); letter-spacing: -0.035em; line-height: 1.02; max-width: 12ch; margin-top: 8px; }
.leg-cab .lead { margin-top: 28px; max-width: 34rem; font-size: clamp(17px, 1.4vw, 20px); line-height: 1.55; }
.leg-cab .riel { margin-bottom: 40px; }
.leg-v { display: none; position: absolute; z-index: 1; right: -9vw; bottom: -10vw; width: 38vw; height: auto; max-width: none; pointer-events: none; }
@media (min-width: 900px) {
  .leg-cab { padding-block: 72px 96px; }
  .leg-cab .riel { margin-bottom: 72px; }
  .leg-cab h1 { max-width: 14ch; }
  .leg-v { display: block; }
}

/* Aviso de borrador */
.borrador { margin-top: 40px; max-width: 38rem; padding: 16px 20px; border: 1.5px solid var(--vx-lavanda); border-radius: 6px; font-size: 15px; line-height: 1.55; }
.borrador strong { font-weight: 500; color: var(--vx-lavanda); }

/* Marca visible de dato pendiente */
.pd { display: inline; padding: 1px 8px; background: var(--vx-lavanda); color: var(--vx-negro); border-radius: 4px; font-weight: 500; font-size: 0.94em; white-space: nowrap; }

/* ---------- Cuerpo del documento ---------- */
.leg-cuerpo { padding-block: 24px 64px; }
@media (min-width: 900px) { .leg-cuerpo { padding-block: 40px 112px; } }
.leg-sec { padding-bottom: 8px; }
.leg-sec .riel { margin-bottom: 24px; padding-top: 14px; }
.leg-sec h2 { font-size: var(--t-m); letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 20px; }
.leg-txt { max-width: 38rem; margin-bottom: 40px; }
.leg-txt p + p, .leg-txt p + ul, .leg-txt ul + p, .leg-txt p + dl, .leg-txt dl + p { margin-top: 16px; }
.leg-txt ul { list-style: none; border-top: 1px solid var(--linea-b); }
.leg-txt ul li { padding: 10px 0 10px 24px; border-bottom: 1px solid var(--linea-b); position: relative; }
.leg-txt ul li::before { content: ""; position: absolute; left: 4px; top: 1.15em; width: 8px; height: 2px; background: var(--fg); }
.leg-txt a { color: var(--link); text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
.leg-txt a:hover { text-decoration-thickness: 3px; }
.leg-txt strong { font-weight: 500; }
@media (min-width: 900px) {
  .leg-sec h2 { grid-column: 1 / span 4; margin-bottom: 0; padding-right: 16px; }
  .leg-txt { grid-column: 5 / span 7; margin-bottom: 56px; }
}

/* Ficha de datos (titular, responsable) */
.ficha { border-top: 1px solid var(--linea-b); }
.ficha div { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--linea-b); }
.ficha dt { font-size: 14px; line-height: 1.4; letter-spacing: 0.06em; text-transform: uppercase; color: var(--fg2); }
.ficha dd { font-weight: 500; overflow-wrap: anywhere; }
@media (min-width: 640px) { .ficha div { grid-template-columns: 11rem 1fr; gap: 16px; align-items: baseline; } }

/* Navegación entre documentos legales */
.leg-otros { max-width: 38rem; }
.leg-otros ul { display: flex; flex-wrap: wrap; gap: 4px 24px; border: 0; }
.leg-otros ul li { padding: 0; border: 0; }
.leg-otros ul li::before { display: none; }
.leg-otros a { display: inline-block; padding: 8px 0; }
.leg-otros a[aria-current="page"] { color: var(--fg); text-decoration: none; font-weight: 500; }

/* Enlace de página actual en el pie */
.pie a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--vx-lavanda); text-underline-offset: 5px; }

/* ---------- 404 ---------- */
.e404 { padding-block: 48px 64vw; }
.e404 .w { position: relative; z-index: 2; }
.e404 h1 { font-size: var(--t-mega); line-height: 1; letter-spacing: -0.04em; margin-top: 8px; max-width: 11ch; }
.e404 .lead { margin-top: 28px; max-width: 30rem; font-size: clamp(17px, 1.4vw, 20px); line-height: 1.55; }
.e404 .riel { margin-bottom: 40px; }
.e404-v { position: absolute; z-index: 1; right: -30vw; bottom: -26vw; width: 96vw; height: auto; max-width: none; pointer-events: none; opacity: 1; }
.e404-apps { margin-top: 48px; max-width: 34rem; border-top: 1px solid var(--linea-b); }
.e404-apps li { border-bottom: 1px solid var(--linea-b); }
.e404-apps a { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; font-size: var(--t-m); font-weight: 500; letter-spacing: -0.015em; text-decoration: none; }
.e404-apps a:hover { color: var(--vx-lavanda); }
.e404-apps .flecha { width: 24px; }
@media (min-width: 900px) {
  .e404 { min-height: calc(100svh - var(--alto-cab) - 1px); padding-block: 72px 112px; }
  .e404 .riel { margin-bottom: 72px; }
  .e404-v { right: -8vw; bottom: -12vw; width: 50vw; }
  .e404 .btns { margin-top: 40px; }
}

/* 404 en escritorio: cabecera + bloque + pie caben en una sola pantalla.
   El bloque se estira entre la cabecera y el pie; el pie se compacta (listas en línea). */
@media (min-width: 1024px) and (min-height: 600px) {
  body:has(.e404) { min-height: 100svh; display: flex; flex-direction: column; }
  body:has(.e404) > main { flex: 1 0 auto; display: flex; flex-direction: column; }
  main .bloque.e404:not(.hero):not(.pie) { flex: 1 0 auto; min-height: 0; padding-block: clamp(16px, 4vh, 56px); justify-content: center; }
  .e404 .riel { margin-bottom: clamp(10px, 3vh, 40px); }
  .e404 h1 { font-size: min(var(--t-mega), 9.5vh); max-width: 14ch; }
  .e404 .lead { margin-top: clamp(10px, 2.4vh, 28px); font-size: clamp(15px, 2.4vh, 20px); line-height: 1.45; }
  .e404 .btns { margin-top: clamp(12px, 3vh, 32px); }
  .e404-apps { display: flex; flex-wrap: wrap; gap: 0 32px; margin-top: clamp(12px, 3vh, 32px); max-width: 34rem; }
  .e404-apps li { border-bottom: 0; }
  .e404-apps a { gap: 14px; padding-block: clamp(6px, 1.4vh, 14px); font-size: clamp(17px, 2.6vh, 24px); }
  .e404-v { right: -6vw; bottom: -10vw; width: min(46vw, 80vh); }

  body:has(.e404) .pie { padding-block: clamp(14px, 3vh, 40px) clamp(12px, 2.4vh, 24px); }
  body:has(.e404) .pie .riel { margin-bottom: clamp(10px, 2.2vh, 24px); }
  body:has(.e404) .pie-fila { row-gap: 12px; align-items: start; }
  body:has(.e404) .pie-sello img { height: clamp(34px, 5vh, 48px); }
  body:has(.e404) .pie-sello .peq { margin-top: 8px; }
  body:has(.e404) .pie ul { display: flex; flex-wrap: wrap; gap: 0 18px; }
  body:has(.e404) .pie ul li a { padding-block: 4px; }
  body:has(.e404) .pie h2 { margin-bottom: 4px; }
  body:has(.e404) .pie .fin { margin-top: clamp(10px, 2.4vh, 24px); padding-top: clamp(8px, 1.6vh, 16px); }
}
@media (min-width: 1024px) and (min-height: 600px) {
  body:has(.e404) .pie-nav { grid-column: 6 / span 4; }
}
@media (min-width: 1024px) and (min-height: 600px) and (max-height: 820px) {
  .e404 h1 { font-size: min(var(--t-mega), 8vh); max-width: 24ch; }
  .e404 .lead { max-width: 40rem; }
}
