/*
Theme Name: AI Pulse
Theme URI: https://example.com
Author: Srhj
Description: Dark navy AI news & tools directory theme, inspired by curated AI news/directory layouts. Custom Post Type "Tool" for rankings, News/Blog via standard posts.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: ai-pulse
*/

/* ===== Variables ===== */
:root {
  --bg: #0B0F19;
  --bg-card: #131826;
  --bg-card-alt: #141A2A;
  --accent: #6366F1;
  --accent-soft: rgba(99,102,241,0.15);
  --text: #E5E7EB;
  --text-muted: #9CA3AF;
  --border: #1F2937;
  --radius: 12px;
  --max-width: 1180px;
}

* { box-sizing: border-box; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin: 0;
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

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

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 16px;
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(11,15,25,0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  padding-bottom: 14px;
}
.site-logo {
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-logo img { height: 28px; }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}
.main-nav a {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}
.main-nav a:hover { color: var(--text); }

.header-cta {
  background: var(--accent);
  color: #fff;
  padding: 9px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.2s;
}
.header-cta:hover { opacity: 0.85; }

.nav-toggle { display: none; background: none; border: none; color: var(--text); font-size: 24px; }

/* ===== Hero ===== */
.hero {
  padding: 80px 0 60px;
  text-align: center;
}
.hero h1 {
  font-size: 48px;
  margin-bottom: 12px;
}
.hero p {
  color: var(--text-muted);
  font-size: 18px;
  max-width: 640px;
  margin: 0 auto 32px;
}
.hero-form {
  display: flex;
  gap: 10px;
  justify-content: center;
  max-width: 460px;
  margin: 0 auto 40px;
}
.hero-form input[type="email"] {
  flex: 1;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 14px;
}
.hero-form button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}
.hero-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 32px;
  justify-content: center;
  align-items: center;
  opacity: 0.5;
}
.hero-logos img { max-height: 26px; filter: grayscale(100%); }

/* ===== Section headings ===== */
.section {
  padding: 60px 0;
  border-top: 1px solid var(--border);
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 32px;
}
.section-head h2 { font-size: 28px; margin: 0; }
.section-head p { color: var(--text-muted); font-size: 14px; margin: 4px 0 0; }
.section-head a.view-all { font-size: 14px; color: var(--accent); font-weight: 600; }

/* ===== Card grid (News / Blog) ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s;
}
.card:hover { transform: translateY(-4px); border-color: var(--accent); }
.card img { height: 160px; object-fit: cover; width: 100%; }
.card-body { padding: 18px; }
.card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.card h3 { font-size: 16px; margin-bottom: 8px; }
.card p { font-size: 14px; color: var(--text-muted); margin: 0; }

/* ===== Tools ranking list ===== */
.tools-list { display: flex; flex-direction: column; gap: 12px; }
.tool-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
}
.tool-rank {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-muted);
  width: 28px;
  flex-shrink: 0;
}
.tool-icon { width: 40px; height: 40px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.tool-info { flex: 1; }
.tool-info h4 { margin: 0; font-size: 15px; }
.tag-pill {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  margin-top: 4px;
}
.tool-votes {
  font-size: 13px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ===== Newsletter block ===== */
.newsletter-block {
  background: var(--bg-card-alt);
  border-radius: 16px;
  padding: 48px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}
.newsletter-block ul { list-style: none; padding: 0; margin: 0 0 20px; }
.newsletter-block li {
  padding: 8px 0;
  color: var(--text-muted);
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 50px 0 30px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  margin-bottom: 30px;
}
.footer-grid h5 { font-size: 13px; text-transform: uppercase; color: var(--text-muted); margin-bottom: 14px; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { font-size: 14px; color: var(--text-muted); }
.footer-grid a:hover { color: var(--text); }
.footer-bottom {
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .newsletter-block { grid-template-columns: 1fr; padding: 32px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .main-nav { display: none; }
  .nav-toggle { display: block; }
  .hero h1 { font-size: 32px; }
  .grid { grid-template-columns: 1fr; }
  .hero-form { flex-direction: column; }
  .footer-grid { grid-template-columns: 1fr; }
}
