/* ==========================================================================
   C B // Studio · páginas de texto (aviso legal, privacidad, cookies, 404 y
   mantenimiento). Mismo lenguaje que la web: fondo #e1e1e1, tinta #202020,
   granate #7b0000, titulares en Times New Roman, texto en Helvetica Neue y
   el logotipo en Georgia con versalitas.
   ========================================================================== */

:root {
  --bg: #e1e1e1;
  --ink: #202020;
  --ink-2: #5c5c5c;
  --ink-3: #818181;
  --accent: #7b0000;
  --rule: rgba(32, 32, 32, 0.14);
  --serif: 'Times New Roman', Times, serif;
  --sans: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --logo: Georgia, 'Times New Roman', serif;
  --padx: 48px;
  --hh: 96px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}
@media (max-width: 1024px) { :root { --hh: 64px; } }
@media (max-width: 700px) { :root { --padx: 20px; } }

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* sin JavaScript se muestra el español; con él, el idioma guardado (el mismo que la web) */
html:not([data-lang='en']) [data-l='en'],
html[data-lang='en'] [data-l='es'] { display: none !important; }

.skip { position: absolute; left: 16px; top: -100px; z-index: 50; padding: 10px 16px; background: var(--ink); color: var(--bg); }
.skip:focus { top: 12px; }

/* --- Cabecera ------------------------------------------------------------ */

.lg-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 12px;
  height: var(--hh);
  padding: 0 var(--padx);
  background: var(--bg);
  transition: box-shadow 0.5s cubic-bezier(0.33, 1, 0.68, 1);
}
.lg-header.is-scrolled { box-shadow: 0 1px 14px rgba(32, 32, 32, 0.1); }
.lg-caps {
  font-family: var(--sans);
  font-size: 14px;
  letter-spacing: 0.12em;
  font-variant-caps: all-small-caps;
  line-height: 1;
  white-space: nowrap;
}
.lg-back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  text-decoration: none;
  background: linear-gradient(var(--ink), var(--ink)) left calc(100% - 6px) / 0 1px no-repeat;
  transition: background-size 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.lg-back:hover { background-size: 100% 1px; }
.lg-logo {
  color: var(--accent);
  font-family: var(--logo);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: 0.2em;
  font-variant-caps: all-small-caps;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
}
.lg-logo .cb {
  font-variant-caps: normal;
  text-transform: uppercase;
  font-size: 0.8em;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.28em;
  margin-right: -0.28em;
}
.lg-logo .s1 { display: inline-block; letter-spacing: -0.06em; margin-left: 0.273em; }
.lg-logo .s2 { display: inline-block; letter-spacing: -0.06em; margin-right: 0.32em; }
.lg-lang { justify-self: end; display: inline-flex; align-items: center; gap: 7px; }
.lg-lang button {
  padding: 10px 0;
  border: 0;
  background: none;
  color: var(--ink);
  cursor: pointer;
  opacity: 0.38;
  transition: opacity 0.35s var(--ease);
}
.lg-lang button:hover,
.lg-lang button[aria-pressed='true'] { opacity: 1; }
.lg-lang .dot { font-size: 14px; line-height: 1; opacity: 0.3; user-select: none; }
@media (max-width: 520px) {
  .lg-back .lbl { display: none; }
  .lg-logo { font-size: 17px; }
}

/* --- Texto legal ---------------------------------------------------------- */

.lg-main { flex: 1; padding: 0 var(--padx); }
.lg-head {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(56px, 10vh, 120px) 0 clamp(40px, 6vh, 72px);
  border-bottom: 1px solid var(--rule);
}
.lg-kicker {
  margin: 0 0 22px;
  font-size: 16px;
  letter-spacing: 0.14em;
  font-variant-caps: all-small-caps;
  color: var(--ink-2);
}
.acc { color: var(--accent); font-weight: 600; letter-spacing: 0.08em; margin-right: 0.3em; }
.lg-head h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(44px, 7vw, 105px);
  line-height: 0.95;
  letter-spacing: -0.015em;
}
.lg-updated {
  margin: 26px 0 0;
  font-size: 14px;
  letter-spacing: 0.12em;
  font-variant-caps: all-small-caps;
  color: var(--ink-3);
}
.lg-layout {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(40px, 6vh, 72px) 0 clamp(72px, 10vh, 120px);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 1100px) {
  .lg-layout { grid-template-columns: 260px minmax(0, 720px); justify-content: space-between; column-gap: 64px; }
}
/* índice: fijo al lado en pantallas anchas; oculto en estrechas */
.lg-toc { display: none; }
@media (min-width: 1100px) {
  .lg-toc { display: block; position: sticky; top: calc(var(--hh) + 32px); align-self: start; }
}
.lg-toc ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; }
.lg-toc a {
  display: grid;
  grid-template-columns: 2.2em 1fr;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-2);
  text-decoration: none;
  transition: color 0.3s var(--ease);
}
.lg-toc a span { color: var(--accent); font-variant-numeric: tabular-nums; }
.lg-toc a:hover,
.lg-toc a[aria-current] { color: var(--ink); }

