/* Cabeçalho Superior da Seção (Largura Total) */
.tes-intro-header {
  margin-bottom: 2rem;
  max-width: 100%;
}

/* ==========================================================================
   TESES E DISSERTAÇÕES DO CEAA — PROJETO MEMÓRIA CEAA 50 ANOS
   Design 100% sans-serif, arejado, modular e moderno.
   Zero box-shadow. Bordas sutis. Cores institucionais:
   - Azul Marinho (#000428, #0B1021)
   - Bordô / Vinho CEAA (#8A1538, #3B020E)
   - Fundos (#FFFFFF, #F8FAFC, #F1F5F9)
   - Bordas (#E2E8F0, #CBD5E1)
   ========================================================================== */

:root {
  --tes-navy: #0B1021;
  --tes-navy-light: #1E293B;
  --tes-bordeau: #8A1538;
  --tes-bordeau-light: #FDF2F4;
  --tes-bg: #FFFFFF;
  --tes-bg-alt: #F8FAFC;
  --tes-bg-subtle: #F1F5F9;
  --tes-border: #E2E8F0;
  --tes-border-subtle: #EDF2F7;
  --tes-text: #334155;
  --tes-text-muted: #64748B;
  --tes-text-light: #94A3B8;
  --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.page-teses-body {
  background-color: var(--tes-bg);
  color: var(--tes-text);
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

.tes-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.tes-section {
  padding: 5rem 0;
}

.tes-section-kicker {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tes-bordeau);
  margin-bottom: 0.5rem;
}

.tes-section-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--tes-navy);
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

.tes-section-subtitle {
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--tes-text-muted);
  max-width: 720px;
  margin: 0 0 2.5rem;
}

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

.site-header.scrolled ~ #main-content .tes-nav-dock-wrap,
#app-header:has(.site-header.scrolled) ~ #main-content .tes-nav-dock-wrap,
body:has(.site-header.scrolled) .tes-nav-dock-wrap,
body.scrolled-header .tes-nav-dock-wrap {
  top: 84px;
  box-shadow: 0 4px 16px -2px rgba(11, 16, 33, 0.04);
}



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

.tes-dock-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--tes-bg-subtle);
  padding: 0.25rem;
  border-radius: 12px;
  border: 1px solid var(--tes-border);
}

.tes-dock-btn {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--tes-text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
}

.tes-dock-btn:hover {
  color: var(--tes-navy);
}

.tes-dock-btn.is-active {
  background: var(--tes-navy);
  color: #FFFFFF;
}

/* ==========================================================================
   1. APRESENTAÇÃO & DIAGRAMAÇÃO EDITORIAL
   ========================================================================== */
.tes-intro-section {
  background: #FFFFFF;
  border-bottom: none;
}

.tes-intro-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3.5rem;
  align-items: start;
}

.tes-story-timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  margin-top: 1.5rem;
  margin-bottom: 2rem;
}

.tes-story-card {
  background: #FFFFFF;
  border: 1px solid var(--tes-border-subtle);
  border-left: 4px solid var(--tes-bordeau);
  border-radius: 12px;
  padding: 1.75rem 2rem;
  box-shadow: none !important;
  transition: border-color 0.2s ease;
}

.tes-story-card:hover {
  border-left-color: var(--tes-navy);
  border-color: var(--tes-border);
}

.tes-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--tes-bordeau);
  background: var(--tes-bordeau-light);
  padding: 0.35rem 0.85rem;
  border-radius: 9999px;
  margin-bottom: 1.25rem;
}

.tes-badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--tes-bordeau);
}

.tes-card-text {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  font-size: 0.985rem;
  line-height: 1.8;
  color: var(--tes-text);
}

.tes-lead-para {
  font-size: 1.075rem;
  font-weight: 500;
  color: var(--tes-navy);
  line-height: 1.75;
}

.tes-highlight-box {
  background: var(--tes-bg-alt);
  border: 1px solid var(--tes-border);
  border-radius: 10px;
  padding: 1.25rem 1.5rem;
  font-size: 0.95rem;
  line-height: 1.75;
  color: #1E293B;
  font-weight: 500;
}

.tes-author-credits-card {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  background: var(--tes-bg-subtle);
  border: 1px solid var(--tes-border);
  border-radius: 10px;
  padding: 1rem 1.25rem;
}

.tes-credits-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--tes-bordeau);
  flex-shrink: 0;
}

.tes-author-credits {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tes-navy-light);
  line-height: 1.5;
  margin: 0;
}

/* Coluna Lateral: Card de Destaque Caderno de Resumos */
.tes-intro-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3.5rem;
  align-items: start;
}

.tes-intro-side-col {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 145px !important;
  z-index: 20;
}

.tes-feature-card {
  background: #FFFFFF;
  border: 1px solid var(--tes-border);
  border-radius: 16px;
  padding: 2.25rem 2rem;
  box-shadow: none !important;
  position: relative;
}

