/*
Theme Name: ACInstallCost
Theme URI: https://acinstallcost.com
Author: AC Install Cost
Description: HVAC cost & sizing tool hub. Custom theme with convention-based JS tool loading, 50-state programmatic cost pages, lead capture, and Rank Math-ready schema. Signature climate cost bar (cooling-blue to heating-orange).
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: acinstallcost
*/

/* ============================================================
   0. DESIGN TOKENS
   Signature idea: HVAC = cooling + heating. Blue -> orange is
   both the cold->hot axis AND the low->high cost axis.
   ============================================================ */
:root {
  --ac-blue: #0A6EBD;
  --ac-blue-deep: #064E86;
  --ac-orange: #F2820D;
  --ac-cta: #E4571C;
  --ac-cta-hover: #C6440F;
  --ac-ink: #14202B;
  --ac-slate: #5A6B78;
  --ac-mist: #F4F8FB;
  --ac-line: #DCE6EE;
  --ac-green: #1E9E6A;
  --ac-white: #FFFFFF;

  --ac-climate: linear-gradient(90deg, var(--ac-blue) 0%, #4F9AD4 38%, #F5B457 68%, var(--ac-orange) 100%);

  --ac-radius: 12px;
  --ac-radius-sm: 8px;
  --ac-shadow: 0 1px 2px rgba(20,32,43,.06), 0 8px 24px rgba(20,32,43,.06);
  --ac-shadow-lift: 0 2px 4px rgba(20,32,43,.08), 0 16px 40px rgba(20,32,43,.12);

  --ac-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --ac-maxw: 1120px;
  --ac-maxw-narrow: 760px;
}

/* ============================================================
   1. RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--ac-font);
  color: var(--ac-ink);
  background: var(--ac-white);
  line-height: 1.6;
  font-size: 17px;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ac-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; font-weight: 800; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }

.ac-container { max-width: var(--ac-maxw); margin: 0 auto; padding: 0 20px; }
.ac-narrow { max-width: var(--ac-maxw-narrow); margin: 0 auto; padding: 0 20px; }
.ac-section { padding: 56px 0; }
.ac-section--mist { background: var(--ac-mist); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ============================================================
   2. HEADER / NAV
   ============================================================ */
.ac-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--ac-blue-deep);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,.08);
}
.ac-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; height: 62px;
}
.ac-brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 1.15rem; letter-spacing: -.02em; }
.ac-brand:hover { text-decoration: none; }
.ac-brand__glyph { width: 26px; height: 26px; flex: none; }
.ac-brand__cost { color: var(--ac-orange); }

.ac-nav { display: flex; align-items: center; gap: 4px; }
.ac-nav a {
  color: #E8F1F8; padding: 8px 12px; border-radius: var(--ac-radius-sm);
  font-size: .95rem; font-weight: 600;
}
.ac-nav a:hover { background: rgba(255,255,255,.1); text-decoration: none; }
.ac-nav .ac-nav__quotes {
  background: var(--ac-cta); color: #fff; margin-left: 6px;
}
.ac-nav .ac-nav__quotes:hover { background: var(--ac-cta-hover); }

.ac-navtoggle { display: none; background: none; border: 0; color: #fff; padding: 8px; cursor: pointer; }
.ac-navtoggle svg { width: 24px; height: 24px; }

@media (max-width: 860px) {
  .ac-navtoggle { display: block; }
  .ac-nav {
    position: absolute; top: 62px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--ac-blue-deep); padding: 8px 12px 16px;
    display: none;
  }
  .ac-nav.is-open { display: flex; }
  .ac-nav a { padding: 12px; }
  .ac-nav .ac-nav__quotes { margin: 8px 0 0; text-align: center; }
}

/* ============================================================
   3. SIGNATURE: CLIMATE COST BAR
   ============================================================ */
