:root {
  --ink: #f3f6fb;
  --slate: #aab4c6;
  --slate-dim: #7d879b;
  --blue: #4d7bff;
  --green: #1fe3ac;
  --panel: rgba(255, 255, 255, 0.06);
  --panel-strong: rgba(255, 255, 255, 0.10);
  --border: rgba(255, 255, 255, 0.14);
  --border-soft: rgba(255, 255, 255, 0.08);
  --void: #05070d;

  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", sans-serif;

  --header-h: 64px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

a { color: inherit; text-decoration: none; }

/* ---------- Fundo: foto + véu escuro + linhas neon ---------- */

.bg-photo {
  position: fixed;
  inset: 0;
  z-index: -3;
  background-color: var(--void);
  background-image: url("bg-galaxy.jpg");
  background-image: image-set(
    url("bg-galaxy.webp") type("image/webp") 1x,
    url("bg-galaxy.jpg") type("image/jpeg") 1x
  );
  background-size: cover;
  background-position: center 32%;
  background-repeat: no-repeat;
}

.bg-scrim {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    linear-gradient(180deg, rgba(4, 6, 12, 0.82) 0%, rgba(4, 6, 12, 0.30) 26%, rgba(4, 6, 12, 0.40) 68%, rgba(4, 6, 12, 0.90) 100%);
}

.bg-decor {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  mix-blend-mode: screen;
  opacity: 0.55;
  pointer-events: none;
}

.bg-decor svg {
  width: 100%;
  height: 100%;
}

.curve { opacity: 0.6; }

@media (prefers-reduced-motion: no-preference) {
  .curve-a, .curve-b, .curve-c {
    animation: drift 22s ease-in-out infinite alternate;
  }
  .curve-b { animation-duration: 26s; }
  .curve-c { animation-duration: 30s; }
}

@keyframes drift {
  from { transform: translateY(0); }
  to { transform: translateY(14px); }
}

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(6, 8, 16, 0.55);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border-soft);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
  gap: 16px;
  flex-wrap: wrap;
}

.logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
  opacity: 0.9;
}

.logo span {
  background: linear-gradient(90deg, var(--blue), var(--green));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.logo.small { font-size: 0.92rem; }

/* ---------- Toggle Arts / Videos ---------- */

.toggle-wrap {
  position: relative;
  display: inline-flex;
  padding: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  backdrop-filter: blur(6px);
}

.toggle-pill {
  position: absolute;
  top: 4px;
  left: 4px;
  height: calc(100% - 8px);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--green));
  box-shadow: 0 4px 14px rgba(31, 227, 172, 0.25);
  transition: left 0.35s cubic-bezier(0.65, 0, 0.35, 1), width 0.35s cubic-bezier(0.65, 0, 0.35, 1);
}

@media (prefers-reduced-motion: reduce) {
  .toggle-pill { transition: none; }
}

.toggle-btn {
  position: relative;
  z-index: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
  color: var(--slate);
  padding: 8px 20px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s ease;
}

.toggle-btn.active { color: #061019; }

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

/* ---------- Espaços publicitários ---------- */

.ad-slot {
  margin: 24px 0;
  text-align: center;
  display: flex;
  justify-content: center;
  min-height: 90px;
}

.ad-slot:empty { min-height: 0; margin: 0; }

.ad-slot ins { max-width: 100%; }

/* Anúncio inserido dentro do feed (ocupa a linha inteira da grade) */
.ad-card {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100px;
  margin: 4px 0;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
}

/* ---------- Conteúdo ---------- */

.content-area {
  display: grid;
  min-height: 46vh;
}

.content-panel {
  grid-area: 1 / 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.content-panel.is-active {
  opacity: 1;
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  .content-panel { transition: none; }
}

.empty-state {
  height: 100%;
  min-height: 46vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 48px 16px;
}

.empty-icon {
  width: 72px;
  height: 72px;
  margin-bottom: 20px;
  opacity: 0.85;
}

.empty-state h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  margin: 0 0 8px;
  color: var(--ink);
}

.empty-state p {
  color: var(--slate);
  font-size: 0.98rem;
  max-width: 34ch;
  margin: 0;
}

/* ---------- Grade de mídia (fotos e vídeos publicados) ---------- */
/* A maioria das fotos é vertical: o enquadramento do card também é
   vertical, e no celular sempre ficam duas colunas lado a lado. */

.media-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 8px 0 40px;
}

