@tailwind base;
@tailwind components;
@tailwind utilities;

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;600;700&family=VT323&display=swap');

/* ================================================================ */
/* CONFIGURAÇÕES GERAIS                                             */
/* ================================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Fredoka', system-ui, sans-serif;
  background: linear-gradient(to bottom, #fefce8, #f5f5f4, #fefce8);
  padding-top: 0; /* REMOVIDO - CABEÇALHO AGORA É MÓVEL */
  min-height: 100vh;
}

/* ================================================================ */
/* ORDEM 1: CABEÇALHO/MENU SUPERIOR AGORA MÓVEL (SEM FIXED)        */
/* ================================================================ */
.navbar-fixed {
  background: #ffffff !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
  border-bottom: 2px solid rgba(245, 158, 11, 0.15) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  width: 100% !important;
  min-height: 80px !important;
  display: flex !important;
  align-items: center !important;
}

.navbar-fixed .max-w-6xl {
  width: 100% !important;
}

/* Fallback para navegadores antigos - AGORA MÓVEL */
nav {
  background: #ffffff !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12) !important;
  border-bottom: 2px solid rgba(245, 158, 11, 0.15) !important;
  backdrop-filter: blur(12px) !important;
  -webkit-backdrop-filter: blur(12px) !important;
  width: 100% !important;
  min-height: 80px !important;
}

/* ================================================================ */
/* TÍTULOS E TEXTOS                                                 */
/* ================================================================ */
h1, h2, h3 {
  font-family: 'Fredoka', sans-serif;
}

h1 {
  font-size: 3.5rem;
  font-weight: 700;
  letter-spacing: -2px;
}

/* ================================================================ */
/* ORDENS 2 e 3: TÍTULOS DAS COLUNAS LATERAIS AGORA MÓVEIS (SEM STICKY) */
/* ================================================================ */
.sticky-title {
  z-index: 100 !important;
  background: rgba(255, 255, 255, 0.97) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-radius: 20px !important;
  padding: 18px 14px !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08) !important;
  margin-bottom: 12px !important;
  border: 1px solid rgba(245, 158, 11, 0.12) !important;
  transition: all 0.3s ease !important;
  width: 100% !important;
}

.sticky-title h3 {
  font-size: 1.65rem !important;
  font-weight: 700 !important;
  color: #854d0e !important;
  margin-bottom: 0.25rem !important;
  line-height: 1.2 !important;
}

.sticky-title p {
  font-size: 1.05rem !important;
  color: #854d0e !important;
  margin: 0.1rem 0 !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
}

/* Fallback para navegadores antigos - AGORA MÓVEL (SEM STICKY) */
.affiliates-column > div.sticky-title {
  z-index: 100 !important;
  background: rgba(255, 255, 255, 0.97) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-radius: 20px !important;
  padding: 18px 14px !important;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08) !important;
  margin-bottom: 12px !important;
  border: 1px solid rgba(245, 158, 11, 0.12) !important;
  width: 100% !important;
}

.affiliates-column > div.sticky-title h3 {
  font-size: 1.65rem !important;
  font-weight: 700 !important;
  color: #854d0e !important;
  margin-bottom: 0.25rem !important;
  line-height: 1.2 !important;
}

.affiliates-column > div.sticky-title p {
  font-size: 1.05rem !important;
  color: #854d0e !important;
  margin: 0.1rem 0 !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px !important;
}

/* ================================================================ */
/* ORDENS 4 e 5: ESPAÇAMENTO +200% + 20px + 30px + 10px = +60px    */
/* ================================================================ */
.affiliates-column {
  display: flex !important;
  flex-direction: column !important;
  gap: calc(6rem + 60px) !important; /* 200% de 3rem = 6rem + 20px + 30px + 10px = 6rem + 60px - ORDENS 4 e 5 */
  scroll-behavior: smooth !important;
  width: 100% !important;
}

.affiliates-column a {
  display: block !important;
  transition: all 0.3s ease !important;
  text-decoration: none !important;
}

