/* Galeria Portal na Balada */
@font-face {
  font-family: "Arvo PNB";
  src: url("../fonts/Arvo-Bold.ttf") format("truetype");
  font-weight: 700;
  font-display: swap;
}

:root {
  --tinta: #16111f;     /* fundo */
  --veludo: #231a31;    /* superfícies */
  --veludo-2: #2f2541;  /* superfície em destaque */
  --fumaca: #efeaf7;    /* texto */
  --nevoa: #aa9fbd;     /* texto secundário */
  --flash: #ffc83d;     /* luz de flash: ações e foco */
  --linha: rgba(239, 234, 247, .16);

  --display: "Arvo PNB", "Roboto Slab", Rockwell, Georgia, serif;
  --texto: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --h: 120px;   /* altura-base das linhas da grade */
  --gap: 3px;
  --raio: 16px;
  color-scheme: dark;
}
@media (min-width: 720px)  { :root { --h: 200px; --gap: 6px; } }
@media (min-width: 1200px) { :root { --h: 230px; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
html.lb-aberto { overflow: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--tinta);
  color: var(--fumaca);
  font: 16px/1.5 var(--texto);
}
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2 { margin: 0; }
:focus-visible { outline: 3px solid var(--flash); outline-offset: 2px; }

.casca { max-width: 1440px; margin: 0 auto; padding-inline: max(12px, env(safe-area-inset-left)) max(12px, env(safe-area-inset-right)); }
@media (min-width: 720px) { .casca { padding-inline: 24px; } }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid var(--linha); border-radius: 999px;
  background: transparent; cursor: pointer; text-decoration: none;
  font-weight: 600; font-size: .9375rem; white-space: nowrap;
}
.btn:hover { background: rgba(239, 234, 247, .07); }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-flash { background: var(--flash); color: #1d1500; border-color: transparent; }
.btn-flash:hover { background: #ffd76e; }

/* ---------- Topo ---------- */
.topo { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 12px; }
.marca {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--display); font-size: 1.0625rem; text-decoration: none; letter-spacing: -.01em;
}
.marca-ponto {
  width: 12px; height: 12px; border-radius: 50%; background: var(--flash);
  box-shadow: 0 0 0 4px rgba(255, 200, 61, .18), 0 0 18px rgba(255, 200, 61, .55);
}
@media (max-width: 420px) { .topo .btn span { display: none; } .topo .btn { padding: 0 12px; } }

/* ---------- Ingresso (cabeçalho da cobertura) ---------- */
.ingresso {
  --furo: 11px;
  --canhoto-h: 84px;
  position: relative;
  display: grid;
  grid-template-rows: auto var(--canhoto-h);
  margin: 4px 0 18px;
  background: var(--veludo);
  border-radius: var(--raio);
  /* recortes do picote, nas laterais */
  -webkit-mask:
    radial-gradient(circle var(--furo) at 0 calc(100% - var(--canhoto-h)), #0000 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle var(--furo) at 100% calc(100% - var(--canhoto-h)), #0000 98%, #000) right / 51% 100% no-repeat;
          mask:
    radial-gradient(circle var(--furo) at 0 calc(100% - var(--canhoto-h)), #0000 98%, #000) left / 51% 100% no-repeat,
    radial-gradient(circle var(--furo) at 100% calc(100% - var(--canhoto-h)), #0000 98%, #000) right / 51% 100% no-repeat;
}
.ing-corpo { padding: 22px 20px 20px; min-width: 0; }
.ingresso h1 {
  font-family: var(--display);
  font-size: clamp(1.75rem, 1.05rem + 3.4vw, 3.75rem);
  line-height: 1.02;
  letter-spacing: -.02em;
  text-transform: uppercase;
  text-wrap: balance;
  overflow-wrap: anywhere;
}
.ing-campos { display: flex; flex-wrap: wrap; gap: 10px 32px; margin: 18px 0 0; }
.ing-campos dt { font-size: .8125rem; color: var(--nevoa); }
.ing-campos dd { margin: 0; font-weight: 600; }

.ing-canhoto {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 0 20px;
  border-top: 2px dashed var(--linha);
}
.ing-qtd { margin: 0; color: var(--nevoa); white-space: nowrap; }
.ing-qtd strong { font-family: var(--display); font-size: 1.625rem; color: var(--fumaca); font-weight: 700; letter-spacing: -.01em; }
.ing-num { display: none; margin: 0; font-size: .8125rem; color: var(--nevoa); }

@media (min-width: 720px) {
  .ingresso {
    --canhoto-w: 240px;
    grid-template-rows: none;
    grid-template-columns: 1fr var(--canhoto-w);
    margin-top: 8px;
    -webkit-mask:
      radial-gradient(circle var(--furo) at calc(100% - var(--canhoto-w)) 0, #0000 98%, #000) top / 100% 51% no-repeat,
      radial-gradient(circle var(--furo) at calc(100% - var(--canhoto-w)) 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
            mask:
      radial-gradient(circle var(--furo) at calc(100% - var(--canhoto-w)) 0, #0000 98%, #000) top / 100% 51% no-repeat,
      radial-gradient(circle var(--furo) at calc(100% - var(--canhoto-w)) 100%, #0000 98%, #000) bottom / 100% 51% no-repeat;
  }
  .ing-corpo { padding: 34px 36px 32px; }
  .ing-canhoto {
    flex-direction: column; justify-content: center; gap: 14px;
    padding: 24px 20px; text-align: center;
    border-top: 0; border-left: 2px dashed var(--linha);
  }
  .ing-qtd strong { display: block; font-size: 2.75rem; line-height: 1; }
  .ing-num { display: block; }
}

/* ---------- Grade justificada (cada linha com a mesma altura, fotos sem corte de proporção) ---------- */
.grade { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--gap); }
.grade::after { content: ""; flex-grow: 1e5; }
.ft {
  position: relative; display: block; overflow: hidden;
  flex-grow: var(--r);
  flex-basis: calc(var(--r) * var(--h));
  max-width: 100%;
  aspect-ratio: var(--r);
  background: var(--veludo);
  border-radius: 4px;
}
.ft img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ft:focus-visible { outline-offset: -3px; }
@media (hover: hover) {
  .ft img { transition: opacity .15s; }
  .grade:hover .ft img { opacity: .82; }
  .grade:hover .ft:hover img { opacity: 1; }
}

.mais { padding: 28px 0 8px; text-align: center; }
.mais p { margin: 10px 0 0; font-size: .875rem; color: var(--nevoa); }
#sentinela { height: 1px; }

.aviso {
  margin: 8px 0 24px; padding: 48px 20px; text-align: center;
  background: var(--veludo); border-radius: var(--raio);
}
.aviso h1, .aviso h2 { font-family: var(--display); font-size: clamp(1.375rem, 1rem + 1.5vw, 2rem); line-height: 1.15; }
.aviso p { margin: 10px auto 22px; max-width: 46ch; color: var(--nevoa); }

.rodape { padding-block: 36px 44px; color: var(--nevoa); font-size: .875rem; }
.rodape p { margin: 0; }
.box-banner-galeria:not(:empty) { margin-bottom: 18px; text-align: center; }

/* ---------- Visualizador ---------- */
.lb {
  --fundo: 1;
  position: fixed; inset: 0; z-index: 100;
  color: #fff;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
}
.lb:focus { outline: none; }
.lb::before { content: ""; position: absolute; inset: 0; background: #000; opacity: var(--fundo); }
.lb-palco { position: absolute; inset: 0; overflow: hidden; }
.lb-trilho { display: flex; height: 100%; transform: translateX(-100%); will-change: transform; }
.lb-slide { position: relative; flex: 0 0 100%; height: 100%; display: grid; place-items: center; overflow: hidden; }
.lb-fig {
  position: relative;
  width: min(100vw, calc(100vh * var(--r, 1.5)));
  width: min(100vw, calc(100dvh * var(--r, 1.5)));
  aspect-ratio: var(--r, 1.5);
  transform-origin: center;
  will-change: transform;
  cursor: zoom-in;
}
.lb-fig img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: contain; -webkit-user-drag: none;
}
.lb-fig .full { opacity: 0; transition: opacity .2s; }
.ok .lb-fig .full { opacity: 1; }
.ok .lb-fig .ph { visibility: hidden; }
.vazio .lb-fig { visibility: hidden; }
.lb-slide:not(.ok):not(.vazio):not(.erro) .lb-fig::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 34px; height: 34px; margin: -17px;
  border: 3px solid rgba(255, 255, 255, .25); border-top-color: var(--flash); border-radius: 50%;
  animation: gira .8s linear infinite;
}
@keyframes gira { to { transform: rotate(1turn); } }
.lb.com-zoom .lb-fig { cursor: grab; }
.lb.com-zoom .lb-fig:active { cursor: grabbing; }

.lb-barra, .lb-nav, .lb-legenda { transition: opacity .2s; }
.lb.limpo .lb-barra, .lb.limpo .lb-nav, .lb.limpo .lb-legenda,
.lb.arrastando .lb-barra, .lb.arrastando .lb-nav, .lb.arrastando .lb-legenda,
.lb.com-zoom .lb-legenda { opacity: 0; pointer-events: none; }

.lb-barra {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) max(8px, env(safe-area-inset-right)) 28px max(16px, env(safe-area-inset-left));
  background: linear-gradient(rgba(0, 0, 0, .65), rgba(0, 0, 0, 0));
}
.lb-cont { font-size: .9375rem; font-variant-numeric: tabular-nums; color: rgba(255, 255, 255, .85); }
.lb-acoes { display: flex; gap: 2px; }
.lb-btn {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; padding: 0;
  border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer;
}
.lb-btn:hover { background: rgba(255, 255, 255, .12); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-btn .i-pausa, .lb-btn[aria-pressed="true"] .i-play { display: none; }
.lb-btn[aria-pressed="true"] .i-pausa { display: contents; }
#lbPlay[aria-pressed="true"] { color: var(--flash); }

.lb-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: grid; place-items: center;
  width: 52px; height: 52px; padding: 0;
  border: 0; border-radius: 50%; cursor: pointer; color: #fff;
  background: rgba(20, 15, 28, .5);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.lb-nav:hover { background: rgba(20, 15, 28, .8); }
.lb-nav svg { width: 26px; height: 26px; }
.lb-ant { left: max(16px, env(safe-area-inset-left)); }
.lb-prox { right: max(16px, env(safe-area-inset-right)); }
.lb-nav:disabled { opacity: 0 !important; pointer-events: none; }
@media (hover: none) { .lb-nav { display: none; } }

.lb-legenda {
  position: absolute; left: 0; right: 0; bottom: 0; margin: 0;
  padding: 36px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .6));
  font-size: .875rem; pointer-events: none;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lb-legenda strong { font-family: var(--display); font-weight: 700; margin-right: 8px; }
.lb-legenda span { color: rgba(255, 255, 255, .7); }

/* ---------- Painel de compartilhar ---------- */
.painel {
  position: fixed; inset: 0; z-index: 200;
  display: grid; align-items: end;
  background: rgba(10, 6, 16, .62);
}
.painel-caixa {
  justify-self: center; width: 100%; max-width: 480px;
  padding: 12px 20px max(22px, env(safe-area-inset-bottom));
  background: var(--veludo-2); border-radius: 22px 22px 0 0;
  animation: sobe .22s cubic-bezier(.2, .8, .2, 1);
}
@keyframes sobe { from { transform: translateY(24px); opacity: 0; } }
@media (min-width: 720px) {
  .painel { align-items: center; }
  .painel-caixa { border-radius: 22px; padding: 16px 24px 24px; }
}
.ps-topo { display: flex; align-items: center; justify-content: space-between; margin: 0 -8px 10px 0; }
.ps-topo h2 { font-family: var(--display); font-size: 1.25rem; }
.ps-link { display: flex; gap: 8px; }
.ps-link input {
  flex: 1; min-width: 0; height: 44px; padding: 0 14px;
  border: 1px solid var(--linha); border-radius: 12px;
  background: var(--tinta); color: var(--fumaca); font: 16px var(--texto);
  transition: opacity .2s;
}
.painel.carregando .ps-link input { opacity: .55; }
.ps-acoes { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 8px; margin-top: 12px; }

/* ---------- Busca por rosto ---------- */
.achar {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 4px 14px;
  margin: -6px 0 18px; padding: 16px 18px;
  border: 1px solid rgba(255, 200, 61, .35); border-radius: var(--raio);
  background: linear-gradient(100deg, rgba(255, 200, 61, .12), rgba(255, 200, 61, .02) 60%);
}
.achar-icone {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  background: var(--flash); color: #1d1500;
}
.achar-icone svg { width: 24px; height: 24px; }
.achar-txt h2 { font-family: var(--display); font-size: 1.125rem; line-height: 1.2; }
.achar-txt p { margin: 2px 0 0; color: var(--nevoa); font-size: .9375rem; }
.achar .btn { grid-column: 1 / -1; margin-top: 10px; }
@media (min-width: 720px) {
  .achar { grid-template-columns: auto 1fr auto; padding: 16px 20px; }
  .achar .btn { grid-column: auto; margin-top: 0; }
}

.resultado { margin-bottom: 8px; }
.res-topo { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.res-topo h2 { font-family: var(--display); font-size: clamp(1.375rem, 1rem + 1.6vw, 2rem); line-height: 1.15; outline: none; }
.res-acoes { display: flex; flex-wrap: wrap; gap: 8px; }
.res-vazio { margin: 0 0 18px; max-width: 60ch; color: var(--nevoa); }
.res-sub { margin: 32px 0 2px; font-family: var(--display); font-size: 1.125rem; }
.res-nota { margin: 0 0 12px; color: var(--nevoa); font-size: .875rem; }
.res-remover { margin: 28px 0 0; }
.link {
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--nevoa); font-size: .875rem; text-decoration: underline; text-underline-offset: 3px;
}
.link:hover { color: var(--fumaca); }

.painel-rosto { max-height: 100vh; max-height: 100dvh; overflow-y: auto; }
.painel-rosto p { margin: 0 0 12px; }
.pr-lista { margin: 0 0 16px; padding: 0 0 0 18px; color: var(--nevoa); font-size: .9375rem; }
.pr-lista li + li { margin-top: 6px; }
.pr-ok { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; cursor: pointer; font-weight: 600; }
.pr-ok input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--flash); flex: none; }
.pr-botoes { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.pr-botoes .btn:disabled { opacity: .45; cursor: not-allowed; }
.pr-link { color: var(--nevoa); font-size: .875rem; }
.pr-nota { color: var(--nevoa); font-size: .875rem; }
.pr-largo { width: 100%; }
.pr-largo:disabled { opacity: .45; cursor: not-allowed; }
.pr-video {
  position: relative; overflow: hidden; margin: 0 0 12px;
  aspect-ratio: 3 / 4; max-height: 52vh; width: 100%;
  border-radius: 16px; background: #000;
}
.pr-video video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.pr-guia {
  position: absolute; left: 50%; top: 46%; width: 58%; aspect-ratio: 3 / 4;
  transform: translate(-50%, -50%);
  border: 3px dashed rgba(255, 200, 61, .85); border-radius: 50%;
  box-shadow: 0 0 0 100vmax rgba(0, 0, 0, .35);
}
.pr-dica { min-height: 1.5em; text-align: center; font-weight: 600; }
.pr-centro { padding: 28px 0 12px; text-align: center; }
.pr-spinner {
  display: inline-block; width: 40px; height: 40px; margin-bottom: 14px;
  border: 3px solid rgba(239, 234, 247, .2); border-top-color: var(--flash); border-radius: 50%;
  animation: gira .8s linear infinite;
}

/* ---------- Aviso rápido ---------- */
.toast {
  position: fixed; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); z-index: 300;
  padding: 10px 18px; border-radius: 999px;
  background: var(--fumaca); color: var(--tinta); font-weight: 600; font-size: .9375rem;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .lb-slide:not(.ok) .lb-fig::after { animation-duration: 2s !important; }
}
