/* =============================================
   Best Small Business Accounting Software
   Shared Stylesheet for Subpages
   ============================================= */

/* --- Design Tokens (from homepage) --- */
:root {
  --paper: #eef3ee;
  --sheet: #fbfdfb;
  --ink: #12202f;
  --muted: #50606c;
  --rule: #c9dad0;
  --green: #0f6b4f;
  --green-dark: #0a4f3a;
  --marker: #ffe45c;
  --amber: #a8650b;
  --display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --body: "IBM Plex Sans", "Helvetica Neue", Arial, sans-serif;
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; height: auto; }
:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Layout --- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* --- Skip Link --- */
.skip { position: absolute; left: -999px; }
.skip:focus {
  left: 16px; top: 16px;
  background: var(--ink); color: #fff;
  padding: 8px 14px; z-index: 99;
  text-decoration: none; border-radius: 4px;
}

/* --- 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;
}

/* =============================================
   NAVIGATION
   ============================================= */
.bar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(238, 243, 238, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}
.bar .wrap {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 16px; height: 60px;
}
.brand {
  font-family: var(--display);
  font-weight: 800; font-size: 20px;
  letter-spacing: -0.01em;
  text-decoration: none;
  white-space: nowrap;
}
.bar nav {
  display: flex; gap: 6px; align-items: center;
}
.bar nav a {
  font-size: 14px; font-weight: 500;
  text-decoration: none;
  padding: 7px 12px; border-radius: 999px;
  color: var(--muted);
  transition: background 0.15s, color 0.15s;
}
.bar nav a:hover,
.bar nav a[aria-current="page"] {
  background: #dfe9e2; color: var(--ink);
}
.bar nav a.primary {
  background: var(--green); color: #fff; font-weight: 600;
}
.bar nav a.primary:hover {
  background: var(--green-dark);
}

/* Hamburger Button */
.menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 8px; margin-right: -8px;
  flex-direction: column; gap: 5px;
  z-index: 30;
}
.menu-toggle span {
  display: block; width: 24px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s, opacity 0.25s;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* =============================================
   BREADCRUMB
   ============================================= */
.breadcrumb {
  padding: 16px 0 0;
}
.breadcrumb ol {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 4px;
  font-size: 14px; color: var(--muted);
}
.breadcrumb li::after {
  content: "/"; margin-left: 8px; color: var(--rule);
}
.breadcrumb li:last-child::after { content: ""; margin: 0; }
.breadcrumb a {
  text-decoration: none; color: var(--green);
}
.breadcrumb a:hover {
  text-decoration: underline; text-underline-offset: 3px;
}
.breadcrumb [aria-current="page"] {
  color: var(--ink); font-weight: 500;
}

/* =============================================
   PAGE HEADER
   ============================================= */
.page-header {
  padding: 56px 0 48px;
  background-image: repeating-linear-gradient(
    to bottom, transparent 0, transparent 39px,
    rgba(15,107,79,0.09) 39px, rgba(15,107,79,0.09) 40px
  );
  border-bottom: 1px solid var(--rule);
}
.page-header h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(32px, 4.5vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 12px;
}
.page-header .subtitle {
  font-size: 19px; color: var(--muted);
  max-width: 60ch; margin: 0;
}

/* =============================================
   CONTENT PAGES
   ============================================= */
.content {
  max-width: 780px;
  padding: 48px 0 72px;
}
.content h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(24px, 3vw, 32px);
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 48px 0 16px;
}
.content h2:first-child { margin-top: 0; }
.content h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 22px;
  line-height: 1.2;
  margin: 36px 0 12px;
}
.content p {
  margin: 0 0 18px;
  color: var(--ink);
}
.content ul, .content ol {
  margin: 0 0 18px;
  padding-left: 24px;
}
.content li {
  margin-bottom: 8px;
}
.content a {
  color: var(--green);
  text-underline-offset: 3px;
}
.content a:hover {
  color: var(--green-dark);
}
.content blockquote {
  border-left: 4px solid var(--green);
  margin: 24px 0;
  padding: 16px 24px;
  background: var(--sheet);
  border-radius: 0 6px 6px 0;
  color: var(--muted);
  font-size: 16px;
}
.content blockquote p:last-child { margin-bottom: 0; }

/* Author placeholder section */
.author-placeholder {
  background: var(--sheet);
  border: 2px dashed var(--rule);
  border-radius: 8px;
  padding: 28px;
  margin: 36px 0;
}
.author-placeholder h3 { margin-top: 0; }
.author-placeholder .placeholder-note {
  color: var(--amber);
  font-size: 14px;
  font-weight: 600;
}

