/* =============================================================
   XLIII Reunión Anual SNMICU — Bilbao 2026
   Sistema de diseño (tokens) + estilos. Mobile-first.
   Paleta: azul acero + rojo (logo UCI Norte) + neutros fríos.
   Contraste objetivo WCAG AA (AAA en titulares y cuerpo).
   ============================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Marca */
  --brand-blue: #2D6A8C;
  --brand-blue-ink: #1C4A63;   /* texto/enlaces sobre blanco */
  --brand-blue-deep: #0F3447;  /* hero/encabezados (AAA) */
  --brand-red: #A83232;        /* acento / CTA */
  --brand-red-ink: #8E2A2A;

  /* Neutros (escala fría) */
  --neutral-900: #14202A;      /* texto principal */
  --neutral-700: #3A4750;      /* texto secundario */
  --neutral-500: #6B7780;      /* texto terciario */
  --neutral-300: #C7CED3;      /* bordes/divisores */
  --neutral-200: #DEE3E6;
  --neutral-100: #EEF1F3;      /* fondo de sección alterna */
  --neutral-50:  #F7F9FA;
  --white: #FFFFFF;

  /* Estados */
  --ok: #2E7D55;
  --warn: #B26A00;
  --warn-ink: #8A5200;         /* texto de aviso sobre fondo claro (AA) */

  /* Tipografía */
  --font-sans: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --font-serif: "IBM Plex Serif", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;

  /* Espaciado (base 4/8) */
  --s-1: 8px;  --s-2: 16px; --s-3: 24px; --s-4: 40px; --s-5: 64px; --s-6: 96px;

  /* Layout */
  --container: 1160px;
  --measure: 72ch;
  --radius: 10px;
  --radius-sm: 8px;

  --shadow-sm: 0 1px 2px rgba(20,32,42,.06), 0 2px 8px rgba(20,32,42,.05);
  --shadow-md: 0 4px 16px rgba(20,32,42,.08);

  --header-h: 64px;
}

/* ---------- Reset ligero ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 8px); }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--neutral-900);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
[hidden] { display: none !important; }
a { color: var(--brand-blue-ink); text-underline-offset: 2px; }
a:hover { color: var(--brand-blue-deep); }
h1, h2, h3 { line-height: 1.15; margin: 0 0 var(--s-2); color: var(--neutral-900); font-weight: 600; }
p { margin: 0 0 var(--s-2); max-width: var(--measure); }
ul { margin: 0 0 var(--s-2); padding-left: 1.2em; }

/* Accesibilidad: foco visible */
:focus-visible { outline: 3px solid var(--brand-blue); outline-offset: 2px; border-radius: 3px; }

.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 100;
  background: var(--brand-blue-deep); color: #fff; padding: 10px 16px;
  border-radius: var(--radius-sm); transition: top .2s;
}
.skip-link:focus { top: 8px; color: #fff; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Utilidades ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 20px; }
.overline {
  font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--brand-blue-ink); margin: 0 0 var(--s-1);
}
.section { padding-block: var(--s-5); }
.section--alt { background: var(--neutral-100); }
.section__head { margin-bottom: var(--s-4); }
.section h2 { font-size: 1.6rem; }
.lede { font-size: 1.05rem; color: var(--neutral-700); }

.tag {
  display: inline-block; font-size: 12px; font-weight: 600; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 999px; text-transform: uppercase;
}
.tag--prelim { background: #FBF1E3; color: var(--warn-ink); border: 1px solid #EBD2A8; }

/* Botones */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-weight: 600; font-size: 1rem; line-height: 1;
  padding: 14px 22px; border-radius: var(--radius-sm); border: 2px solid transparent;
  cursor: pointer; text-decoration: none; transition: background .15s, color .15s, border-color .15s;
}
.btn--primary { background: var(--brand-red); color: #fff; }
.btn--primary:hover { background: var(--brand-red-ink); color: #fff; }
.btn--secondary { background: transparent; color: var(--brand-blue-ink); border-color: var(--brand-blue); }
.btn--secondary:hover { background: var(--brand-blue); color: #fff; }
.btn[aria-disabled="true"] { opacity: .55; pointer-events: none; }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92); backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--neutral-200);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: var(--header-h); }
.nav__brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--neutral-900); }
.nav__brand img { height: 38px; width: auto; }
.nav__brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.nav__brand-text b { font-weight: 600; font-size: 15px; letter-spacing: .02em; color: var(--neutral-900); }
.nav__brand-text small { font-size: 11px; color: var(--neutral-500); font-weight: 500; }

.nav__toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; background: none; border: 1px solid var(--neutral-300);
  border-radius: var(--radius-sm); cursor: pointer; color: var(--neutral-900);
}
.nav__menu { display: none; }

