/*
 * ============================================================
 *  FOCALIZZE — document-viewer.css
 *  Componente de "visualizador de documento" (índice, progresso,
 *  documento estilo PDF/Docs, paginação). Compartilhado por todas
 *  as páginas jurídicas/institucionais do site (Política de
 *  Privacidade, Termos e Condições de Uso, e futuras páginas do
 *  mesmo sistema de documentação).
 *  Depende dos design tokens definidos em style.css (:root)
 *  Versão: 1.1.0
 * ============================================================
 */

/* ══════════════════════════════════════════
   HERO DISCRETO
══════════════════════════════════════════ */
.pp-hero {
  position: relative;
  padding: 9.5rem 0 3rem;
  overflow: hidden;
}

.pp-hero .container {
  position: relative;
}

.pp-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--text-dim);
  margin-bottom: 1.75rem;
}

.pp-breadcrumb a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.pp-breadcrumb a:hover,
.pp-breadcrumb a:focus-visible {
  color: var(--gold);
}

.pp-breadcrumb-sep {
  color: var(--gold-dim);
  opacity: 0.8;
}

.pp-breadcrumb-current {
  color: var(--gold);
}

.pp-hero-title {
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  font-weight: 400;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.pp-hero-sub {
  font-size: 0.98rem;
  color: var(--text-secondary);
  font-weight: 300;
  line-height: 1.75;
  max-width: 620px;
}

.pp-hero .gold-line {
  margin: 1.5rem 0 0;
}

/* ══════════════════════════════════════════
   LAYOUT — CONTAINER DE DUAS COLUNAS
══════════════════════════════════════════ */
.pp-layout {
  padding: 2rem 0 7rem;
  position: relative;
}

.pp-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 3rem;
  align-items: start;
}

/* ══════════════════════════════════════════
   PAINEL ESQUERDO — STICKY
══════════════════════════════════════════ */
.pp-side {
  position: sticky;
  top: 6.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  max-height: calc(100vh - 8rem);
}

.pp-panel {
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1.5rem;
}

.pp-panel-title {
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Índice / TOC ── */
.pp-toc-panel {
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pp-toc-list {
  list-style: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  max-height: 38vh;
  padding-right: 0.4rem;
  margin-right: -0.4rem;
}

.pp-toc-list::-webkit-scrollbar { width: 3px; }
.pp-toc-list::-webkit-scrollbar-thumb { background: var(--gold-dim); border-radius: 2px; }

.pp-toc-list a {
  display: block;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-dim);
  text-decoration: none;
  padding: 0.42rem 0 0.42rem 0.85rem;
  border-left: 2px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.pp-toc-list a:hover,
.pp-toc-list a:focus-visible {
  color: var(--text-secondary);
}

.pp-toc-list a.active {
  color: var(--gold);
  border-left-color: var(--gold);
}

/* ── Progresso ── */
.pp-progress-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.pp-progress-track {
  position: relative;
  width: 4px;
  height: 90px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
}

.pp-progress-fill {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, var(--gold-light), var(--gold));
  border-radius: 2px;
  transition: height 0.15s linear;
}

.pp-progress-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.pp-progress-percent {
  font-family: var(--serif);
  font-size: 1.9rem;
  color: var(--text-primary);
  line-height: 1;
}

.pp-progress-label {
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.04em;
}

/* ── Informações ── */
.pp-info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.pp-info-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border-light);
  padding-bottom: 0.9rem;
}

.pp-info-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.pp-info-label {
  color: var(--text-dim);
}

.pp-info-value {
  color: var(--text-secondary);
  text-align: right;
}

/* ── Botão voltar ao topo ── */
.pp-top-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  background: transparent;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.9rem 1rem;
  border: 1px solid var(--border);
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.pp-top-btn:hover,
.pp-top-btn:focus-visible {
  border-color: var(--gold);
  background: rgba(200, 169, 110, 0.06);
}

.pp-top-btn svg { transition: transform 0.3s ease; }
.pp-top-btn:hover svg { transform: translateY(-2px); }

