/* =========================================================
   style.css — shared site styles
   Style: modern / tech, blue tone (desktop-first).
   All color/spacing variables live in :root for easy global changes.
   ========================================================= */

:root {
  /* --- Brand color (the CTA button uses this single blue across the site) --- */
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-darker: #3730a3;
  --brand-soft: #eef2ff;
  --brand-border: #c7d2fe;

  /* Gradient used for the hero and accents (AI tech: indigo → violet → cyan) */
  --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
  --grad-soft: linear-gradient(180deg, #f1f3ff 0%, #ffffff 100%);

  /* --- Surfaces & text --- */
  --bg: #ffffff;
  --bg-soft: #f6f8fc;
  --surface: #ffffff;
  --text: #0f1b2d;
  --text-muted: #5b6675;
  --border: #e6eaf1;
  --border-soft: #eef1f6;

  /* Rating stars */
  --star: #f59e0b;
  --star-empty: #d7dce4;

  /* Pros/cons states */
  --good: #16a34a;
  --bad: #ef4444;

  /* --- Layout --- */
  --container: 1140px;
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(16, 27, 45, 0.06);
  --shadow: 0 8px 24px rgba(16, 27, 45, 0.08);
  --shadow-lg: 0 20px 48px rgba(16, 27, 45, 0.14);

  /* --- Fonts: 1 heading font + 1 body font (system fonts for speed) --- */
  --font-heading: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-body: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

/* --- Light reset --- */
*,
*::before,
*::after { box-sizing: border-box; }

html { font-family: var(--font-body); scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 17px;            /* body text >= 16px */
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  line-height: 1.2;
  color: var(--text);
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3.1rem); margin: 0 0 0.5em; }
h2 { font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); margin: 1.4em 0 0.5em; }
h3 { font-size: 1.15rem; margin: 0 0 0.4em; }

p { margin: 0 0 1em; }

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

/* Keep long text blocks to ~70 chars for readability */
.prose p, .prose li { max-width: 70ch; }
.prose h2, .prose h3 { max-width: 40ch; }

/* --- Centered container --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Vertical spacing between sections inside <main> */
main > section { margin: 56px 0; }

/* =========================================================
   Buttons & badges
   ========================================================= */
.cta-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--brand);
  color: #fff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  padding: 12px 22px;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.32);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.cta-button:hover {
  background: var(--brand-dark);
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(79, 70, 229, 0.4);
}
.cta-button:active { transform: translateY(0); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-family: var(--font-heading);
  font-weight: 600;
  transition: border-color 0.15s, color 0.15s;
}
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--brand-darker);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  padding: 6px 12px;
  border-radius: 999px;
}

/* Centered section heading */
.section-head { text-align: center; margin-bottom: 28px; }
.section-kicker {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: 8px;
}
.section-head h2 { margin: 0 auto; max-width: 24ch; }

/* =========================================================
   Header / Nav (SHARED:HEADER) — identical on every page
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 168px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.22rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.logo:hover { text-decoration: none; }
.logo-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: var(--grad);
  color: #fff;
  font-size: 1rem;
  box-shadow: var(--shadow-sm);
}
.logo-accent { color: var(--brand); }
.logo-mark svg { width: 18px; height: 18px; }
.logo-img { height: 132px; width: auto; display: block; }

.site-nav { display: flex; align-items: center; gap: 26px; }
.site-nav a { color: var(--text-muted); font-weight: 600; font-size: 0.96rem; }
.site-nav a:hover { color: var(--brand); text-decoration: none; }
.site-nav .nav-cta {
  color: #fff;
  background: var(--brand);
  padding: 9px 18px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.32);
}
.site-nav .nav-cta:hover { background: var(--brand-dark); color: #fff; }

/* =========================================================
   Hero (home page) — full-width gradient band
   ========================================================= */
