/*
 * Localização (footer.php): botão "Tour 360° pelo campus" e o modal com o Google Street View.
 * O modal é um <dialog> nativo (Esc fecha e o foco fica preso nele); o iframe só recebe o src ao abrir
 * (js/localizacao.js). Cores por extenso: este arquivo não depende dos tokens --uh-* das outras folhas.
 */

/* ---- Botão: pílula contornada, ao lado de "Como chegar" ---- */
#location-section.localizacao-v2 .localizacao-v2__tour {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 24px;
  border: 1.5px solid #120363;
  border-radius: 999px;
  background: #fff;
  color: #120363;
  font-family: "Josefin Sans", sans-serif;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

#location-section.localizacao-v2 .localizacao-v2__tour i {
  color: #120363;
  transition: color 0.2s ease;
}

#location-section.localizacao-v2 .localizacao-v2__tour:hover,
#location-section.localizacao-v2 .localizacao-v2__tour:focus-visible {
  background: #120363;
  color: #fff;
}

#location-section.localizacao-v2 .localizacao-v2__tour:hover i,
#location-section.localizacao-v2 .localizacao-v2__tour:focus-visible i {
  color: #ffcf00;
}

#location-section.localizacao-v2 .localizacao-v2__tour:focus-visible {
  outline: 3px solid #120363;
  outline-offset: 3px;
}

/* ---- Modal ---- */
.streetview-modal {
  width: min(1100px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  padding: 20px;
  border: 0;
  border-radius: 24px;
  background: #fff;
  color: #1e1b3a;
  font-family: "Josefin Sans", sans-serif;
  box-shadow: 0 32px 80px -24px rgba(28, 26, 74, 0.5);
  overflow: hidden;
}

.streetview-modal::backdrop {
  background: rgba(28, 26, 74, 0.72);
  backdrop-filter: blur(3px);
}

.streetview-modal[open] {
  display: flex;
  flex-direction: column;
  gap: 14px;
  animation: streetview-entrada 0.22s ease-out;
}

@keyframes streetview-entrada {
  from {
    opacity: 0;
    transform: scale(0.98);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.streetview-modal__topo {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 4px 0;
}

.streetview-modal__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  color: #120363;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.streetview-modal__eyebrow::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ffcf00;
  box-shadow: 0 0 0 3px rgba(255, 207, 0, 0.25);
}

.streetview-modal .streetview-modal__titulo {
  margin: 0;
  color: #120363;
  font-family: "Josefin Sans", sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

.streetview-modal__fechar {
  display: inline-grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f1effa;
  color: #120363;
  font-size: 18px;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.streetview-modal__fechar:hover,
.streetview-modal__fechar:focus-visible {
  background: #120363;
  color: #fff;
}

.streetview-modal__fechar:focus-visible {
  outline: 3px solid #120363;
  outline-offset: 3px;
}

/* Quadro 16:9 limitado pela altura da tela; o spinner fica atrás do iframe até ele carregar. */
.streetview-modal__quadro {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 190px);
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(180deg, #25225e 0%, #1c1a4a 100%);
}

.streetview-modal__quadro iframe {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.streetview-modal__carregando {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffcf00;
  font-size: 32px;
}

.streetview-modal__dica {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0 4px 2px;
  color: #5b5876;
  font-size: 14px;
}

.streetview-modal__dica i {
  color: #120363;
}

/* Celular: tela cheia e quadro mais alto (retrato). */
@media (max-width: 575.98px) {
  .streetview-modal {
    width: 100vw;
    max-height: 100dvh;
    height: 100dvh;
    padding: 16px;
    border-radius: 0;
  }

  .streetview-modal__quadro {
    flex: 1 1 auto;
    aspect-ratio: auto;
    max-height: none;
  }

  .streetview-modal .streetview-modal__titulo {
    font-size: 19px;
  }
}

/* Página não rola por trás do modal. */
html:has(.streetview-modal[open]) {
  overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
  .streetview-modal[open] {
    animation: none;
  }

  #location-section.localizacao-v2 .localizacao-v2__tour,
  #location-section.localizacao-v2 .localizacao-v2__tour i,
  .streetview-modal__fechar {
    transition: none;
  }
}