.affiliates-column img {
  width: 100% !important;
  max-height: 220px !important;
  object-fit: contain !important;
  border-radius: 20px !important;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  display: block !important;
}

.affiliates-column a:hover img {
  transform: scale(1.06) translateY(-4px) !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15) !important;
}

/* ================================================================ */
/* SUBTÍTULOS DAS IMAGENS - ORDENS 2 e 3                           */
/* ================================================================ */
.affiliate-subtitle {
  text-align: center !important;
  font-family: 'Fredoka', sans-serif !important;
  font-size: 0.95rem !important;
  font-weight: 600 !important;
  color: #854d0e !important;
  margin-top: 6px !important;
  padding: 4px 8px !important;
  background: rgba(254, 252, 232, 0.6) !important;
  border-radius: 10px !important;
  transition: all 0.3s ease !important;
  line-height: 1.3 !important;
  width: 100% !important;
}

.affiliate-subtitle-secondary {
  text-align: center !important;
  font-family: 'Fredoka', sans-serif !important;
  font-size: 0.85rem !important;
  font-weight: 500 !important;
  color: #b45309 !important;
  margin-top: 2px !important;
  padding: 2px 8px !important;
  background: rgba(254, 252, 232, 0.4) !important;
  border-radius: 8px !important;
  font-style: italic !important;
  width: 100% !important;
}

.affiliate-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  transition: all 0.3s ease !important;
  width: 100% !important;
}

.affiliate-item:hover .affiliate-subtitle {
  background: rgba(252, 211, 77, 0.3) !important;
  transform: scale(1.02) !important;
}

.affiliate-item:hover .affiliate-subtitle-secondary {
  background: rgba(252, 211, 77, 0.2) !important;
}

/* ================================================================ */
/* EBOOKS - IMAGENS (DENTRO DA MESMA CÉLULA)                       */
/* ================================================================ */
.ebook-images {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem 1.5rem;
  background: #fefce8;
  border-bottom: 1px solid #fcd34d;
  margin-bottom: 1.5rem;
  border-radius: 20px 20px 0 0;
}

.ebook-images img {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 20px;
}

.ebook-images img:hover {
  transform: scale(1.06);
}

/* Capa central - Rebeca */
.ebook-images .main-cover {
  max-height: 360px;
  max-width: 100%;
  object-fit: contain;
  box-shadow: 0 20px 30px -10px rgb(0 0 0 / 0.25);
  border: 8px solid white;
  z-index: 2;
}

/* ================================================================ */
/* CARDS DOS EBOOKS - ORDEM 8                                       */
/* ================================================================ */
.ebook-card {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.ebook-card:hover {
  transform: translateY(-8px) scale(1.01);
  box-shadow: 0 25px 50px -12px rgb(245 158 11 / 0.35);
}

/* ================================================================ */
/* BOTÕES REBECA                                                    */
/* ================================================================ */
.btn-comprar {
  background: linear-gradient(90deg, #ec4899, #a855f7) !important;
  transition: all 0.3s ease !important;
}

.btn-comprar:hover {
  transform: scale(1.06) !important;
  box-shadow: 0 0 30px rgba(236, 72, 153, 0.5) !important;
}

/* ================================================================ */
/* RODAPÉ - ORDEM 1                                                 */
/* ================================================================ */
footer {
  background: linear-gradient(to top, #854d0e, #713f12) !important;
  width: 100% !important;
  margin-top: 0 !important;
}

/* ================================================================ */
/* CURIOSIDADES HISTÓRICAS - ORDEM 6                                */
/* ================================================================ */
#curiosidades a {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  justify-content: center !important;
  min-height: 180px !important;
  padding: 2rem 1rem !important;
  transition: all 0.3s ease !important;
  text-decoration: none !important;
}

#curiosidades a span {
  font-size: 4.5rem !important;
  margin-bottom: 1rem !important;
  line-height: 1 !important;
}

#curiosidades a:hover {
  transform: scale(1.06) !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1) !important;
}

/* Cores específicas para a célula Suméria - ORDEM 6 */
#curiosidades a[href="curiosidades-sumerias.html"] {
  background: linear-gradient(to bottom right, #dbeafe, #e0e7ff) !important;
}

