@font-face {
  font-family: "Athena";
  src: url("../fonts/Athena-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Safira March";
  src: url("../fonts/Safira March.otf") format("opentype");
  font-weight: normal;
  font-style: normal;
}

*,
html,
body {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #121417;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Athena", serif;
  color: #EAEAEA;
  overflow-x: hidden;
}

body.no-scroll {
  overflow: hidden;
  height: 100%;
  position: fixed;
  width: 100%;
}

/* HEADER FIXO PARA AMBAS AS PÁGINAS */
header {
  background: #1A1D25;
  padding: 20px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container, .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 96%;
  max-width: 1920px; /* Aumentado para acomodar o container do header */
  padding: 0 10px;
  margin: 0 auto;
  flex-wrap: wrap;
}

.logo {
  height: 70px;
  width: auto;
}

.menu {
  list-style: none;
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 0;
}

.menu li {
  display: inline-block;
}

.menu a {
  text-decoration: none;
  font-size: 16px;
  color: #FFFFFF;
  font-weight: bold;
  padding: 10px 15px;
  transition: color 0.3s, transform 0.3s;
}

.menu a:hover {
  color: #CF640C;
  transform: scale(1.05);
}

h1 {
  color: #FFFFFF;
  font-family: "Times New Roman", Times, serif;
}

/* MAIN ESPECÍFICO PARA PÁGINA INICIAL (INDEX) */
main.blog-index {
  flex: 1;
  margin: 20px auto;
  max-width: 100%;
  padding: 0 15px;
  width: 100%;
}

#wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 15px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0 15px;
}

.grid article {
  background: #1A1D25;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  text-align: left;
}

.grid article img, .card-img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-top: 10px;
}

.card-image {
  position: relative;
}

.post-type-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(207, 100, 12, 0.9);
  color: white;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  z-index: 10;
  text-transform: uppercase;
}

.card-title {
  font-size: 1.2rem;
  color: #FFFFFF;
  margin: 10px 0 5px;
  font-family: "Times New Roman", Times, serif;
}

.read-more {
  color: #CF640C;
  font-weight: bold;
  text-decoration: none;
  margin-top: 5px;
}

.card-footer, .grid article .meta {
  font-size: 0.85rem;
  color: #BBBBBB;
  margin-top: auto;
  text-align: right;
}

.flair {
  font-size: 0.85rem;
  color: #BBBBBB;
  margin: 5px 0 0;
  font-weight: 500;
}

/* MAIN ESPECÍFICO PARA PÁGINA DE POST */
/* Container principal do post */
.post-container {
  font-family: "Athena", serif;
  color: #FFFFFF;
  padding: 30px;
  text-align: justify;
  background: #1A1D25;
  border-radius: 8px;
  width: 100%;
  box-sizing: border-box;
  max-width: 960px; /* Definido max-width para centralizar */
  margin: 20px auto; /* Centraliza o container do post */
}

/* Cabeçalho do post */
.post-container h1 {
  font-family: "Times New Roman", Times, serif;
  text-align: left;
  margin-bottom: 20px;
  font-size: 2.2rem; /* Ajustado para melhor visualização */
  line-height: 1.3;
}

/* Metadados do post */
.post-meta {
  color: #DDDDDD;
  font-size: 16px;
  margin-bottom: 30px;
  border-bottom: 1px solid #333;
  padding-bottom: 20px;
}

/* Conteúdo do post */
.post-content {
  color: #EEEEEE;
  line-height: 1.8;
  font-size: 1.1rem; /* Ajustado para melhor visualização */
}

/* CORREÇÃO CRÍTICA: Imagens no post não devem herdar estilos dos cards */
.post-content img {
  max-width: 60% !important; /* Força a largura máxima para 60% */
  height: auto !important;
  display: block;
  margin: 30px auto !important; /* Centraliza a imagem e adiciona margem */
  border-radius: 5px;
  box-sizing: border-box;
  border: 1px solid #444;
}

/* Container de compartilhamento */
.share-container {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #333;
}

/* Título de compartilhamento */
.share-container h3 {
  color: #FFFFFF;
  font-size: 1.3rem; /* Ajustado para melhor visualização */
  margin-bottom: 20px;
  text-align: center;
}

/* Botões de compartilhamento */
.social-share-buttons {
  display: flex;
  gap: 20px; /* Aumentado o gap para melhor espaçamento */
  flex-wrap: wrap;
  justify-content: center;
}

.share-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  text-decoration: none;
  color: #FFFFFF;
  font-size: 18px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.share-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.facebook {
  background: #3b5998;
}

.linkedin {
  background: #0077b5;
}

.whatsapp {
  background: #25d366;
}

.instagram {
  background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

/* FORMULÁRIOS */
input, textarea {
  width: 100%;
  padding: 8px;
  margin: 6px 0 12px;
  font-size: 1rem;
  background: #22252B;
  color: #EAEAEA;
  border: 1px solid #555;
  box-sizing: border-box;
}

textarea {
  height: 120px;
  resize: vertical;
}

#search {
  max-width: 100%;
  margin: 0 auto 30px;
  display: block;
  box-sizing: border-box;
  padding: 15px;
}

button {
  padding: 10px 20px;
  background: #CF640C;
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.3s;
}

button:hover {
  background: #E87F25;
}

/* PAGINAÇÃO */
#pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

#pagination button {
  padding: 5px 10px;
  background: #CF640C;
  color: #FFFFFF;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

#pagination button.active {
  background: #FFFFFF;
  color: #CF640C;
}

#pagination button:disabled {
  background: #777;
  cursor: default;
}

