/* Tela de totem — pensada para TV/monitor touch na vertical (retrato),
   com um computador ligado nela rodando o navegador em modo kiosk.
   Reaproveita as variáveis de cor/fonte de style.css; aqui só entram
   layout, tamanhos e alvos de toque bem maiores que o site normal. */

html, body.totem-body {
  height: 100%;
  overflow: hidden; /* quem rola é a lista, não a página inteira */
  background: var(--ink);
}

.totem {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  font-size: 1.15rem; /* base maior que o site normal, pra leitura à distância */
}

/* Faixa de imagem opcional, acima do cabeçalho — altura fixa e pequena
   de propósito: a tela do totem é 100dvh sem rolagem geral (só a lista
   rola), então o banner não pode "roubar" espaço demais da lista. */
.totem-banner {
  flex-shrink: 0;
  width: 100%;
  height: 220px;
  background-repeat: no-repeat;
}

.totem-header {
  background: var(--ink);
  color: #fff;
  padding: 22px 28px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 4px solid var(--stamp);
  flex-shrink: 0;
}
.totem-brand {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.6rem;
}
.totem-brand-logo { max-height: 56px; display: block; }
.totem-count {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--ink-soft);
  white-space: nowrap;
}

.totem-search-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.totem-search-row .totem-search-input {
  width: auto;
  flex: 1;
}

.totem-search-wrap {
  padding: 20px 24px;
  background: var(--paper-raised);
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.totem-search-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1.5rem;
  padding: 22px 24px;
  border: 3px solid var(--ink);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
}
.totem-search-input:focus {
  border-color: var(--stamp);
  outline: none;
}
/* Select + Limpar busca + Teclado lado a lado numa linha só. O select
   ocupa o espaço que sobrar (encolhendo/crescendo); os botões mantêm o
   tamanho natural. Só quebra linha em tela realmente estreita (celular),
   ver media query no fim do arquivo — no totem de verdade (TV/tablet) fica
   tudo numa linha. */
.totem-search-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.totem-clear-btn, .totem-kb-toggle {
  flex-shrink: 0;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 12px 20px;
  border-radius: 6px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
}
.totem-area-select {
  flex: 1 1 140px;
  min-width: 0; /* sem isso o flexbox não deixa o select encolher além do texto */
  font-family: var(--font-mono);
  font-size: 1rem;
  padding: 12px 36px 12px 16px;
  border-radius: 6px;
  border: 2px solid var(--line);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7695' d='M1 1l5 5 5-5'/%3E%3C/svg%3E") no-repeat right 14px center;
  background-size: 12px 8px;
  color: var(--ink-soft);
  -webkit-appearance: none;
  appearance: none;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}
.totem-area-select:focus {
  border-color: var(--stamp);
  outline: none;
}

.totem-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 12px 20px 40px;
}

.totem-row {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-left: 6px solid var(--stamp);
  border-radius: 0 8px 8px 0;
  padding: 20px 22px;
  margin-bottom: 12px;
  min-height: 84px;
}
.totem-row .code {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--stamp-dark);
  font-size: 0.85rem;
}
/* Já apresentado (marcado em /admin/presenca) — borda verde em vez de
   vermelha, pra equipe do evento bater o olho e saber de longe. */
.totem-row-apresentado {
  border-left-color: var(--teal);
}
.totem-badge-apresentado {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal);
  background: var(--teal-soft);
  padding: 3px 8px;
  border-radius: 3px;
  vertical-align: middle;
}
.totem-row h3 {
  margin: 4px 0 2px;
  font-size: 1.1rem;
  line-height: 1.3;
}
.totem-row .meta {
  color: var(--ink-soft);
  font-size: 0.85rem;
}
.totem-author-responsavel {
  color: var(--stamp-dark);
  font-weight: 700;
}
.totem-row-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.totem-row-btn {
  flex: 1;
  min-width: 150px;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 14px 16px;
  border-radius: 6px;
  border: 2px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  cursor: pointer;
}
.totem-row-btn:active { background: #F2EFE6; }
.totem-row-btn-primary {
  background: var(--stamp);
  color: #fff;
  border-color: var(--stamp);
}
.totem-row-btn-primary:active { background: var(--stamp-dark); }

.totem-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
  font-size: 1.2rem;
}

/* Teclado virtual — chaves grandes o suficiente pra dedo em TV touch */
.totem-keyboard {
  display: none;
  background: var(--ink);
  padding: 14px;
  flex-shrink: 0;
}
.totem-keyboard.active { display: block; }
.totem-kb-row { display: flex; gap: 8px; margin-bottom: 8px; justify-content: center; }
.totem-kb-key {
  flex: 1;
  max-width: 80px;
  padding: 20px 0;
  text-align: center;
  background: #2A3A5C;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 1.3rem;
}
.totem-kb-key:active { background: var(--stamp); }
.totem-kb-key.wide { max-width: none; flex: 2; font-size: 1rem; }

