@import url("https://fonts.googleapis.com/css?family=DM+Sans:400,500,700&display=swap");

/* Estilos do carrossel */
.carousel-wrapper {
  width: 95%;
  max-width: 900px;
  background-color: white;
  border-radius: 15px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  padding: 25px;
  margin: 20px auto;
  border: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
}

input[type=radio] {
  display: none;
}
.card {
  position: absolute;
  width: 60%;
  height: 100%;
  left: 0;
  right: 0;
  margin: auto;
  transition: transform .4s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.container {
  width: 100%;
  max-width: 800px;
  height: 33.75vh; /* Reduzido para 3/4 do tamanho anterior (45vh * 0.75) */
  max-height: 300px; /* Aumentado para acomodar melhor o conteúdo */
  transform-style: preserve-3d;
  display: flex;
  justify-content: center;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.cards {
  position: relative;
  width: 100%;
  height: 100%;
  margin-bottom: 20px;
}
.image-container {
  width: 45%; /* Ligeiramente aumentado */
  height: 0;
  padding-bottom: 45%; /* Mantendo a proporção quadrada */
  margin: 0 auto 20px; /* Aumento da margem inferior */
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 10px;
  position: absolute;
  top: 0;
  left: 0;
}
.btn-link {
  display: inline-block;
  background-color: #2992dc;
  color: white;
  padding: 10px 16px; /* Aumentado o padding vertical */
  text-decoration: none;
  border-radius: 5px;
  font-weight: 500;
  text-align: center;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 5px #2992dc,
              0 0 10px #2992dc;
  animation: neon-pulse 1.5s infinite alternate;
  font-size: 0.9em;
  width: 90%; /* Aumentando a largura do botão */
  max-width: 300px;
  min-height: 50px; /* Adicionando altura mínima para garantir que caibam as duas linhas */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@keyframes neon-pulse {
  0% {
    box-shadow: 0 0 5px #2992dc,
                0 0 10px #2992dc;
  }
  100% {
    box-shadow: 0 0 10px #2992dc,
               0 0 20px #2992dc,
               0 0 30px #2992dc;
  }
}

.btn-link:hover {
  background-color: #1a7ac1;
  transform: translateY(-3px);
  box-shadow: 0 0 15px #2992dc,
              0 0 30px #2992dc,
              0 0 45px #2992dc;
}

.btn-text {
  display: block;
  line-height: 1.4;
  margin: 2px 0; /* Adiciona margem entre as linhas */
}

.btn-text-primary {
  font-size: 14px; /* Aumentado */
  font-weight: bold;
}

.btn-text-secondary {
  font-size: 12px; /* Aumentado */
  opacity: 0.9;
}

/* Botões de navegação nas laterais */
.nav-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
}

.nav-button:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.nav-prev {
  left: 15%;
}

.nav-next {
  right: 15%;
}

.nav-arrow {
  width: 0;
  height: 0;
  border-style: solid;
}

.nav-prev .nav-arrow {
  border-width: 8px 12px 8px 0;
  border-color: transparent white transparent transparent;
}

.nav-next .nav-arrow {
  border-width: 8px 0 8px 12px;
  border-color: transparent transparent transparent white;
}

/* Por padrão, esconder todos os slides */
.card {
  transform: translatex(100vw) scale(0);
  opacity: 0;
  z-index: 0;
  transition: transform .4s ease, opacity .4s ease;
}

/* Slide atual (ativo) */
#item-1:checked ~ .cards #news-1,
#item-2:checked ~ .cards #news-2,
#item-3:checked ~ .cards #news-3,
#item-4:checked ~ .cards #news-4,
#item-5:checked ~ .cards #news-5,
#item-6:checked ~ .cards #news-6,
#item-7:checked ~ .cards #news-7,
#item-8:checked ~ .cards #news-8 {
  transform: translatex(0) scale(1);
  opacity: 1;
  z-index: 1;
}

/* Slide à direita (apenas um visível) */
#item-1:checked ~ .cards #news-2,
#item-2:checked ~ .cards #news-3,
#item-3:checked ~ .cards #news-4,
#item-4:checked ~ .cards #news-5,
#item-5:checked ~ .cards #news-6,
#item-6:checked ~ .cards #news-7,
#item-7:checked ~ .cards #news-8,
#item-8:checked ~ .cards #news-1 {
  transform: translatex(40%) scale(.8);
  opacity: .4;
  z-index: 0;
}