/* =============================================
   CARD GRID (hub pages, blog index)
   ============================================= */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 24px;
  margin: 36px 0;
}
.card {
  background: var(--sheet);
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  padding: 28px;
  text-decoration: none;
  display: flex; flex-direction: column;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover {
  border-color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
}
.card .card-tag {
  font-size: 13px; font-weight: 600;
  color: var(--green);
  margin: 0 0 8px;
}
.card h3 {
  font-family: var(--display);
  font-size: 22px; font-weight: 800;
  line-height: 1.15;
  margin: 0 0 10px;
  color: var(--ink);
}
.card p {
  margin: 0; color: var(--muted);
  font-size: 16px; flex-grow: 1;
}
.card .card-meta {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--muted);
}

/* Link list style (alternative to cards) */
.link-list {
  border-top: 2px solid var(--ink);
  margin: 36px 0;
}
.link-list a {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--rule);
  text-decoration: none;
  transition: background 0.1s;
}
.link-list a:hover { background: rgba(15,107,79,0.04); }
.link-list .link-title {
  font-family: var(--display);
  font-weight: 600; font-size: 18px;
}
.link-list .link-desc {
  color: var(--muted); font-size: 15px;
  margin-top: 2px;
}
.link-list .link-arrow {
  font-size: 20px; color: var(--green);
  flex-shrink: 0;
}

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-block;
  background: var(--green); color: #fff;
  text-decoration: none; font-weight: 600;
  padding: 14px 24px; border-radius: 6px;
  transition: background 0.15s;
}
.btn:hover { background: var(--green-dark); }
.btn.ghost {
  background: transparent; color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--ink);
}
.btn.ghost:hover { background: var(--ink); color: #fff; }

/* =============================================
   ARTICLE LAYOUT
   ============================================= */
.article-header {
  padding: 56px 0 32px;
  background-image: repeating-linear-gradient(
    to bottom, transparent 0, transparent 39px,
    rgba(15,107,79,0.09) 39px, rgba(15,107,79,0.09) 40px
  );
  border-bottom: 1px solid var(--rule);
}
.article-header h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(30px, 4.2vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
  max-width: 22ch;
}
.article-meta {
  display: flex; flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 14px; color: var(--muted);
}
.article-meta time { font-weight: 500; }

/* Table of Contents */
.toc {
  background: var(--sheet);
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  padding: 24px 28px;
  margin: 32px 0;
}
.toc h2 {
  font-family: var(--display);
  font-size: 18px; font-weight: 800;
  margin: 0 0 12px;
}
.toc ol {
  margin: 0; padding-left: 20px;
}
.toc li { margin-bottom: 6px; }
.toc a {
  color: var(--green); text-decoration: none;
  font-size: 15px;
}
.toc a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Author Box */
.author-box {
  display: flex; gap: 20px;
  align-items: flex-start;
  background: var(--sheet);
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  padding: 24px;
  margin: 40px 0;
}
.author-box img {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--rule);
}
.author-box .author-name {
  font-family: var(--display);
  font-weight: 800; font-size: 18px;
  margin: 0 0 4px;
}
.author-box .author-title {
  font-size: 14px; color: var(--green);
  font-weight: 600; margin: 0 0 8px;
}
.author-box .author-bio {
  font-size: 15px; color: var(--muted);
  margin: 0 0 10px;
}
.author-box .author-links {
  display: flex; gap: 12px;
  font-size: 14px;
}
.author-box .author-links a {
  color: var(--green); text-decoration: none;
}
.author-box .author-links a:hover {
  text-decoration: underline;
}

/* Inline Affiliate Disclosure */
.inline-disclosure {
  font-size: 14px;
  color: var(--muted);
  padding: 12px 16px;
  background: rgba(15,107,79,0.05);
  border-radius: 6px;
  margin: 24px 0;
  border-left: 3px solid var(--green);
}

/* Related Articles */
.related-articles {
  margin: 48px 0;
  padding-top: 32px;
  border-top: 2px solid var(--ink);
}
.related-articles h2 {
  font-family: var(--display);
  font-weight: 800; font-size: 28px;
  margin: 0 0 20px;
}

