/*
Theme Name: Automate Invoice
Theme URI: https://adhikarivivek.com.np
Author: Vivek Adhikari
Description: A lightweight, fast affiliate review site theme for invoice automation software. Built for SEO, Core Web Vitals, and affiliate conversions.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: invoiceauto
Tags: blog, custom-menu, featured-images, threaded-comments, translation-ready
*/

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --ink:        #0f1923;
  --ink-mid:    #374151;
  --ink-soft:   #6b7280;
  --ink-faint:  #f1f5f9;
  --blue:       #1e40af;
  --blue-light: #dbeafe;
  --blue-hover: #1d3a9e;
  --amber:      #d97706;
  --amber-bg:   #fffbeb;
  --amber-hover:#b45309;
  --green:      #059669;
  --green-bg:   #ecfdf5;
  --white:      #ffffff;
  --border:     #e2e8f0;
  --radius-sm:  6px;
  --radius:     10px;
  --radius-lg:  16px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.07);
  --shadow:     0 4px 12px rgba(0,0,0,.08);
  --max-width:  1120px;
  --col-width:  720px;
  --font:       -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
  --font-mono:  "SFMono-Regular", Consolas, monospace;
}

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

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; border-radius: 3px; }

/* === TYPOGRAPHY === */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.25;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }

p { margin-bottom: 1.25rem; color: var(--ink-mid); }
p:last-child { margin-bottom: 0; }

/* === LAYOUT UTILITIES === */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

.container--narrow {
  max-width: var(--col-width);
}

.section { padding: 4rem 0; }
.section--lg { padding: 6rem 0; }
.section--sm { padding: 2rem 0; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .7rem 1.5rem;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .1s;
  border: none;
  text-decoration: none !important;
  line-height: 1;
}

.btn:active { transform: scale(.98); }

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

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

.btn-ghost {
  background: transparent;
  color: var(--blue);
  border: 1.5px solid var(--blue);
}
.btn-ghost:hover { background: var(--blue-light); }

.btn-lg { padding: .9rem 2rem; font-size: 1.1rem; }

/* === BADGES === */
.badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  padding: .2rem .6rem;
  border-radius: 100px;
  letter-spacing: .02em;
}
.badge-green  { background: var(--green-bg);  color: var(--green); }
.badge-amber  { background: var(--amber-bg);  color: var(--amber); }
.badge-blue   { background: var(--blue-light); color: var(--blue); }
.badge-gray   { background: var(--ink-faint); color: var(--ink-soft); }

/* === CARDS === */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card--featured { border-color: var(--blue); border-width: 2px; }

/* === TABLES === */
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th { background: var(--ink-faint); color: var(--ink); font-weight: 600; text-align: left; padding: .75rem 1rem; }
td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); color: var(--ink-mid); }
tr:last-child td { border-bottom: none; }
td.check::before { content: "✓"; color: var(--green); font-weight: 700; margin-right: .3rem; }
td.cross::before { content: "✗"; color: #ef4444; font-weight: 700; margin-right: .3rem; }

/* === AFFILIATE DISCLOSURE === */
.disclosure {
  background: var(--ink-faint);
  border-left: 3px solid var(--amber);
  padding: .75rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .85rem;
  color: var(--ink-soft);
  margin-bottom: 2rem;
}

/* === STICKY TOC === */
.toc {
  background: var(--ink-faint);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin-bottom: 2rem;
}
.toc h3 { font-size: 1rem; margin-bottom: .75rem; }
.toc ol { padding-left: 1.25rem; }
.toc li { margin-bottom: .35rem; font-size: .9rem; }
.toc a { color: var(--blue); text-decoration: none; }
.toc a:hover { text-decoration: underline; }

/* === STAR RATING === */
.stars { color: #f59e0b; font-size: 1.1rem; letter-spacing: .1rem; }

/* === HIGHLIGHT BOX === */
.highlight-box {
  background: var(--blue-light);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.highlight-box p { color: var(--blue); font-weight: 600; margin: 0; }

/* === RESPONSIVE GRID === */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.5rem; }

/* === SKIP LINK === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  background: var(--blue);
  color: var(--white);
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  z-index: 9999;
  font-weight: 600;
}
.skip-link:focus { top: .5rem; }

/* === SCREEN READER ONLY === */
.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;
}

/* ==============================
   HEADER & NAVIGATION
   ============================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: .9rem 0;
}

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

.site-logo {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--ink);
  text-decoration: none !important;
  letter-spacing: -0.03em;
  white-space: nowrap;
}
.site-logo span { color: var(--blue); }

.site-nav { display: flex; align-items: center; gap: .25rem; list-style: none; }
.site-nav a {
  display: block;
  padding: .4rem .75rem;
  font-size: .9rem;
  font-weight: 500;
  color: var(--ink-mid);
  border-radius: var(--radius-sm);
  text-decoration: none !important;
  transition: background .15s, color .15s;
}
.site-nav a:hover { background: var(--ink-faint); color: var(--ink); }
.site-nav .current-menu-item a { color: var(--blue); font-weight: 600; }

.nav-cta {
  background: var(--amber) !important;
  color: var(--white) !important;
  font-weight: 600 !important;
  padding: .45rem 1rem !important;
}
.nav-cta:hover { background: var(--amber-hover) !important; }

/* Hamburger */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: .5rem;
  color: var(--ink);
}

