/* =============================================
   AIToolsPro — Main Stylesheet
   Clean, fast, AdSense-optimised design
   ============================================= */

:root {
  --brand: #2563EB;
  --brand-dark: #1D4ED8;
  --brand-light: #EFF6FF;
  --accent: #7C3AED;
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --bg: #FFFFFF;
  --bg-soft: #F8FAFC;
  --bg-card: #FFFFFF;
  --border: #E2E8F0;
  --border-soft: #F1F5F9;
  --success: #10B981;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 32px rgba(0,0,0,0.10);
  --max-w: 1180px;
  --font-display: 'Sora', 'Inter', sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ===== LAYOUT ===== */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 72px 0;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text-primary);
  font-size: 1.2rem;
  letter-spacing: -0.02em;
}

.logo-icon { font-size: 1.3rem; }
.logo-text strong { color: var(--brand); }

.main-nav {
  display: flex;
  gap: 4px;
}

.main-nav a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.main-nav a:hover {
  background: var(--bg-soft);
  color: var(--text-primary);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.4rem;
  cursor: pointer;
  color: var(--text-primary);
  padding: 4px 8px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.btn-primary:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37,99,235,0.3);
}

.btn-outline {
  background: transparent;
  color: var(--brand);
  border-color: var(--brand);
}

.btn-outline:hover {
  background: var(--brand-light);
  text-decoration: none;
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(135deg, #F0F4FF 0%, #FAF5FF 50%, #F0F9FF 100%);
  padding: 80px 0 72px;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  margin-bottom: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.highlight {
  color: var(--brand);
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-sub {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 640px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.hero-stats {
  display: flex;
  gap: 40px;
  justify-content: center;
  flex-wrap: wrap;
}

.stat { text-align: center; }
.stat strong {
  display: block;
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
}
.stat span { font-size: 0.85rem; color: var(--text-muted); }

/* ===== AD SLOTS ===== */
.ad-slot {
  text-align: center;
  padding: 12px 0;
}

.ad-leaderboard {
  background: var(--bg-soft);
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
}

.ad-rectangle {
  margin: 0 auto;
}

.ad-placeholder {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ===== SECTION HEADER ===== */
.section-header {
  text-align: center;
  margin-bottom: 48px;
  max-width: 640px;
  margin-left: auto;
  margin-right: auto;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 12px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.65;
}

/* ===== PROFESSIONS GRID ===== */
.professions-section { background: var(--bg); }

.professions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.prof-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.prof-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.prof-card--more {
  border: 2px dashed var(--border);
  background: var(--bg-soft);
  align-items: center;
  text-align: center;
}

.prof-icon { font-size: 2rem; }

.prof-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.prof-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
  flex: 1;
}

.prof-tag {
  font-size: 0.75rem;
  background: var(--brand-light);
  color: var(--brand);
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 500;
  width: fit-content;
}

.read-more {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand);
  margin-top: 4px;
}

/* ===== WHY SECTION ===== */
.why-section { background: var(--bg-soft); }

.why-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}

.why-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.why-icon { font-size: 2rem; margin-bottom: 12px; }

.why-card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.why-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ===== BLOG GRID ===== */
.blog-section { background: var(--bg); }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 36px;
}

.blog-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.2s;
}

.blog-card:hover { box-shadow: var(--shadow-md); }

.blog-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.blog-cat {
  background: var(--brand-light);
  color: var(--brand);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}

.blog-card h3 {
  font-size: 0.975rem;
  font-weight: 600;
  line-height: 1.45;
}

.blog-card h3 a {
  color: var(--text-primary);
}

.blog-card h3 a:hover { color: var(--brand); }

.blog-card p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
  flex: 1;
}

.read-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand);
}

.blog-cta { text-align: center; }

/* ===== NEWSLETTER ===== */
.newsletter-section {
  background: linear-gradient(135deg, var(--brand) 0%, var(--accent) 100%);
  color: #fff;
}

.newsletter-inner {
  display: flex;
  gap: 48px;
  align-items: center;
  flex-wrap: wrap;
}

.newsletter-text { flex: 1; min-width: 240px; }

.newsletter-text h2 {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.5vw, 1.8rem);
  font-weight: 700;
  margin-bottom: 10px;
}

.newsletter-text p { opacity: 0.85; font-size: 0.95rem; }

.newsletter-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  flex: 1;
  min-width: 280px;
}

.newsletter-form input {
  flex: 1;
  min-width: 200px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: none;
  font-size: 0.95rem;
  outline: none;
}

.newsletter-form .btn-primary {
  background: #fff;
  color: var(--brand);
  border-color: #fff;
  white-space: nowrap;
}

.newsletter-form .btn-primary:hover {
  background: var(--brand-light);
}

/* ===== FOOTER ===== */
.site-footer {
  background: var(--text-primary);
  color: #94A3B8;
  padding: 60px 0 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid #1E293B;
}

