/* =============================================
   ZERO GRAU FILMES — base.css
   Variáveis, reset, componentes globais
   ============================================= */

/* ---- CSS Custom Properties ---- */
:root {
  /* ---- Zero Grau Design Tokens ---- */
  --zg-bg:          #0A0A0A;
  --zg-surface:     #141414;
  --zg-surface-2:   #1E1E1E;
  --zg-border:      rgba(255,255,255,0.08);

  --zg-orange:       #F4631E;
  --zg-orange-lt:    #F2854E;
  --zg-orange-dk:    #BA4A14;
  --zg-orange-ghost: rgba(244,99,30,0.15);

  --zg-pink:         #E8457A;
  --zg-pink-lt:      #ED7299;
  --zg-pink-dk:      #B32F5C;
  --zg-pink-ghost:   rgba(232,69,122,0.15);

  --zg-purple:       #7C4DFF;
  --zg-purple-lt:    #A07EFF;
  --zg-purple-ghost: rgba(124,77,255,0.12);

  /* ---- Aliases ---- */
  --accent:      var(--zg-purple);
  --accent-hi:   var(--zg-pink-lt);
  --accent-deep: var(--zg-purple);

  /* ---- Estruturais ---- */
  --bg:        var(--zg-bg);
  --bg-2:      var(--zg-surface);
  --text:      #ffffff;
  --font:      'Inter', sans-serif;
  --header-h:  72px;

  /* Beziers */
  --bez:       cubic-bezier(0.16, 1, 0.3, 1);
  --bez-in:    cubic-bezier(0.4, 0, 1, 1);
  --bez-out:   cubic-bezier(0, 0, 0.2, 1);
  --bez-sharp: cubic-bezier(0.25, 0, 0, 1);
}

/* @property para animar conic-gradient sem transform */
@property --border-angle {
  syntax: '<angle>';
  initial-value: 0deg;
  inherits: false;
}

/* =============================================
   RESET
   ============================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Fundo com gradiente radial fixo — profundidade visual em todas as páginas */
body {
  background:
    radial-gradient(ellipse at 10% 15%, rgba(244, 99, 30, 0.05) 0%, transparent 45%),
    radial-gradient(ellipse at 90% 80%, rgba(186, 74, 20, 0.03) 0%, transparent 45%),
    var(--zg-bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.6;
  overflow-x: hidden;
  cursor: auto;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

img, video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* =============================================
   CURSOR CUSTOMIZADO — lerp via JS
   ============================================= */
#cursor {
  display: none;
}

/* =============================================
   LIQUID GLASS — Base intensificada
   ============================================= */
.liquid-glass {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(32px) saturate(200%) brightness(1.08);
  -webkit-backdrop-filter: blur(32px) saturate(200%) brightness(1.08);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow:
    0 0 0 0.5px rgba(255, 255, 255, 0.04) inset,
    0 12px 40px rgba(0, 0, 0, 0.5),
    0 1px 0 rgba(255, 255, 255, 0.08) inset,
    0 -1px 0 rgba(0, 0, 0, 0.3) inset;
}

/* =============================================
   LOGO SVG
   ============================================= */
.logo {
  display: flex;
  align-items: center;
  padding: 4px 0;
}

.logo-img {
  height: 16px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
}

.footer-logo {
  display: flex;
  align-items: center;
}

.footer-logo .logo-img {
  height: 24px;
  width: auto;
  display: block;
  filter: brightness(0) invert(1);
  opacity: 0.7;
}

/* =============================================
   VIDEO MODAL
   ============================================= */
.video-modal {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--bez);
}

.video-modal.open {
  opacity: 1;
  pointer-events: all;
}

.video-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.93);
  backdrop-filter: blur(28px) saturate(120%);
  -webkit-backdrop-filter: blur(28px) saturate(120%);
  cursor: pointer;
}

.video-modal-inner {
  position: relative;
  z-index: 1;
  width: min(90vw, 1280px);
  aspect-ratio: 16 / 9;
  transform: scale(0.96);
  transition: transform 0.45s var(--bez);
}

.video-modal.open .video-modal-inner {
  transform: scale(1);
}

.video-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  z-index: 10;
  transition:
    background 0.25s var(--bez),
    color      0.25s var(--bez),
    border-color 0.25s var(--bez);
}

