/* Wanga, the guide (Story AV.1). Self-contained: brand tokens fall back to the
   Mozambique palette when the global design tokens (--mz-*) are not defined. */
.guia {
  --guia-verde: var(--mz-green-700, #007168);
  --guia-amarelo: var(--mz-yellow-400, #FCE100);
  --guia-vermelho: var(--mz-red-600, #D21034);
  /* own colours, light and dark: independent of the global tokens, contrast-tested */
  --guia-bolha-bg: #FFFFFF;
  --guia-vidro: linear-gradient(155deg, rgb(255 255 255 / 0.86), rgb(255 255 255 / 0.66));
  --guia-bolha-texto: #1F2937;
  --guia-nome: #007168; /* 5.9:1 on white */
  --guia-chao: rgb(0 113 104 / 0.14);
  --guia-tam: 140px;
  display: flex;
  align-items: flex-end;
  gap: 0.75rem;
  margin: 1rem 0;
  max-width: 36rem;
}
[data-theme="dark"] .guia {
  --guia-nome: #6EE0D2;
  --guia-bolha-bg: #1F2937;
  --guia-vidro: linear-gradient(155deg, rgb(31 41 55 / 0.88), rgb(17 24 39 / 0.74));
  --guia-bolha-texto: #F9FAFB;
  --guia-chao: rgb(110 224 210 / 0.16);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .guia {
    --guia-nome: #6EE0D2;
    --guia-bolha-bg: #1F2937;
  --guia-vidro: linear-gradient(155deg, rgb(31 41 55 / 0.88), rgb(17 24 39 / 0.74));
    --guia-bolha-texto: #F9FAFB;
    --guia-chao: rgb(110 224 210 / 0.16);
  }
}
.guia--sm { --guia-tam: 96px; }
.guia--lg { --guia-tam: 220px; }
.guia--direita { flex-direction: row-reverse; }

.guia__palco {
  position: relative;
  flex: 0 0 var(--guia-tam);
  width: var(--guia-tam);
  height: var(--guia-tam);
  /* R.3: no floor disc (the poster fades out at the knees) */
  background: radial-gradient(ellipse 0% 0% at 50% 100%, var(--guia-chao) 0 98%, transparent 100%);
}
.guia__palco picture,
.guia__poster,
.guia__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}
.guia__canvas { pointer-events: none; }
.guia--3d .guia__poster { opacity: 0; }

.guia__bolha {
  position: relative;
  flex: 1 1 auto;
  margin-bottom: calc(var(--guia-tam) * 0.35);
  padding: 0.75rem 1rem 0.85rem;
  border-radius: 1rem 1rem 1rem 0.3rem;
  border-top: 0;
  background: var(--guia-bolha-bg);
  color: var(--guia-bolha-texto);
  font-size: 0.95rem;
  line-height: 1.45;
  /* R.3: liquid glass (was clay) — translucent pane, specular rim, a thin yellow light at the top */
  background:
    linear-gradient(180deg, rgb(252 225 0 / 0.9) 0 3px, transparent 3px),
    radial-gradient(130% 70% at 50% -30%, rgb(255 255 255 / 0.55), transparent 62%),
    var(--guia-vidro);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.9),
    inset 0 0 0 1px rgb(255 255 255 / 0.35),
    0 0 0 1px rgb(20 40 36 / 0.1),
    0 14px 28px -16px rgb(0 40 36 / 0.45);
}
.guia--direita .guia__bolha { border-radius: 1rem 1rem 0.3rem 1rem; }
.guia__bolha::before {
  content: "";
  position: absolute;
  bottom: 0.6rem;
  left: -0.5rem;
  border: 0.5rem solid transparent;
  border-left: 0;
  border-right-color: var(--guia-bolha-bg);
}
.guia--direita .guia__bolha::before {
  left: auto;
  right: -0.5rem;
  border-right: 0;
  border-left: 0.5rem solid var(--guia-bolha-bg);
}
.guia__nome {
  display: block;
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  color: var(--guia-nome);
}
.guia__texto { display: block; }
/* N.1: closable bubble (button shown by guia.js); hidden figures stay hidden */
.guia[hidden], .guia__fechar[hidden] { display: none; }
[data-guia-fecho] .guia__bolha { padding-right: 2.75rem; }
.guia__fechar {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--guia-bolha-texto);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}
.guia__fechar:focus-visible { outline: 3px solid var(--guia-nome); outline-offset: -3px; }

/* 360 px phones: the large guide stacks above its bubble */
@media (max-width: 420px) {
  .guia--lg { flex-direction: column; align-items: center; --guia-tam: 180px; }
  .guia--lg .guia__bolha { margin-bottom: 0; border-radius: 1.25rem; }
  .guia--lg .guia__bolha::before {
    left: calc(50% - 0.5rem);
    top: -0.85rem;
    bottom: auto;
    border: 0.5rem solid transparent;
    border-top: 0;
    border-bottom-color: var(--guia-amarelo);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .guia__poster { transition: opacity 0.3s ease; }
  /* CT.1: the rendered poster breathes (transform only, from the feet) */
  .guia__poster { transform-origin: 50% 100%; animation: guia-respira 4.2s cubic-bezier(0.45, 0, 0.25, 1) infinite alternate; }
  @keyframes guia-respira {
    from { transform: scale(1, 1); }
    to { transform: scale(1.012, 1.022) translateY(-1px); }
  }
  .guia__bolha { animation: guia-entra 0.35s ease-out both; }
  @keyframes guia-entra {
    from { opacity: 0; transform: translateY(6px) scale(0.98); }
    to { opacity: 1; transform: none; }
  }
}
