/* =============================================================
   base.css — reset, escala y elementos comunes.
   Escala: 1rem = 10px cuando el ancho es 1080px.
   Todo el diseño está expresado en rem para conservar las
   proporciones de la pantalla 1080 x 1920.
   ============================================================= */

:root {
  /* Colores de marca, tomados de los logos oficiales de SIATA */
  --bg:            #09202e;
  --bg-sunken:     #061620;
  --bg-raised:     #0e2b3d;
  --accent:        #7cb829;
  --h1-color:      #4C9AD4;
  --m1-color:      #F0A63C;
  --text:          #F2F5F4;
  --text-dim:      #9BB0B8;
  --text-faint:    #61757E;
  --line:          rgba(255, 255, 255, 0.10);

  /* Zonas táctiles: nunca por debajo de 6.4rem (64px a 1080 de ancho) */
  --tap: 6.4rem;

  --header-h: 8rem;
  --radius: 2.4rem;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: calc(100vw / 108);   /* 1rem = 10px a 1080 de ancho */
  -webkit-text-size-adjust: 100%;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
               'Helvetica Neue', Arial, sans-serif;
  color: var(--text);
  /* Kiosco: sin selección, sin rebote, sin menú contextual, sin zoom del navegador */
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

img, svg, video { display: block; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- App ---------- */

#app {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
}

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

.topbar {
  flex: 0 0 auto;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 1.6rem;
  padding: 0 3rem;
  background: var(--bg-sunken);
  border-bottom: 1px solid var(--line);
  z-index: 30;
}

.topbar__brand {
  display: flex;
  align-items: center;
  gap: 2.4rem;
  min-width: 0;
  flex: 1 1 auto;
}

.topbar__logos {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  flex: 0 0 auto;
}

.topbar__logos img {
  height: 4.4rem;
  width: auto;
  max-width: 34rem;
  object-fit: contain;
}

/* El lockup de la Metropolitana es muy horizontal: necesita más ancho
   y menos alto para que se lea */
.topbar__logos img.is-wide {
  width: 24rem;
  height: 5rem;
}

.topbar__titles { min-width: 0; }

.topbar__title {
  margin: 0;
  font-size: 2.6rem;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar__subtitle {
  margin: 0.3rem 0 0;
  font-size: 1.85rem;
  color: var(--text-dim);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Botón de icono (índice): siempre visible en el recorrido */
.topbar__icon {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  justify-content: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--line);
  color: var(--text-dim);
  transition: background 0.13s ease, transform 0.13s ease;
}

.topbar__icon.is-visible { display: flex; }
.topbar__icon:active { transform: scale(0.92); background: rgba(255, 255, 255, 0.16); }
.topbar__icon svg { width: 3rem; height: 3rem; }

/* Botón de inicio: visible en todos los frames del recorrido */
.topbar__home {
  flex: 0 0 auto;
  display: none;
  align-items: center;
  gap: 1.2rem;
  min-height: var(--tap);
  padding: 0 2.8rem;
  border-radius: 999px;
  background: rgba(124, 184, 41, 0.14);
  border: 1px solid rgba(124, 184, 41, 0.35);
  color: var(--accent);
  font-size: 2.2rem;
  font-weight: 600;
  transition: transform 0.13s ease, background 0.13s ease;
}

.topbar__home.is-visible { display: flex; }
.topbar__home:active { transform: scale(0.96); background: rgba(124, 184, 41, 0.26); }
.topbar__home svg { width: 2.6rem; height: 2.6rem; }

/* Botón de retroceso: discreto, pero con área táctil amplia */
.topbar__back {
  flex: 0 0 auto;
  width: var(--tap);
  height: var(--tap);
  margin-left: -1.2rem;
  display: none;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  transition: background 0.15s;
}

.topbar__back.is-visible { display: flex; }
.topbar__back:active { background: rgba(255, 255, 255, 0.16); }
.topbar__back svg { width: 3rem; height: 3rem; }

/* ---------- Contenedor de vistas ---------- */

.views {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.view {
  position: absolute;
  inset: 0;
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.view.is-active {
  visibility: visible;
  opacity: 1;
}

/* ---------- Barra de progreso ---------- */

.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 0.7rem;
  background: rgba(255, 255, 255, 0.07);
  z-index: 40;
  display: none;
}

.progress.is-visible { display: block; }

.progress__bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width 0.28s ease;
}

/* ---------- Puntos indicadores ---------- */

.dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.4rem;
  padding: 2rem 0 0;
}

.dots__item {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.24);
  transition: background 0.2s, transform 0.2s;
}

.dots__item.is-active {
  background: var(--accent);
  transform: scale(1.45);
}

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

/* Sin fondo propio: el lockup conserva su cielo transparente y se apoya
   directo sobre la página. Un color de fondo detrás lo delataba como franja. */
.footer {
  flex: 0 0 auto;
  background: transparent;
  border-top: 1px solid var(--line);
  /* El lockup es muy horizontal: se estira a todo el ancho y la altura sale
     sola de su proporción. El relleno es mínimo para no robarle espacio
     al área de contenido. */
  padding: 0.4rem 0;
}

.footer__inner {
  display: flex;
  align-items: center;
  width: 100%;
}

.footer__logo {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0.9;
}

/* ---------- Utilidades ---------- */

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

/* Placeholder cuando falta un archivo */
.missing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.6rem;
  padding: 6rem 4rem;
  text-align: center;
  color: var(--text-dim);
  background: repeating-linear-gradient(
    45deg, rgba(255,255,255,0.03) 0 4rem, transparent 4rem 8rem
  );
}

.missing__icon { width: 9rem; height: 9rem; opacity: 0.35; }
.missing__name {
  font-size: 2.4rem;
  color: var(--text);
  word-break: break-all;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.missing__hint { font-size: 2.1rem; }

/* ---------- Aviso de pantalla completa ---------- */

.fscue {
  position: fixed;
  right: 3rem;
  /* Por encima del pie y de los puntos de progreso, para no tapar nada */
  bottom: 30rem;
  display: flex;
  align-items: center;
  gap: 1.6rem;
  padding: 1.8rem 2.6rem;
  min-height: var(--tap);
  border-radius: var(--radius);
  background: rgba(6, 22, 32, 0.94);
  border: 1px solid var(--line);
  font-size: 2.2rem;
  z-index: 60;
  display: none;
}

.fscue.is-visible { display: flex; }
.fscue svg { width: 3.2rem; height: 3.2rem; flex: 0 0 auto; }