.hero {
  background: var(--grad-soft);
  border-bottom: 1px solid var(--border-soft);
  overflow: hidden;
}
.hero-inner {
  max-width: 820px;
  margin: 0 auto;
  text-align: center;
  padding: 72px 24px 76px;
}
.hero-copy h1 { margin-top: 14px; }
.hero-copy .lead {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 60ch;
  margin-left: auto;
  margin-right: auto;
}
.hero-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; margin: 26px 0 34px; }

.hero-stats {
  list-style: none;
  margin: 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--border);
  display: inline-flex;
  justify-content: center;
  gap: 48px;
}
.hero-stats strong {
  display: block;
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--text);
}
.hero-stats span { color: var(--text-muted); font-size: 0.92rem; }

/* Compact hero for inner pages */
.page-hero {
  background: var(--grad-soft);
  border-bottom: 1px solid var(--border-soft);
  padding: 48px 0 40px;
}
.page-hero h1 { margin: 12px 0 10px; }
.page-hero .lead { color: var(--text-muted); font-size: 1.12rem; max-width: 58ch; }

/* =========================================================
   Tool card grid (.tool-card) — 3 columns on desktop
   ========================================================= */
.tool-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
}
.tool-card {
  display: flex;
  flex-direction: column;
  flex: 1 1 300px;
  max-width: 360px;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.tool-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--brand-border);
}
.tool-card-head { display: flex; align-items: center; gap: 12px; }
.tool-logo {
  flex: none;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  border-radius: 11px;
  background: var(--brand-soft);
  color: var(--brand-darker);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.2rem;
  border: 1px solid var(--brand-border);
}
.tool-card-head h3 { margin: 0; font-size: 1.1rem; }
.tool-card .tagline { color: var(--text-muted); flex: 1; margin: 0; }
.price-chip {
  align-self: flex-start;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--brand-darker);
  background: var(--brand-soft);
  border: 1px solid var(--brand-border);
  padding: 5px 12px;
  border-radius: 999px;
}
.tool-card .cta-button { width: 100%; margin-top: 4px; }

/* Rating row: stars + number */
.rating { display: inline-flex; align-items: center; gap: 7px; font-size: 0.9rem; color: var(--text-muted); font-weight: 600; }

/* Star rating: 5 faded stars + an overlay clipped to a % (supports half stars) */
.stars {
  position: relative;
  display: inline-block;
  font-size: 1rem;
  line-height: 1;
  color: var(--star-empty);
  letter-spacing: 1px;
}
.stars::before { content: "★★★★★"; }
.stars::after {
  content: "★★★★★";
  position: absolute;
  inset: 0;
  width: var(--pct, 0%);
  overflow: hidden;
  color: var(--star);
  white-space: nowrap;
}

/* =========================================================
   Comparison table (.comparison-table)
   ========================================================= */
.table-scroll { overflow-x: auto; border-radius: var(--radius); }
.comparison-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  font-size: 0.98rem;
}
.comparison-table th,
.comparison-table td {
  padding: 16px 18px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border-soft);
}
.comparison-table thead th {
  background: var(--bg-soft);
  font-family: var(--font-heading);
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.comparison-table tbody tr:last-child td { border-bottom: none; }
.comparison-table tbody tr:hover { background: var(--brand-soft); }
.comparison-table .ct-name { font-weight: 700; color: var(--text); }
.comparison-table .ct-name small { display: block; font-weight: 400; color: var(--text-muted); }
.comparison-table .cta-button { padding: 9px 18px; font-size: 0.9rem; box-shadow: none; }
.comparison-table .cta-button:hover { transform: none; }

/* =========================================================
   Per-tool review section (best/top page)
   ========================================================= */
.tool-review {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 30px;
  margin: 24px 0;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  scroll-margin-top: 90px;
}
.tool-review h2 { margin-top: 0; }
.tool-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: -0.2em 0 1em;
}
.meta-chip {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 999px;
}
.meta-chip .stars { vertical-align: -2px; }

.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin: 20px 0 24px;
}
.pros-cons > div {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  background: var(--bg-soft);
}
.pros-cons h3 { display: flex; align-items: center; gap: 8px; }
.pros-cons ul { list-style: none; margin: 0; padding: 0; }
.pros-cons li { position: relative; padding-left: 26px; margin-bottom: 8px; }
.pros-cons li::before {
  position: absolute;
  left: 0; top: 0;
  font-weight: 800;
}
.pros li::before { content: "✓"; color: var(--good); }
.cons li::before { content: "✕"; color: var(--bad); }