.nav__links { list-style: none; display: flex; gap: var(--s-3); margin: 0; padding: 0; }
.nav__links a { text-decoration: none; color: var(--neutral-700); font-weight: 500; font-size: 15px; }
.nav__links a:hover { color: var(--brand-blue-deep); }

/* Menú desplegado en móvil */
.nav__panel {
  position: fixed; inset: var(--header-h) 0 auto 0; background: #fff;
  border-bottom: 1px solid var(--neutral-200); box-shadow: var(--shadow-md);
  padding: var(--s-2) 20px var(--s-3); display: none;
}
.nav__panel[data-open="true"] { display: block; }
.nav__panel ul { list-style: none; margin: 0; padding: 0; }
.nav__panel a {
  display: block; padding: 14px 4px; text-decoration: none; color: var(--neutral-900);
  font-weight: 500; border-bottom: 1px solid var(--neutral-100);
}
.nav__panel .btn { width: 100%; margin-top: var(--s-2); }

/* ---------- Hero ---------- */
.hero {
  position: relative; display: flex; align-items: center;
  min-height: clamp(460px, 72vh, 660px); padding-block: var(--s-5);
  color: #fff; background-color: var(--brand-blue-deep);
  background-image:
    linear-gradient(100deg, rgba(13,46,63,.90) 0%, rgba(13,46,63,.66) 45%, rgba(13,46,63,.34) 100%),
    url('../assets/hero-sede.jpg');
  background-size: cover; background-position: center 38%;
}
@supports (background-image: image-set(url("x.webp") type("image/webp"))) {
  .hero { background-image:
    linear-gradient(100deg, rgba(13,46,63,.90) 0%, rgba(13,46,63,.66) 45%, rgba(13,46,63,.34) 100%),
    image-set(url('../assets/hero-sede.webp') type("image/webp"), url('../assets/hero-sede.jpg') type("image/jpeg")); }
}
.hero__inner { text-shadow: 0 1px 14px rgba(6,20,28,.35); }
.hero__credit { position: absolute; right: 16px; bottom: 10px; z-index: 2; padding: 2px 8px; border-radius: 999px; background: rgba(6,20,28,.3); font-size: .72rem; line-height: 1.3; color: #fff; }
.hero__badge {
  position: absolute; top: 80px; right: 9%; z-index: 2;
  display: inline-flex; background: #fff; padding: 10px 14px; border-radius: 14px;
  box-shadow: var(--shadow-md); text-shadow: none;
}
.hero__badge img { height: 62px; width: auto; display: block; }
@media (max-width: 719px) {
  .hero__badge { top: 74px; right: 14px; padding: 7px 10px; }
  .hero__badge img { height: 44px; }
}
.hero .overline { color: #c9dde9; }
.hero h1 {
  font-family: var(--font-serif); font-weight: 600; color: #fff;
  font-size: clamp(2rem, 6vw, 3.4rem); margin-bottom: var(--s-2); max-width: 16ch;
}
.hero__subtitle { font-size: 1.15rem; color: rgba(255,255,255,.92); max-width: 42ch; }
.hero__meta {
  display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-3); margin: var(--s-3) 0 var(--s-4);
  font-size: 1.05rem;
}
.hero__meta div { display: flex; align-items: center; gap: 8px; font-weight: 600; color: #fff; }
.hero__meta svg { color: #fff; flex: none; }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.hero .btn--secondary { color: #fff; border-color: rgba(255,255,255,.75); }
.hero .btn--secondary:hover { background: #fff; color: var(--brand-blue-deep); border-color: #fff; }

/* ---------- Fechas clave ---------- */
.keydates { display: grid; gap: var(--s-2); grid-template-columns: 1fr; }
.keydate {
  background: #fff; border: 1px solid var(--neutral-200); border-left: 4px solid var(--brand-blue);
  border-radius: var(--radius-sm); padding: var(--s-2) var(--s-3);
}
.keydate__when { font-family: var(--font-mono); font-size: 14px; color: var(--brand-blue-ink); font-weight: 600; }
.keydate__what { font-weight: 600; margin-top: 2px; }
.keydate--tbd { border-left-color: var(--neutral-300); color: var(--neutral-500); }

/* ---------- Programa ---------- */
.prog-note { display: flex; align-items: center; gap: 10px; margin-bottom: var(--s-3); }
.timeline { border-top: 1px solid var(--neutral-200); }
.timeline__row {
  display: grid; grid-template-columns: 84px 1fr; gap: var(--s-2);
  padding: var(--s-3) 0; border-bottom: 1px solid var(--neutral-200);
}
.timeline__time { font-family: var(--font-mono); font-weight: 600; color: var(--brand-blue-ink); font-variant-numeric: tabular-nums; }
.timeline__act h3 { font-size: 1.05rem; margin-bottom: 4px; }
.timeline__act p { font-size: .95rem; color: var(--neutral-700); margin: 0; }
.timeline__row--opt .timeline__act h3 { color: var(--neutral-700); }
.timeline__row--break { background: var(--neutral-50); }
.timeline__act h3 { color: var(--brand-blue-deep); }
.ponencias { list-style: none; margin: var(--s-1) 0 0; padding: 0; display: grid; gap: 8px; }
.ponencias li {
  display: flex; flex-direction: column; gap: 1px;
  padding: 8px 0 8px 12px; border-left: 3px solid var(--neutral-300);
}
.ponencias__title { font-size: .95rem; font-weight: 500; color: var(--neutral-900); }
.ponencias__who { font-size: .82rem; color: var(--neutral-700); font-weight: 500; }
.ponencias__time { font-family: var(--font-mono); font-size: .78rem; font-weight: 600; color: var(--brand-blue-ink); font-variant-numeric: tabular-nums; }
.ponencias li.ponencias__aux { border-left-style: dashed; padding-top: 4px; padding-bottom: 4px; }
.ponencias__aux .ponencias__title { font-weight: 400; color: var(--neutral-700); }

/* ---------- Patrocinadores ---------- */
.sponsors {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr; gap: var(--s-2);
  align-items: stretch; justify-items: stretch;
}
.sponsor {
  display: flex; align-items: center; justify-content: center;
  min-height: 120px; padding: var(--s-3) var(--s-2);
  background: #fff; border: 1px solid var(--neutral-200); border-radius: var(--radius);
}
.sponsor img { max-height: 66px; width: auto; max-width: 78%; object-fit: contain; }
/* Logo con margen blanco interno (JPG): se agranda para igualar peso visual */
.sponsor img.sponsor__img--pad { max-height: 112px; max-width: 88%; }
@media (min-width: 720px) {
  .sponsors { grid-template-columns: repeat(3, 1fr); gap: var(--s-3); }
}

/* ---------- Ponentes / placeholder ---------- */
.placeholder {
  border: 1px dashed var(--neutral-300); border-radius: var(--radius);
  padding: var(--s-4); text-align: center; color: var(--neutral-700); background: var(--neutral-50);
}
.speakers-grid { display: grid; gap: var(--s-3); grid-template-columns: 1fr; }
.speaker { background: #fff; border: 1px solid var(--neutral-200); border-radius: var(--radius); padding: var(--s-3); }
.speaker__name { font-size: 1.05rem; color: var(--brand-blue-ink); margin: 0 0 4px; }
.speaker__aff { font-size: .85rem; color: var(--neutral-700); margin: 0 0 var(--s-2); }
.speaker__talk { font-size: .9rem; margin: 0; }
.speaker__mesa { display: block; font-family: var(--font-mono); font-size: .72rem; font-weight: 600; color: var(--brand-blue-ink); margin-bottom: 2px; }
.speakers-note { margin-top: var(--s-3); font-size: .85rem; color: var(--neutral-700); }

/* ---------- Comité ---------- */
.committee { display: grid; gap: var(--s-4); grid-template-columns: 1fr; }
.committee h3 { font-size: 1.05rem; color: var(--brand-blue-ink); }
.committee ul { list-style: none; padding: 0; }
.committee li { padding: 6px 0; border-bottom: 1px solid var(--neutral-100); }
.committee li small { display: block; color: var(--neutral-700); font-weight: 400; }

/* ---------- Sede ---------- */
.venue { display: grid; gap: var(--s-3); grid-template-columns: 1fr; }
.venue__main { min-width: 0; }
.venue__sub { font-size: 1.05rem; color: var(--brand-blue-ink); margin: var(--s-3) 0 var(--s-1); }
.venue__info dt { font-weight: 600; color: var(--neutral-900); margin-top: var(--s-2); }
.venue__info dt:first-child { margin-top: 0; }
.venue__info dd { margin: 2px 0 0; color: var(--neutral-700); }
.table-wrap { overflow-x: auto; margin-bottom: var(--s-2); -webkit-overflow-scrolling: touch; }
.venue__table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.venue__table th, .venue__table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--neutral-200); }
.venue__table th { font-weight: 600; color: var(--neutral-900); background: var(--neutral-100); }
.venue__table td { color: var(--neutral-700); }
.venue__table td:first-child { font-weight: 500; color: var(--neutral-900); }
.howto { margin-top: 0; padding-left: 1.1em; }
.howto li { margin-bottom: 8px; color: var(--neutral-700); }
.venue__photo { margin: 0; }
.venue__photo img { width: 100%; height: auto; display: block; border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.venue__photo figcaption { margin-top: 8px; font-size: .85rem; color: var(--neutral-700); }
.photo-credit { display: block; margin-top: 2px; font-size: .78rem; }
.venue__map {
  border: 0; width: 100%; aspect-ratio: 16/9; border-radius: var(--radius);
  box-shadow: var(--shadow-sm); margin-top: var(--s-4);
}

/* ---------- Contacto / Footer ---------- */
.contact-card {
  background: #fff; border: 1px solid var(--neutral-200); border-radius: var(--radius);
  padding: var(--s-3); max-width: 520px;
}
.contact-card a { font-weight: 600; }
.contact-card a, .venue__info dd a { overflow-wrap: anywhere; }
.site-footer { background: var(--brand-blue-deep); color: #cdd9e2; padding-block: var(--s-4); margin-top: var(--s-5); }
.site-footer a { color: #fff; }
.site-footer p { max-width: none; font-size: .9rem; }
.site-footer__legal { color: #8fa6b6; font-size: .82rem; margin-top: var(--s-2); }

/* ---------- Inscripción (formulario) ---------- */
.insc__intro { margin-bottom: var(--s-4); }
.insc-form { max-width: 760px; }
.insc-grid { display: grid; gap: var(--s-3); grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: .95rem; color: var(--neutral-900); }
.field .req { color: var(--brand-red); }
.field input[type="text"], .field select {
  font: inherit; font-size: 1rem; color: var(--neutral-900);
  padding: 12px 14px; border: 1px solid var(--neutral-300); border-radius: var(--radius-sm);
  background: #fff; width: 100%; max-width: none;
}
.field select { appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%231C4A63' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px;
}
.field input:hover, .field select:hover { border-color: var(--neutral-500); }
.field input:focus-visible, .field select:focus-visible { border-color: var(--brand-blue); }
.field--consent { margin-top: var(--s-3); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; font-size: .95rem; color: var(--neutral-700); cursor: pointer; max-width: 60ch; }
.consent input { margin-top: 3px; width: 18px; height: 18px; flex: none; accent-color: var(--brand-blue); cursor: pointer; }
.consent a { font-weight: 600; }
.insc-form__submit { margin-top: var(--s-3); }
.insc-form__hint { font-size: .85rem; color: var(--neutral-500); margin-top: var(--s-1); }
.insc-form__hint .req { color: var(--brand-red); }
.insc-feedback { margin-top: var(--s-3); padding: var(--s-2) var(--s-3); border-radius: var(--radius-sm); font-weight: 500; max-width: 60ch; }
.insc-feedback p { margin: 0; max-width: none; }
.insc-feedback--ok   { background: #E6F4EC; border: 1px solid #A9D8BE; color: #1E5C3D; }
.insc-feedback--err  { background: #FBEAEA; border: 1px solid #E3B4B4; color: var(--brand-red-ink); }
.insc-feedback--info { background: #EAF2F7; border: 1px solid #B9D4E2; color: var(--brand-blue-ink); }
/* Tras enviar con éxito: ocultar campos y dejar solo la confirmación */
.insc-form.is-sent > :not(.insc-feedback) { display: none; }

/* ---------- Página legal ---------- */
.legal { padding-block: var(--s-4) var(--s-5); }
.legal h2 { font-size: 1.2rem; color: var(--brand-blue-ink); margin-top: var(--s-4); }
.legal h2:first-of-type { margin-top: var(--s-2); }
.legal .legal__updated { font-size: .9rem; color: var(--neutral-500); }
.legal .legal__back { display: inline-block; margin-top: var(--s-4); font-weight: 600; }
.legal dl dt { font-weight: 600; margin-top: var(--s-1); }
.legal dl dd { margin: 0 0 var(--s-1); }

/* ---------- Reveal (motion mínimo) ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .5s ease-out, transform .5s ease-out; }
.reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (min-width: 720px) {
  body { font-size: 18px; }
  .section { padding-block: var(--s-6); }
  .section h2 { font-size: 2rem; }
  .keydates { grid-template-columns: repeat(2, 1fr); }
  .speakers-grid { grid-template-columns: repeat(3, 1fr); }
  .committee { grid-template-columns: 1fr 1fr; }
  .venue { grid-template-columns: 1fr 300px; gap: var(--s-4); align-items: start; }
  .venue__main { grid-column: 1; }
  .venue__photo { grid-column: 2; position: sticky; top: calc(var(--header-h) + 16px); }
  .timeline__row { grid-template-columns: 110px 1fr; gap: var(--s-3); }
  .insc-grid { grid-template-columns: 1fr 1fr; }
  .field--full { grid-column: 1 / -1; }
}
@media (min-width: 920px) {
  .nav__toggle { display: none; }
  .nav__menu { display: flex; align-items: center; gap: var(--s-3); }
  .nav__panel { display: none !important; }
  .hero { padding-block: var(--s-6); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