.lg-body > p:first-child,
.lg-intro { margin-top: 0; }
.lg-intro { font-size: 19px; line-height: 1.6; color: var(--ink); margin-bottom: 48px; }
.lg-body section { padding-top: 8px; margin-bottom: 52px; scroll-margin-top: calc(var(--hh) + 24px); }
.lg-body h2 {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 18px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 2.6vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.lg-body h2 .n {
  flex: none;
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  transform: translateY(-0.35em);
}
.lg-body h3 {
  margin: 26px 0 10px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.14em;
  font-variant-caps: all-small-caps;
  color: var(--ink);
}
.lg-body p { margin: 0 0 14px; color: #3d3d3d; }
.lg-body a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
.lg-body a:hover { color: var(--accent); }
.lg-body ul { margin: 0 0 16px; padding: 0; list-style: none; }
.lg-body li { position: relative; padding-left: 26px; margin: 0 0 8px; color: #3d3d3d; }
.lg-body li::before { content: '—'; position: absolute; left: 0; color: var(--ink-3); }
.lg-body strong { color: var(--ink); font-weight: 500; }
/* ficha de datos */
.lg-dl { margin: 0 0 16px; border-top: 1px solid var(--rule); }
.lg-dl div { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 4px 24px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.lg-dl dt { font-size: 14px; letter-spacing: 0.1em; font-variant-caps: all-small-caps; color: var(--ink-2); }
.lg-dl dd { margin: 0; color: var(--ink); }
@media (max-width: 600px) { .lg-dl div { grid-template-columns: 1fr; } }
/* tablas: en móvil cada fila pasa a ficha */
.lg-table { width: 100%; margin: 4px 0 18px; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.lg-table th {
  padding: 0 14px 10px 0;
  text-align: left;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.12em;
  font-variant-caps: all-small-caps;
  color: var(--ink-2);
  border-bottom: 1px solid var(--ink);
}
.lg-table td { padding: 14px 14px 14px 0; vertical-align: top; border-bottom: 1px solid var(--rule); color: #3d3d3d; }
.lg-table code { font-size: 0.92em; color: var(--ink); }
@media (max-width: 760px) {
  .lg-table thead { display: none; }
  .lg-table, .lg-table tbody, .lg-table tr, .lg-table td { display: block; width: 100%; }
  .lg-table tr { padding: 12px 0; border-bottom: 1px solid var(--rule); }
  .lg-table td { padding: 3px 0; border: 0; }
  .lg-table td::before { content: attr(data-th); display: block; font-size: 12px; letter-spacing: 0.12em; font-variant-caps: all-small-caps; color: var(--ink-3); }
}
/* dato de la empresa aún sin completar (ver legales/generar.py) */
.pendiente { padding: 0 4px; background: rgba(123, 0, 0, 0.08); color: var(--accent); font-style: normal; border-radius: 2px; }

/* --- Pie --------------------------------------------------------------- */

.lg-footer {
  padding: 32px var(--padx) 36px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  letter-spacing: 0.08em;
  font-variant-caps: all-small-caps;
}
.lg-footer-in { max-width: 1200px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 32px; }
.lg-footer nav { display: flex; flex-wrap: wrap; gap: 8px 28px; }
.lg-footer a {
  font-size: 15px;
  letter-spacing: 0.06em;
  text-decoration: none;
  padding-bottom: 3px;
  background: linear-gradient(var(--ink), var(--ink)) left bottom / 0 1px no-repeat;
  transition: background-size 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.lg-footer a:hover,
.lg-footer a[aria-current] { background-size: 100% 1px; }
.lg-copy { opacity: 0.55; }
.lg-copy .cb { font-variant-caps: normal; text-transform: uppercase; font-family: var(--logo); font-size: 0.9em; font-style: italic; letter-spacing: 0.2em; }
.lg-copy .lg { font-family: var(--logo); }

/* --- 404 y mantenimiento -------------------------------------------------- */

.lg-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: clamp(40px, 8vh, 96px) var(--padx);
  text-align: center;
}
.lg-big {
  position: relative;
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(120px, 26vw, 320px);
  line-height: 0.8;
  letter-spacing: -0.03em;
  animation: lg-rise 1.1s var(--ease) 0.1s both;
}
.lg-big .bars {
  color: var(--accent);
  font-size: 0.55em;
  letter-spacing: -0.04em;
  margin-right: 0.12em;
  vertical-align: 0.18em;
}
.lg-title {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(40px, 6.8vw, 105px);
  line-height: 0.95;
  letter-spacing: -0.015em;
  text-wrap: balance;
  animation: lg-rise 1.1s var(--ease) 0.15s both;
}
.lg-title .bars { color: var(--accent); margin-right: 0.18em; }
.lg-lead {
  max-width: 34em;
  margin: clamp(26px, 4vh, 40px) auto 0;
  font-size: 17px;
  line-height: 1.45;
  color: var(--ink-2);
  text-wrap: pretty;
  animation: lg-rise 1.1s var(--ease) 0.35s both;
}
.lg-lead a { color: var(--ink); text-underline-offset: 3px; text-decoration-thickness: 1px; }
.lg-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 18px 32px;
  margin-top: clamp(30px, 5vh, 44px);
  animation: lg-rise 1.1s var(--ease) 0.55s both;
}
/* botón con el borde fino de la web */
.lg-btn {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 30px;
  border: 1px solid var(--ink);
  font-size: 15px;
  text-decoration: none;
  transition: background-color 0.3s ease, color 0.3s ease;
}
.lg-btn:hover { background: #0a0a0a; color: #b8b8b8; }
.lg-link {
  text-decoration: none;
  padding-bottom: 3px;
  background: linear-gradient(var(--ink), var(--ink)) left bottom / 0 1px no-repeat;
  transition: background-size 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.lg-link:hover { background-size: 100% 1px; }
.lg-slim { justify-content: center; grid-template-columns: auto; }
@keyframes lg-rise { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .lg-big, .lg-title, .lg-lead, .lg-actions { animation: none; }
}
