/* ═══════════════════════════════════════════════════════════
   base.css — jesyrodriguezc.com
   Se carga en TODAS las páginas: fuentes propias, variables,
   banner de cookies y mensajes de validación de formularios.
   No lleva resets ni estilos de elementos (las páginas legales,
   gracias y 404 tienen su propio maquetado).
   Tras cualquier cambio: subir ?v=N en todas las páginas.
═══════════════════════════════════════════════════════════ */

/* ── Fuentes servidas desde el dominio (subconjunto latino, OFL) ──
   Un solo fichero variable por familia, con los pesos que se usan:
   Fraunces 700–800 (títulos) y DM Sans 400–600 (texto).
   Precargadas en el <head> de cada página. */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url('/fonts/fraunces-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/dm-sans-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Reserva de fuentes del sistema para reducir el salto (CLS) mientras
   cargan. Nombres propios ("… Fallback") para NO sustituir a las reales. */
@font-face {
  font-family: 'Fraunces Fallback';
  font-style: normal;
  font-weight: 700 800;
  size-adjust: 112%;
  ascent-override: 96%;
  descent-override: 20%;
  line-gap-override: 0%;
  src: local('Georgia'), local('Times New Roman');
}
@font-face {
  font-family: 'DM Sans Fallback';
  font-style: normal;
  font-weight: 400 600;
  size-adjust: 100%;
  ascent-override: 96%;
  descent-override: 20%;
  line-gap-override: 0%;
  src: local('Helvetica Neue'), local('Arial');
}

/* ── Variables ── */
:root {
  --azul:        #4968f5;
  --azul-oscuro: #2f4dd4;
  --azul-suave:  #dce3fd;
  --lima:        #edf67d;
  --gris-claro:  #f5f7f8;
  --blanco:      #ffffff;
  --texto:       #111827;
  --texto-suave: #4b5563;
  --borde:       #e5e7eb;
  --radio:       14px;
  --radio-lg:    24px;
  --sombra:      0 4px 24px rgba(73,104,245,.12);
  --sombra-lg:   0 12px 48px rgba(73,104,245,.18);
  --fuente-display: 'Fraunces', 'Fraunces Fallback', 'Georgia', serif;
  --fuente-cuerpo:  'DM Sans', 'DM Sans Fallback', 'Helvetica Neue', Arial, system-ui, sans-serif;
  --nav-h:       72px;
}

/* ═══════════════════════════════════════════════
   BANNER DE COOKIES (lo inserta /js/main.js)
   Aceptar y Rechazar con el mismo peso visual.
═══════════════════════════════════════════════ */
.cookies-banner {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 48px);
  max-width: 860px;
  background: #0f172a;
  color: #ffffff;
  border-radius: var(--radio-lg);
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  z-index: 9999;
  box-shadow: 0 16px 48px rgba(0,0,0,.35);
  transition: opacity .4s, transform .4s;
  font-family: var(--fuente-cuerpo);
  text-align: left;
}
.cookies-banner.oculto {
  opacity: 0;
  transform: translateX(-50%) translateY(24px);
  pointer-events: none;
}
.cookies-texto { font-size: .88rem; line-height: 1.6; color: #ffffff; margin: 0; }
.cookies-texto a { color: var(--lima); text-decoration: underline; }
.cookies-acciones { display: flex; gap: 10px; flex-shrink: 0; }
.cookies-acciones button {
  font-family: var(--fuente-display);
  font-weight: 700;
  font-size: .85rem;
  padding: 10px 20px;
  min-width: 110px;
  border-radius: var(--radio);
  cursor: pointer;
  border: 2px solid var(--lima);
  background: var(--lima);
  color: var(--texto);
  transition: background .2s, transform .2s;
}
.cookies-acciones button:hover { transform: translateY(-1px); background: #dde96a; }
.cookies-acciones button:focus-visible { outline: 3px solid #ffffff; outline-offset: 2px; }

@media (max-width: 768px) {
  .cookies-banner {
    flex-direction: column;
    bottom: 12px;
    width: calc(100% - 24px);
    padding: 16px 18px;
    gap: 14px;
  }
  .cookies-acciones { width: 100%; justify-content: stretch; }
  .cookies-acciones button { flex: 1; }
}

/* Botón "Configurar cookies" con aspecto de enlace (footer) */
.enlace-cookies {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: underline;
}

/* ═══════════════════════════════════════════════
   VALIDACIÓN DE FORMULARIOS (la gestiona /js/main.js)
═══════════════════════════════════════════════ */
.campo-error {
  display: block;
  font-size: .8rem;
  color: #dc2626;
  margin-top: 6px;
  line-height: 1.4;
}
[aria-invalid="true"] {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220,38,38,.12) !important;
}
.form-error {
  font-size: .82rem;
  color: #ef4444;
  margin-top: 10px;
  text-align: center;
  line-height: 1.5;
}
