/* RESET E CONFIGURAÇÕES GLOBAIS */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  width: 100%;
  overflow-x: hidden;
}

:root {
  --bg-body: #1c1c1c;
  --bg-body-transparent: rgba(28, 28, 28, 0.7);
  --text-color: #ffffff;
  --header-bg: #293e5c;
  --card-border: #ccc;
  --card-text: #fff;
  --secondary: #ffcc00;
  --bg-card: #2c2c2c;
}

body.light-mode {
  --bg-body: #f4f4f4;
  --bg-body-transparent: rgba(244, 244, 244, 0.7);
  --text-color: #1a1a1a;
  --card-border: #333;
  --card-text: #000;
  --bg-card: #ffffff;
}

body {
  background-color: var(--bg-body);
  color: var(--text-color);
  font-family: "Poppins", sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  /* padding-top: 100px; */
  transition:
    background-color 0.3s ease,
    color 0.3s ease;
}

main {
  flex: 1;
  width: 100%;
  margin-bottom: 100px;
}

/* TIPOGRAFIA E LINKS */
a {
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

a:visited {
  color: inherit;
}

.content_title {
  display: inline-block;
  position: relative;
  font-size: 2rem;
  margin-bottom: 20px;
}

.content_title::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 3px;
  background-color: var(--header-bg);
  transition: width 0.3s ease;
}

.content_title:hover::after {
  width: 100%;
}

/* COMPONENTES DE INTERFACE (BOTÕES E MODAIS) */
#back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background-color: var(--secondary);
  color: var(--header-bg);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.4s ease;
}

#back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-to-top:hover {
  transform: scale(1.1);
  background-color: #ffd633;
}

/* --- MODAL (POPUP) CORRIGIDO PARA CELULAR --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  /* Z-index bem alto para ficar acima de tudo (menu, header, cookies) */
  z-index: 10001;
  display: none; /* O JavaScript muda isso para 'flex' */
  justify-content: center;
  align-items: center;
  padding: 20px; /* Garante espaço nas laterais no celular */
}

.modal-box {
  background: white;
  padding: 30px;
  border-radius: 12px;
  width: 90%; /* Ocupa quase toda a largura no celular */
  max-width: 400px; /* Mas não passa de 400px no computador */
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  animation: subir 0.3s ease-out;
  position: relative;
}

.modal-box h3 {
  color: #333;
  margin-top: 0;
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.modal-box p {
  color: #666;
  margin-bottom: 25px;
  font-size: 1rem;
}

.modal-botoes {
  display: flex;
  gap: 10px;
  justify-content: center;
}

/* Botões do Modal */
.btn-primario {
  background: var(--header-bg);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  font-size: 1rem;
  transition: background 0.3s;
}

.btn-primario:hover {
  background-color: #34495e; /* Um pouco mais claro que o header */
}

.btn-secundario {
  background: transparent;
  border: 1px solid #ccc;
  color: #666;
  padding: 12px 24px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.3s;
}

.btn-secundario:hover {
  background-color: #f0f0f0;
  border-color: #bbb;
}

/* COOKIE BANNER */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background-color: #2c3e50;
  color: white;
  padding: 15px 20px;
  display: none;
  justify-content: center;
  align-items: center;
  gap: 20px;
  z-index: 10000;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.cookie-banner button {
  background-color: #27ae60;
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: background 0.3s;
}

.cookie-banner button:hover {
  background-color: #219150;
}

/* FOOTER */
footer {
  background-color: var(--header-bg);
  color: white;
  padding-top: 40px;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  max-width: 1200px;
  margin: 0 auto;
  padding-bottom: 20px;
  gap: 20px;
}

.footer-section {
  flex: 1;
  min-width: 250px;
  padding: 0 20px;
}

.footer-section h3 {
  font-family: "Oswald", sans-serif;
  margin-bottom: 15px;
  color: var(--secondary);
  font-size: 1.2rem;
}

.footer-section p {
  font-size: 0.9rem;
  line-height: 1.6;
  opacity: 0.8;
}

.footer-section ul {
  list-style: none;
  padding: 0;
}

.footer-section ul li {
  margin-bottom: 10px;
}

.footer-section ul li a {
  color: white;
  opacity: 0.8;
  transition: all 0.3s;
  text-decoration: none;
}

.footer-section ul li a:hover {
  opacity: 1;
  padding-left: 5px;
  color: var(--secondary);
}

.footer-bottom {
  background-color: rgba(0, 0, 0, 0.2);
  text-align: center;
  padding: 15px;
  font-size: 0.8rem;
  margin-top: 20px;
}

@media (max-width: 768px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
}

footer {
  text-align: center;
  padding: 20px;
  background: var(--header-bg);
  color: white;
  font-size: 0.9rem;
  margin-top: auto;
}

/* Títulos das Seções (H2 com linha embaixo) */
.content_title {
  display: inline-block;
  position: relative;
  color: inherit;
  text-decoration: none;
  font-family: "Poppins", sans-serif;
  font-size: 2rem;
  margin-bottom: 20px;
}

.content_title::after {
  content: "";
  position: absolute;
  width: 0;
  height: 3px;
  bottom: -5px;
  left: 0;
  background-color: var(--header-bg);
  transition: width 0.3s ease;
}

.content_title:hover::after {
  width: 100%;
}

/* ANIMAÇÕES E RESPONSIVIDADE */
@keyframes subir {
  from {
    transform: translateY(20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .modal-botoes {
    flex-direction: column; /* Botões um embaixo do outro */
  }
  .btn-primario,
  .btn-secundario {
    width: 100%;
  }

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

@media (max-width: 600px) {
  .cookie-banner {
    flex-direction: column;
    text-align: center;
  }
}

/* HEADER E NAVEGAÇÃO */
header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 100%;
  height: 80px;
  padding: 0 5%;
  background-color: var(--header-bg);
  color: white;
  box-shadow: 0 2px 15px rgba(0, 0, 0, 0.3);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

header a {
  color: white;
  font-family: "Oswald", sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: color 0.3s;
}

header nav ul li a:hover {
  color: var(--secondary);
}

.branding {
  display: flex;
  align-items: center;
  gap: 15px;
  font-size: 1.4rem;
  z-index: 1001;
}

.branding img {
  width: 45px;
  height: auto;
}

nav ul {
  display: flex;
  align-items: center;
  gap: 25px;
  list-style: none;
}

/* BOTÃO DE TEMA */
#btn-tema {
  width: 35px;
  height: 35px;
  background: rgba(255, 255, 255, 0.15);
  color: white;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

/* MENU MOBILE (BOTÃO HAMBÚRGUER) */
#btn-mobile {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 24px;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 1001;
}

#btn-mobile div {
  width: 100%;
  height: 3px;
  background-color: white;
  border-radius: 2px;
  transition: 0.3s;
}

#btn-mobile.active .line1 {
  transform: translateY(10.5px) rotate(45deg);
}
#btn-mobile.active .line2 {
  opacity: 0;
}
#btn-mobile.active .line3 {
  transform: translateY(-10.5px) rotate(-45deg);
}