/* Slide à esquerda (apenas um visível) */
#item-1:checked ~ .cards #news-8,
#item-2:checked ~ .cards #news-1,
#item-3:checked ~ .cards #news-2,
#item-4:checked ~ .cards #news-3,
#item-5:checked ~ .cards #news-4,
#item-6:checked ~ .cards #news-5,
#item-7:checked ~ .cards #news-6,
#item-8:checked ~ .cards #news-7 {
  transform: translatex(-40%) scale(.8);
  opacity: .4;
  z-index: 0;
}

/* Ocultando botões nos slides não ativos */
[id^="item-"]:not(:checked) ~ .cards [id^="news-"] .btn-link {
  opacity: 0;
  pointer-events: none;
}

#item-1:checked ~ .cards #news-1 .btn-link,
#item-2:checked ~ .cards #news-2 .btn-link,
#item-3:checked ~ .cards #news-3 .btn-link,
#item-4:checked ~ .cards #news-4 .btn-link,
#item-5:checked ~ .cards #news-5 .btn-link,
#item-6:checked ~ .cards #news-6 .btn-link,
#item-7:checked ~ .cards #news-7 .btn-link,
#item-8:checked ~ .cards #news-8 .btn-link {
  opacity: 1;
  pointer-events: auto;
}

/* Media queries para responsividade */
@media (max-width: 768px) {
  .container {
    height: 35vh; /* Aumentado para melhor proporção */
    max-height: 260px; /* Aumentado para melhor adaptação */
  }
  
  .image-container {
    width: 55%;
    padding-bottom: 55%;
    margin-bottom: 15px;
  }
  
  .card {
    width: 80%;
  }
  
  .nav-prev {
    left: 5%;
  }
  
  .nav-next {
    right: 5%;
  }
  
  .carousel-wrapper {
    padding: 15px;
    min-height: 280px; /* Aumentado para melhor adaptação */
  }
  
  /* Garante que o botão tenha altura suficiente em telas médias */
  .btn-link {
    min-height: 56px;
    padding: 10px 14px;
  }
}

@media (max-width: 480px) {
  .container {
    height: 32vh; /* Aumentado para dar mais espaço */
    max-height: 210px; /* Aumentado para melhor adaptação */
  }
  
  .image-container {
    width: 70%;
    padding-bottom: 70%;
    margin-bottom: 12px; /* Aumentado */
  }
  
  .card {
    width: 90%;
  }
  
  .carousel-wrapper {
    min-height: 240px; /* Aumentado para garantir espaço suficiente */
    padding: 12px;
  }
  
  /* Em telas muito pequenas, esconder todos os slides exceto o ativo */
  .card {
    transform: translatex(100vw) scale(0);
    opacity: 0;
  }
  
  /* Mostrar apenas o slide ativo */
  #item-1:checked ~ .cards #news-1,
  #item-2:checked ~ .cards #news-2,
  #item-3:checked ~ .cards #news-3,
  #item-4:checked ~ .cards #news-4,
  #item-5:checked ~ .cards #news-5,
  #item-6:checked ~ .cards #news-6,
  #item-7:checked ~ .cards #news-7,
  #item-8:checked ~ .cards #news-8 {
    transform: translatex(0) scale(1);
    opacity: 1;
    z-index: 1;
  }
  
  .btn-link {
    padding: 12px 16px; /* Aumentado o padding vertical */
    min-height: 60px; /* Garantir altura mínima */
  }
  
  .btn-text-primary {
    font-size: 14px;
  }
  
  .btn-text-secondary {
    font-size: 12px;
  }
  
  .nav-button {
    width: 30px;
    height: 30px;
  }
  
  .nav-prev {
    left: 2%;
  }
  
  .nav-next {
    right: 2%;
  }
}

/* Ajuste para telas muito pequenas */
@media (max-width: 360px) {
  .carousel-wrapper {
    min-height: 220px;
    padding: 10px;
  }
  
  .container {
    height: 28vh;
    max-height: 200px;
  }
  
  .image-container {
    margin-bottom: 10px;
  }
  
  .btn-link {
    min-height: 54px;
    font-size: 0.85em;
  }
  
  .btn-text-primary {
    font-size: 13px;
  }
  
  .btn-text-secondary {
    font-size: 11px;
  }
}