/*
Theme Name: Billing Bazaar
Description: Billing software comparisons, partner codes, demos and installation for Indian businesses. Pages are generated from the JSON files in /data.
Version: 1.0.3
Requires PHP: 8.0
Text Domain: billingbazaar
*/

:root {
  --paper: #fbfaf6;
  --card: #ffffff;
  --ink: #1b1b18;
  --muted: #5d5c55;
  --line: #e3e0d6;
  --line-strong: #cfcabb;
  --accent: #1d6b47;
  --accent-ink: #ffffff;
  --accent-dark: #155236;
  --accent-soft: #e8f2ec;
  --marker: #fff2b3;
  --radius: 10px;
  --wrap: 1080px;
  --read: 720px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  padding-bottom: 72px; /* room for the mobile action bar */
}
img, svg { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--accent-dark); }
h1, h2, h3 { line-height: 1.22; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(1.75rem, 5.5vw, 2.6rem); }
h2 { font-size: clamp(1.3rem, 3.6vw, 1.7rem); margin-top: 2.2em; }
h3 { font-size: 1.1rem; margin-top: 1.4em; }
p, ul, ol, table { margin: 0 0 1em; }
ul, ol { padding-left: 1.25em; }
li { margin-bottom: .35em; }
small, .muted { color: var(--muted); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 16px; }
.read { max-width: var(--read); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: var(--card); padding: 8px 12px; z-index: 20; }

/* Header */
.site-header { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.12rem; letter-spacing: -0.01em; }
.brand-mark { width: 26px; height: 26px; flex: none; }
.nav { display: flex; align-items: center; gap: 22px; }
.nav a { color: var(--ink); text-decoration: none; font-size: .96rem; }
.nav a:hover { color: var(--accent); }
.nav .btn { color: var(--accent-ink); }
.menu { display: none; }
@media (max-width: 820px) {
  .nav { display: none; }
  .menu { display: block; position: relative; }
  .menu summary { list-style: none; cursor: pointer; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: .95rem; }
  .menu summary::-webkit-details-marker { display: none; }
  .menu[open] .menu-panel { display: flex; }
  .menu-panel { display: none; flex-direction: column; position: absolute; right: 0; top: calc(100% + 8px); background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); min-width: 220px; padding: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.08); }
  .menu-panel a { padding: 10px 12px; color: var(--ink); text-decoration: none; border-radius: 6px; }
  .menu-panel a:hover { background: var(--paper); }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 8px; background: var(--accent); color: var(--accent-ink); text-decoration: none; font-weight: 600; font-size: 1rem; border: 1px solid var(--accent); cursor: pointer; line-height: 1.2; font-family: inherit; }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: var(--accent-ink); }
