/* ==========================================================================
   ATIVIDADES DE PESQUISA E FORMAÇÃO - CSS MODERNO, EDITORIAL & INTERATIVO
   Estilo: Clean Acadêmico / Awwwards / Linha do Tempo / Sem Box-Shadow
   ========================================================================== */

:root {
  --pf-wine: #950221;
  --pf-wine-dark: #3B020E;
  --pf-wine-light: #FDF2F4;
  --pf-navy: #0F172A;
  --pf-slate: #334155;
  --pf-muted: #64748B;
  --pf-border: #E2E8F0;
  --pf-card-bg: #FFFFFF;
  --pf-bg-alt: #F8FAFC;
}

/* Container Global da Página */
.pesquisa-formacao-wrapper {
  background-color: #FFFFFF;
  color: var(--pf-navy);
  font-family: var(--font-sans, 'Inter', -apple-system, sans-serif);
}

/* ==========================================================================
   1. STICKY DOCK DE FILTROS & NAVEGAÇÃO ENTRE CATEGORIAS (MINIMALISTA)
   ========================================================================== */
.pf-nav-dock-wrap {
  position: -webkit-sticky;
  position: sticky;
  top: 96px;
  z-index: 990;
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: none;
  box-shadow: 0 4px 16px -2px rgba(11, 16, 33, 0.04);
  transition: top 0.25s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.2s ease;
}

/* Quando o header do site encolhe ao rolar (de 96px para 84px) */
.site-header.scrolled ~ #main-content .pf-nav-dock-wrap,
#app-header:has(.site-header.scrolled) ~ #main-content .pf-nav-dock-wrap,
body:has(.site-header.scrolled) .pf-nav-dock-wrap,
body.scrolled-header .pf-nav-dock-wrap {
  top: 84px;
  box-shadow: 0 4px 16px -2px rgba(11, 16, 33, 0.04);
}

.pf-nav-dock {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pf-dock-buttons {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.pf-dock-buttons::-webkit-scrollbar {
  display: none;
}

.pf-dock-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.15rem;
  border-radius: 8px;
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: 0.84rem;
  font-weight: 500;
  color: #475569;
  text-decoration: none !important;
  background: var(--pf-bg-alt);
  border: 1px solid var(--pf-border);
  white-space: nowrap;
  transition: all 0.2s ease;
  cursor: pointer;
}

.pf-dock-btn:hover {
  background-color: #EDF2F7;
  color: var(--pf-navy);
  border-color: #CBD5E1;
}

.pf-dock-btn.is-active {
  background-color: var(--pf-navy) !important;
  color: #FFFFFF !important;
  border-color: var(--pf-navy) !important;
  font-weight: 600;
}

/* ==========================================================================
   2. ESTRUTURA GERAL DAS SEÇÕES
   ========================================================================== */
.pf-section {
  padding: 4.5rem 1.5rem;
  position: relative;
}

.pf-section.bg-alt {
  background-color: var(--pf-bg-alt);
  /* removed section border */
  border-bottom: none;
}

.pf-container {
  max-width: 1180px;
  margin: 0 auto;
}

/* Header de Seção */
.pf-section-header {
  margin-bottom: 3rem;
  text-align: left;
}

.pf-section-kicker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 0.6rem;
}

.pf-section-kicker {
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--pf-wine);
}

.pf-section-badge {
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--pf-navy);
  background-color: #E2E8F0;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.pf-section-title {
  font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
  font-size: 2.1rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: var(--pf-navy);
  margin: 0 0 0.5rem 0;
  line-height: 1.25;
}

.pf-section-subtitle {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--pf-slate);
  margin: 0;
  max-width: 820px;
}

/* ==========================================================================
   3. LINHA DO TEMPO CRONOLÓGICA & CARDS EDITORIAIS
   ========================================================================== */
.pf-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

.pf-timeline::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 15px;
  bottom: 15px;
  width: 2px;
  background: #E2E8F0;
  z-index: 1;
}

.pf-timeline-entry {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 24px;
  z-index: 2;
}

/* Marcador do Ano / Período */
.pf-year-node {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #FFFFFF;
  border: 2px solid var(--pf-wine);
  color: var(--pf-wine-dark);
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: 0.85rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  transition: all 0.2s ease;
  text-align: center;
  line-height: 1.1;
  padding: 4px;
  box-sizing: border-box;
}

.pf-timeline-entry:hover .pf-year-node {
  background-color: var(--pf-wine);
  color: #FFFFFF;
}

.pf-year-node.long-text {
  font-size: 0.68rem;
  font-weight: 700;
}

/* Card de Conteúdo do Período */
.pf-content-card {
  flex: 1;
  background-color: var(--pf-card-bg);
  border: 1px solid var(--pf-border);
  border-radius: 14px;
  padding: 1.75rem 2rem;
  box-shadow: none !important;
  transition: border-color 0.2s ease;
}

.pf-timeline-entry:hover .pf-content-card {
  border-color: #CBD5E1;
}

/* Subtítulos e Parágrafos */
.pf-card-subheading {
  font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--pf-navy);
  margin: 1.25rem 0 0.5rem 0;
  line-height: 1.35;
}

.pf-card-subheading:first-child {
  margin-top: 0;
}

.pf-card-lead-text {
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.75;
  color: #334155;
  margin: 0 0 1rem 0;
}

.pf-card-lead-text:last-child {
  margin-bottom: 0;
}

/* Listas Editoriais com Marcador Personalizado */
.pf-item-list {
  list-style: none;
  margin: 0 0 1.25rem 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pf-item-list:last-child {
  margin-bottom: 0;
}

.pf-item-list li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.93rem;
  line-height: 1.65;
  color: #1E293B;
}

