/* Minimal Theme for TopAIToolRank */

:root {
  --primary-color: #2563eb;
  --secondary-color: #1e40af;
  --text-color: #1f2937;
  --light-gray: #f3f4f6;
  --border-color: #e5e7eb;
  --max-width: 1200px;
}

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

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #fff;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Header & Navigation */
.header {
  background: #fff;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar {
  padding: 1rem 0;
}

.navbar-container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
}

.nav-menu {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.nav-menu a {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.3s;
}

.nav-menu a:hover {
  color: var(--primary-color);
}

/* Main Content */
.main-content {
  flex: 1;
  min-height: calc(100vh - 100px);
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  padding: 4rem 2rem;
  text-align: center;
}

.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.lead {
  font-size: 1.25rem;
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto;
}

/* Posts Grid */
.latest-posts {
  padding: 3rem 2rem;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.post-card {
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: box-shadow 0.3s, transform 0.3s;
}

.post-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

.post-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.post-card h3 {
  padding: 1.5rem 1.5rem 0;
  font-size: 1.25rem;
  line-height: 1.4;
}

.post-card h3 a {
  color: var(--text-color);
  text-decoration: none;
}

.post-card h3 a:hover {
  color: var(--primary-color);
}

.post-meta {
  padding: 0.5rem 1.5rem;
  font-size: 0.9rem;
  color: #666;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.post-card p {
  padding: 0 1.5rem;
  color: #555;
}

.read-more {
  display: inline-block;
  padding: 1rem 1.5rem;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.read-more:hover {
  color: var(--secondary-color);
}

.tag {
  display: inline-block;
  background: var(--light-gray);
  color: var(--text-color);
  padding: 0.25rem 0.75rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

/* CTA Section */
.cta {
  background: var(--light-gray);
  padding: 3rem 2rem;
  text-align: center;
}

.cta h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.cta p {
  font-size: 1.1rem;
  margin-bottom: 2rem;
  color: #666;
}

.cta form, #newsletter-form, #cta-newsletter {
  display: flex;
  gap: 0.5rem;
  max-width: 400px;
  margin: 0 auto;
}

.cta form input,
#newsletter-form input,
#cta-newsletter input {
  flex: 1;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 1rem;
}

.cta form button,
#newsletter-form button,
#cta-newsletter button {
  padding: 0.75rem 1.5rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
  transition: background 0.3s;
}

.cta form button:hover,
#newsletter-form button:hover,
#cta-newsletter button:hover {
  background: var(--secondary-color);
}

/* Post Page */
.post {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

.post-header {
  margin-bottom: 2rem;
}

.post-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.post-header .post-meta {
  flex-direction: column;
  align-items: flex-start;
  padding: 0;
}

.featured-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  margin: 1.5rem 0;
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.8;
  margin-bottom: 2rem;
}

.post-content h2 {
  font-size: 1.75rem;
  margin: 1.5rem 0 1rem;
  color: var(--text-color);
}

.post-content h3 {
  font-size: 1.35rem;
  margin: 1.25rem 0 0.75rem;
  color: var(--text-color);
}

.post-content p {
  margin-bottom: 1rem;
}

.post-content ul, .post-content ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

.post-content table th,
.post-content table td {
  border: 1px solid var(--border-color);
  padding: 0.75rem;
  text-align: left;
}

.post-content table th {
  background: var(--light-gray);
  font-weight: 600;
}

.post-content code {
  background: var(--light-gray);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
}

.post-content pre {
  background: #1f2937;
  color: #e5e7eb;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1rem 0;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

/* Post Footer */
.post-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 2rem;
  margin-top: 2rem;
}

.post-navigation {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.prev-post, .next-post {
  flex: 1;
  padding: 1rem;
  background: var(--light-gray);
  border-radius: 4px;
  color: var(--primary-color);
  text-decoration: none;
  transition: background 0.3s;
}

.prev-post:hover, .next-post:hover {
  background: #e5e7eb;
}

.post-share {
  margin-bottom: 2rem;
}

.post-share h3 {
  margin-bottom: 1rem;
}

.share-btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  margin-right: 0.5rem;
  background: var(--primary-color);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.3s;
}

.share-btn:hover {
  background: var(--secondary-color);
}

.related-posts {
  margin-bottom: 2rem;
}

.related-posts h3 {
  margin-bottom: 1rem;
}

.related-posts ul {
  list-style: none;
  padding: 0;
}

.related-posts li {
  margin-bottom: 0.5rem;
}

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

.related-posts a:hover {
  text-decoration: underline;
}

/* Taxonomy Navigation */
.taxonomy-tags {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  margin: 1rem 0;
}

.tag-link {
  display: inline-block;
  background: var(--light-gray);
  color: var(--primary-color);
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.3s;
}

.tag-link:hover {
  background: #e5e7eb;
}

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

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

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

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

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

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

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

.footer-bottom {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  color: #666;
  font-size: 0.9rem;
}

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

/* Monetization */
.monetization-section {
  margin: 2rem 0;
  padding: 1rem;
  background: #f0f7ff;
  border-left: 4px solid var(--primary-color);
  border-radius: 4px;
  font-size: 0.95rem;
}

.affiliate-disclosure {
  margin-bottom: 1rem;
}

.sponsorship-info {
  color: var(--primary-color);
}

.ad-container {
  margin: 2rem 0;
  padding: 1rem;
  background: var(--light-gray);
  border-radius: 4px;
  text-align: center;
  min-height: 300px;
}

.ad-container ins {
  display: block;
}

/* Affiliate Links */
a[data-affiliate] {
  position: relative;
}

a[data-affiliate]::after {
  content: attr(data-affiliate);
  display: none;
  position: absolute;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.7rem;
  white-space: nowrap;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-bottom: 5px;
  z-index: 1000;
}

a[data-affiliate]:hover::after {
  display: block;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-menu {
    gap: 1rem;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

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

  .post {
    padding: 1rem;
  }

  .post-header h1 {
    font-size: 1.75rem;
  }

  .post-navigation {
    flex-direction: column;
  }

  .cta form {
    flex-direction: column;
  }

  .ad-container {
    min-height: 250px;
  }
}
