/* Rodrigo Valencia · rodrigovalencia.cl
   Mundo: un expediente bien redactado. Papel marfil, tinta azul profunda, serifa para la voz,
   sans pública para la lectura. Sobrio, formal y cercano. */

:root {
  --papel: #F6F2EA;
  --papel-2: #EFE9DD;
  --hoja: #FFFDF8;
  --tinta: #18202E;
  --tinta-2: #4A5364;
  --tinta-3: #6B7383;
  --linea: #DCD4C5;
  --linea-2: #CBC1AE;
  --azul: #1F3A5F;
  --azul-hover: #172D4A;
  --noche: #14213A;
  --noche-2: #1C2C49;
  --sobre-noche: #EEE8DC;
  --sobre-noche-2: #B9C1CF;
  --laton: #9A6F2E;
  --laton-claro: #C9A46A;
  --verde: #2F6B4F;
  --error: #9B2C2C;

  --serifa: "Newsreader", "Iowan Old Style", Georgia, serif;
  --titulo: "Plus Jakarta Sans", "Public Sans", system-ui, sans-serif;
  --sans: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;

  --r: 6px;
  --sombra: 0 1px 2px rgba(24, 32, 46, .06), 0 12px 32px -12px rgba(24, 32, 46, .18);
  --sombra-alta: 0 2px 4px rgba(24, 32, 46, .06), 0 28px 60px -18px rgba(24, 32, 46, .32);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--papel); color: var(--tinta);
  font: 400 1.0625rem/1.65 var(--sans); caret-color: var(--azul);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--azul); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
::selection { background: var(--azul); color: var(--papel); }
:focus-visible { outline: 2px solid var(--laton); outline-offset: 3px; border-radius: 3px; }
html { scrollbar-color: var(--linea-2) var(--papel); scrollbar-width: thin; }

h1, h2, h3 { font-family: var(--titulo); font-weight: 700; color: var(--tinta); margin: 0; text-wrap: balance; letter-spacing: -0.025em; }
h1 { font-size: clamp(2.15rem, 4.6vw, 3.6rem); line-height: 1.08; font-variation-settings: "opsz" 72; }
h2 { font-size: clamp(1.85rem, 3.4vw, 2.7rem); line-height: 1.12; font-variation-settings: "opsz" 60; }
h3 { font-size: 1.22rem; line-height: 1.25; font-weight: 700; font-variation-settings: "opsz" 24; }
p { margin: 0 0 1em; }
em { font-style: italic; }

.envoltura { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.estrecha { width: min(760px, calc(100% - 32px)); margin-inline: auto; }

/* ── Botones ── */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--azul); color: var(--papel); border: 0; border-radius: var(--r);
  font: 600 1.05rem/1.2 var(--sans); padding: 17px 26px; min-height: 56px;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 10px 24px -12px rgba(31,58,95,.7);
  transition: background-color .25s var(--ease), transform .25s var(--ease), box-shadow .25s var(--ease);
}
.boton:hover { background: var(--azul-hover); transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 16px 30px -14px rgba(31,58,95,.75); text-decoration: none; }
.boton:active { transform: translateY(0); }
.boton svg { width: 18px; height: 18px; transition: transform .25s var(--ease); }
.boton:hover svg { transform: translateX(3px); }
.boton[aria-disabled="true"], .boton:disabled { background: #8C94A3; cursor: not-allowed; box-shadow: none; transform: none; }
.boton.claro { background: var(--papel); color: var(--noche); box-shadow: 0 10px 24px -14px rgba(0,0,0,.6); }
.boton.claro:hover { background: #fff; }
.boton.chico { padding: 10px 16px; min-height: 42px; font-size: .95rem; box-shadow: none; }

/* ── Marcas de pendiente (solo en la vista previa; ?publicar las oculta) ── */
.pendiente {
  display: inline-block; vertical-align: 2px; margin-left: 6px;
  font: 600 .7rem/1.4 var(--sans); letter-spacing: .02em;
  color: #7A4B00; background: #FBE7B8; border: 1px dashed #D9A441; border-radius: 99px; padding: 1px 9px;
}
.publicar .pendiente { display: none; }

/* ── Cabecera ── */
.cabecera {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--papel) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid transparent; transition: border-color .3s var(--ease);
}
.cabecera.con-borde { border-bottom-color: var(--linea); }
.cabecera .envoltura { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 68px; }
.firma-nombre { text-decoration: none; color: var(--tinta); line-height: 1.15; }
.firma-nombre b { display: block; font: 700 1.1rem/1.15 var(--titulo); letter-spacing: -0.02em; }
.firma-nombre span { font-size: .8rem; color: var(--tinta-3); letter-spacing: .01em; }
.cabecera .boton { opacity: 0; pointer-events: none; transform: translateY(-4px); }
.cabecera.mostrar-boton .boton { opacity: 1; pointer-events: auto; transform: none; }

/* ── Pie ── */
.pie { background: var(--noche); color: var(--sobre-noche-2); padding: 40px 0; font-size: .92rem; }
.pie .envoltura { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; }
.pie b { color: var(--sobre-noche); font: 700 1rem/1.3 var(--titulo); }
.pie a { color: var(--sobre-noche); }
