:root {
  --bg: #0a0d12;
  --panel: #12161f;
  --border: #232838;
  --text: #e8eaf0;
  --text-dim: #8a93a8;
  --live: #ff3b3b;
  --live-green: #17a34a;
  --focus: #4d7cff;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100%;
}

.topbar {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-wrap: wrap;
  gap: 28px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: rgba(10, 13, 18, 0.92);
  backdrop-filter: blur(6px);
  z-index: 20;
  transition: transform 0.25s ease;
}

/* Some ao rolar para baixo, reaparece ao rolar para cima (JS em app.js) -
   libera espaco de tela, principalmente no mobile. */
.topbar.topbar-hidden {
  transform: translateY(-100%);
}

.topbar-slot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-width: 0;
}

.topbar .logo {
  height: 90px;
  width: auto;
  max-width: 260px;
  object-fit: contain;
  display: block;
  /* sombra/blur branco bem sutil, dando um leve halo nas logos sobre o
     fundo escuro */
  filter: drop-shadow(0 0 6px rgba(255, 255, 255, 0.22))
          drop-shadow(0 0 14px rgba(255, 255, 255, 0.08));
  transition: transform 0.2s ease, filter 0.2s ease;
}

.topbar-slot a:hover .logo,
.topbar-slot a:focus-visible .logo {
  transform: translateY(-3px) scale(1.05);
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.35))
          drop-shadow(0 0 22px rgba(255, 255, 255, 0.15));
}

/* Slot "Em parceria com" (Argos): discreto, menor que as duas logos
   institucionais, para deixar claro que e o parceiro tecnico, nao um dos
   dois orgaos donos das cameras. */
.partner-credit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.partner-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-dim);
}


.page-heading {
  text-align: center;
  padding: 18px 24px 0;
}

.page-heading h1 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  color: var(--text-dim);
}

@media (max-width: 900px) {
  .topbar { gap: 14px; }
  .topbar .logo { height: 56px; }
}

/* Mobile: mantem tudo em uma linha compacta em vez de empilhar as tres
   logos - reduz bastante a altura ocupada, alem do auto-ocultar ao rolar. */
@media (max-width: 640px) {
  .topbar {
    padding: 10px 12px;
    gap: 8px;
    justify-content: space-between;
  }
  .topbar .logo { height: 32px; max-width: 120px; }
  .partner-label { display: none; }
  .partner-credit { gap: 0; }
  .page-heading { padding: 10px 16px 0; }
  .page-heading h1 { font-size: 12px; }
}

.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

.tile {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.tile:hover,
.tile:focus-visible {
  border-color: var(--focus);
  transform: translateY(-2px);
}

.tile:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  background: #000;
}

.badge {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px 4px 8px;
  border-radius: 20px;
  background: var(--live-green);
  color: #ffffff;
  letter-spacing: 0.03em;
  animation: badge-glow 1.8s ease-out infinite;
}

.badge-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: #ffffff;
}

@keyframes badge-glow {
  0% { box-shadow: 0 0 0 0 rgba(23, 163, 74, 0.6); }
  70% { box-shadow: 0 0 0 9px rgba(23, 163, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(23, 163, 74, 0); }
}

.label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 12px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--live);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.25; }
}


@media (max-width: 760px) {
  .grid {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 14px;
  }
  .page-heading h1 { font-size: 14px; }
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal[hidden] { display: none; }

.modal-content {
  width: 100%;
  max-width: 1200px;
  padding: 0 64px;
}

.modal-video-wrap {
  position: relative;
  border-radius: 6px;
  overflow: hidden;
}

.modal-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  display: block;
}

.modal-video-wrap .label {
  font-size: 15px;
  padding: 14px 16px;
}

/* Tela cheia de verdade (Fullscreen API) pedida no proprio wrapper, nao
   no <video>, para que o badge/label continuem visiveis por cima -
   ver o intercept do duplo-clique em app.js. */
.modal-video-wrap:fullscreen,
.modal-video-wrap:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  border-radius: 0;
}

.modal-video-wrap:fullscreen .modal-video,
.modal-video-wrap:-webkit-full-screen .modal-video {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
}

.modal-close,
.modal-nav {
  position: absolute;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover,
.modal-nav:hover {
  background: rgba(255, 255, 255, 0.14);
}

.modal-close {
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  font-size: 22px;
  line-height: 1;
}

.modal-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  font-size: 28px;
}

.modal-prev { left: 12px; }
.modal-next { right: 12px; }

@media (max-width: 760px) {
  .modal-content { padding: 0 48px; }
  .modal-nav { width: 40px; height: 40px; font-size: 22px; }
}

@media (max-width: 480px) {
  .modal-content { padding: 0 40px; }
  .modal-nav { width: 34px; height: 34px; font-size: 18px; }
  .modal-prev { left: 4px; }
  .modal-next { right: 4px; }
  .modal-close { top: 10px; right: 10px; width: 34px; height: 34px; font-size: 18px; }
}

/* Rodape */
.site-footer {
  margin-top: 32px;
  border-top: 1px solid var(--border);
  background: var(--panel);
}

.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 24px 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  justify-content: space-between;
}

.footer-brand {
  max-width: 360px;
}

.footer-logo {
  height: 34px;
  width: auto;
  display: block;
  margin-bottom: 14px;
}

.footer-tagline {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
  margin: 0 0 16px;
}

.footer-contact {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 13px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.footer-contact a {
  color: var(--text-dim);
  text-decoration: none;
}

.footer-contact a:hover { color: var(--text); }

.footer-credit {
  max-width: 420px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-dim);
}

.footer-credit a {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding: 16px 24px;
  text-align: center;
}

.footer-bottom p {
  margin: 0;
  font-size: 12px;
  color: var(--text-dim);
}

@media (max-width: 640px) {
  .footer-inner {
    flex-direction: column;
    gap: 24px;
  }
  .footer-brand, .footer-credit { max-width: 100%; }
}