/* =========================================================
   "Why trust us / criteria" block — icon card grid
   ========================================================= */
.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.feature-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.feature-icon {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: 14px;
}
.feature-icon svg { width: 24px; height: 24px; }
.feature-card h3 { margin-bottom: 6px; }
.feature-card p { margin: 0; color: var(--text-muted); }

/* =========================================================
   Two-column blog layout (content + sidebar)
   ========================================================= */
.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 44px;
  align-items: start;
}
.sidebar {
  position: sticky;
  top: 90px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--bg-soft);
}
.sidebar h3 { margin-top: 0; }
.sidebar .tool-grid { flex-direction: column; gap: 16px; }
.sidebar .tool-card { max-width: none; }

/* =========================================================
   Footer (SHARED:FOOTER)
   ========================================================= */
.site-footer {
  margin-top: 72px;
  background: #0f1b2d;
  color: #aeb8c7;
  padding: 48px 0 28px;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 30px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.footer-brand { max-width: 380px; }
.footer-brand p { margin: 12px 0 0; font-size: 0.95rem; }
.logo--light { color: #fff; }
.logo--light .logo-accent { color: #a5b4fc; }
.logo--light .logo-img { height: 156px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 22px; align-items: flex-start; }
.footer-links a { color: #aeb8c7; font-weight: 600; }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  padding-top: 24px;
  font-size: 0.9rem;
}
.footer-bottom .aff-disclosure { color: #fff; font-weight: 600; margin: 0; }
.footer-bottom p { margin: 0; }

/* =========================================================
   "Categories" nav dropdown
   ========================================================= */
.nav-dropdown { position: relative; }
.nav-dropdown-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.96rem;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
}
.nav-dropdown-toggle:hover { color: var(--brand); }
.nav-dropdown-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 2px;
  z-index: 30;
}
.nav-dropdown:hover .nav-dropdown-menu,
.nav-dropdown.open .nav-dropdown-menu { display: flex; }
.nav-dropdown-menu a {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.92rem;
}
.nav-dropdown-menu a:hover {
  background: var(--brand-soft);
  color: var(--brand-darker);
  text-decoration: none;
}

/* =========================================================
   Category grid (home page)
   ========================================================= */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
}
.category-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: var(--text);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.category-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
  border-color: var(--brand-border);
  text-decoration: none;
}
.category-card h3 { margin: 4px 0 0; }
.category-card p { color: var(--text-muted); margin: 0; flex: 1; }
.category-link { color: var(--brand); font-weight: 700; font-size: 0.92rem; }

/* =========================================================
   Responsive — 768px: everything to a single column
   (Google indexes the mobile version, never drop it)
   ========================================================= */
@media (max-width: 980px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .header-inner { min-height: 60px; }
  .site-nav { gap: 14px; font-size: 0.9rem; }
  .site-nav .nav-cta { display: none; }     /* keep the header compact on mobile */

  .hero-inner { padding: 48px 24px 56px; }
  .hero-stats { gap: 24px; flex-wrap: wrap; }

  .tool-grid,
  .feature-grid,
  .category-grid { grid-template-columns: 1fr; }

  .pros-cons { grid-template-columns: 1fr; }

  .blog-layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }

  .tool-review { padding: 22px 20px; }

  /* Comparison table: scroll horizontally instead of breaking layout */
  .comparison-table { min-width: 580px; }

  /* Dropdown on mobile: expand vertically on tap, no hover-open */
  .nav-dropdown:hover .nav-dropdown-menu { display: none; }
  .nav-dropdown.open .nav-dropdown-menu { display: flex; }
  .nav-dropdown-menu {
    position: static;
    transform: none;
    box-shadow: none;
    border: none;
    min-width: 0;
    padding: 4px 0 0 12px;
  }
}