.footer-brand .logo { color: #fff; margin-bottom: 14px; }
.footer-brand p { font-size: 0.85rem; line-height: 1.65; max-width: 280px; }

.footer-nav {
  display: contents;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col h4 {
  color: #E2E8F0;
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.footer-col a {
  color: #94A3B8;
  font-size: 0.875rem;
  text-decoration: none;
  transition: color 0.15s;
}

.footer-col a:hover { color: #fff; }

.footer-bottom {
  padding: 20px 0;
  border-top: 1px solid #1E293B;
}

.footer-bottom .container {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-bottom p { font-size: 0.8rem; color: #64748B; }
.footer-bottom a { color: #94A3B8; }
.disclosure { font-style: italic; font-size: 0.75rem !important; }

/* ===== INNER PAGE LAYOUT ===== */
.page-hero {
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  padding: 56px 0 48px;
}

.page-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
}

.page-hero p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 600px;
  line-height: 1.7;
}

.breadcrumb {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--brand); }
.breadcrumb span { color: var(--text-muted); }

/* ===== TOOL CARD ===== */
.tools-list { display: flex; flex-direction: column; gap: 20px; }

.tool-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  background: var(--bg-card);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: start;
  transition: box-shadow 0.2s;
}

.tool-card:hover { box-shadow: var(--shadow-md); }

.tool-rank {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-muted);
  min-width: 36px;
  text-align: center;
}

.tool-rank.rank-1 { color: #F59E0B; }
.tool-rank.rank-2 { color: #9CA3AF; }
.tool-rank.rank-3 { color: #B45309; }

.tool-body { flex: 1; }

.tool-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.tool-header h3 { font-size: 1.1rem; font-weight: 600; }

.tool-badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-top { background: #FEF3C7; color: #92400E; }
.badge-free { background: #D1FAE5; color: #065F46; }
.badge-new { background: #EDE9FE; color: #5B21B6; }

.tool-desc { font-size: 0.9rem; color: var(--text-secondary); line-height: 1.65; margin-bottom: 12px; }

.tool-meta {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.tool-meta strong { color: var(--text-primary); }

.tool-rating {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #F59E0B;
  font-weight: 600;
  font-size: 0.9rem;
}

.tool-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }

/* ===== SIDEBAR LAYOUT ===== */
.content-sidebar {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 40px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 80px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sidebar-widget {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
}

.sidebar-widget h4 {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

/* ===== COMPARISON TABLE ===== */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 32px 0;
}

.compare-table th {
  background: var(--bg-soft);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
}

.compare-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}

.compare-table tr:hover td { background: var(--bg-soft); }

.check { color: var(--success); font-weight: 600; }
.cross { color: #EF4444; font-weight: 600; }

/* ===== PROSE / ARTICLE ===== */
.article-body {
  max-width: 720px;
}

.article-body h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 40px 0 14px;
  color: var(--text-primary);
}

.article-body h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 28px 0 10px;
}

.article-body p {
  font-size: 0.975rem;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 16px;
}

.article-body ul, .article-body ol {
  padding-left: 20px;
  margin-bottom: 16px;
}

.article-body li {
  font-size: 0.975rem;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 6px;
}

.callout {
  background: var(--brand-light);
  border-left: 4px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 16px 20px;
  margin: 24px 0;
  font-size: 0.9rem;
  color: var(--text-primary);
  line-height: 1.65;
}

/* ===== ABOUT / STATIC PAGES ===== */
.static-page { padding: 60px 0; }

.static-page h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.static-page .page-intro {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 40px;
}

.static-page h2 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 32px 0 10px;
}

.static-page p, .static-page li {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
}

.static-page ul { padding-left: 20px; margin-bottom: 16px; }
.static-page li { margin-bottom: 6px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .content-sidebar { grid-template-columns: 1fr; }
  .sidebar { position: static; }
}

@media (max-width: 640px) {
  .main-nav { display: none; }
  .main-nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 64px; left: 0; right: 0;
    background: #fff;
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    box-shadow: var(--shadow-md);
    z-index: 99;
  }
  .nav-toggle { display: block; }
  .hero { padding: 56px 0 48px; }
  .hero h1 { font-size: 1.9rem; }
  .hero-cta-row { flex-direction: column; align-items: center; }
  .hero-stats { gap: 24px; }
  .footer-inner { grid-template-columns: 1fr; }
  .newsletter-inner { flex-direction: column; gap: 24px; }
  .tool-card { grid-template-columns: 1fr; }
  .tool-actions { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ===== NAV DROPDOWN ===== */
.nav-dropdown {
  position: static;
  display: inline-block;
}

.nav-dropdown-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-body);
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.nav-dropdown-btn:hover,
.nav-dropdown-btn.open {
  background: var(--bg-soft);
  color: var(--text-primary);
}

.nav-arrow {
  font-size: 10px;
  transition: transform 0.2s;
  display: inline-block;
}

.nav-dropdown-btn.open .nav-arrow { transform: rotate(180deg); }

/* The mega-menu — hidden by default using visibility + opacity so grid layout
   is preserved internally and there are no display:none / display:grid conflicts */
.nav-dropdown-menu {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  top: 64px; /* matches header height */
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 40px rgba(0,0,0,0.14);
  z-index: 9999;
  width: 740px;
  max-width: 96vw;
  padding: 24px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 28px;
  transition: opacity 0.15s, visibility 0.15s;
}

.nav-dropdown-menu.open {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}

.dropdown-section {
  margin-bottom: 8px;
  min-width: 0;
}

.dropdown-section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 7px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
  white-space: nowrap;
}

.nav-dropdown-menu a {
  display: block;
  font-size: 12.5px;
  color: var(--text-secondary);
  padding: 3px 0;
  text-decoration: none;
  line-height: 1.45;
  transition: color 0.12s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-dropdown-menu a:hover {
  color: var(--brand);
  text-decoration: none;
}

/* Backdrop — dims page behind open menu */
.nav-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: transparent;
}

.nav-backdrop.open { display: block; }

@media (max-width: 900px) {
  .nav-dropdown-menu {
    width: 90vw;
    grid-template-columns: repeat(2, 1fr);
    left: 4vw;
    transform: none;
  }
}

@media (max-width: 640px) {
  .nav-dropdown { display: none; }
}