#curiosidades a[href="curiosidades-sumerias.html"]:hover {
  background: linear-gradient(to bottom right, #bfdbfe, #c7d2fe) !important;
  box-shadow: 0 20px 25px -5px rgba(99, 102, 241, 0.3) !important;
}

/* ================================================================ */
/* LAYOUT DAS TRÊS COLUNAS                                         */
/* ================================================================ */
.ebooks-container {
  display: grid !important;
  grid-template-columns: 1fr 2fr 1fr !important;
  gap: 2rem !important;
  max-width: 1400px !important;
  margin: 0 auto !important;
  padding: 0 1rem !important;
  align-items: start !important;
}

/* ================================================================ */
/* RESPONSIVIDADE - ATUALIZADO COM +60px                            */
/* ================================================================ */
@media (max-width: 1024px) {
  .ebooks-container {
    grid-template-columns: 1fr !important;
    gap: 2.5rem !important;
  }
  
  .affiliates-column img {
    max-height: 200px !important;
  }
  
  .affiliates-column {
    gap: calc(4.5rem + 60px) !important; /* Ajuste proporcional para tablet com +60px */
  }
  
  .affiliate-subtitle {
    font-size: 0.9rem !important;
  }
  
  .affiliate-subtitle-secondary {
    font-size: 0.8rem !important;
  }
}

@media (max-width: 768px) {
  body {
    padding-top: 0 !important;
  }
  
  h1 {
    font-size: 2.75rem !important;
    line-height: 1.1;
  }
  
  .ebook-images {
    flex-direction: column;
    padding: 1.8rem 1rem 1.2rem;
  }
  
  .ebook-images .main-cover {
    max-height: 280px;
  }
  
  .sticky-title {
    padding: 14px 10px !important;
  }
  
  .sticky-title h3 {
    font-size: 1.35rem !important;
  }
  
  .sticky-title p {
    font-size: 0.9rem !important;
  }
  
  .affiliates-column > div.sticky-title {
    padding: 14px 10px !important;
  }
  
  .affiliates-column > div.sticky-title h3 {
    font-size: 1.35rem !important;
  }
  
  .affiliates-column > div.sticky-title p {
    font-size: 0.9rem !important;
  }
  
  .affiliates-column img {
    max-height: 180px !important;
  }
  
  .affiliates-column {
    gap: calc(3.5rem + 60px) !important; /* Ajuste proporcional para mobile com +60px */
  }
  
  .affiliate-subtitle {
    font-size: 0.85rem !important;
    padding: 3px 6px !important;
  }
  
  .affiliate-subtitle-secondary {
    font-size: 0.75rem !important;
    padding: 2px 6px !important;
  }
}

@media (max-width: 480px) {
  body {
    padding-top: 0 !important;
  }
  
  .ebook-images .main-cover {
    max-height: 250px;
  }
  
  .sticky-title {
    padding: 10px 8px !important;
    border-radius: 14px !important;
  }
  
  .sticky-title h3 {
    font-size: 1.1rem !important;
  }
  
  .sticky-title p {
    font-size: 0.8rem !important;
  }
  
  .affiliates-column > div.sticky-title {
    padding: 10px 8px !important;
    border-radius: 14px !important;
  }
  
  .affiliates-column > div.sticky-title h3 {
    font-size: 1.1rem !important;
  }
  
  .affiliates-column > div.sticky-title p {
    font-size: 0.8rem !important;
  }
  
  .affiliates-column img {
    max-height: 160px !important;
  }
  
  .affiliates-column {
    gap: calc(2.8rem + 60px) !important; /* Ajuste proporcional para mobile pequeno com +60px */
  }
  
  .affiliate-subtitle {
    font-size: 0.75rem !important;
    padding: 2px 4px !important;
    margin-top: 4px !important;
    border-radius: 8px !important;
  }
  
  .affiliate-subtitle-secondary {
    font-size: 0.7rem !important;
    padding: 1px 4px !important;
    margin-top: 1px !important;
    border-radius: 6px !important;
  }
}