/* ==============================
   HERO SECTION
   ============================== */
.hero {
  padding: 5rem 0 4rem;
  background: linear-gradient(170deg, #f8faff 0%, var(--white) 60%);
  border-bottom: 1px solid var(--border);
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 3rem;
  align-items: center;
}

.hero-eyebrow {
  display: inline-block;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-light);
  padding: .3rem .75rem;
  border-radius: 100px;
  margin-bottom: 1.25rem;
}

.hero h1 { margin-bottom: 1.25rem; }

.hero-subtext {
  font-size: 1.15rem;
  color: var(--ink-soft);
  margin-bottom: 2rem;
  line-height: 1.65;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; }

.hero-trust {
  margin-top: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: .85rem;
  color: var(--ink-soft);
  flex-wrap: wrap;
}
.trust-item { display: flex; align-items: center; gap: .35rem; }
.trust-item::before { content: "✓"; color: var(--green); font-weight: 700; }

/* Hero calculator card */
.hero-calc {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}
.hero-calc h3 { font-size: 1rem; margin-bottom: 1.25rem; color: var(--ink); }
.calc-row { margin-bottom: 1.1rem; }
.calc-row label { display: block; font-size: .85rem; font-weight: 500; color: var(--ink-mid); margin-bottom: .4rem; }
.calc-row input[type="range"] { width: 100%; accent-color: var(--blue); }
.calc-row .val { font-weight: 700; color: var(--blue); }
.calc-result {
  background: var(--green-bg);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: center;
  margin-top: 1rem;
}
.calc-result .result-num { font-size: 2rem; font-weight: 800; color: var(--green); display: block; }
.calc-result .result-label { font-size: .85rem; color: var(--ink-soft); }

/* ==============================
   TOP TOOLS SECTION
   ============================== */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }

.tool-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: box-shadow .2s, transform .2s;
}
.tool-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.tool-card--top { border-color: var(--blue); border-width: 2px; }

.tool-header { display: flex; align-items: center; justify-content: space-between; }
.tool-logo {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: var(--ink-faint);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; color: var(--blue);
  letter-spacing: -.02em;
}
.tool-rating { text-align: right; }
.tool-rating .score { font-size: 1.5rem; font-weight: 800; color: var(--ink); }
.tool-rating .out-of { font-size: .8rem; color: var(--ink-soft); }