.pf-list-bullet {
  color: var(--pf-wine);
  font-weight: 800;
  font-size: 1.1rem;
  line-height: 1.4;
  flex-shrink: 0;
}

.pf-list-content {
  flex: 1;
}

.pf-list-link {
  color: var(--pf-wine);
  text-decoration: none;
  text-underline-offset: 3px;
  font-weight: 600;
  transition: color 0.2s ease;
}

.pf-list-link:hover {
  color: #720019;
}

/* Barra de Botões e Downloads de PDFs */
.pf-action-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 0.85rem;
  margin-bottom: 1.25rem;
}

.pf-action-row:last-child {
  margin-bottom: 0;
}

.pf-btn-doc {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--pf-navy);
  background-color: var(--pf-bg-alt);
  border: 1px solid var(--pf-border);
  text-decoration: none !important;
  transition: all 0.2s ease;
  cursor: pointer;
}

.pf-btn-doc:hover {
  background-color: #EDF2F7;
  color: var(--pf-wine);
  border-color: #CBD5E1;
}

.pf-btn-doc svg {
  width: 14px;
  height: 14px;
  stroke: currentColor;
}

.pf-btn-doc.highlight {
  background-color: var(--pf-wine-light);
  color: var(--pf-wine);
  border-color: #F8D7DA;
}

.pf-btn-doc.highlight:hover {
  background-color: #F8D7DA;
}

/* ==========================================================================
   4. ACCORDIONS / TOGGLES REFINADOS (OBJETIVOS, PUBLICAÇÕES, FINANCIAMENTO)
   ========================================================================== */
.pf-accordion-group {
  margin: 0.75rem 0 1.25rem 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pf-accordion-group:last-child {
  margin-bottom: 0;
}

.pf-accordion-item {
  border: 1px solid var(--pf-border);
  border-radius: 8px;
  background-color: #F8FAFC;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.pf-accordion-item.is-open {
  border-color: #CBD5E1;
  background-color: #FFFFFF;
}

.pf-accordion-toggle {
  width: 100%;
  padding: 0.75rem 1rem;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--pf-slate);
  cursor: pointer;
  text-align: left;
  transition: color 0.2s ease;
}

.pf-accordion-toggle:hover {
  color: var(--pf-wine);
}

.pf-accordion-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}

.pf-accordion-item.is-open .pf-accordion-icon {
  transform: rotate(180deg);
  stroke: var(--pf-wine);
}

.pf-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.pf-accordion-inner {
  padding: 0.25rem 1rem 1rem 1rem;
  font-size: 0.9rem;
  line-height: 1.7;
  color: #475569;
  /* border-line removed */ border-top: none;
}

.pf-accordion-inner p {
  margin: 0.5rem 0 0 0;
}

.pf-accordion-inner a {
  color: var(--pf-wine);
  text-decoration: none;
  font-weight: 500;
}

/* ==========================================================================
   5. POPUP / MODAL ACADÊMICO (CICLO SENGHOR 1977)
   ========================================================================== */
.pf-modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.pf-modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
}

.pf-modal-dialog {
  background-color: #FFFFFF;
  border: 1px solid var(--pf-border);
  border-radius: 18px;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: none !important;
  position: relative;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

.pf-modal-backdrop.is-open .pf-modal-dialog {
  transform: translateY(0) scale(1);
}

.pf-modal-header {
  padding: 2rem 2rem 1.25rem 2rem;
  border-bottom: none;
  position: relative;
}

.pf-modal-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--pf-border);
  background: var(--pf-bg-alt);
  color: var(--pf-muted);
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.pf-modal-close-btn:hover {
  background-color: #EDF2F7;
  color: var(--pf-navy);
  border-color: #CBD5E1;
}

.pf-modal-tag {
  font-family: var(--font-sans, 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--pf-wine);
  margin-bottom: 0.35rem;
  display: block;
}

.pf-modal-title {
  font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--pf-navy);
  margin: 0;
  line-height: 1.3;
}

.pf-modal-body {
  padding: 1.75rem 2rem;
  flex: 1;
  overflow-y: auto;
}

.pf-modal-body p {
  font-size: 0.95rem;
  line-height: 1.75;
  color: #334155;
  margin: 0 0 1.25rem 0;
}

.pf-modal-body p:last-child {
  margin-bottom: 0;
}

.pf-modal-footer {
  padding: 1.25rem 2rem;
  /* border-line removed */ border-top: none;
  background-color: var(--pf-bg-alt);
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* ==========================================================================
   6. RESPONSIVIDADE
   ========================================================================== */
@media (max-width: 992px) {
  .pf-nav-dock {
    padding: 0.75rem 1rem;
    gap: 0.65rem;
  }
}

@media (max-width: 640px) {
  .pf-section {
    padding: 3rem 1rem;
  }

  .pf-timeline::before {
    left: 20px;
  }

  .pf-timeline-entry {
    gap: 14px;
  }

  .pf-year-node {
    width: 42px;
    height: 42px;
    font-size: 0.72rem;
  }

  .pf-year-node.long-text {
    font-size: 0.58rem;
  }

  .pf-content-card {
    padding: 1.25rem 1.25rem;
  }

  .pf-section-title {
    font-size: 1.65rem;
  }

  .pf-modal-header,
  .pf-modal-body,
  .pf-modal-footer {
    padding: 1.25rem;
  }

  .pf-section-subtitle,
  .pf-list-content,
  .pf-card-lead-text,
  .pf-accordion-inner p,
  .pf-modal-body p {
    text-align: justify !important;
    text-justify: inter-word !important;
  }
}