/* ADMIN */
#login-screen {
  max-width: 400px;
  margin: 100px auto;
  background: #1A1D25;
  padding: 30px;
  text-align: center;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

#admin-screen main {
  padding: 20px;
}

/* FOOTER PARA AMBAS AS PÁGINAS */
footer {
  background: #1A1D25;
  padding: 30px 0;
  border-top: 2px solid #CF640C;
  margin-top: 50px;
  text-align: center;
  width: 100%;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

footer p {
  font-size: 14px;
  color: #FFFFFF;
  font-weight: bold;
  letter-spacing: 0.5px;
}

footer a {
  color: #CF640C;
  text-decoration: none;
  font-weight: bold;
}

footer a:hover {
  text-decoration: underline;
}

/* TOGGLE DE TEMA */
.theme-toggle-wrapper {
  display: flex;
  align-items: center;
}

.theme-toggle {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.theme-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
  z-index: -1;
}

.theme-toggle .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #121417;
  transition: background 0.4s;
  border-radius: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.theme-toggle .slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background: #FFFFFF;
  transition: transform 0.4s;
  border-radius: 50%;
}

.theme-toggle input:checked + .slider {
  background: #CF640C;
}

.theme-toggle input:checked + .slider:before {
  transform: translateX(26px);
}

.theme-toggle .icon {
  font-size: 18px;
  color: #FFFFFF;
  line-height: 34px;
}

.theme-toggle .sun {
  opacity: 0;
  transition: opacity 0.4s;
}

.theme-toggle input:checked + .slider .sun {
  opacity: 1;
}

.theme-toggle .moon {
  opacity: 1;
  transition: opacity 0.4s;
}

.theme-toggle input:checked + .slider .moon {
  opacity: 0;
}

.theme-toggle input:focus + .slider {
  box-shadow: 0 0 8px rgba(207, 100, 12, 0.7);
}

/* HAMBURGER - NÃO MEXER! */
.hamburger {
  position: absolute !important;
  right: 20px;
  top: 30% !important;
  transform: translateY(-0%) !important;
  display: none;
  z-index: 1001;
  background: transparent !important;
  width: 40px;
  height: 30px;
  cursor: pointer;
}

/* Overlay para fundo */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 999;
}

.overlay.active {
  display: block;
}

/* Hamburger animation */
.hamburger span {
  transition: all 0.3s ease;
  display: block;
  height: 3px;
  width: 100%;
  background: #CF640C;
  border-radius: 3px;
  opacity: 1;
  position: absolute;
  left: 0;
}

.hamburger span:nth-child(1) {
  top: 0;
}

.hamburger span:nth-child(2) {
  top: 12px;
}

.hamburger span:nth-child(3) {
  top: 24px;
}

.hamburger.active span:nth-child(1) {
  top: 12px;
  transform: rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  top: 12px;
  transform: rotate(-45deg);
}

/* Mobile menu */
@media (max-width: 768px) {
  .hamburger {
    display: block;
  }

  .container {
    padding-right: 70px !important;
  }

  .menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: #1A1D25;
    flex-direction: column;
    padding: 80px 20px 20px;
    gap: 15px;
    transition: 0.3s;
    z-index: 1000;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
  }

  .menu.active {
    right: 0;
  }

  .menu li {
    width: 100%;
  }

  .menu a {
    width: 100%;
    padding: 12px 20px;
    text-align: center;
    font-size: 12px;
  }

  .logo {
    height: 45px;
  }

  /* Ajustes para o post container em mobile */
  .post-container h1 {
    font-size: 24px;
  }

  .post-meta {
    font-size: 14px;
  }

  .theme-toggle-wrapper {
    position: absolute;
    right: 80px;
    top: 50% !important;
    transform: translateY(-50%) !important;
    z-index: 1002;
  }
  
  /* Correção para imagens em posts no mobile */
  .post-content img {
    max-width: 100% !important; /* Garante que a imagem não exceda a largura do container */
    margin: 20px auto !important;
  }

  /* Ajustes para o post container em mobile */
  .post-container {
    padding: 20px 15px;
    margin: 10px auto !important;
  }
}

@media (max-width: 480px) {
  .logo {
    height: 40px;
  }

  .menu {
    width: 100%;
    max-width: 100%;
  }

  header {
    padding: 15px 0;
    margin-bottom: 20px;
  }

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

  .post-container {
    padding: 15px 10px;
  }

  h1 {
    font-size: 1.8rem;
  }

  #wrapper {
    padding: 0 15px;
  }

  footer {
    padding: 20px 0;
  }

  /* Ajustes para o post container em mobile muito pequeno */
  .post-container h1 {
    font-size: 1.5rem;
  }
  
  .post-meta {
    font-size: 0.85rem;
  }
  
  .post-content {
    font-size: 1rem;
  }
  
  .social-share-buttons {
    gap: 15px;
  }
}

@media (max-width: 992px) {
  .logo {
    height: 50px;
  }

  .menu a {
    font-size: 14px;
    padding: 8px 12px;
  }
}

@media (min-width: 769px) {
  .hamburger {
    display: none;
  }

  .container, .header-container {
    padding-right: 10px;
    justify-content: space-between;
  }

  .menu {
    position: static !important;
    display: flex !important;
    width: auto;
    height: auto;
    padding: 0;
    box-shadow: none;
    background: transparent;
    flex-direction: row;
  }

  main.blog-index {
    padding: 0 15px;
  }

  /* Removido main.blog-post para usar o #post-content diretamente */

  .overlay {
    display: none;
  }

  .overlay.active {
    display: block;
  }
}