.tool-name { font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.tool-tagline { font-size: .9rem; color: var(--ink-soft); }
.tool-best-for { font-size: .82rem; font-weight: 600; }

.tool-pros { list-style: none; padding: 0; margin: 0; }
.tool-pros li { font-size: .9rem; color: var(--ink-mid); padding: .3rem 0; border-bottom: 1px solid var(--border); display: flex; gap: .5rem; }
.tool-pros li:last-child { border-bottom: none; }
.tool-pros li::before { content: "✓"; color: var(--green); flex-shrink: 0; font-weight: 700; }

.tool-footer { display: flex; gap: .75rem; align-items: center; margin-top: auto; }
.tool-price { font-size: .85rem; color: var(--ink-soft); }

/* ==============================
   INDUSTRY GUIDE CARDS
   ============================== */
.guide-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.guide-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.guide-card-body { padding: 1.25rem; }
.guide-card-icon {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1rem;
}
.guide-card h3 { font-size: 1rem; margin-bottom: .4rem; }
.guide-card p  { font-size: .88rem; color: var(--ink-soft); margin-bottom: 1rem; }
.guide-card a  { font-size: .88rem; font-weight: 600; color: var(--blue); }

/* ==============================
   STATS STRIP
   ============================== */
.stats-strip {
  background: var(--ink);
  padding: 2.5rem 0;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 2rem;
  text-align: center;
}
.stat-num { font-size: 2.25rem; font-weight: 800; color: var(--white); display: block; }
.stat-label { font-size: .85rem; color: #94a3b8; }

/* ==============================
   COMPARISON TABLE SECTION
   ============================== */
.compare-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.compare-table { min-width: 600px; }
.compare-table th:first-child, .compare-table td:first-child { width: 35%; }
.best-pick { background: #fffbeb; }
.best-pick td:first-child { font-weight: 700; border-left: 3px solid var(--amber); }

/* ==============================
   SINGLE POST / ARTICLE
   ============================== */
.post-header { padding: 3rem 0 2rem; border-bottom: 1px solid var(--border); margin-bottom: 2rem; }
.post-meta { display: flex; flex-wrap: wrap; gap: .75rem; align-items: center; font-size: .85rem; color: var(--ink-soft); margin-bottom: 1rem; }
.post-meta a { color: var(--ink-soft); text-decoration: underline; }

.entry-content h2 { margin: 2rem 0 1rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.entry-content h3 { margin: 1.5rem 0 .75rem; }
.entry-content ul, .entry-content ol { padding-left: 1.5rem; margin-bottom: 1.25rem; }
.entry-content li { margin-bottom: .4rem; color: var(--ink-mid); }
.entry-content blockquote { border-left: 4px solid var(--blue); padding: 1rem 1.25rem; margin: 1.5rem 0; background: var(--ink-faint); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.entry-content blockquote p { color: var(--ink); font-style: italic; margin: 0; font-size: 1.05rem; }
.entry-content table { margin: 1.5rem 0; }
.entry-content img { border-radius: var(--radius); margin: 1.5rem 0; }
.entry-content .wp-caption { margin: 1.5rem 0; }

/* Sidebar layout for single posts */
.post-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}
.post-sidebar { position: sticky; top: 5rem; }

/* ==============================
   SIDEBAR WIDGETS
   ============================== */
.widget {
  background: var(--ink-faint);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.5rem;
}
.widget-title { font-size: .95rem; font-weight: 700; margin-bottom: 1rem; color: var(--ink); }
.widget ul { list-style: none; padding: 0; }
.widget ul li { padding: .4rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.widget ul li:last-child { border-bottom: none; }

/* ==============================
   FOOTER
   ============================== */
.site-footer {
  background: var(--ink);
  color: #94a3b8;
  padding: 4rem 0 2rem;
  margin-top: 5rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
}
.footer-brand h3 { color: var(--white); font-size: 1.25rem; margin-bottom: .75rem; }
.footer-brand p  { font-size: .9rem; line-height: 1.6; }

.footer-col h4 { color: var(--white); font-size: .9rem; font-weight: 700; margin-bottom: 1rem; letter-spacing: .04em; text-transform: uppercase; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: .5rem; }
.footer-col a  { color: #94a3b8; font-size: .88rem; text-decoration: none; }
.footer-col a:hover { color: var(--white); }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: .82rem;
}
.footer-legal { display: flex; gap: 1.5rem; }
.footer-legal a { color: #94a3b8; }
.footer-legal a:hover { color: var(--white); }
.footer-disclosure {
  background: rgba(255,255,255,.06);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  font-size: .8rem;
  line-height: 1.6;
  margin-bottom: 2rem;
  border-left: 2px solid var(--amber);
}

/* ==============================
   PAGINATION
   ============================== */
.pagination { display: flex; gap: .5rem; align-items: center; justify-content: center; padding: 2rem 0; }
.pagination a, .pagination .current {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-sm);
  font-size: .9rem; font-weight: 600;
  border: 1px solid var(--border);
  text-decoration: none !important;
  transition: background .15s;
}
.pagination .current { background: var(--blue); color: var(--white); border-color: var(--blue); }
.pagination a:hover { background: var(--ink-faint); }

/* ==============================
   BREADCRUMBS
   ============================== */
.breadcrumb { display: flex; flex-wrap: wrap; gap: .4rem; font-size: .82rem; color: var(--ink-soft); margin-bottom: 1rem; }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb .sep { opacity: .4; }
.breadcrumb .current { color: var(--ink); }

/* ==============================
   NOTICE / ALERT
   ============================== */
.notice { padding: 1rem 1.25rem; border-radius: var(--radius); margin: 1.5rem 0; font-size: .9rem; }
.notice-info    { background: var(--blue-light); color: var(--blue); border-left: 3px solid var(--blue); }
.notice-success { background: var(--green-bg); color: var(--green); border-left: 3px solid var(--green); }
.notice-warn    { background: var(--amber-bg); color: var(--amber); border-left: 3px solid var(--amber); }

/* ==============================
   SEARCH FORM
   ============================== */
.search-form { display: flex; gap: .5rem; }
.search-form input[type="search"] {
  flex: 1;
  padding: .6rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-family: var(--font);
}
.search-form input[type="search"]:focus { outline: 2px solid var(--blue); outline-offset: -1px; border-color: var(--blue); }
.search-form button {
  padding: .6rem 1.2rem;
  background: var(--blue);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
}

/* ==============================
   COMMENTS
   ============================== */
.comments-area { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.comment { padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.comment-meta { display: flex; gap: .75rem; align-items: center; margin-bottom: .5rem; }
.comment-author { font-weight: 600; font-size: .9rem; }
.comment-date   { font-size: .82rem; color: var(--ink-soft); }
.comment-body p { font-size: .9rem; }

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

@media (max-width: 640px) {
  .section { padding: 2.5rem 0; }
  .site-nav { display: none; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; z-index: 99; }
  .site-nav.open { display: flex; }
  .menu-toggle { display: block; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .stats-grid { grid-template-columns: repeat(2,1fr); }
  h1 { font-size: 1.85rem; }
}

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