.video-modal-close:hover {
  background: rgba(0, 0, 0, 0.8);
  border-color: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.video-modal-frame {
  width: 100%;
  height: 100%;
  border-radius: 4px;
  overflow: hidden;
  box-shadow:
    0 32px 100px rgba(0, 0, 0, 0.85),
    0 0 0 1px rgba(255, 255, 255, 0.07);
}

.video-modal-frame iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Título do modal — fica acima do frame, alinhado à esquerda */
.video-modal-title {
  position: absolute;
  top: -34px;
  left: 0;
  font-family: var(--font);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: rgba(255,255,255,0.85);
  max-width: calc(100% - 56px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Link "abrir em nova aba" e botão de fechar do PDF modal —
   no desktop ficam discretos (só o link no canto direito); no mobile a
   media-query abaixo (≤768px) transforma em par de botões grandes. */
.modal-pdf-link {
  display: none;
  text-align: right;
  margin-top: 10px;
  font-family: monospace;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s ease;
  padding-right: 2px;
}
.modal-pdf-link:hover { color: rgba(255, 255, 255, 0.85); }
.modal-pdf-close-bottom { display: none; }
.modal-pdf-actions { display: contents; }
.video-modal.pdf-mode .modal-pdf-link { display: block; }

/* =============================================
   SCROLL REVEALS — Intersection Observer
   ============================================= */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.75s var(--bez), transform 0.75s var(--bez);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================
   FILM GRID — Compartilhado
   ============================================= */
.film-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  width: 100%;
}

.film-cell {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  cursor: pointer;
  opacity: 0;
  transform: scale(0.97);
  transition:
    opacity   0.75s var(--bez),
    transform 0.75s var(--bez);
}

.film-cell.visible {
  opacity: 1;
  transform: scale(1);
}

/* Background image/gradiente da célula */
.film-cell-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transition: transform 0.7s var(--bez);
  will-change: transform;
}

.film-cell:hover .film-cell-bg { transform: scale(1.05); }

/* Glow de borda colorida no hover */
.film-cell::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(244, 99, 30, 0);
  z-index: 3;
  pointer-events: none;
  transition:
    border-color 0.45s var(--bez),
    box-shadow   0.45s var(--bez);
}

.film-cell:hover::after {
  border-color: transparent;
  box-shadow: none;
}

/* Overlay ancorado no rodapé esquerdo */
.film-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  padding: 20px 24px;
  background:
    linear-gradient(to right, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.2) 40%, transparent 70%),
    linear-gradient(to top, rgba(0,0,0,0.85) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s var(--bez);
  z-index: 2;
}

.film-cell:hover .film-overlay { opacity: 1; }

/* Ícone ↗ — canto superior direito */
.film-icon {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.85);
  font-family: sans-serif;
  font-variant-emoji: text;
}

/* Tag de lançamento — badge flutuante canto superior esquerdo */
.film-launch {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 10;
  transition: none;
  animation: none;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #ffffff;
  font-family: monospace;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 14px;
  border-radius: 999px;
}

/* Badge PDF — compartilhado (index.html + cases.html) */
.film-cell[data-type="pdf"] .film-overlay::after {
  content: 'PDF';
  position: absolute;
  bottom: 12px;
  right: 12px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  padding: 4px 10px;
  background: var(--zg-pink-ghost);
  border: 1px solid rgba(232, 69, 122, 0.35);
  border-radius: 100px;
  color: var(--zg-pink-lt);
  z-index: 3;
}

/* Categoria — linha monospace acima do título */
.film-genre {
  font-family: monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--zg-orange);
  margin-bottom: 5px;
  display: block;
}

/* Título — fonte padrão do projeto (Inter) */
.film-title {
  font-family: var(--font);
  font-size: clamp(1.2rem, 2vw, 1.5rem);
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0;
  text-align: left;
  line-height: 1.2;
  transition: none;
}

/* =============================================
   SECTION TITLES — Compartilhado
   ============================================= */
.section-title {
  font-size: clamp(1.4rem, 2.8vw, 2.1rem);
  font-weight: 300;
  letter-spacing: -0.02em;
  text-transform: none;
  text-align: center;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 48px;
  padding: 80px 48px 0;
  line-height: 1.2;
}

.section-title span   { font-weight: 300; color: rgba(255, 255, 255, 0.35); }
.section-title strong { font-weight: 700; color: rgba(255, 255, 255, 0.82); }

/* =============================================
   PAGE LABEL — cinema.html / cases.html
   ============================================= */