/* FAQ section in articles */
.faq-section { margin: 48px 0; }
.faq-section h2 {
  font-family: var(--display);
  font-weight: 800; font-size: 28px;
  margin: 0 0 20px;
}
.faq-item {
  border-bottom: 1px solid var(--rule);
  padding: 20px 0;
}
.faq-item:first-of-type {
  border-top: 2px solid var(--ink);
}
.faq-item h3 {
  font-family: var(--display);
  font-weight: 600; font-size: 19px;
  margin: 0 0 10px;
  color: var(--ink);
}
.faq-item p {
  margin: 0; color: var(--muted); font-size: 16px;
}

/* Comparison table in articles */
.article-table-wrap {
  overflow-x: auto;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  background: var(--sheet);
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
}
.article-table-wrap table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 15px;
}
.article-table-wrap th,
.article-table-wrap td {
  padding: 14px;
  text-align: center;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.article-table-wrap th {
  font-size: 13px; font-weight: 600;
  color: var(--muted);
  background: #e6eee8;
  position: sticky; top: 0;
}
.article-table-wrap th:first-child,
.article-table-wrap td:first-child {
  text-align: left;
  position: sticky; left: 0;
  background: var(--sheet); z-index: 2;
  border-right: 1px solid var(--rule);
}
.article-table-wrap th:first-child {
  background: #e6eee8; z-index: 3;
}
.article-table-wrap tr:last-child td { border-bottom: 0; }

/* Featured image */
.featured-image {
  margin: 32px 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--rule);
}
.featured-image img {
  display: block; width: 100%;
  height: auto;
}

/* =============================================
   PROS / CONS (review template)
   ============================================= */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
}
.pros, .cons {
  background: var(--sheet);
  border: 1.5px solid var(--rule);
  border-radius: 8px;
  padding: 24px;
}
.pros h3, .cons h3 {
  font-family: var(--display);
  font-size: 20px;
  margin: 0 0 12px;
}
.pros h3 { color: var(--green); }
.cons h3 { color: var(--amber); }
.pros ul, .cons ul {
  margin: 0; padding-left: 20px;
}
.pros li, .cons li {
  margin-bottom: 6px; font-size: 15px;
}

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: var(--ink);
  color: #b8c7d1;
  padding: 56px 0 36px;
  font-size: 14px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-brand .footer-logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 20px;
  color: #fff;
  margin: 0 0 10px;
}
.footer-brand p {
  margin: 0; max-width: 32ch;
  line-height: 1.5;
}
.site-footer h4 {
  font-family: var(--display);
  font-weight: 600; font-size: 15px;
  color: #fff; margin: 0 0 14px;
}
.site-footer ul {
  list-style: none; margin: 0; padding: 0;
}
.site-footer li { margin-bottom: 8px; }
.site-footer a {
  color: #b8c7d1;
  text-decoration: none;
  transition: color 0.15s;
}
.site-footer a:hover { color: #fff; }
.footer-bottom {
  padding-top: 24px;
  font-size: 13px;
}
.footer-bottom p {
  margin: 0 0 8px;
  max-width: 80ch;
}
.footer-bottom p:last-child { margin-bottom: 0; }

/* =============================================
   404 PAGE
   ============================================= */
.error-page {
  text-align: center;
  padding: 80px 0;
}
.error-page h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(48px, 8vw, 96px);
  color: var(--rule);
  margin: 0 0 8px;
}
.error-page h2 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(24px, 3vw, 36px);
  margin: 0 0 16px;
}
.error-page p {
  color: var(--muted); margin: 0 0 32px;
  font-size: 18px;
}
.error-page .error-links {
  display: flex; flex-wrap: wrap;
  gap: 12px; justify-content: center;
}

/* =============================================
   RESPONSIVE
   ============================================= */

/* Tablet */
@media (max-width: 900px) {
  .bar nav a:not(.primary) { display: none; }
  .menu-toggle { display: flex; }

  /* Mobile menu open state */
  .bar nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 60px; left: 0; right: 0;
    background: var(--sheet);
    border-bottom: 2px solid var(--ink);
    padding: 16px 24px 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    gap: 4px;
  }
  .bar nav.open a {
    display: block;
    padding: 12px 16px;
    font-size: 16px;
    border-radius: 6px;
  }
  .bar nav.open a.primary {
    margin-top: 8px;
    text-align: center;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }

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

  .author-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .author-box .author-links {
    justify-content: center;
  }
}

/* Mobile */
@media (max-width: 560px) {
  body { font-size: 16px; }
  .wrap { padding: 0 18px; }

  .page-header { padding: 40px 0 36px; }
  .content { padding: 36px 0 56px; }

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

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .article-header { padding: 40px 0 24px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition-duration: 0.01ms !important; }
}