@media (min-width: 620px) {
  .media-grid { gap: 16px; }
}

@media (min-width: 760px) {
  .media-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; }
}

@media (min-width: 1040px) {
  .media-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
}

.media-card {
  display: flex;
  flex-direction: column;
  border-radius: 16px;
}

.media-thumb {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  overflow: hidden;
  background: var(--panel-strong);
  border: 1px solid var(--border-soft);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.media-card:hover .media-thumb {
  transform: translateY(-3px);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.45);
  border-color: var(--border);
}

.media-thumb img,
.media-thumb video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none; /* o clique é tratado pelo card, não pelos controles nativos */
}

.media-thumb.is-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

/* Ícone de play sobre a miniatura de vídeo (a miniatura mostra uma
   fotinha do próprio vídeo por baixo, nunca fica preta) */
.media-thumb.is-video::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(6, 9, 16, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(2px);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M8 5v14l11-7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 54% 50%, center;
  background-size: 20px 20px;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.media-card:hover .media-thumb.is-video::after {
  transform: scale(1.08);
}

/* Enquanto a miniatura do vídeo ainda não carregou o quadro, mostra um
   leve brilho pulsante em vez de tela preta */
.media-thumb.is-video.is-loading {
  animation: thumb-pulse 1.6s ease-in-out infinite;
}

@keyframes thumb-pulse {
  0%, 100% { background-color: var(--panel-strong); }
  50% { background-color: rgba(255, 255, 255, 0.14); }
}

/* Elemento invisível que dispara o carregamento do próximo lote do feed infinito */
.feed-sentinela {
  grid-column: 1 / -1;
  height: 1px;
}

/* ---------- Feed de vídeos em tela cheia (rolagem vertical, um por vez) ---------- */
/* A aba de vídeos sai do grid empilhado de cima (que é pensado pra grade de
   fotos) e vira sua própria camada de tela cheia, ocupando tudo que sobra
   abaixo do header. Assim o vídeo pode ficar bem grande sem empurrar a
   altura da página quando a aba de fotos está sendo exibida. */

#videos.content-panel {
  grid-area: auto;
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
}

#videos .panel-target {
  height: 100%;
}

.video-feed {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
}

.video-slide {
  position: relative;
  height: 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--void);
  overflow: hidden;
}

.video-slide-ad {
  background: var(--panel);
  flex-direction: column;
  justify-content: space-between;
  align-items: stretch;
  padding: 28px 16px;
  gap: 16px;
}

.video-slide-ad .ad-card {
  margin: 0;
}

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

@media (min-width: 680px) {
  /* Em telas largas o vídeo vertical fica centralizado em vez de esticado */
  .video-player { object-fit: contain; }
}

.video-btn-som {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: rgba(6, 9, 16, 0.55);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.video-icone-pausa {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(6, 9, 16, 0.45);
  color: #fff;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.15s ease;
  pointer-events: none;
}

.video-slide.is-pausado .video-icone-pausa { opacity: 1; }

.feed-sentinela-video { height: 1px; }

/* ---------- Visualizador em tela cheia (lightbox) ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 4, 8, 0.96);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-content {
  max-width: 96vw;
  max-height: 92vh;
  display: flex;
}

.lightbox-content img,
.lightbox-content video {
  max-width: 96vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  display: block;
  border-radius: 6px;
}

.lightbox-content iframe {
  width: min(96vw, 1100px);
  height: min(80vh, 620px);
  border: 0;
  border-radius: 6px;
}

.lightbox-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white, #fff);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  z-index: 1001;
  backdrop-filter: blur(6px);
}

.lightbox-close:hover { background: rgba(255, 255, 255, 0.18); }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 26px 0 40px;
  margin-top: 24px;
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.site-footer p {
  color: var(--slate-dim);
  font-size: 0.85rem;
  margin: 0;
}

@media (max-width: 560px) {
  .header-inner { justify-content: center; text-align: center; }
  .site-footer .container { justify-content: center; text-align: center; }
}