.ac-climatebar { margin: 20px 0 8px; }
.ac-climatebar__track {
  position: relative; height: 16px; border-radius: 999px;
  background: var(--ac-climate);
  box-shadow: inset 0 0 0 1px rgba(20,32,43,.06);
}
/* highlighted "typical" range window */
.ac-climatebar__range {
  position: absolute; top: -4px; bottom: -4px;
  border: 2px solid var(--ac-ink); border-radius: 999px;
  background: rgba(255,255,255,.18);
  box-shadow: 0 2px 8px rgba(20,32,43,.18);
}
.ac-climatebar__scale {
  display: flex; justify-content: space-between;
  margin-top: 10px; font-size: .8rem; color: var(--ac-slate);
  font-variant-numeric: tabular-nums;
}
.ac-climatebar__labels {
  display: flex; justify-content: space-between;
  margin-top: 6px; font-size: .72rem; text-transform: uppercase;
  letter-spacing: .08em; color: var(--ac-slate);
}
.ac-climatebar__labels .lo { color: var(--ac-blue); font-weight: 700; }
.ac-climatebar__labels .hi { color: var(--ac-orange); font-weight: 700; }

/* ============================================================
   4. HERO (live cost lookup = the thesis)
   ============================================================ */
.ac-hero { background: linear-gradient(180deg, #fff 0%, var(--ac-mist) 100%); padding: 52px 0 40px; }
.ac-hero__eyebrow {
  text-transform: uppercase; letter-spacing: .12em; font-size: .78rem;
  font-weight: 700; color: var(--ac-blue); margin-bottom: 10px;
}
.ac-hero h1 { max-width: 15ch; }
.ac-hero__sub { font-size: 1.1rem; color: var(--ac-slate); max-width: 52ch; margin-bottom: 24px; }

.ac-lookup {
  background: #fff; border: 1px solid var(--ac-line); border-radius: var(--ac-radius);
  padding: 22px; box-shadow: var(--ac-shadow); max-width: 620px;
}
.ac-lookup__row { display: flex; gap: 10px; flex-wrap: wrap; }
.ac-lookup label { font-size: .82rem; font-weight: 700; color: var(--ac-slate); display: block; margin-bottom: 6px; }
.ac-field { flex: 1 1 200px; }
.ac-select, .ac-input {
  width: 100%; padding: 12px 14px; font-size: 1rem; font-family: inherit;
  border: 1px solid var(--ac-line); border-radius: var(--ac-radius-sm);
  background: #fff; color: var(--ac-ink);
}
.ac-select:focus, .ac-input:focus { outline: 3px solid rgba(10,110,189,.25); border-color: var(--ac-blue); }

.ac-result { margin-top: 20px; }
.ac-result__figure {
  font-size: clamp(2rem, 6vw, 3rem); font-weight: 800; letter-spacing: -.02em;
  font-variant-numeric: tabular-nums; color: var(--ac-ink); line-height: 1;
}
.ac-result__figure .sep { color: var(--ac-line); font-weight: 400; margin: 0 .25em; }
.ac-result__note { font-size: .9rem; color: var(--ac-slate); margin-top: 8px; }

/* ============================================================
   5. BUTTONS
   ============================================================ */
.ac-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: var(--ac-radius-sm);
  font-weight: 700; font-size: 1rem; cursor: pointer; border: 0;
  font-family: inherit; text-decoration: none; transition: background .15s, transform .05s;
}
.ac-btn:hover { text-decoration: none; }
.ac-btn:active { transform: translateY(1px); }
.ac-btn--cta { background: var(--ac-cta); color: #fff; }
.ac-btn--cta:hover { background: var(--ac-cta-hover); }
.ac-btn--primary { background: var(--ac-blue); color: #fff; }
.ac-btn--primary:hover { background: var(--ac-blue-deep); }
.ac-btn--ghost { background: #fff; color: var(--ac-blue); border: 1.5px solid var(--ac-line); }
.ac-btn--ghost:hover { border-color: var(--ac-blue); }
.ac-btn--block { display: flex; width: 100%; justify-content: center; }

/* ============================================================
   6. TOOL DIRECTORY / CARDS
   ============================================================ */
.ac-cathead { display: flex; align-items: baseline; gap: 12px; margin: 0 0 18px; }
.ac-cathead__kicker { font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ac-slate); font-weight: 700; }

.ac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.ac-card {
  position: relative; background: #fff; border: 1px solid var(--ac-line);
  border-radius: var(--ac-radius); padding: 20px 18px 18px; overflow: hidden;
  box-shadow: var(--ac-shadow); transition: box-shadow .18s, transform .18s;
}
.ac-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--ac-climate);
}
.ac-card:hover { box-shadow: var(--ac-shadow-lift); transform: translateY(-2px); }
.ac-card h3 { font-size: 1.08rem; margin-bottom: 6px; }
.ac-card h3 a { color: var(--ac-ink); }
.ac-card h3 a:hover { color: var(--ac-blue); text-decoration: none; }
.ac-card p { font-size: .92rem; color: var(--ac-slate); margin: 0; }
.ac-card__flag {
  display: inline-block; font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ac-orange); margin-bottom: 8px;
}