/* Modal de detalhe do trabalho */
.totem-modal-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(27, 42, 74, .75);
  z-index: 50;
  padding: 24px;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
}
.totem-modal-backdrop.active { display: flex; }
.totem-modal {
  background: #fff;
  border-radius: 10px;
  max-width: 720px;
  width: 100%;
  margin-top: 40px;
  padding: 32px;
}
.totem-modal-close {
  float: right;
  font-size: 1.4rem;
  background: var(--ink);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
}
.totem-modal h2 { font-size: 1.6rem; margin-top: 10px; clear: both; }
.totem-modal .meta { color: var(--ink-soft); margin-bottom: 18px; }
.totem-modal .abstract { white-space: pre-wrap; line-height: 1.6; font-size: 1.05rem; }

.totem-footer-link {
  flex-shrink: 0;
  text-align: center;
  padding: 8px;
  background: var(--ink);
}
.totem-footer-link a {
  color: #6b7695;
  font-size: .78rem;
  text-decoration: none;
}

/* Se a tela for realmente estreita/alta (retrato de verdade), aumenta ainda mais */
@media (orientation: portrait) and (max-width: 900px) {
  .totem { font-size: 1.3rem; }
  .totem-row h3 { font-size: 1.5rem; }
}

/* Só em tela muito estreita (celular) os três controles quebram pra duas
   linhas — no totem de verdade (TV/tablet) isso não deve disparar. */
@media (max-width: 480px) {
  .totem-search-actions { flex-wrap: wrap; }
  .totem-area-select { flex-basis: 100%; }
}

/* ---------- Apresentação do e-poster em tela cheia ---------- */
.totem-present-overlay {
  display: none;
  position: fixed; inset: 0;
  background: #0d1526;
  z-index: 100;
  flex-direction: column;
}
.totem-present-overlay.active { display: flex; }

.totem-present-topbar {
  flex-shrink: 0;
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 22px;
  background: #10192E;
}
.totem-present-pagecount {
  font-family: var(--font-mono); color: #9AA6C4; font-size: 1rem;
}
.totem-present-close {
  font-family: var(--font-body); font-weight: 600; font-size: 1rem;
  background: var(--stamp); color: #fff; border: none; border-radius: 6px;
  padding: 12px 20px;
}

.totem-present-canvas-wrap {
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  padding: 10px;
}
.totem-present-canvas-wrap canvas {
  max-width: 100%; max-height: 100%;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
  background: #fff;
}

.totem-present-navbar {
  flex-shrink: 0;
  display: flex; justify-content: space-between; gap: 14px;
  padding: 16px 22px 26px;
  background: #10192E;
}
.totem-present-nav-btn {
  flex: 1;
  font-family: var(--font-body); font-weight: 600; font-size: 1.15rem;
  background: #1E2C4C; color: #fff; border: 2px solid #33436B; border-radius: 8px;
  padding: 18px 0;
}
.totem-present-nav-btn:active { background: var(--teal); border-color: var(--teal); }
.totem-present-nav-btn[disabled] { opacity: .35; }
.totem-present-nav-btn.finalizar { background: var(--stamp); border-color: var(--stamp); }

/* ---------- Tela de atração (index) — aparece sozinha entre um uso e
   outro do totem, some quando alguém toca em "Buscar" ---------- */
.totem-index {
  height: 100dvh;
  width: 100vw;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background-color: var(--ink);
  background-size: cover;
  background-repeat: no-repeat;
  padding-bottom: 60px;
}

.totem-index-text {
  position: absolute;
  transform: translate(-50%, -50%);
  max-width: 85%;
  padding: 20px 28px;
  background: rgba(27, 42, 74, 0.55);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 2rem;
  line-height: 1.3;
  text-align: center;
  border-radius: 10px;
}

.totem-index-search-btn {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.4rem;
  background: var(--stamp);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 22px 48px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}
.totem-index-search-btn:active { background: var(--stamp-dark); }
.totem-index-search-icon { font-size: 1.5rem; }

/* ---------- Logos de rodapé (patrocinadores/apoio) no totem ---------- */
.totem-footer-logos {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 10px 20px;
  background: var(--paper-raised);
  border-top: 1px solid var(--line);
}
.totem-footer-logos img {
  max-height: 32px;
  max-width: 100px;
  object-fit: contain;
}

.totem-index-footer-logos {
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 0 20px;
  z-index: 1;
}
.totem-index-footer-logos img {
  max-height: 36px;
  max-width: 100px;
  object-fit: contain;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 4px;
  padding: 4px 8px;
}

/* ---------- Banner do rodapé (faixa discreta) no totem ---------- */
.totem-footer-banner {
  flex-shrink: 0;
  width: 100%;
  height: 150px;
  background-repeat: no-repeat;
}
