/* ======================================================
   RESET GLOBAL
====================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Segoe UI', Roboto, sans-serif;
}


/* ======================================================
   BASE / BODY
====================================================== */

body {
  background: #FDF9EA;
  color: #1C3952;
}

h1 {
  padding-bottom: 30px;
}

#arquivo,
#equipe,
#home,
#sobre {
  padding: 60px 40px;
}


/* ======================================================
   HEADER / NAVBAR
====================================================== */

header {
  display: flex;
  align-items: center;
  padding: 15px 30px;
  background: #1C3952;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.logo {
  color: #c9b37c;
  font-weight: bold;
  font-size: x-large;
  letter-spacing: 1px;
  gap: 10px;
  align-items: center;
  text-align: center;
  display: flex;
}

.logo img {
  height: 40px;
  width: auto;
  object-fit: contain;
}

nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  /* margin-left: auto; */
  padding: 15px 30px;
}

nav button {
  background: #DCC993;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  transition: 0.2s;
}

nav button:hover {
  background: #c9b37c;
}

@media (max-width: 600px) {

  nav {
    flex-direction: column;
    align-items: flex-end;
    width: 100%;
  }

  .logo {
    width: 100%;
    text-align: center;
    flex-direction: column;
    margin-bottom: 10px;
  }

  nav button {
    width: 100%;
    text-align: center;
  }
}

/* ======================================================
   HOME GRID
====================================================== */

.home-container {
  max-width: 1200px;
  margin: 0 auto;
}

.home-grid {
  display: grid;
  grid-template-columns: 2fr 1fr; /* 60% / 40% */
  gap: 25px;
  margin: 30px auto;
  max-width: 1200px;
  align-items: start;
}

.home-grid-full {
  width: 100%;
  display: flex;
  justify-content: center; /* 🔥 centraliza o conteúdo */
  margin: 30px 0;
}

.home-grid-full > .home-main {
  width: 100%;
  max-width: 1200px; /* 🔥 limite real */
}

.home-grid.reverse {
  grid-template-columns: 1fr 2fr; /* invertido */
}

/* CARDS */
.home-main, .home-side {
  background: #FFFFFF;
  padding: 20px;
  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

/* ======================================================
   VÍDEOS RESPONSIVOS
====================================================== */

.videos-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  max-width: 1200px;
  margin: 40px auto;
}

.videos-grid h2, .home-grid.reverse h2 {
  grid-column: 1 / -1;
}

.video {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 */
  border-radius: 12px;
  overflow: hidden;
}

.video iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* ======================================================
   PUBLICAÇÕES
====================================================== */

#publicacoesContainer, #capitulosContainer, #outrasContainer {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  max-width: 1200px;
  margin: 20px auto;
}

.publicacao, .capitulo {
  background: #FFFFFF;
  padding: 15px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  line-height: 1.5;
}

/* ======================================================
   RESPONSIVO
====================================================== */

@media (max-width: 900px) {

  .home-grid,
  .home-grid.reverse {
    grid-template-columns: 1fr;
  }

  .videos-grid {
    grid-template-columns: 1fr;
  }
}

/* ======================================================
   LAYOUT PRINCIPAL (ARQUIVO)
====================================================== */

.arquivo-container {
  display: flex;
  gap: 25px;
  padding: 30px;
}

.conteudo {
  flex: 1;
}


/* ======================================================
   SIDEBAR
====================================================== */

.sidebar {
  width: 280px;
  background: #FFFFFF;
  padding: 20px;
  border-radius: 12px;
  height: 80vh;
  overflow-y: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}


/* ======================================================
   INPUTS
====================================================== */

input {
  width: 100%;
  padding: 10px 12px;
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid #ddd;
}


/* ======================================================
   CATEGORIAS (SIDEBAR)
====================================================== */

.categoria-item {
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}

.categoria-item:hover {
  background: #f3f3f3;
}

/* Estado selecionado */
.categoria-item.selected {
  background: #DCC993;
  border-left: 5px solid #1C3952;
  font-weight: 700;
  color: #1C3952;
}

.categoria-item.selected::before {
  content: "✓ ";
  font-weight: bold;
}


/* ======================================================
   CATEGORIAS SELECIONADAS (TAGS)
====================================================== */

#categoriasSelecionadas {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.tag {
  display: flex;
  align-items: center;
  gap: 5px;

  background: #1C3952;
  color: white;

  padding: 6px 10px;
  border-radius: 20px;
  font-size: 13px;

  cursor: pointer;
}

.tag span {
  font-weight: bold;
}


/* ======================================================
   BOTÃO LIMPAR CATEGORIAS
====================================================== */

#limparCategorias, #exportarLidos {
  width: 100%;
  padding: 10px;
  margin-bottom: 10px;

  border: none;
  border-radius: 8px;

  background: #1C3952;
  color: white;

  cursor: pointer;
  transition: 0.2s;
}

#limparCategorias:hover {
  background: #152c40;
}

#limparCategorias:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}


/* ======================================================
   RESULTADOS
====================================================== */