.page-label {
  padding: calc(var(--header-h) + 40px) 48px 48px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

/* =============================================
   RESPONSIVIDADE — Base / Global
   ============================================= */
@media (max-width: 768px) {
  .film-grid { grid-template-columns: 1fr; }

  /* Mobile: cell vira flex column com overlay ancorado ao fundo.
     Cell tem min-height (4:3) mas cresce quando louros expandem. */
  .film-cell {
    aspect-ratio: auto;
    min-height: 75vw;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }
  /* Overlay no fluxo, no fundo do cell. Sem min-height — gradiente
     fica colado ao rodapé e cresce só com o conteúdo. */
  .film-overlay {
    position: relative;
    inset: auto;
    width: 100%;
    min-height: 0;
    z-index: 2;
  }

  /* Setinha ↗ não faz sentido no touch */
  .film-icon { display: none; }

  /* Sem zoom no "hover" (que não acontece em touch) */
  .film-cell:hover .film-cell-bg { transform: none; }

  /* Gradiente compacto SÓ no rodapé do overlay — não invade o miolo
     da imagem. Louros e watch-on (acima) leem com text-shadow. */
  .film-overlay {
    padding: 16px 18px;
    background:
      linear-gradient(to top,
        rgba(0,0,0,0.95) 0%,
        rgba(0,0,0,0.75) 25%,
        rgba(0,0,0,0.3) 55%,
        transparent 100%);
  }
  /* Tudo dentro do overlay no mobile ganha drop-shadow pra legibilidade
     sobre a imagem (área superior do overlay é semi-transparente) */
  .film-cell .film-overlay,
  .film-cell .festival-badges,
  .film-cell .festival-badge,
  .film-cell .watch-on,
  .film-cell .film-title,
  .film-cell .film-genre {
    text-shadow: 0 1px 4px rgba(0,0,0,0.85), 0 0 12px rgba(0,0,0,0.6);
  }
  .film-cell .louro {
    filter: brightness(0) invert(1) drop-shadow(0 1px 3px rgba(0,0,0,0.85));
  }

  /* Estado padrão (mobile sem tap): só imagem + tag LANÇAMENTO/EM PRODUÇÃO.
     1º tap (.is-tapped) → revela overlay completo (equivalente ao hover desktop).
     2º tap → abre modal. */
  .film-overlay {
    opacity: 0;
    transition: opacity 0.3s var(--bez);
  }
  .film-cell.is-tapped .film-overlay { opacity: 1; }
  .film-cell .festival-badges,
  .film-cell .watch-on { display: none; }
  .film-cell.is-tapped .festival-badges { display: flex; }
  .film-cell.is-tapped .watch-on { display: flex; }
  .film-cell.is-tapped .festival-badge { opacity: 0.95; transform: none; transition: none; }

  .film-title { font-size: clamp(1rem, 4.2vw, 1.25rem); }
  .film-genre { font-size: 10px; margin-bottom: 4px; }

  .section-title {
    font-size: clamp(2rem, 9vw, 3rem);
    padding: 0 24px;
    margin-bottom: 40px;
  }

  .page-label { padding: calc(var(--header-h) + 24px) 24px 32px; }

  /* Modal de vídeo (16:9) */
  .video-modal-inner {
    width: 92vw;
    max-height: 90vh;
    border-radius: 12px;
    overflow: visible;
  }

  .video-modal-frame iframe {
    width: 100%;
    height: 56vw;
    min-height: 240px;
  }

  .video-modal-title {
    top: -28px;
    font-size: 0.78rem;
    max-width: calc(100% - 48px);
  }

  .video-modal-close {
    width: 32px;
    height: 32px;
    top: -42px;
    right: 0;
  }

  /* PDF modal mobile — iframe PDF não funciona bem no iOS,
     então mostramos um placeholder + botão grande "Abrir PDF" */
  .video-modal.pdf-mode .video-modal-inner {
    width: 92vw;
    aspect-ratio: unset;
    height: auto;
    max-height: 85vh;
  }
  .video-modal.pdf-mode .video-modal-frame {
    height: 60vh;
    min-height: 320px;
  }
  .video-modal.pdf-mode .video-modal-frame iframe {
    height: 100%;
    min-height: 320px;
  }
  /* Linha de botões no rodapé do PDF modal (mobile): Fechar + Abrir em nova aba */
  .video-modal.pdf-mode .modal-pdf-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px;
    width: 100%;
  }
  .video-modal.pdf-mode .modal-pdf-link,
  .video-modal.pdf-mode .modal-pdf-close-bottom {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 12px 10px;
    font-family: var(--font);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    border-radius: 100px;
    cursor: pointer;
    text-decoration: none;
    line-height: 1;
    margin: 0;
    white-space: nowrap; /* nunca quebra em duas linhas */
  }
  .video-modal.pdf-mode .modal-pdf-link {
    color: #fff;
    background: var(--zg-pink);
    border: none;
    box-shadow: 0 6px 24px rgba(232,69,122,0.35);
  }
  .video-modal.pdf-mode .modal-pdf-close-bottom {
    color: rgba(255,255,255,0.9);
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.25);
  }
  .video-modal.pdf-mode .modal-pdf-link:active { background: var(--zg-pink-lt); }
  .video-modal.pdf-mode .modal-pdf-close-bottom:active { background: rgba(255,255,255,0.18); }

  /* Esconde o X do canto — botão "Fechar" no rodapé já cumpre */
  .video-modal.pdf-mode .video-modal-close { display: none; }
  .video-modal.pdf-mode .video-modal-inner { display: flex; flex-direction: column; }
  .video-modal.pdf-mode .video-modal-frame { flex: 1 1 auto; min-height: 60vh; }

  /* Tag de lançamento mobile */
  .film-launch {
    font-size: 9px;
    padding: 4px 10px;
  }
}

@media (max-width: 480px) {
  .film-cell { min-height: 80vw; }
  .film-overlay { padding: 14px 16px; }
  .award-text { max-width: 160px; font-size: 0.62rem; }
  .laurel-branch { width: 28px; height: 16px; }
}