/* ══════════════════════════════════════════
   PAINEL DIREITO — VISUALIZADOR DO DOCUMENTO
══════════════════════════════════════════ */
.pp-doc-wrap {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-width: 0;
}

.pp-doc-viewer {
  background: #FCFBF9;
  border-radius: 10px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(200, 169, 110, 0.12);
  max-width: 950px;
  width: 100%;
  height: 850px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scroll-behavior: smooth;
  margin: 0 auto;
}

.pp-doc-inner {
  padding: 3.5rem 4rem 4.5rem;
  color: #2D2D2D;
  font-family: var(--sans);
}

/* Cabeçalho do documento (dentro do "papel") */
.pp-doc-titlepage {
  text-align: center;
  padding-bottom: 2.5rem;
  margin-bottom: 2.5rem;
  border-bottom: 1px solid rgba(45, 45, 45, 0.12);
}

.pp-doc-titlepage .pp-doc-logo {
  height: 44px;
  width: auto;
  margin-bottom: 1.5rem;
}

.pp-doc-titlepage h2 {
  font-family: var(--serif);
  font-size: 2rem;
  font-weight: 500;
  color: #2D2D2D;
}

.pp-doc-titlepage .pp-doc-company {
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-top: 0.6rem;
}

.pp-doc-titlepage .pp-doc-meta {
  font-size: 0.78rem;
  color: #8a8478;
  margin-top: 1rem;
}

/* Sumário */
.pp-summary {
  background: rgba(200, 169, 110, 0.06);
  border: 1px solid rgba(200, 169, 110, 0.18);
  border-radius: 8px;
  padding: 1.75rem 2rem;
  margin-bottom: 3rem;
}

.pp-summary h3 {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold-dim);
  margin-bottom: 1rem;
}

.pp-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 2rem;
  list-style: none;
}

.pp-summary-grid a {
  display: block;
  font-size: 0.85rem;
  color: #4a463e;
  text-decoration: none;
  padding: 0.3rem 0;
  border-bottom: 1px dotted transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.pp-summary-grid a:hover,
.pp-summary-grid a:focus-visible {
  color: var(--gold-dim);
  border-bottom-color: var(--gold-dim);
}

/* Capítulos do documento */
.pp-chapter {
  margin-bottom: 3rem;
  scroll-margin-top: 1.5rem;
}

.pp-chapter:last-of-type {
  margin-bottom: 1rem;
}

.pp-chapter-num {
  display: inline-block;
  font-family: var(--serif);
  font-size: 0.85rem;
  color: var(--gold-dim);
  letter-spacing: 0.05em;
  margin-bottom: 0.35rem;
}

.pp-chapter h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  color: #242424;
  margin-bottom: 1.1rem;
  line-height: 1.3;
}

.pp-chapter h3 {
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 600;
  color: #2D2D2D;
  margin: 1.6rem 0 0.8rem;
}

.pp-chapter p {
  font-size: 0.94rem;
  line-height: 1.85;
  color: #423f38;
  margin-bottom: 1.1rem;
  font-weight: 300;
}

.pp-chapter ul {
  margin: 0 0 1.1rem;
  padding-left: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pp-chapter li {
  font-size: 0.94rem;
  line-height: 1.7;
  color: #423f38;
  font-weight: 300;
}

.pp-chapter strong {
  color: #2D2D2D;
  font-weight: 600;
}

.pp-chapter a,
.pp-defs a {
  color: var(--gold-dim);
  text-decoration: underline;
  text-decoration-color: rgba(138, 110, 62, 0.4);
  text-underline-offset: 2px;
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

.pp-chapter a:hover,
.pp-chapter a:focus-visible,
.pp-defs a:hover,
.pp-defs a:focus-visible {
  color: var(--gold);
  text-decoration-color: var(--gold);
}

.pp-divider {
  border: none;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 169, 110, 0.4), transparent);
  margin: 2.5rem 0;
}