/* ============================================================
   7. TOOL PAGE LAYOUT
   ============================================================ */
.ac-tool { padding: 36px 0 48px; }
.ac-tool__head { max-width: 62ch; margin-bottom: 24px; }
.ac-tool__mount {
  background: #fff; border: 1px solid var(--ac-line); border-radius: var(--ac-radius);
  padding: 26px; box-shadow: var(--ac-shadow);
}
.ac-tool__fallback { color: var(--ac-slate); font-size: .95rem; }

.ac-adzone { margin: 28px 0; text-align: center; min-height: 1px; }
.ac-adzone:empty { display: none; }

/* ============================================================
   8. RELATED TOOLS BAR
   ============================================================ */
.ac-related { margin: 32px 0; }
.ac-related__title { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: var(--ac-slate); font-weight: 700; margin-bottom: 12px; }
.ac-related__list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.ac-related__item {
  display: block; padding: 14px 16px; background: var(--ac-mist);
  border: 1px solid var(--ac-line); border-radius: var(--ac-radius-sm);
  font-weight: 600; color: var(--ac-ink); font-size: .95rem;
}
.ac-related__item:hover { border-color: var(--ac-blue); color: var(--ac-blue); text-decoration: none; }

/* ============================================================
   9. LEAD CTA BLOCK
   ============================================================ */