.btn-line { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-line:hover { background: var(--card); color: var(--ink); border-color: var(--ink); }
.btn-sm { padding: 8px 14px; font-size: .92rem; }
.btn svg { width: 18px; height: 18px; flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 1.2em 0; }

/* Page head */
.crumbs { font-size: .88rem; color: var(--muted); margin: 18px 0 10px; }
.crumbs a { color: var(--muted); }
.crumbs span[aria-hidden] { margin: 0 6px; }
.page-head { padding: 8px 0 8px; }
.lede { font-size: 1.12rem; color: #33322d; max-width: 680px; }
.updated { font-size: .86rem; color: var(--muted); }

/* Layout */
.layout { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); padding-bottom: 48px; }
.layout > * { min-width: 0; }
@media (min-width: 960px) { .layout { grid-template-columns: minmax(0, 1fr) 320px; } .aside-sticky { position: sticky; top: 84px; } }
.section { padding: 8px 0; }

/* Cards and boxes */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.card + .card { margin-top: 16px; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.note { border-left: 3px solid var(--line-strong); padding: 4px 0 4px 14px; color: #3d3c36; }

/* Ledger-style fact table */
.facts { width: 100%; border-collapse: collapse; font-size: .97rem; }
.facts th, .facts td { overflow-wrap: anywhere; text-align: left; padding: 10px 0; border-bottom: 1px dashed var(--line-strong); vertical-align: top; }
.facts th { font-weight: 500; color: var(--muted); width: 42%; padding-right: 12px; }
.facts tr:last-child th, .facts tr:last-child td { border-bottom: 0; }

/* Code box */
.code-box { border: 2px dashed var(--accent); border-radius: var(--radius); background: var(--card); padding: 18px; text-align: center; }
.code-label { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0; }
.code-value { font-family: var(--mono); font-size: 2rem; font-weight: 700; letter-spacing: .12em; margin: 6px 0 10px; }
.code-help { font-size: .9rem; color: var(--muted); margin: 10px 0 0; }

/* Plans */
.plans { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .plans { grid-template-columns: 1fr 1fr; } }
.plan .price { font-size: 1.9rem; font-weight: 700; margin: 4px 0; font-variant-numeric: tabular-nums; }
.plan .mrp { color: var(--muted); text-decoration: line-through; margin-left: 6px; font-size: 1rem; font-weight: 400; }
.plan ul { padding-left: 1.1em; font-size: .95rem; }

/* Lists of links */
.link-grid { list-style: none; padding: 0; display: grid; gap: 8px 24px; grid-template-columns: repeat(auto-fill, minmax(min(150px, 100%), 1fr)); }
.link-grid li { margin: 0; }
.link-grid a { display: block; padding: 6px 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--ink); }
.link-grid a:hover { color: var(--accent); border-color: var(--accent); }
.tiles { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); list-style: none; padding: 0; }
@media (min-width: 640px) { .tiles { grid-template-columns: 1fr 1fr; } }
@media (min-width: 960px) { .tiles.three { grid-template-columns: 1fr 1fr 1fr; } }
.tiles li { margin: 0; }
.tile { display: block; height: 100%; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-decoration: none; color: var(--ink); }
.tile:hover { border-color: var(--accent); color: var(--ink); }
.tile strong { display: block; margin-bottom: 2px; }
.tile span { color: var(--muted); font-size: .93rem; }

/* Steps */
.steps { counter-reset: s; list-style: none; padding: 0; }
.steps li { counter-increment: s; position: relative; padding: 0 0 14px 44px; margin: 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--ink); display: grid; place-items: center; font-weight: 600; font-size: .9rem; }

/* Feature list */
.features { list-style: none; padding: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .features { grid-template-columns: 1fr 1fr; } }
.features li { margin: 0; padding-left: 14px; border-left: 2px solid var(--accent); }
.features strong { display: block; }
.features span { color: var(--muted); font-size: .95rem; }

/* Compare table */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.compare { border-collapse: collapse; width: 100%; min-width: 560px; font-size: .95rem; }
.compare th, .compare td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.compare thead th { background: var(--paper); font-size: .9rem; }
.compare tbody th { font-weight: 500; color: var(--muted); width: 26%; }

/* FAQ */
.faq details { border-bottom: 1px solid var(--line); padding: 14px 0; }
.faq summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 10px 0 0; color: #33322d; }