/* Definições (dl) */
.pp-defs {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-bottom: 1.1rem;
}

.pp-defs dt {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.92rem;
  color: #2D2D2D;
  margin-bottom: 0.25rem;
}

.pp-defs dd {
  font-size: 0.9rem;
  color: #423f38;
  font-weight: 300;
  line-height: 1.7;
}

/* Tabela resumo (seção 11) */
.pp-table-wrap {
  overflow-x: auto;
  margin-bottom: 1.5rem;
  border: 1px solid rgba(45, 45, 45, 0.1);
  border-radius: 6px;
}

.pp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.pp-table caption {
  caption-side: top;
  text-align: left;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--gold-dim);
  padding: 0.9rem 1rem 0;
}

.pp-table th {
  text-align: left;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b665c;
  background: rgba(200, 169, 110, 0.08);
  padding: 0.8rem 1rem;
  border-bottom: 1px solid rgba(45, 45, 45, 0.1);
}

.pp-table td {
  padding: 0.85rem 1rem;
  color: #423f38;
  border-bottom: 1px solid rgba(45, 45, 45, 0.08);
  vertical-align: top;
  font-weight: 300;
}

.pp-table tr:last-child td { border-bottom: none; }

/* Marcador de página (para a paginação visual) */
.pp-page-marker {
  scroll-margin-top: 1.5rem;
}

/* ══════════════════════════════════════════
   PAGINAÇÃO VISUAL
══════════════════════════════════════════ */
.pp-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pp-page-btn,
.pp-page-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 0.9rem;
  border-radius: 2px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--sans);
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.pp-page-btn { min-width: 38px; padding: 0; }

.pp-page-btn:hover,
.pp-page-nav:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.pp-page-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg-base);
}

.pp-page-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.pp-page-nav:disabled:hover {
  border-color: var(--border);
  color: var(--text-secondary);
}

/* ══════════════════════════════════════════
   ACCORDION MOBILE (painel esquerdo)
══════════════════════════════════════════ */
.pp-side-toggle {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-2);
  border: 1px solid var(--border-light);
  border-radius: 8px;
  padding: 1rem 1.25rem;
  color: var(--text-primary);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.pp-side-toggle svg {
  transition: transform 0.3s ease;
}

.pp-side-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

/* ══════════════════════════════════════════
   RESPONSIVIDADE
══════════════════════════════════════════ */

/* Tablet — painel esquerdo reduzido */
@media (max-width: 1024px) {
  .pp-grid {
    grid-template-columns: 240px 1fr;
    gap: 2rem;
  }

  .pp-doc-inner {
    padding: 2.75rem 2.5rem 3.5rem;
  }
}

/* Mobile — painel esquerdo vira accordion, documento ocupa 100% e perde scroll interno */
@media (max-width: 900px) {
  .pp-hero { padding: 8rem 0 2.5rem; }

  .pp-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .pp-side-toggle { display: flex; }

  .pp-side {
    position: static;
    max-height: none;
    display: none;
    gap: 1.25rem;
  }

  .pp-side.pp-side-open {
    display: flex;
  }

  .pp-toc-list {
    max-height: none;
  }

  .pp-doc-viewer {
    height: auto;
    max-height: none;
    overflow-y: visible;
    box-shadow: 0 20px 40px -20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(200, 169, 110, 0.12);
  }

  .pp-doc-inner {
    padding: 2rem 1.5rem 3rem;
  }

  .pp-summary-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .container.pp-container { padding: 0 1.25rem; }

  .pp-doc-inner { padding: 1.75rem 1.25rem 2.5rem; }

  .pp-chapter h2 { font-size: 1.3rem; }

  .pp-panel { padding: 1.25rem; }
}

/* Impressão — mostra o documento por completo, sem chrome do site */
@media print {
  .pp-hero,
  .pp-side,
  .pp-pagination {
    display: none !important;
  }

  .pp-doc-viewer {
    height: auto;
    overflow: visible;
    box-shadow: none;
    max-width: 100%;
  }
}
