/* Otimizações Tailwind para Dispositivos Móveis */

/* Container personalizado para artigos em mobile */
.tw-template-container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Remover padding lateral em mobile para conteúdo Tailwind */
@media (max-width: 640px) {
  .tw-template-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
  
  /* Garantir que o conteúdo tenha margem mínima nas laterais */
  .tw-template-container > div {
    margin-left: 0.5rem !important;
    margin-right: 0.5rem !important;
  }
  
  /* Ajustar padding dos cards principais */
  .tw-template-container .tw-p-8 {
    padding: 1rem !important;
    margin-bottom: 1rem !important;
  }
  
  .tw-template-container .tw-p-6 {
    padding: 0.75rem !important;
    margin-bottom: 0.75rem !important;
  }
  
  .tw-template-container .tw-px-4 {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
  
  .tw-template-container .tw-px-6 {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }
  
  .tw-template-container .tw-px-8 {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  
  /* Preservar margens verticais importantes */
  .tw-template-container .tw-mb-12 {
    margin-bottom: 2rem !important;
  }
  
  .tw-template-container .tw-mb-8 {
    margin-bottom: 1.5rem !important;
  }
  
  .tw-template-container .tw-mb-6 {
    margin-bottom: 1rem !important;
  }
  
  .tw-template-container .tw-mb-4 {
    margin-bottom: 0.75rem !important;
  }
  
  .tw-template-container .tw-mb-3 {
    margin-bottom: 0.5rem !important;
  }
  
  /* Ajustar margens laterais mas manter espaçamento */
  .tw-template-container .tw-mx-auto {
    margin-left: 0.25rem !important;
    margin-right: 0.25rem !important;
  }
  
  /* Garantir que elementos ocupem largura adequada com margem mínima */
  .tw-template-container .tw-rounded-2xl,
  .tw-template-container .tw-rounded-xl {
    border-radius: 0.5rem !important;
    margin-left: 0.5rem !important;
    margin-right: 0.5rem !important;
    margin-bottom: 1rem !important;
  }
  
  /* Espaçamento entre seções */
  .tw-template-container > div:not(:last-child) {
    margin-bottom: 1.5rem !important;
  }
  
  /* Espaçamento específico para grids */
  .tw-template-container .tw-grid {
    gap: 0.75rem !important;
    margin-bottom: 1rem !important;
  }
  
  /* Espaçamento para elementos com space-y */
  .tw-template-container .tw-space-y-2 > * + * {
    margin-top: 0.5rem !important;
  }
  
  .tw-template-container .tw-space-y-3 > * + * {
    margin-top: 0.75rem !important;
  }
  
  .tw-template-container .tw-space-y-6 > * + * {
    margin-top: 1rem !important;
  }
  
  /* Ajustar tipografia para mobile */
  .tw-template-container .tw-text-3xl {
    font-size: 1.75rem !important;
    line-height: 2rem !important;
  }
  
  .tw-template-container .tw-text-2xl {
    font-size: 1.5rem !important;
    line-height: 1.75rem !important;
  }
  
  .tw-template-container .tw-text-xl {
    font-size: 1.125rem !important;
    line-height: 1.5rem !important;
  }
  
  .tw-template-container .tw-text-lg {
    font-size: 1rem !important;
    line-height: 1.5rem !important;
  }
  
  /* Ajustar grids para mobile */
  .tw-template-container .tw-grid.tw-grid-cols-2,
  .tw-template-container .tw-grid.tw-grid-cols-3,
  .tw-template-container .tw-grid.tw-grid-cols-4,
  .tw-template-container .tw-grid.lg\\:tw-grid-cols-2,
  .tw-template-container .tw-grid.lg\\:tw-grid-cols-3,
  .tw-template-container .tw-grid.lg\\:tw-grid-cols-4,
  .tw-template-container .tw-grid.md\\:tw-grid-cols-2,
  .tw-template-container .tw-grid.md\\:tw-grid-cols-3,
  .tw-template-container .tw-grid.md\\:tw-grid-cols-4 {
    grid-template-columns: 1fr !important;
    gap: 0.75rem !important;
  }
  
  /* Ajustar tabelas para mobile */
  .tw-template-container .tw-overflow-x-auto {
    margin-left: -0.5rem !important;
    margin-right: -0.5rem !important;
  }
  
  .tw-template-container table {
    font-size: 0.75rem !important;
  }
  
  .tw-template-container .tw-py-3 {
    padding-top: 0.5rem !important;
    padding-bottom: 0.5rem !important;
  }
  
  .tw-template-container .tw-px-4 {
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }
}

/* Otimizações para tablets */
@media (min-width: 641px) and (max-width: 768px) {
  .tw-template-container .tw-p-8 {
    padding: 1.5rem !important;
  }
  
  .tw-template-container .tw-grid.lg\\:tw-grid-cols-2 {
    grid-template-columns: 1fr !important;
  }
  
  .tw-template-container .tw-grid.lg\\:tw-grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Garantir que o conteúdo principal ocupe toda a largura disponível */
@media (max-width: 1024px) {
  .tw-template-container {
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
  }
  
  /* Restaurar padding interno para conteúdo */
  .tw-template-container > div {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
}

/* Otimizações específicas para elementos gradientes */
@media (max-width: 640px) {
  .tw-template-container .tw-bg-gradient-to-r {
    margin-left: 0.5rem !important;
    margin-right: 0.5rem !important;
    border-radius: 0.5rem !important;
  }
}

/* Melhorar legibilidade em telas pequenas */
@media (max-width: 480px) {
  .tw-template-container .tw-leading-relaxed {
    line-height: 1.5 !important;
  }
  
  .tw-template-container .tw-space-y-2 > * + * {
    margin-top: 0.375rem !important;
  }
  
  .tw-template-container .tw-space-y-3 > * + * {
    margin-top: 0.5rem !important;
  }
  
  .tw-template-container .tw-mb-12 {
    margin-bottom: 2rem !important;
  }
  
  .tw-template-container .tw-mb-8 {
    margin-bottom: 1.5rem !important;
  }
  
  .tw-template-container .tw-mb-6 {
    margin-bottom: 1rem !important;
  }
}
