/* ============================================================
   Design tokens — altere aqui para propagar por todos os slides
   ============================================================ */
:root {
  /* Reveal.js aplica padding: 30px às sections internamente.
     Elementos full-bleed (ftitle, sld__sub) usam este valor para
     calcular margin negativa e width correto. */
  --rv-pad: 30px;

  /* Paleta — cor de destaque definida por cada index.html via --custombordo */
  --slide-accent: var(--custombordo, #9b1536);
  --slide-blue:   #1a4a8a;
  --slide-text:   #1a1a1a;
  --slide-bg-alt: #f4f4f4;
  --slide-border: #e5e5e5;

  /* Escala tipográfica (relativa ao font-size base de 72px do .reveal) */
  --text-xs:   0.72em;   /* .sld__sub   */
  --text-sm:   0.78em;   /* table       */
  --text-md:   0.80em;   /* .block      */
  --text-base: 0.82em;   /* .sld__list  */
  --text-lg:   0.90em;   /* .ftitle     */
}

/* ============================================================
   Font-size base — 72px compensa a escala reduzida do canvas 1920×1080
   em relação ao padrão 960×700 do reveal.js (~0.96 vs ~1.42 de escala)
   ============================================================ */
.reveal {
  font-size: 72px;
}

/* ============================================================
   Layout geral
   ============================================================ */
html, body { height: 100%; }

.reveal .slides section {
  text-align: left;
  height: 100%;
  box-sizing: border-box;
}

/* Autor fixo no rodapé */
.author-fixed {
  position: fixed;
  bottom: 14px;
  left: 18px;
  font-size: 13px;
  color: rgba(0, 0, 0, 0.35);
  z-index: 50;
  pointer-events: none;
}

/* ============================================================
   Slide padrão — JS define altura do body via getBoundingClientRect().
   overflow: hidden na section (não no body) garante que o excedente
   do body (cuja scrollHeight não diminui com zoom) seja clipado. */
.reveal .slides section.sld {
  height: 100% !important;
  overflow: hidden;
}

/* Título do slide — barra colorida full-bleed
   O reveal.js ancora flex-items no content-start da section (x = --rv-pad).
   O flex ignora margin-left negativo no eixo cruzado; usa-se transform para
   o deslocamento visual e width corrigido para cobrir de borda a borda. */
.reveal .slides .ftitle {
  box-sizing: border-box;
  margin-top: calc(-1 * var(--rv-pad) + 5px);
  margin-bottom: 0;
  transform: translateX(calc(-1 * var(--rv-pad)));
  width: calc(100% + var(--rv-pad) * 2);
  padding: calc(var(--rv-pad) - 16px) calc(var(--rv-pad) + 48px);
  font-size: var(--text-lg) !important;
  font-weight: 700 !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  color: #fff !important;
  background: var(--slide-accent);
  border-radius: 0;
  line-height: 1.3;
}

/* Subtítulo abaixo do título — mesmo tratamento full-bleed */
.reveal .slides .sld__sub {
  box-sizing: border-box;
  margin: 0;
  transform: translateX(calc(-1 * var(--rv-pad)));
  width: calc(100% + var(--rv-pad) * 2);
  padding: 6px calc(var(--rv-pad) + 48px);
  font-size: var(--text-xs);
  color: #fff;
  background: var(--slide-blue);
}

/* Corpo do slide — sem overflow:hidden (herda o clip da section).
   O zoom reduz a aparência visual; scrollHeight não é afetado.
   A section (pai) com overflow:hidden faz o recorte final. */
.reveal .slides .sld__body {
  padding: 28px 48px 30px;
}

/* ============================================================
   Separador de capítulo
   Uso: <section class="chapter-break" data-background-color="#HEX">Título</section>
   ============================================================ */
.reveal .slides section.chapter-break {
  height: 100% !important;
  padding: 0 400px !important;
  overflow: hidden;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 2.6rem;
  font-weight: 700;
  color: #fff;
  text-align: center;
  line-height: 1.25;
  text-transform: none;
  box-sizing: border-box;
  overflow-wrap: break-word;
  word-break: break-word;
}

.reveal .slides section.chapter-break::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 1150px;
  height: 1150px;
  border: 6px solid #f2c94c;
  border-radius: 50%;
  box-sizing: border-box;
  pointer-events: none;
}

/* ============================================================
   Listas
   ============================================================ */
.reveal .slides .sld__list {
  margin: 0 0 0 1.1em;
  padding: 0;
  list-style: disc;
  font-size: var(--text-base);
  line-height: 1.55;
}

.reveal .slides .sld__list li {
  margin-bottom: 6px;
  color: var(--slide-text);
}

.reveal .slides ol.sld__list {
  list-style: decimal;
}

.reveal .slides .sld__list li ul {
  margin-top: 4px;
  list-style: circle;
}

/* ============================================================
   Bloco destacado (equivale ao \begin{block} do Beamer)
   ============================================================ */
.reveal .slides .block {
  margin-top: 24px;
  background: var(--slide-bg-alt);
  border-left: 4px solid var(--slide-accent);
  border-radius: 0 6px 6px 0;
  padding: 14px 22px 16px;
  font-size: var(--text-md);
  line-height: 1.5;
  color: var(--slide-text);
}

.reveal .slides .block .btitle {
  font-weight: 700;
  font-size: var(--text-base);
  margin-bottom: 5px;
  color: var(--slide-accent);
  text-transform: none;
  letter-spacing: 0;
}

/* ============================================================
   Variante compacta para slides densos
   Uso: <section class="sld sld--tight">
   Reduz padding do corpo (blocos e listas usam margin collapse).
   ============================================================ */