/* RESPONSIVIDADE */
@media (max-width: 900px) {
  header {
    height: 70px;
    padding: 0 20px;
  }

  nav ul {
    display: none;
  }

  #btn-mobile {
    display: flex;
  }

  #menu {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    height: 100vh;

    background: var(--header-bg);
    box-shadow: 20px 20px 40px -6px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(9.5px);
    -webkit-backdrop-filter: blur(9.5px);

    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 100px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
    overflow-y: auto;
  }

  #menu.active {
    transform: translateX(0);
  }

  #menu li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  #menu li a {
    display: block;
    padding: 20px;
    font-size: 1.3rem;
    text-align: center;
  }

  #btn-tema {
    margin: 20px auto;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    background-color: rgba(255, 255, 255, 0.1);
  }
}
/* CONTAINER DO CARROSSEL */
.carousel-container {
  display: flex;
  gap: 25px;
  padding: 10px;
  margin-bottom: 20px;
  height: auto;
  max-width: max-content;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    black 1%,
    black 99%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    black 1%,
    black 99%,
    transparent
  );
}

.carousel-container::-webkit-scrollbar {
  display: none;
}

/* CARDS (GALLERY ITEM) */
div.gallery-item {
  flex: 0 0 auto;
  width: 260px;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  overflow: hidden;
  scroll-snap-align: start;
  position: relative;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition:
    transform 0.3s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

div.gallery-item:hover {
  border-color: var(--secondary);
  cursor: pointer;
  transform: translateY(-5px);
}

div.gallery-item a.card-link-wrapper {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

/* IMAGEM DO CARD */
.card-image-box {
  width: 100%;
  height: 180px;
  flex-shrink: 0;
  background-color: #000;
  border-bottom: 1px solid var(--card-border);
}

.card-image-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* CONTEÚDO DO CARD */
.card-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 15px 20px;
  background-color: var(--bg-card);
}

.card-content h3.desc {
  font-family: "Oswald", sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  line-height: 1.3;
  color: var(--text-color);
  margin-bottom: 10px;
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.short-desc {
  font-family: "Poppins", sans-serif;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-color);
  opacity: 0.8;
  margin-bottom: 15px;
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.read-more {
  display: block;
  margin-top: auto;
  font-family: "Poppins", sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary);
}

/* GRID DE NOTÍCIAS */
.news-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 30px;
  justify-content: start;
  padding: 40px 20px;
}

.news-grid .gallery-item {
  width: 280px;
}

/* RESPONSIVIDADE */
@media (max-width: 768px) {
  .carousel-container {
    flex-wrap: nowrap;
    justify-content: flex-start;
  }

  div.gallery-item {
    width: 240px;
  }

  .news-grid {
    justify-content: center;
  }
}