.ac-leadcta {
  background: linear-gradient(135deg, var(--ac-blue-deep), var(--ac-blue));
  color: #fff; border-radius: var(--ac-radius); padding: 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.ac-leadcta h3 { color: #fff; margin-bottom: 6px; }
.ac-leadcta p { color: #DCE9F5; margin: 0; max-width: 46ch; }
.ac-leadcta__action { flex: none; }

/* ============================================================
   10. STATE PAGE
   ============================================================ */
.ac-statehead { padding: 36px 0 8px; }
.ac-breadcrumb { font-size: .85rem; color: var(--ac-slate); margin-bottom: 14px; }
.ac-breadcrumb a { color: var(--ac-slate); }
.ac-costtable { width: 100%; border-collapse: collapse; margin: 20px 0; font-size: .95rem; }
.ac-costtable th, .ac-costtable td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--ac-line); }
.ac-costtable th { background: var(--ac-mist); font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ac-slate); }
.ac-costtable td:last-child { font-variant-numeric: tabular-nums; font-weight: 700; text-align: right; }
.ac-metrorow { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.ac-metrorow a { padding: 8px 14px; background: var(--ac-mist); border: 1px solid var(--ac-line); border-radius: 999px; font-size: .9rem; font-weight: 600; }

/* ============================================================
   11. FAQ (single-block: visible + JSON-LD lives in content)
   ============================================================ */
.ac-faq { margin: 32px 0; }
.ac-faq h2 { margin-bottom: 16px; }
.ac-faq__q { font-weight: 700; margin: 18px 0 4px; font-size: 1.05rem; }
.ac-faq__a { color: var(--ac-slate); margin: 0; }

/* ============================================================
   12. CONTENT (blog / articles)
   ============================================================ */
.ac-prose { max-width: 68ch; font-size: 1.05rem; }
.ac-prose h2 { margin-top: 1.6em; }
.ac-prose ul, .ac-prose ol { padding-left: 1.3em; }
.ac-prose li { margin-bottom: .4em; }

/* ============================================================
   13. FOOTER
   ============================================================ */
.ac-footer { background: var(--ac-ink); color: #B9C6D1; padding: 48px 0 28px; margin-top: 40px; }
.ac-footer a { color: #DCE6EE; }
.ac-footer__cols { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 32px; }
.ac-footer h4 { color: #fff; font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.ac-footer ul { list-style: none; padding: 0; margin: 0; }
.ac-footer li { margin-bottom: 8px; font-size: .92rem; }
.ac-footer__brand { font-weight: 800; font-size: 1.1rem; color: #fff; margin-bottom: 10px; }
.ac-footer__brand .ac-brand__cost { color: var(--ac-orange); }
.ac-footer__disclaimer { font-size: .82rem; color: #7E8E9B; margin-top: 28px; border-top: 1px solid #2A3844; padding-top: 20px; max-width: 90ch; }
@media (max-width: 720px) { .ac-footer__cols { grid-template-columns: 1fr 1fr; } }

/* ============================================================
   14. A11Y / MOTION
   ============================================================ */
:focus-visible { outline: 3px solid rgba(10,110,189,.45); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ============================================================
   15. WIZARD (flagship sizing tool)
   ============================================================ */
.ac-wizard-page { padding: 32px 0 48px; }
.ac-wizard {
  background: #fff; border: 1px solid var(--ac-line); border-radius: var(--ac-radius);
  padding: 26px; box-shadow: var(--ac-shadow);
}
.ac-wizard__progress { margin-bottom: 22px; }
.ac-wizard__bar { height: 6px; background: var(--ac-mist); border-radius: 999px; overflow: hidden; }
.ac-wizard__fill { display: block; height: 100%; width: 0; background: var(--ac-climate); transition: width .3s ease; }
.ac-wizard__count { font-size: .82rem; color: var(--ac-slate); margin-top: 8px; font-weight: 600; }

.ac-wizard__step { display: none; }
.ac-wizard__step.is-active { display: block; animation: acFade .25s ease; }
@keyframes acFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ac-wizard__step h2 { margin-bottom: 16px; }

.ac-optset { border: 0; padding: 0; margin: 0 0 18px; }
.ac-optset legend { font-size: .82rem; font-weight: 700; color: var(--ac-slate); padding: 0; margin-bottom: 8px; }
.ac-optgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ac-optgrid--2 { grid-template-columns: repeat(2, 1fr); }
.ac-opt { position: relative; display: block; cursor: pointer; }
.ac-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.ac-opt span {
  display: block; text-align: center; padding: 14px 10px;
  border: 1.5px solid var(--ac-line); border-radius: var(--ac-radius-sm);
  font-weight: 600; font-size: .95rem; background: #fff; transition: all .12s;
}
.ac-opt input:checked + span { border-color: var(--ac-blue); background: rgba(10,110,189,.06); color: var(--ac-blue-deep); box-shadow: inset 0 0 0 1px var(--ac-blue); }
.ac-opt input:focus-visible + span { outline: 3px solid rgba(10,110,189,.35); outline-offset: 2px; }

.ac-wizard__nav { display: flex; gap: 12px; margin-top: 24px; align-items: center; }
.ac-wizard__nav [data-wz="next"] { margin-left: auto; }
.ac-wizard__err { color: var(--ac-cta); font-weight: 600; font-size: .92rem; margin-top: 12px; }

/* result */
.ac-wizard__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 20px; }
.ac-stat { background: var(--ac-mist); border: 1px solid var(--ac-line); border-radius: var(--ac-radius-sm); padding: 16px; text-align: center; }
.ac-stat__num { display: block; font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; color: var(--ac-ink); line-height: 1.1; }
.ac-stat__lbl { display: block; font-size: .78rem; color: var(--ac-slate); margin-top: 4px; }
.ac-wizard__handoff { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.ac-wizard__handoff .ac-btn { flex: 1 1 auto; justify-content: center; }

@media (max-width: 560px) {
  .ac-optgrid { grid-template-columns: 1fr; }
  .ac-optgrid--2 { grid-template-columns: 1fr 1fr; }
  .ac-wizard__stats { grid-template-columns: 1fr; }
}