.reveal .slides section.sld--tight .sld__body {
  padding: 16px 48px 20px;
}

/* ============================================================
   Tabela simples
   ============================================================ */
.reveal .slides table {
  font-size: var(--text-sm);
  border-collapse: collapse;
  width: 100%;
}

.reveal .slides table th {
  background: var(--slide-accent);
  color: #fff;
  padding: 8px 12px;
  text-align: left;
}

.reveal .slides table td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--slide-border);
}

.reveal .slides table tr:nth-child(even) td {
  background: #f8f8f8;
}

/* ============================================================
   Links
   ============================================================ */
.reveal a {
  color: var(--slide-blue);
}

/* ============================================================
   Capa (is-cover) — slide inicial de cada aula
   Movido do index.html para cá para evitar duplicação por arquivo
   ============================================================ */
html.is-cover .reveal {
  background: #eceff3 !important;
}

html.is-cover .reveal .slides section.cover {
  background: transparent !important;
  padding: 0 !important;
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center !important;
}

html.is-cover .cover__content {
  width: min(1100px, 92vw);
  padding: 36px 28px 28px;
}

html.is-cover .cover__logo {
  width: min(220px, 20vw);
  height: auto;
  display: block;
  margin: 0 auto 26px;
}

html.is-cover .cover__title {
  margin: 0 !important;
  font-size: 52px !important;
  font-weight: 800 !important;
  letter-spacing: -0.01em !important;
  line-height: 1.1 !important;
  color: #111827 !important;
}

html.is-cover .cover__subtitle {
  margin: 12px 0 0 !important;
  font-size: 26px !important;
  font-weight: 500 !important;
  color: rgba(17, 24, 39, 0.75) !important;
}

html.is-cover .cover__meta {
  margin-top: 22px !important;
  display: grid;
  gap: 10px;
  justify-items: center;
}

html.is-cover .cover__author {
  font-size: 22px !important;
  font-weight: 600 !important;
  color: #111827 !important;
}

html.is-cover .cover__date {
  font-size: 20px !important;
  color: rgba(17, 24, 39, 0.7) !important;
}

html.is-cover .slide-number {
  display: none !important;
}

/* ============================================================
   Sidebar de navegação (hover na borda esquerda / swipe mobile)
   ============================================================ */

/* Hint visual de swipe — só aparece em portrait mobile */
@media (max-width: 899px) and (orientation: portrait) {
  body::before {
    content: '';
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 0 4px 4px 0;
    z-index: 9998;
    pointer-events: none;
  }
}

#slide-nav {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 248px;
  background: rgba(8, 10, 16, 0.93);
  backdrop-filter: blur(20px) saturate(160%);
  -webkit-backdrop-filter: blur(20px) saturate(160%);
  z-index: 9999;
  transform: translateX(-100%);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.28s ease;
  display: flex;
  flex-direction: column;
  font-family: 'Source Sans Pro', sans-serif;
}

#slide-nav.visible {
  transform: translateX(0);
  opacity: 1;
}

/* Cabeçalho com botões de saída */
#slide-nav .nav-header {
  flex-shrink: 0;
  padding: 20px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

#slide-nav .nav-action {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 8px;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

#slide-nav .nav-action:hover {
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.95);
}

#slide-nav .nav-action--exit {
  color: rgba(255, 150, 150, 0.7);
}

#slide-nav .nav-action--exit:hover {
  background: rgba(200, 50, 50, 0.14);
  color: rgba(255, 170, 170, 1);
}

/* Lista de slides — scroll independente */
#slide-nav ul {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  list-style: none;
  margin: 0;
  padding: 10px 0 20px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

#slide-nav li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.5);
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.35;
  position: relative;
  transition: color 0.14s, background 0.14s;
  user-select: none;
}

#slide-nav li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 5px;
  bottom: 5px;
  width: 2px;
  border-radius: 0 2px 2px 0;
  background: transparent;
  transition: background 0.15s;
}

#slide-nav li:hover {
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.04);
}

#slide-nav li.active {
  color: #fff;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.05);
}

#slide-nav li.active::before {
  background: rgba(255, 255, 255, 0.55);
}

#slide-nav .nav-number {
  font-family: ui-monospace, 'SF Mono', Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.04em;
  opacity: 0.3;
  flex-shrink: 0;
  min-width: 20px;
  text-align: right;
  transition: opacity 0.14s;
}

#slide-nav li.active .nav-number { opacity: 0.55; }
#slide-nav li:hover  .nav-number { opacity: 0.45; }

/* ============================================================
/* ============================================================
   Código — sem scroll, expande para mostrar tudo.
   O auto-shrink ajusta o font-size se ultrapassar o canvas.
   Layout de bloco no sld__body dispensa flex-shrink hacks.
   ============================================================ */
.reveal pre code {
  max-height: none !important;
  overflow: visible !important;
}

/* ============================================================
   Glossário contextual — popup de definição para termos técnicos
   ============================================================ */
[data-def] {
  cursor: help;
}

code[data-def],
span[data-def],
strong[data-def] {
  border-bottom: 1.5px dashed rgba(255, 255, 255, 0.4);
}

#term-popup {
  position: fixed;
  max-width: 320px;
  background: #0f111a;
  color: #dde3f0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 12px 16px;
  font-family: 'Source Sans Pro', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  z-index: 99999;
  pointer-events: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), 0 2px 8px rgba(0, 0, 0, 0.35);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.14s ease, transform 0.14s ease;
  white-space: normal;
  word-break: break-word;
}

#term-popup.visible {
  opacity: 1;
  transform: translateY(0);
}

.popup-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 5px;
}