.tes-feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--tes-bordeau-light);
  color: var(--tes-bordeau);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}

.tes-feature-tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tes-bordeau);
  margin-bottom: 0.35rem;
}

.tes-feature-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--tes-navy);
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
}

.tes-feature-desc {
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--tes-text-muted);
  margin: 0 0 1.75rem;
}

.tes-stat-pills {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.625rem;
  margin-bottom: 1.75rem;
}

.tes-stat-pill {
  background: var(--tes-bg-alt);
  border: 1px solid var(--tes-border);
  border-radius: 8px;
  padding: 0.75rem 0.5rem;
  text-align: center;
}

.tes-stat-pill strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--tes-navy);
  line-height: 1.1;
  margin-bottom: 0.25rem;
}

.tes-stat-pill span {
  font-size: 0.6875rem;
  color: var(--tes-text-muted);
  line-height: 1.2;
}

.tes-btn-caderno {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.625rem;
  width: 100%;
  padding: 0.875rem 1.25rem;
  background: var(--tes-navy);
  color: #FFFFFF;
  border-radius: 10px;
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: none !important;
  transition: all 0.2s ease;
  box-sizing: border-box;
  white-space: nowrap !important;
}

@media (max-width: 480px) {
  .tes-btn-caderno {
    font-size: 0.84rem;
    padding: 0.8rem 0.85rem;
    gap: 0.45rem;
    white-space: nowrap !important;
  }
}

.tes-btn-caderno:hover {
  background: var(--tes-bordeau);
}

/* ==========================================================================
   2. ACERVO: BARRA DE FILTROS & BUSCA EM LINHA ÚNICA
   ========================================================================== */
.tes-archive-section {
  background: var(--tes-bg-alt);
}

.tes-filter-toolbar {
  background: #FFFFFF;
  border: 1px solid var(--tes-border);
  border-radius: 14px;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2.25rem;
  flex-wrap: wrap;
}

.tes-filter-pills {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.tes-filter-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  background: transparent;
  color: var(--tes-text-muted);
  border: 1px solid var(--tes-border);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tes-filter-pill:hover {
  border-color: var(--tes-text-muted);
  color: var(--tes-navy);
}

.tes-filter-pill.is-active {
  background: var(--tes-navy);
  color: #FFFFFF;
  border-color: var(--tes-navy);
}

.tes-pill-count {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  background: rgba(0, 0, 0, 0.06);
  color: inherit;
}

.tes-filter-pill.is-active .tes-pill-count {
  background: var(--tes-bordeau);
  color: #FFFFFF;
}

.tes-search-wrap {
  position: relative;
  width: 280px;
  max-width: 100%;
  display: flex;
  align-items: center;
  flex: 1 1 240px;
}

.tes-search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tes-text-light);
  pointer-events: none;
}

.tes-search-input {
  width: 100%;
  padding: 0.625rem 1rem 0.625rem 2.5rem;
  background: var(--tes-bg-alt);
  border: 1px solid var(--tes-border);
  border-radius: 9999px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  color: var(--tes-navy);
  box-sizing: border-box;
  outline: none;
  transition: all 0.2s ease;
}

.tes-search-input:focus {
  outline: none;
  background: #FFFFFF;
  border-color: var(--tes-navy);
}

/* ==========================================================================
   GRID DE TESES & CARDS
   ========================================================================== */
.tes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 1.5rem;
}

.tes-card {
  background: #FFFFFF;
  border: 1px solid var(--tes-border);
  border-radius: 14px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-shadow: none !important;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.tes-card:hover {
  transform: translateY(-2px);
  border-color: var(--tes-bordeau);
}

.tes-card.is-hidden {
  display: none !important;
}

.tes-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.85rem;
}

.tes-card-decade-badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  background: var(--tes-bg-alt);
  border: 1px solid var(--tes-border);
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--tes-navy);
}

.tes-card-num {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--tes-text-light);
}

.tes-card-body {
  flex: 1;
  margin-bottom: 1.25rem;
}

.tes-card-author {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--tes-bordeau);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0 0 0.5rem;
}

.tes-card-title {
  font-family: var(--font-heading);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--tes-navy);
  line-height: 1.45;
  margin: 0;
}

.tes-card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-top: 1rem;
  /* border-line removed */
  border-top: none;
}

.tes-btn-pdf {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.85rem;
  border-radius: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  box-shadow: none !important;
}

.tes-btn-full {
  background: var(--tes-bordeau-light);
  color: var(--tes-bordeau);
  border: 1px solid rgba(138, 21, 56, 0.2);
}

.tes-btn-full:hover {
  background: var(--tes-bordeau);
  color: #FFFFFF;
}

.tes-btn-resumo {
  background: var(--tes-bg-subtle);
  color: var(--tes-text-muted);
  border: 1px solid var(--tes-border);
}