.resultado {
  background: #FFFFFF;
  padding: 20px;
  margin-bottom: 20px;

  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.resultado h3 {
  margin-bottom: 10px;
}


/* ======================================================
   BOTÃO "VER DETALHES"
====================================================== */

.toggle-btn {
  margin-top: 10px;

  background: #1C3952;
  color: white;

  border: none;
  padding: 8px 14px;
  border-radius: 8px;

  cursor: pointer;
}

.toggle-btn:hover {
  opacity: 0.9;
}


/* ======================================================
   DETALHES DO RESULTADO
====================================================== */

.detalhes {
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid #eee;
}

.categoria-bloco {
  background: #f9f9f9;
  padding: 10px;
  margin-bottom: 10px;
  border-radius: 8px;
}


/* ======================================================
   BOTÕES (ARTIGO / EQUIPE)
====================================================== */

.team-btn,
.btn-article {
  display: inline-block;
  margin-top: 15px;

  background: #1C3952;
  color: white;

  padding: 10px 16px;
  border-radius: 10px;

  text-decoration: none;
  font-weight: 500;

  transition: 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.team-btn:hover,
.btn-article:hover {
  background: #152c40;
  transform: translateY(-2px);
}

.team-btn:active,
.btn-article:active {
  transform: scale(0.97);
}


/* ======================================================
   PAGINAÇÃO
====================================================== */

#paginacao {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;

  gap: 8px;
  margin-top: 30px;
}

#paginacao button {
  min-width: 36px;

  padding: 8px 12px;
  border-radius: 8px;
  border: none;

  background: #FFFFFF;
  cursor: pointer;

  transition: 0.2s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

#paginacao button:hover {
  background: #DCC993;
}

#paginacao .active {
  background: #1C3952;
  font-weight: bold;
  color: white;
  transform: scale(1.05);
}


/* ======================================================
   EQUIPE
====================================================== */

#teamContainer {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;

  max-width: 1200px;
  margin: 20px auto;
}

.team-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;

  background: #FFFFFF;
  padding: 20px;

  border-radius: 16px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05);
}

.team-card:hover {
  transform: translateY(-3px);
  transition: 0.2s;
}

.team-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.team-photo {
  width: 140px;
  height: 140px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.team-meta {
  display: flex;
  flex-direction: column;
  gap: 5px;
}


/* ======================================================
   FOOTER
====================================================== */

.footer {
  display: flex;
  gap: 20px;
  padding: 30px;

  background: #1C3952;
  color: white;
}

.footer-col {
  flex: 1;

  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.logos {
  display: flex;
  gap: 10px;
  margin: 10px 0;
}

.logos img {
  width: 50px;
  height: auto;

  background: white;
  padding: 5px;
  border-radius: 6px;
}

@media (max-width: 700px) {

  .footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .footer-col {
    width: 100%;
    max-width: 400px;
  }

  .logos {
    justify-content: center;
  }

  .footer-col:not(:last-child) {
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 15px;
  }

}


/* ======================================================
   UTILIDADES
====================================================== */

.hidden {
  display: none;
}

#totalResultados {
  margin-bottom: 15px;
  font-size: 14px;
  color: #666;
}


/* ======================================================
   RESPONSIVIDADE
====================================================== */

@media (max-width: 900px) {

  .arquivo-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
  }

  #teamContainer {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {

  #teamContainer {
    grid-template-columns: 1fr;
  }
}


/* ======================================================
   GALERIA (HOME SIDE)
====================================================== */

.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.galeria img {
  width: 100%;
  height: 100px;

  object-fit: cover;
  border-radius: 10px;

  cursor: pointer;
  transition: 0.2s;

  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.galeria img:hover {
  transform: scale(1.05);
  opacity: 0.9;
}


/* ======================================================
   GALERIA
====================================================== */

.galeria {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
}

.galeria img {
  width: 100%;
  height: 100px;
  object-fit: cover;

  border-radius: 10px;
  cursor: pointer;

  transition: 0.2s;
}

.galeria img:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

/* ======================================================
   LIGHTBOX
====================================================== */

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background: rgba(0,0,0,0.85);

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  pointer-events: none;
  transition: 0.3s;

  z-index: 9999;

  border: 1px;
}

.lightbox:target {
  opacity: 1;
  pointer-events: auto;
  display: flex;
}

.overlay {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  cursor: zoom-out;
}

.lightbox img {
  max-width: 85%;
  max-height: 85%;
  border-radius: 12px;
  z-index: 2;

  border: 5px solid rgba(255,255,255,0.15);

  box-shadow: 
    0 10px 30px rgba(0,0,0,0.4),
    0 0 0 1px rgba(255,255,255,0.05) inset;
}

.nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  font-size: 40px;
  color: white;
  text-decoration: none;

  padding: 10px;
  z-index: 3;

  opacity: 0.7;
  transition: 0.2s;
}

.nav:hover {
  opacity: 1;
}

.prev {
  left: 30px;
}

.next {
  right: 30px;
}

.close {
  position: absolute;
  top: 20px;
  right: 30px;

  font-size: 28px;
  color: white;
  text-decoration: none;

  z-index: 3;
  opacity: 0.7;
}

.close:hover {
  opacity: 1;
}

.lightbox::after {
  content: "Clique fora da imagem para fechar";
  position: absolute;
  bottom: 20px;
  width: 100%;
  text-align: center;

  color: white;
  font-size: 14px;
  opacity: 0.7;
}

/* ======================================================
   BOTÃO LEIA MAIS
====================================================== */

.texto-limitado {
  max-height: 240px;
  overflow: hidden;
  position: relative;
  transition: 0.3s;
}

.texto-limitado-metodologia {
  max-height: 290px;
  overflow: hidden;
  position: relative;
  transition: 0.3s;
}

.texto-limitado::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;

  width: 100%;
  height: 40px;

  background: linear-gradient(transparent, #FDF9EA);
}

.texto-expandido {
  max-height: none;
}

.texto-expandido::after {
  display: none;
}

.btn-lermais {
  margin-top: 10px;
  background: #1C3952;
  color: white;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.resultado-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-lido {
  background: #eee;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  transition: 0.2s;
  /* width: 100px; */
  margin-top: 10px;
}

.btn-lido:hover {
  background: #ddd;
}

.btn-lido.ativo {
  background: #1C3952;
  color: white;
  font-weight: 500;
}