/*
Theme Name: Dicionário de Nomes - Corrigido
Description: Template WordPress otimizado para dicionário de nomes próprios compatível com estrutura existente
Version: 1.1
Author: Desenvolvedor
*/

/* Reset básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Variáveis CSS */
:root {
  --primary-color: #3b82f6;
  --primary-hover: #2563eb;
  --secondary-color: #64748b;
  --accent-color: #10b981;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --bg-light: #f8fafc;
  --border-color: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Typography */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background-color: #ffffff;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }

/* Layout */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header {
  background: white;
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

/* Navigation */
.main-navigation ul {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.main-navigation a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  transition: color 0.3s;
}

.main-navigation a:hover {
  color: var(--primary-color);
}

.mobile-menu {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-dark);
}

.mobile-navigation {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
}

.mobile-navigation ul {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Content */
.site-main {
  min-height: 70vh;
  padding: 2rem 0;
}

/* Cards de nomes */
.name-card {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.name-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.15);
}

.name-title {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.name-meta {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.meta-badge {
  background: var(--bg-light);
  color: var(--text-dark);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 500;
}

.meta-badge.masculine {
  background: #dbeafe;
  color: #1d4ed8;
}

.meta-badge.feminine {
  background: #fce7f3;
  color: #be185d;
}

.meta-badge.unisex {
  background: #f3e8ff;
  color: #7c3aed;
}

/* Names grid */
.names-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Grid de letras */
.alphabet-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(50px, 1fr));
  gap: 0.5rem;
  margin: 2rem 0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.alphabet-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  background: var(--bg-light);
  color: var(--text-dark);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s;
}

.alphabet-letter:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.alphabet-letter.has-posts {
  background: var(--primary-color);
  color: white;
}

.alphabet-letter.has-posts:hover {
  background: var(--primary-hover);
}

/* Search form */
.search-form {
  margin: 2rem 0;
  position: relative;
}

.search-input {
  width: 100%;
  max-width: 600px;
  padding: 1rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 1rem;
  transition: border-color 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Hero section */
.hero-section {
  text-align: center;
  padding: 4rem 0;
}

.hero-section h1 {
  margin-bottom: 1rem;
  color: var(--text-dark);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 2rem 0;
}

.page-numbers {
  padding: 0.75rem 1rem;
  background: white;
  border: 1px solid var(--border-color);
  color: var(--text-dark);
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s;
}

.page-numbers:hover,
.page-numbers.current {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* Footer */
.site-footer {
  background: var(--bg-light);
  border-top: 1px solid var(--border-color);
  padding: 3rem 0 1rem;
  margin-top: 3rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.footer-section h3 {
  color: var(--text-dark);
  margin-bottom: 1rem;
}

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

.footer-section ul li {
  margin-bottom: 0.5rem;
}

.footer-section a {
  color: var(--text-light);
  text-decoration: none;
  transition: color 0.3s;
}

.footer-section a:hover {
  color: var(--primary-color);
}

/* AdSense containers */
.adsense-container {
  margin: 2rem 0;
  text-align: center;
}

.adsense-horizontal {
  min-height: 100px;
  background: #f8f9fa;
  border: 1px dashed #dee2e6;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #6c757d;
  font-size: 0.875rem;
}

/* Breadcrumbs */
.breadcrumbs {
  margin: 1rem 0;
  font-size: 0.875rem;
  color: var(--text-light);
}

.breadcrumbs a {
  color: var(--primary-color);
  text-decoration: none;
}

.breadcrumbs a:hover {
  text-decoration: underline;
}

/* Single name page */
.single-name {
  max-width: 1000px;
  margin: 0 auto;
}

.name-header {
  text-align: center;
  padding: 2rem 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 2rem;
}

.name-header h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.post-navigation {
  display: flex;
  justify-content: space-between;
  margin: 3rem 0;
  padding: 2rem 0;
  border-top: 1px solid var(--border-color);
}

.post-navigation a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  text-decoration: none;
  transition: opacity 0.3s;
}

.post-navigation a:hover {
  opacity: 0.8;
}

/* Load more button */
.load-more-names {
  padding: 1rem 2rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s;
}

.load-more-names:hover {
  background: var(--primary-hover);
}

.load-more-names.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Buttons */
.favorite-btn {
  background: var(--bg-light);
  border: 2px solid var(--border-color);
  color: var(--text-dark);
  padding: 0.75rem 1.5rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.favorite-btn:hover {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.favorite-btn.favorited {
  background: #ef4444;
  color: white;
  border-color: #ef4444;
}

/* Search suggestions */
.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.1);
  z-index: 100;
  max-height: 300px;
  overflow-y: auto;
  margin-top: 4px;
}

.suggestion-item {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.2s;
}

.suggestion-item:hover,
.suggestion-item.active {
  background-color: var(--bg-light);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-title {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.25rem;
}

.suggestion-excerpt {
  font-size: 0.875rem;
  color: var(--text-light);
}

.suggestion-loading,
.no-suggestions {
  padding: 1rem;
  text-align: center;
  color: var(--text-light);
  font-size: 0.875rem;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 0 0.5rem;
  }
  
  .header-content {
    flex-direction: column;
    gap: 1rem;
  }
  
  .main-navigation {
    display: none;
  }
  
  .mobile-menu {
    display: block;
  }
  
  .main-navigation ul {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }
  
  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  
  .alphabet-grid {
    grid-template-columns: repeat(6, 1fr);
  }
  
  .name-meta {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .names-grid {
    grid-template-columns: 1fr;
  }
  
  .hero-section {
    padding: 2rem 0;
  }
  
  .hero-section h1 {
    font-size: 2rem;
  }
  
  .search-form > div {
    flex-direction: column;
  }
  
  .search-form button {
    margin-top: 0.5rem;
  }
  
  .name-header h1 {
    font-size: 2rem;
  }
  
  .name-header > div {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .post-navigation {
    flex-direction: column;
    gap: 1rem;
  }
  
  .post-navigation > div:last-child {
    text-align: left;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
  }
}

/* Performance optimizations */
img {
  max-width: 100%;
  height: auto;
  loading: lazy;
}

/* Animations */
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* WordPress specific overrides */
.wp-block-button__link {
  background: var(--primary-color);
  border-radius: 8px;
}

.wp-block-quote {
  border-left: 4px solid var(--primary-color);
  padding-left: 1rem;
}