.tes-btn-resumo:hover {
  background: var(--tes-navy);
  color: #FFFFFF;
  border-color: var(--tes-navy);
}

/* ==========================================================================
   CARREGAMENTO POR ETAPAS & FEEDBACK VAZIO
   ========================================================================== */
.tes-empty-state {
  text-align: center;
  padding: 4rem 1rem;
  background: #FFFFFF;
  border: 1px dashed var(--tes-border);
  border-radius: 12px;
  color: var(--tes-text-muted);
}

.tes-load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 3.5rem;
}

.tes-load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.85rem 2rem;
  background: #FFFFFF;
  color: var(--tes-navy);
  border: 1px solid var(--tes-border);
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: none !important;
  transition: all 0.2s ease;
}

.tes-load-more-btn:hover {
  background: var(--tes-bg-alt);
  border-color: var(--tes-navy);
  color: var(--tes-bordeau);
}

.tes-load-more-btn svg {
  transition: transform 0.2s ease;
}

.tes-load-more-btn:hover svg {
  transform: translateY(2px);
}

/* Responsividade */
@media (max-width: 1024px) {
  .tes-intro-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .tes-feature-card {
    position: static;
  }

  .tes-btn-caderno {
    width: fit-content !important;
    max-width: 100% !important;
    align-self: flex-start !important;
    display: inline-flex !important;
  }

  .tes-filter-toolbar {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 1.25rem;
    padding: 1rem 1.25rem;
    flex-wrap: nowrap;
  }

  .tes-search-wrap {
    width: auto;
    max-width: 360px;
    flex: 1 1 auto;
  }

  .tes-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
  }
}

@media (max-width: 640px) {
  .tes-grid {
    grid-template-columns: 1fr !important;
  }

  /* Cards de métricas um abaixo do outro e botão centralizado apenas no celular */
  .tes-stat-pills {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }

  .tes-btn-caderno {
    display: flex !important;
    width: fit-content !important;
    align-self: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .tes-gallery-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }

  .tes-gallery-img {
    height: 240px !important;
  }

  .tes-filter-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem;
  }

  .tes-filter-pills {
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
  }

  .tes-search-wrap {
    width: 100%;
    max-width: 100%;
    flex: 0 0 auto;
    height: auto;
  }

  .tes-section-subtitle {
    text-align: justify !important;
    text-justify: inter-word !important;
  }
}

/* Alinhamento justificado geral para o conteúdo (exceto títulos, tags e botões) */
.tes-lead-para,
.tes-card-text p,
.tes-highlight-box p,
.tes-feature-desc {
  text-align: justify !important;
  text-justify: inter-word !important;
}


/* Padronização Sticky Lateral */

.tes-intro-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 3.5rem;
  align-items: start;
}

.tes-intro-side-col {
  position: -webkit-sticky !important;
  position: sticky !important;
  top: 145px !important;
  z-index: 20;
}

@media (max-width: 1024px) {
  .tes-intro-grid {
    grid-template-columns: 1fr;
  }

  .tes-intro-side-col {
    position: static !important;
  }
}


/* ==========================================================================
   GALERIA HISTÓRICA DO ACERVO (ENTRE DOBRA 2 E 3)
   ========================================================================== */
.tes-gallery-section {
  background: var(--tes-bg-subtle);
  padding: 4rem 0;
}

.tes-gallery-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: stretch;
}

.tes-gallery-item {
  position: relative;
  background: #FFFFFF;
  border: 1px solid var(--tes-border);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: none !important;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.tes-gallery-item:hover {
  transform: translateY(-2px);
  border-color: #CBD5E1;
  box-shadow: 0 8px 24px -4px rgba(11, 16, 33, 0.08) !important;
}

.tes-gallery-img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
  cursor: pointer;
}

.tes-gallery-item:hover .tes-gallery-img {
  transform: scale(1.02);
}

.tes-gallery-caption {
  padding: 1.25rem 1.5rem;
  background: #FFFFFF;
  /* border-line removed */
  border-top: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.tes-gallery-caption-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tes-gallery-icon {
  color: var(--tes-bordeau);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.tes-gallery-text {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--tes-navy);
  line-height: 1.4;
  margin: 0;
}

/* Badge 'Clique para ampliar' */
.tes-zoom-hint {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.35rem 0.85rem;
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 8px;
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
  font-size: 0.75rem;
  font-weight: 600;
  color: #64748B;
  cursor: pointer;
  outline: none;
  transition: all 0.2s ease;
  align-self: flex-start;
}

.tes-zoom-hint:hover,
.tes-gallery-item:hover .tes-zoom-hint {
  background: #FFFFFF;
  border-color: #950221;
  color: #950221;
  box-shadow: 0 2px 8px rgba(149, 2, 33, 0.12);
  transform: translateY(-1px);
}

/* Lightbox Modal Institucional de Teses & Biblioteca */
