/* ============================================================================
   PORTADA · "Bienvenida" — estilos scopeados bajo .portada
   Pantalla completa sin topbar/sidebar. Réplica del PBI (última versión) con
   la capa acordada: acento POR IDIOMA en toda la hoja (ES verde 335C · EU
   azul 280C · EN naranja rojizo AA), etiquetas descriptivas propias (fondo
   blanco, letra negra), ENTRAR rectángulo fino,
   lockup PARTICIPA del PBIX como logo-enlace (bilingüe fijo, solo cambia de
   color) y la tira de la ciudad de PARTICIPA. Todo degrada con
   prefers-reduced-motion.
   ============================================================================ */

#page:has(> .portada) { padding: 0; }
#content:has(> #page > .portada) #breadcrumb { display: none; }

.portada {
  /* acento por idioma — base: castellano (verde corporativo 335C) */
  --po-accent: #07523A;
  --po-accent-soft: #e3f5ee;
  --po-eu: #002F6C;                 /* euskera → azul navy 280C */
  --po-es: #07523A;                 /* castellano → verde AAA con blanco */
  --po-en: #A12A1B;                 /* inglés → rojo teja AAA con blanco */
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  color: #1a1a18;
  font-family: 'Leelawadee', 'Leelawadee UI', 'Segoe UI', system-ui, sans-serif;
  overflow: hidden;
}
.portada.portada-eu { --po-accent: #002F6C; --po-accent-soft: #eaeef6; }
.portada.portada-en { --po-accent: #A12A1B; --po-accent-soft: #f9e8e5; }

/* Evita que el contenido intrínseco de textos o imágenes fuerce el ancho. */
.po-brand, .po-main, .po-plogo, .po-footer, .po-foot-left, .po-credits { min-width: 0; }
.po-logo-vg2030, .po-foot-left img, .po-credits img { max-width: 100%; }
.po-title, .po-desc, .po-managed, .pl-eyebrow, .pl-tagline { overflow-wrap: anywhere; }

/* el contenido va por encima de la capa ambiental */
.po-langs, .po-brand, .po-main, .po-plogo, .po-footer { position: relative; z-index: 2; }

/* ── Idiomas — arriba a la IZQUIERDA, pequeños, puntas rectas ─────────────── */
.po-langs {
  position: absolute;
  top: 18px;
  /* El PNG del Ayuntamiento incluye aire transparente: sumamos ese margen
     interno al padding del pie para alinear el borde VISIBLE del escudo. */
  left: calc(clamp(24px, 3vw, 48px) + 20px);
  display: flex;
  gap: 6px;
  /* Por encima de .po-brand (z-index: 4): el header transparente ocupa todo
     el ancho y, si queda delante, intercepta los clics de idioma. */
  z-index: 5;
}
.po-lang {
  font-family: inherit;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .04em;
  min-width: 44px;
  min-height: 44px;
  padding: 5px 10px;
  border-radius: 0;
  border: 2px solid;
  background: #fff;
  color: #070F25;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s ease, box-shadow .15s ease;
}
.po-lang:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(7,15,37,.14); }
.po-lang[data-lang="eu"] { border-color: var(--po-eu); }
.po-lang[data-lang="es"] { border-color: var(--po-es); }
.po-lang[data-lang="en"] { border-color: var(--po-en); }
.po-lang.active[data-lang="eu"] { background: var(--po-eu); color: #fff; }
.po-lang.active[data-lang="es"] { background: var(--po-es); color: #fff; }
.po-lang.active[data-lang="en"] { background: var(--po-en); color: #fff; }

/* ── Etiquetas descriptivas propias: fondo blanco, letra negra ─────────────── */
.po-tt { position: relative; }
.po-tt::after {
  content: attr(data-tt);
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  background: #fff;
  color: #111;
  font-family: 'Leelawadee', 'Leelawadee UI', 'Segoe UI', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;       /* todas las etiquetas de la Bienvenida, centradas */
  text-transform: none;
  letter-spacing: 0;
  padding: 9px 13px;
  border: 1px solid rgba(0,0,0,.14);
  box-shadow: 0 6px 18px rgba(0,0,0,.14);
  width: max-content;
  max-width: 300px;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease, transform .15s ease;
  pointer-events: none;
  z-index: 6;
}
.po-tt::before {
  content: '';
  position: absolute;
  left: 50%;
  top: calc(100% + 5px);
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid rgba(0,0,0,.14);
  border-top: 1px solid rgba(0,0,0,.14);
  transform: translateX(-50%) rotate(45deg);
  opacity: 0;
  visibility: hidden;
  transition: opacity .15s ease;
  pointer-events: none;
  z-index: 7;
}
.po-tt:hover::after, .po-tt:focus-visible::after,
.po-tt:hover::before, .po-tt:focus-visible::before {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.po-tooltip-js .po-tt::before,
.po-tooltip-js .po-tt::after { display: none !important; }
.po-a11y-tooltip {
  position: fixed;
  z-index: 1000;
  max-width: min(300px, calc(100vw - 16px));
  padding: 9px 13px;
  border: 1px solid rgba(0,0,0,.14);
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.14);
  color: #111;
  font-family: 'Leelawadee', 'Leelawadee UI', 'Segoe UI', sans-serif;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
  white-space: pre-line;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity .15s ease;
}
.po-a11y-tooltip.is-visible { opacity: 1; visibility: visible; pointer-events: auto; }
.po-a11y-tooltip::before {
  content: '';
  position: absolute;
  left: 50%;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid rgba(0,0,0,.14);
  border-top: 1px solid rgba(0,0,0,.14);
  transform: translateX(-50%) rotate(45deg);
}
.po-a11y-tooltip[data-placement="down"]::before { top: -6px; }
.po-a11y-tooltip[data-placement="up"]::before { bottom: -6px; transform: translateX(-50%) rotate(225deg); }
.po-a11y-tooltip[data-placement="right"]::before { left: -6px; top: 50%; transform: translateY(-50%) rotate(-45deg); }
.po-a11y-tooltip[data-placement="left"]::before { left: auto; right: -6px; top: 50%; transform: translateY(-50%) rotate(135deg); }
.po-tt::before { transform: translateX(-50%) rotate(45deg); }
.po-tt--up::after { top: auto; bottom: calc(100% + 10px); transform: translateX(-50%) translateY(-4px); }
.po-tt--up::before { top: auto; bottom: calc(100% + 5px); transform: translateX(-50%) rotate(225deg); }
.po-tt--up:hover::after, .po-tt--up:focus-visible::after { transform: translateX(-50%) translateY(0); }
/* etiquetas junto al borde derecho (naider): ancladas a la derecha para que no
   se corten con la pantalla; ancho corto -> caen en dos líneas centradas */
.po-credits .po-tt--up::after {
  left: auto;
  right: 0;
  max-width: 200px;
  transform: translateY(-4px);
}
.po-credits .po-tt--up:hover::after,
.po-credits .po-tt--up:focus-visible::after { transform: translateY(0); }
/* La etiqueta de Naider debe pasar por encima de la guía y del héroe. El pie
   solo sube de capa mientras el enlace está señalado o tiene foco. */
.po-footer:has(.po-credits .po-tt:hover),
.po-footer:has(.po-credits .po-tt:focus-visible) { z-index: 8; }
/* etiqueta A LA DERECHA del elemento (logo de arriba: abajo pisa el título y
   arriba se corta con el borde de la pantalla; a la derecha hay hueco) */
.po-tt--right::after {
  left: calc(100% + 12px);
  right: auto;
  top: 50%;
  bottom: auto;
  max-width: 240px;
  transform: translateY(-50%) translateX(4px);
}
.po-tt--right::before {
  left: calc(100% + 7px);
  top: 50%;
  bottom: auto;
  transform: translateY(-50%) rotate(-45deg);
}
.po-tt--right:hover::after, .po-tt--right:focus-visible::after { transform: translateY(-50%) translateX(0); }
.po-tt--right:hover::before, .po-tt--right:focus-visible::before { transform: translateY(-50%) rotate(-45deg); }
/* la etiqueta del logo debe quedar POR ENCIMA del título: el header .po-brand
   sube de capa (el título vive en .po-main, z-index 2, posterior en el DOM) */
.po-brand { z-index: 4; }
/* y las del PIE (naider, escudos) por encima del muñeco (capa 3) */
.po-footer { z-index: 4; }
/* Etiquetas de idioma centradas respecto a cada botón, igual que el resto
   de etiquetas descriptivas de la Bienvenida. */
.po-langs .po-tt::after {
  content: attr(data-tt-action) "\A" attr(data-tt-lang);
  left: 50%;
  right: auto;
  max-width: 190px;
  white-space: pre-line;
  transform: translateX(-50%) translateY(4px);
}
.po-langs .po-tt:hover::after,
.po-langs .po-tt:focus-visible::after { transform: translateX(-50%) translateY(0); }
/* Las etiquetas de pausar/cerrar (botones junto al muñeco) usan el anclaje
   genérico .po-tt--up; con solo 40px de ancho no necesitan una regla propia. */

/* ── Logo Oficina del Futuro centrado ──────────────────────────────────────── */
.po-brand {
  display: flex;
  justify-content: center;
  padding: clamp(24px, 4vh, 46px) 24px 0;
}
.po-brand a { display: block; }
.po-logo-vg2030 {
  display: block;
  width: clamp(320px, 31vw, 480px);
  height: clamp(132px, 12vw, 188px);
  object-fit: cover;
  object-position: center;
  animation: poFadeUp .5s ease both;
}

/* ── Héroe central ─────────────────────────────────────────────────────────── */
.po-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: clamp(12px, 2.2vh, 26px) 32px;
  gap: clamp(16px, 2.6vh, 28px);
}
.po-title {
  font-family: 'Leelawadee', 'Leelawadee UI', 'Segoe UI', system-ui, sans-serif;
  /* medido: con 3.3vw el título cabe entero en UNA línea en todo ancho ≥900px */
  font-size: clamp(28px, 3.3vw, 54px);
  font-weight: 600;
  letter-spacing: -0.005em;
  line-height: 1.12;
  color: #111;
  max-width: 1700px;
  margin: 0;
  animation: poFadeUp .5s ease both;
}
.po-title:focus { outline: none; }
.po-desc {
  font-family: 'Leelawadee', 'Leelawadee UI', 'Segoe UI', system-ui, sans-serif;
  font-size: clamp(16px, 1.7vw, 24px);
  font-weight: 400;
  line-height: 1.65;
  color: rgba(26, 26, 24, 0.80);
  max-width: 1360px;
  margin: 0;
  animation: poFadeUp .5s ease .08s both;
}
.po-desc .po-agenda-link {
  color: var(--po-accent);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.po-agenda-icon { width: 13px; height: 13px; flex: 0 0 13px; fill: currentColor; }
.po-agenda-link:hover, .po-agenda-link:focus-visible { text-decoration: underline; text-underline-offset: 3px;
  color: color-mix(in srgb, var(--po-accent), #000 34%); }
.po-managed {
  max-width: 1100px;
  margin: -8px 0 0;
  color: #3F4643;
  font-size: clamp(14px, 1.25vw, 18px);
  font-weight: 600;
  line-height: 1.5;
  text-wrap: balance;
  animation: poFadeUp .5s ease .12s both;
}

/* Dos destinos seleccionables y una sola acción de entrada. */
.po-destination-label {
  margin: 2px 0 -4px;
  color: var(--po-accent);   /* color del idioma, como los rótulos de la tarjeta PARTICIPA */
  font-family: 'Leelawadee', 'Leelawadee UI', 'Segoe UI', sans-serif;
  font-size: clamp(13px, 1.05vw, 16px);
  font-weight: 700;
  letter-spacing: .14em;
  line-height: 1.2;
  text-transform: uppercase;
}
.po-portals {
  width: min(780px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: clamp(14px, 2vw, 24px);
  margin-top: 0;
  padding-bottom: 0;
}

/* ── ENTRAR: rectángulo fino, una línea, centrado ──────────────────────────── */
/* relleno del color del idioma, letras blancas, tipografía Segoe UI Black */
.po-observatorio-access {
  width: 100%;
  min-width: 0;
  min-height: clamp(236px, 24vh, 276px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.2vh, 24px);
  padding: 18px;
  border: 2px solid #C8D1DD;
  background: #fff;
  color: inherit;
  cursor: pointer;
  position: relative;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
  animation: poFadeUp .5s ease .16s both;
  justify-self: stretch;
}
.po-portal-choice.is-selected {
  border-color: var(--po-accent);
  background: var(--po-accent-soft);
  box-shadow: inset 0 0 0 3px #fff;
}
.po-enter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: 'Leelawadee', 'Leelawadee UI', 'Segoe UI', sans-serif;
  font-size: clamp(15px, 1.45vw, 20px);
  font-weight: 700;
  letter-spacing: .01em;
  white-space: nowrap;
  color: #fff;
  background: var(--po-accent);
  border: 2px solid transparent;
  border-radius: 0;
  min-height: 52px;
  padding: 14px clamp(36px, 4.4vw, 64px);
  cursor: pointer;
  box-shadow: none; /* antes 0 3px 12px */
  transition: filter .18s ease;
}
.po-observatorio-logo {
  display: block;
  width: clamp(200px, 18vw, 250px);
  height: auto;
}
.po-observatorio-access:hover,
.po-observatorio-access:focus-visible {
  transform: translateY(-2px);
  border-color: var(--po-accent);
}
.po-observatorio-access:focus-visible {
  outline: 3px solid var(--po-accent);
  outline-offset: 5px;
}

/* ── PARTICIPA: lockup del PBIX como logo-enlace ───────────────────────────
   Bilingüe fijo (no se traduce); solo el color acompaña al idioma activo.  */
.po-plogo {
  font-family: 'Leelawadee', 'Leelawadee UI', 'Segoe UI', sans-serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  margin: 0;
  padding: 18px;
  width: 100%;
  min-height: clamp(236px, 24vh, 276px);
  background: #fff;
  border: 2px solid #C8D1DD;
  position: relative;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background-color .18s ease;
  animation: poFadeUp .5s ease .22s both;
}
.po-participa-wrap {
  position: relative;
  display: flex;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  justify-self: stretch;
}
.pl-motion-toggle {
  position: absolute;
  top: auto;
  bottom: 10px;
  left: auto;
  right: 10px;
  width: 36px;
  height: 28px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--po-accent);
  font-size: 17px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transform: none;
  z-index: 4;
}
.pl-motion-toggle:hover { opacity: .72; }
.pl-motion-toggle:focus-visible { outline: 3px solid var(--po-accent); outline-offset: 3px; }
.po-participa-wrap.is-motion-paused .pl-motion-toggle { background: transparent; color: var(--po-accent); }
.po-plogo:hover, .po-plogo:focus-visible {
  transform: translateY(-2px);
  border-color: var(--po-accent);
}

.po-plogo:hover .po-enter,
.po-plogo:focus-visible .po-enter {
  filter: none;
  color: #fff;
  background: var(--po-accent);
  box-shadow: none;
}
.po-destination-enter {
  /* antes
     width: min(680px, 100%) → ahora tamaño natural (texto + padding),
     centrado, sin estirarse con la pantalla. */
  display: flex;
  width: max-content;
  max-width: 100%;
  margin-inline: auto;
  gap: 12px;
  margin-block: -2px clamp(20px, 3vh, 34px);
  animation: poFadeUp .5s ease .28s both;
}
.po-destination-enter:hover,
.po-destination-enter:focus-visible {
  transform: none;          /* antes translateY(-2px) + sombra */
  filter: brightness(1.08);
  box-shadow: none;
}
.pl-eyebrow, .pl-tagline {
  font-size: clamp(9px, .72vw, 11px);
  font-weight: 800;
  letter-spacing: .24em;
  color: var(--po-accent);
}
.pl-word {
  font-family: 'Poppins', 'Segoe UI', 'Leelawadee', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(24px, 2.15vw, 34px);
  line-height: 1.08;
  letter-spacing: .005em;
  color: #111;
}
.pl-mascot { line-height: 0; margin: 5px 0 4px; }
.pl-mascot svg { width: clamp(52px, 4.4vw, 60px); height: auto; }
.pl-mascot svg { overflow: visible; }
.pl-evo {
  position: relative;
  display: block;
  width: clamp(52px, 4.4vw, 60px);
  aspect-ratio: 78 / 104;
  transform: none;
}
.pl-evo-stage {
  position: absolute;
  inset: 0;
  display: block;
  opacity: 0;
  animation: poHeroEvolve 3s linear infinite;
}
.pl-evo-stage svg { width: 100%; height: auto; }
.pl-evo-stage--1 { animation-delay: 0s; }
.pl-evo-stage--2 { animation-delay: .6s; }
.pl-evo-stage--3 { animation-delay: 1.2s; }
.pl-evo-stage--4 { animation-delay: 1.8s; }
.pl-evo-stage--5 { animation-delay: 2.4s; }
@keyframes poHeroEvolve {
  0%, 16% { opacity: 1; transform: scale(1); }
  20%, 100% { opacity: 0; transform: scale(1.05); }
}
.po-participa-wrap.is-motion-paused .pl-evo-stage {
  animation: none;
  opacity: 0;
  transform: scale(1);
}
.po-participa-wrap.is-motion-paused .pl-evo-stage--5 { opacity: 1; }


/* ── Guía-mascota fija (esquina inferior derecha, encima de naider) ───────────
   El monigote 2D (mismo diseño, estadio 5) respira suave y a su izquierda van
   rotando mensajes SIN caja (Poppins, tinta) que explican el Observatorio y
   PARTICIPA. Capa por encima del contenido pero sin capturar el puntero. */
.po-guide {
  position: absolute;
  right: clamp(16px, 2vw, 32px);
  bottom: clamp(96px, 15vh, 130px);
  z-index: 5;
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  gap: 0;
  max-width: min(92vw, 360px);
}
.po-guide-tab {
  position: relative;
  width: 64px;
  min-height: 52px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: var(--po-accent);
  color: #fff;
  cursor: pointer;
}
.po-guide-tab:hover { filter: brightness(.9); }
.po-guide-tab.po-tt::after {
  content: attr(data-tt-line1) "\A" attr(data-tt-line2);
  width: 150px;
  max-width: 150px;
  white-space: pre-line;
  background: #fff !important;
  color: #111 !important;
  left: auto;
  right: 0;
  transform: translateY(-4px);
}
.po-guide-tab.po-tt:hover::after,
.po-guide-tab.po-tt:focus-visible::after { transform: translateY(0); }
.po-guide-tab.po-tt::before { left: auto; right: 26px; transform: rotate(225deg); }
.po-guide-tab:focus-visible {
  outline: 3px solid #070f25;
  outline-offset: 3px;
}
.po-guide-tab-plus {
  position: relative;
  width: 64px;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
  font-size: 0;
  line-height: 1;
}
.po-guide-tab-plus::before,
.po-guide-tab-plus::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  background: #fff;
  transform: translate(-50%, -50%);
}
.po-guide-tab-plus::before { width: 24px; height: 6px; }
.po-guide-tab-plus::after  { width: 6px; height: 24px; }
.po-guide-tab-close { display: none; width: 64px; min-height: 52px; align-items: center; justify-content: center; background: var(--po-accent); color: #fff; font-size: 28px; font-weight: 400; line-height: 1; }
.po-guide-tab.is-open { min-height: 52px; color: #fff; }
.po-guide-tab.is-open .po-guide-tab-plus { display: none; }
.po-guide-tab.is-open .po-guide-tab-close { display: flex; }
.po-guide-panel {
  width: min(250px, calc(100vw - 64px));
  padding: 0;
  border: 0;
  border-radius: 0;
  background: #fff;
  color: #070f25;
  font-family: 'Leelawadee', 'Leelawadee UI', 'Segoe UI', system-ui, sans-serif;
}
.po-guide-panel[hidden] { display: none; }





.po-guide-content { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0; padding: 0 0 6px; }
/* El mensaje va EN FLUJO, ENCIMA del monigote y centrado dentro del panel
   (antes iba absolute a la izquierda y se salía del viewport en estrecho). */
.po-quest-stage { position: relative; width: 220px; flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; }
.po-quest-stage .po-quest-bubble {
  position: static;
  order: -1;
  width: 100%;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-family: 'Leelawadee', 'Leelawadee UI', 'Segoe UI', system-ui, sans-serif;
  font-size: clamp(14px, 1.15vw, 17px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--po-accent);
  text-align: center;
  text-wrap: balance;
  overflow-wrap: anywhere;
  min-height: 3.9em;              /* reserva alto: el mensaje rota sin saltos */
  display: flex; align-items: flex-end; justify-content: center;
  opacity: 0;
  transition: opacity .4s ease;
}
.po-guide-content .pq-hop canvas,
.po-guide-content .pq-hop svg { display: block; width: 220px; height: auto; aspect-ratio: 142 / 190; }
/* Pausar y cerrar: agrupados junto al muñeco, arriba a la derecha del panel,
   con el mismo aspecto de botón (borde de 2px, sin redondear) que el resto
   del sitio (idiomas, Entrar, pestaña de la guía). A 320px de ancho solo
   queda el de cerrar (ver media query): cerrar también detiene la
   rotación, así que sigue cumpliendo WCAG 2.2.2 con un único control. */
.po-guide-actions {
  align-self: flex-end;
  display: flex;
  gap: 6px;
  padding: 6px 6px 0;
}
.po-guide-action {
  min-width: 40px;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--po-accent);
  border-radius: 0;
  background: #fff;
  color: var(--po-accent);
  cursor: pointer;
  padding: 0;
}
.po-guide-action-icon { font-size: 17px; font-weight: 800; line-height: 1; }
.po-guide-close .po-guide-action-icon { font-size: 22px; font-weight: 400; }
.po-guide-action:hover { background: var(--po-accent); color: #fff; }
.po-guide-action:focus-visible { outline: 3px solid var(--po-accent); outline-offset: 3px; }
/* El muñeco y su mensaje son decorativos (aria-hidden en el marcado);
   solo respira, sin ser un botón. */
.pq-hop { display: inline-block; line-height: 0; transform-origin: 50% 100%; animation: poBreathe 3.8s ease-in-out infinite; }
.pq-hop svg { overflow: visible; }
.po-guide-panel.is-paused .pq-hop { animation-play-state: paused; }
@keyframes poBreathe {
  0%, 100% { transform: translateY(0) scaleY(1); }
  50%      { transform: translateY(-3px) scaleY(1.025); }
}
/* muñeco COMPLETAMENTE responsive: el buffer 3D se pinta a 142×190×DPR y el
   tamaño en pantalla lo fija el CSS (escala con el viewport, con topes) */
.pq-hop canvas,
.pq-hop svg {
  display: block;
  width: clamp(180px, 16vw, 240px);
  height: auto;
  aspect-ratio: 142 / 190;
}
/* texto del monigote: SIN nada alrededor (ni caja ni círculo), en negrita,
   color del idioma, pegado al monigote a la altura de la boca */
.po-quest-bubble {
  flex: 1 1 18ch;
  inline-size: 18ch;
  min-width: 0;
  max-inline-size: 18ch;                  /* mensajes equilibrados en 3-4 líneas */
  margin-bottom: clamp(148px, 17vw, 216px);
  font-family: 'Leelawadee', 'Leelawadee UI', 'Segoe UI', system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(14px, 1.2vw, 18.5px);
  line-height: 1.35;
  color: var(--po-accent);
  text-align: right;
  white-space: normal;
  overflow-wrap: normal;
  text-wrap: balance;
  opacity: 0;
  transition: opacity .4s ease;
}
/* En anchos estrechos, guía y mensaje vuelven al flujo: quedan completos
   después del contenido y antes del pie, sin tapar nunca los logos. */
@media (max-width: 1120px) {
  .portada { overflow-x: hidden; overflow-y: auto; }
  .po-guide {
    position: relative;
    inset: auto;
    align-self: center;
    width: min(calc(100% - 24px), 460px);
    max-width: none;
    margin: 8px auto 12px;
    gap: 0;
    justify-content: center;
  }
  .po-guide-tab { flex: 0 0 64px; }
  .po-guide-panel { flex: 0 1 250px; width: auto; min-width: 0; max-width: 250px; }
  .po-guide-content .pq-hop canvas,
  .po-guide-content .pq-hop svg { width: 190px; }
  .po-quest-stage { width: 190px; }
  .po-quest-stage .po-quest-bubble { font-size: clamp(14px, 2vw, 17px); }
  .po-footer { flex-direction: column; justify-content: center; gap: 14px; padding: 12px 18px 16px; }
  .po-foot-left { width: 100%; justify-content: center; }
  .po-credits { max-width: 100%; justify-content: center; flex-wrap: wrap; text-align: center; }
}

@media (max-width: 430px) {
  .po-guide { width: calc(100% - 16px); margin-inline: 8px; }
  .po-guide-tab, .po-guide-tab-plus, .po-guide-tab-close { width: 56px; flex-basis: 56px; }
  .po-guide-panel { flex: 1 1 auto; width: auto; max-width: calc(100% - 56px); padding: 0; }
  .po-guide-content { gap: 8px; }
  .po-guide-content .pq-hop canvas,
  .po-guide-content .pq-hop svg { width: min(52vw, 170px); }
  .po-quest-stage { width: min(52vw, 170px); }
  .po-quest-stage .po-quest-bubble { font-size: clamp(13px, 3.6vw, 16px); }
}
/* Ancho mínimo de referencia (320px): un solo botón junto al muñeco. Cerrar
   también detiene la rotación de mensajes, así que el control que queda
   sigue cumpliendo WCAG 2.2.2 (pausar, detener u ocultar). */
@media (max-width: 320px) {
  .po-guide-pause { display: none; }
}
@media (prefers-reduced-motion: reduce) { .pq-hop { animation: none !important; } }

/* ── Pie: logos a la izquierda, créditos naider a la derecha ───────────────── */
.po-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: nowrap;                /* los créditos nunca caen a otra línea */
  padding: 14px clamp(24px, 3vw, 48px) 20px;
}
.po-foot-left {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.8vw, 46px);
  flex-wrap: wrap;
}
.po-foot-left a,
.po-credits a {
  min-width: 44px;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
/* Logo del Ayuntamiento (abajo-izquierda): el DIBUJO visible un 30 % más
   grande que las franjas de su derecha. El PNG lleva un 30 % de aire
   transparente (dibujo = 70 % del alto), así que la caja va a 1.3/0.7 = 1.86×
   las franjas para que lo VISIBLE quede al 130 % exacto. */
.po-foot-ayto img { display: block; height: clamp(96px, 13vh, 150px); width: auto; margin: -14px 0; }
.po-foot-left img { display: block; }
.po-foot-left a:not(.po-foot-ayto) img,
.po-foot-left span img { height: clamp(32px, 4.2vh, 48px); width: auto; }
.po-credits {
  display: flex;
  align-items: center;
  align-self: center;
  gap: 12px;
  flex-shrink: 0;                   /* anclado a la derecha, centrado en su fila */
  font-family: 'Leelawadee UI Semilight', 'Leelawadee', 'Leelawadee UI', 'Segoe UI', sans-serif;
  font-size: clamp(13px, 1vw, 15.5px);
  font-weight: 300;                 /* fina */
  color: rgba(26, 26, 24, 0.72);
}
.po-credits img { display: block; width: clamp(112px, 10vw, 156px); height: auto; }

/* foco visible accesible */
.portada :focus-visible {
  outline: 3px solid var(--po-accent);
  outline-offset: 3px;
}

@keyframes poFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}
/* ── Responsive ────────────────────────────────────────────────────────────── */
/* Ventanas BAJAS (portátiles, navegador con barras): compactar en vertical
   para que la portada quepa SIEMPRE entera, sin scroll ni cortes */
@media (min-width: 761px) and (max-height: 880px) {
  .po-brand { padding-top: 12px; }
  .po-logo-vg2030 { width: min(clamp(290px, 27vw, 410px), 62vh); height: min(clamp(118px, 11vw, 160px), 25vh); }
  .po-main { padding-top: 6px; padding-bottom: 6px; gap: clamp(10px, 1.8vh, 18px); }
  .po-title { font-size: clamp(26px, 3vw, 44px); }
  .po-desc { font-size: clamp(14px, 1.35vw, 19px); max-width: 1100px; }
  .po-managed { font-size: clamp(13px, 1.1vw, 16px); margin-top: -5px; }
  .po-portals { gap: clamp(14px, 2vw, 24px); padding-bottom: 0; }
  .po-observatorio-access { gap: 16px; }
  .po-observatorio-logo { width: clamp(210px, 20vw, 300px); }
  .po-enter { padding-top: 10px; padding-bottom: 10px; }
  .po-participa-wrap { margin: 0 auto; }
  .po-plogo { gap: 0; }
  .pl-word { font-size: clamp(21px, 2vw, 32px); }
  .pl-eyebrow, .pl-tagline { font-size: clamp(8px, .7vw, 10px); }
  .pl-evo { width: clamp(46px, 8vh, 58px); }
  .pl-evo-stage svg { width: 100%; height: auto; }
  .po-footer { padding-top: 8px; padding-bottom: 12px; }
  .po-foot-ayto img { height: clamp(84px, 12vh, 120px); margin: -16px 0; }
  .po-foot-left a:not(.po-foot-ayto) img,
  .po-foot-left span img { height: clamp(28px, 3.8vh, 38px); }
}

@media (max-width: 760px) {
  .portada { min-height: 100dvh; overflow-x: hidden; overflow-y: auto; }
  /* Idiomas y marca ocupan filas distintas: a 200 % de zoom y en móvil
     nunca pueden invadirse aunque el texto o el logo crezcan. */
  .po-langs {
    position: relative;
    inset: auto;
    align-self: center;
    justify-content: center;
    margin: 12px auto 6px;
    padding: 0;
  }
  .po-brand { padding: 4px 16px 2px; }
  .po-logo-vg2030 { width: min(360px, 92vw); height: min(150px, 38vw); }
  .po-main { flex: 0 0 auto; padding: 14px 18px 18px; gap: 14px; }
  .po-title { max-width: 100%; font-size: clamp(26px, 7.5vw, 34px); line-height: 1.12; overflow-wrap: anywhere; }
  .po-desc { max-width: 100%; font-size: clamp(15px, 4.2vw, 18px); line-height: 1.5; }
  .po-managed { max-width: 100%; margin-top: -2px; font-size: clamp(14px, 3.9vw, 16px); }
  .po-portals { grid-template-columns: 1fr; gap: 14px; padding-bottom: 0; }
  .po-observatorio-access { gap: 18px; padding-inline: 16px; justify-self: center; min-height: 220px; }
  .po-observatorio-logo { width: min(260px, 72vw); }
  .po-enter { width: min(100%, 420px); max-width: 420px; white-space: normal; }
  .po-participa-wrap { margin: 0 auto; justify-self: center; }
  .po-plogo { max-width: 100%; min-height: 220px; padding-inline: 16px; }
  .po-destination-enter { margin-bottom: 30px; }
  .pl-word { font-size: clamp(23px, 7.5vw, 30px); white-space: nowrap; }
  .pl-eyebrow, .pl-tagline { max-width: 96vw; font-size: clamp(8px, 2.6vw, 10px); text-wrap: balance; }
        /* en pantallas estrechas, sin ambulantes */
  .po-footer { flex-direction: column; justify-content: center; gap: 16px; padding: 12px 18px 16px; }
  .po-foot-left { justify-content: center; gap: clamp(10px, 4vw, 18px); }
  .po-credits { justify-content: center; flex-wrap: wrap; text-align: center; }

  /* La etiqueta del logo superior pasa debajo y centrada; a la derecha se
     saldría del viewport en los anchos de la captura. */
  .po-brand .po-tt--right::after {
    left: 50%; right: auto; top: calc(100% + 10px); bottom: auto;
    max-width: min(260px, calc(100vw - 28px));
    transform: translateX(-50%) translateY(4px);
  }
  .po-brand .po-tt--right::before {
    left: 50%; top: calc(100% + 5px); bottom: auto;
    transform: translateX(-50%) rotate(45deg);
  }
  .po-brand .po-tt--right:hover::after,
  .po-brand .po-tt--right:focus-visible::after { transform: translateX(-50%) translateY(0); }
  .po-brand .po-tt--right:hover::before,
  .po-brand .po-tt--right:focus-visible::before { transform: translateX(-50%) rotate(45deg); }
}

@media (max-width: 430px) {
  .po-main { padding-inline: 14px; gap: 12px; }
  .po-title { font-size: clamp(25px, 8.2vw, 30px); line-height: 1.1; }
  .po-desc { font-size: clamp(15px, 4.7vw, 17px); line-height: 1.5; }
  .po-managed { font-size: clamp(14px, 4.2vw, 16px); }
  .po-enter { width: 100%; padding: 12px 16px; }
  .po-observatorio-access { width: 100%; padding-inline: 12px; }
  .po-participa-wrap { width: 100%; margin: 0; }
  .po-plogo { width: 100%; padding-inline: 12px; }
  .pl-word { font-size: clamp(23px, 7.5vw, 29px); }
  .pl-eyebrow, .pl-tagline { font-size: clamp(8px, 2.7vw, 10px); letter-spacing: .18em; }
  .po-footer { padding-inline: 12px; }
  .po-foot-left { gap: 12px; }
  .po-foot-ayto img { height: clamp(80px, 28vw, 96px); }
  .po-foot-left a:not(.po-foot-ayto) img,
  .po-foot-left span img { height: clamp(26px, 9vw, 34px); }
  .po-credits { gap: 8px; font-size: 13px; }
}

/* Zoom alto o ventana baja: el contenido puede desplazarse y la guía deja
   de flotar sobre él. Intentar comprimirlo todo sería peor para accesibilidad. */
@media (min-width: 761px) and (max-height: 700px) {
  .portada { overflow-x: hidden; overflow-y: auto; }
  .po-main { flex: 0 0 auto; justify-content: flex-start; }
  .po-guide {
    position: relative;
    inset: auto;
    align-self: flex-end;
    width: calc(100% - 24px);
    max-width: none;
    margin: 8px 12px 12px;
    justify-content: flex-start;
  }
  .po-guide-tab { flex: 0 0 64px; }
  .po-guide-panel { flex: 0 1 250px; width: auto; min-width: 0; }
  .po-footer { margin-top: auto; }
  .pl-evo { width: clamp(46px, 8vh, 58px); }
  .pl-evo-stage svg { width: 100%; height: auto; }
}

/* ── Monigote PARTICIPA: CRECE cobrando color al cargar la portada ────────────
   Relato: aparece pequeño y en gris (idea) y crece hasta su forma y color
   plenos (la ciudad 2030 que se hace realidad). Brota desde el suelo
   (transform-origin abajo). Una sola pieza, sin tocar la estructura del SVG.
   Solo el logo de la portada (no los caminantes .po-scene ni Participa). */
.po-plogo .pl-mascot {
  display: inline-block;
  transform-origin: 50% 100%;
  animation: mascotGrow 1.15s cubic-bezier(.18,.7,.24,1) both;
}
@keyframes mascotGrow {
  0%   { opacity: 0; transform: scale(.18) translateY(10%); filter: grayscale(1) brightness(1.25); }
  35%  { opacity: 1; }
  70%  { filter: grayscale(.35) brightness(1.05); }
  100% { opacity: 1; transform: scale(1) translateY(0); filter: none; }
}

/* ── Tira de la ciudad de PARTICIPA ──
   Tira de 5:1 en la base de la página, sin cielo, dormida. Su marcado (dos capas
   por zona, dormida siempre y encendida detrás a opacity:0) lo pone participa.css;
   esta hoja decide cuándo se ve la capa encendida: al elegir PARTICIPA en el
   selector de destino (.is-on, ver updatePortalSelection() en portada.js), con un
   fundido de 1 s que va y vuelve igual en los dos sentidos. */
.po-city-strip{
  width:100%;max-width:1140px;margin:18px auto 0;aspect-ratio:5/1;max-height:230px;
  background:transparent;overflow:hidden;
}
/* en pantallas anchas la pestaña de la guía queda fija en el borde derecho: la tira le deja sitio */
@media (min-width:701px){
  .po-city-strip{max-width:min(1140px, calc(100% - 192px))}
}
@media (max-width:700px){
  .po-city-strip{aspect-ratio:2/1;max-height:260px}
}
/* en una pantalla baja, al elegir PARTICIPA la página lleva la tarjeta arriba (poVerTira, portada.js):
   este margen la deja entera a la vista, con su foco */
.po-portal-choice{scroll-margin-top:12px}
.po-city-strip .pt4t-shot{display:block;width:100%;height:100%}
.po-city-strip .pt4-lit{transition:opacity 1s ease}
.po-city-strip.is-on .pt4-lit{opacity:1}
@media (prefers-reduced-motion: reduce){
  .po-city-strip .pt4-lit{transition:none}
}

/* ── Pantallas GRANDES: NO escalar a lo gigante (decisión): los clamp
   base ya crecen un poco con vw y se quedan capados; a partir de 1900×1200
   todo entra igual, con aire, y sin scroll. (Se retiraron las dos media
   queries que multiplicaban tamaños en ≥2000px/≥2560px.) */

/* Sin movimiento: fuera personajes ambulantes; el lockup queda estático */
@media (prefers-reduced-motion: reduce) {
  .po-title, .po-desc, .po-enter, .po-observatorio-access, .po-plogo, .po-logo-vg2030 { animation: none !important; }
  .po-plogo .pl-mascot { animation: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
  .pl-evo-stage { animation: none !important; opacity: 0 !important; transform: none !important; }
  .pl-evo-stage--5 { opacity: 1 !important; }
  .pl-motion-toggle { display: none; }
  
  .po-observatorio-access:hover, .po-lang:hover, .po-plogo:hover,
  .po-observatorio-access:focus-visible, .po-plogo:focus-visible { transform: none !important; }
}

/* Escritorio con altura suficiente: la guía flota en la esquina inferior derecha
   de la ventana (mismo right/bottom), así su pestaña se ve siempre en la primera
   pantalla aunque la tira de la ciudad alargue la portada. En anchos o alturas
   menores sigue en el flujo, como fijan las reglas de más arriba. */
@media (min-width: 1121px) and (min-height: 701px) {
  .po-guide { position: fixed; }
}