/* CTA panel */
.cta { background: var(--ink); color: #f4f2ea; border-radius: var(--radius); padding: 22px; }
.cta h2, .cta h3 { color: #fff; margin-top: 0; }
.cta p { color: #d9d6cc; }
.cta .btn-line { color: #fff; border-color: #5c5b55; }
.cta .btn-line:hover { border-color: #fff; background: transparent; }
.cta-wide { margin: 40px 0; padding: 28px; }
@media (min-width: 760px) { .cta-wide { display: flex; align-items: center; justify-content: space-between; gap: 24px; } .cta-wide .actions { margin: 0; flex: none; } }

/* Forms */
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-size: .94rem; font-weight: 500; }
.form input, .form select, .form textarea { font: inherit; font-size: 16px; padding: 11px 12px; border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; color: var(--ink); width: 100%; }
.form input:focus, .form select:focus, .form textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.form .hp { position: absolute; left: -9999px; }
.form .two { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .form .two { grid-template-columns: 1fr 1fr; } }
.alert { padding: 12px 14px; border-radius: 8px; background: #fdecea; color: #7a1f16; margin-bottom: 14px; }
.alert-ok { background: var(--accent-soft); color: var(--accent-dark); }

/* Home */
.hero { padding: 36px 0 12px; }
.hero h1 { max-width: 760px; }
.mark { background: linear-gradient(transparent 58%, var(--marker) 58%); }
.trust { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: .92rem; color: var(--muted); list-style: none; padding: 0; }
.trust li::before { content: "✓ "; color: var(--accent); font-weight: 700; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--card); margin-top: 24px; padding: 32px 0 24px; font-size: .93rem; }
.footer-cols { display: grid; gap: 24px; grid-template-columns: 1fr 1fr; }
@media (min-width: 760px) { .footer-cols { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.site-footer h3 { font-size: .95rem; margin: 0 0 8px; }
.site-footer ul { list-style: none; padding: 0; }
.site-footer a { color: var(--ink); text-decoration: none; }
.site-footer a:hover { color: var(--accent); }
.disclosure { font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }

/* Mobile action bar */
.action-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 15; background: var(--card); border-top: 1px solid var(--line); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px; padding: 8px 12px calc(8px + env(safe-area-inset-bottom)); }
.action-bar .btn { padding: 11px 8px; font-size: .95rem; }
@media (min-width: 821px) { .action-bar { display: none; } body { padding-bottom: 0; } }

/* Blog content */
.entry { max-width: var(--read); }
.entry img { border-radius: var(--radius); }
.post-list { list-style: none; padding: 0; }
.post-list li { padding: 16px 0; border-bottom: 1px solid var(--line); margin: 0; }

/* Compact link lists: pills, "show all" toggles and collapsible groups */
.chips { list-style: none; padding: 0; margin: 0 0 1em; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { margin: 0; }
.chips a { display: inline-block; padding: 6px 12px; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--card); color: var(--ink); text-decoration: none; font-size: .92rem; line-height: 1.35; }
.chips a:hover { border-color: var(--accent); color: var(--accent); }
.more { margin: -4px 0 1em; }
.more > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .94rem; list-style: none; display: inline-block; padding: 4px 0; }
.more > summary::-webkit-details-marker { display: none; }
.more > summary::after { content: " +"; }
.more[open] > summary::after { content: " –"; }
.more[open] > summary { margin-bottom: 8px; }
.folds { border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); margin-bottom: 1em; }
.fold + .fold { border-top: 1px solid var(--line); }
.fold > summary { cursor: pointer; list-style: none; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 600; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary span { color: var(--muted); font-weight: 400; font-size: .9rem; white-space: nowrap; }
.fold > summary span::after { content: "  +"; }
.fold[open] > summary span::after { content: "  –"; }
.fold > .chips { padding: 0 16px 14px; margin: 0; }
.section-note { color: var(--muted); font-size: .94rem; margin-top: -.4em; }
.compare.compact, .table-scroll .compare { min-width: 0; }
.compare tbody th { width: 34%; }
@media (max-width: 640px) { .features { gap: 10px; } .features span { font-size: .9rem; } .site-footer { padding-top: 24px; } }
/* Phones: the sticky action bar already offers WhatsApp / Call / Demo, so drop the side CTA panel and compress the footer */
@media (max-width: 820px) {
  aside .cta { display: none; }
  .footer-cols { grid-template-columns: 1fr; gap: 14px; }
  .site-footer ul { display: flex; flex-wrap: wrap; gap: 2px 16px; margin: 0; }
  .site-footer li { margin: 0; }
  .site-footer h3 { margin-bottom: 4px; }
}
