/*
Theme Name: Certification Costs US
Theme URI: https://certificationcosts.com/
Author: CertificationCosts.com
Author URI: https://certificationcosts.com/
Description: Independent US guides and cost calculators for ISO certification. Every price is shown as a plain-English USD range. A self-contained theme that auto-builds a guide page and a range-based cost calculator for every ISO standard from a single data file. Identity: measured — cool white, cobalt, and a green-to-amber range bar.
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
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: certificationcosts-us
*/

/* ============================================================
   DESIGN TOKENS
   Identity: "measured". The site's whole job is cost RANGES,
   so the range bar (green low -> amber high, ruler ticks) is
   the signature element. Cool, technical, American-modern.
   Palette : bg #f3f5f8 / ink #0f1622 / cobalt #2545c8
             low green #0e7a58 / high amber #b9760f
   Type    : Space Grotesk (display), IBM Plex Sans (body),
             JetBrains Mono (figures / ruler ticks)
   ============================================================ */
:root {
  --bg:        #f3f5f8;
  --surface:   #ffffff;
  --surface-2: #f8fafc;
  --ink:       #0f1622;
  --ink-soft:  #55607a;
  --ink-faint: #8a93a6;
  --cobalt:    #2545c8;
  --cobalt-dk: #1a339c;
  --cobalt-wash:#eef2ff;
  --low:       #0e7a58;   /* low end of a price range */
  --low-wash:  #e6f4ef;
  --high:      #b9760f;   /* high end of a price range */
  --high-wash: #fbf2e2;
  --line:      #e2e7ee;
  --line-2:    #eef1f5;
  --rose:      #b23b3b;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow:    0 1px 2px rgba(15,22,34,.04), 0 8px 24px rgba(15,22,34,.06);
  --shadow-sm: 0 1px 2px rgba(15,22,34,.05);
  --maxw:      1120px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--ink);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
  font-weight: 600;
}
h1 { font-size: clamp(2.1rem, 4.6vw, 3.35rem); letter-spacing: -0.025em; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); letter-spacing: -0.02em; }
h3 { font-size: 1.22rem; }
h4 { font-size: 1rem; }

p { margin: 0 0 1em; }
a { color: var(--cobalt); text-decoration: none; }
a:hover { color: var(--cobalt-dk); text-decoration: underline; }

.mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.text-center { text-align: center; }

.eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: .74rem; font-weight: 500; letter-spacing: .16em; text-transform: uppercase;
  color: var(--cobalt); margin: 0 0 14px;
}

.skip-link {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: #fff;
  padding: 10px 16px; z-index: 200; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

/* ============================================================
   HEADER / NAV
   ============================================================ */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,.86);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; flex: 0 0 auto; }
.brand-name { font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 1.14rem; letter-spacing: -0.02em; }
.brand-name .dot { color: var(--cobalt); }

.main-nav { margin-left: auto; }
.main-nav ul { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.main-nav a {
  display: inline-block; padding: 8px 14px; border-radius: 8px; color: var(--ink-soft);
  font-size: .95rem; font-weight: 500;
}
.main-nav a:hover { background: var(--surface-2); color: var(--ink); text-decoration: none; }

.menu-button {
  display: none; margin-left: auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: 8px; width: 42px; height: 42px; cursor: pointer; color: var(--ink);
  align-items: center; justify-content: center;
}
.menu-button svg { width: 20px; height: 20px; }

/* ============================================================
   RANGE BAR — the signature element
   ============================================================ */
.rangebar { display: block; }
.rangebar .rb-ends {
  display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px;
}
.rangebar .rb-lo, .rangebar .rb-hi {
  font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: 1.02rem;
}
.rangebar .rb-lo { color: var(--low); }
.rangebar .rb-hi { color: var(--high); }
.rangebar .rb-track {
  position: relative; height: 12px; border-radius: 20px;
  background: linear-gradient(90deg, var(--low) 0%, #6a9a3f 50%, var(--high) 100%);
  box-shadow: inset 0 0 0 1px rgba(15,22,34,.05);
}
/* ruler ticks under the track */
.rangebar .rb-ticks {
  display: flex; justify-content: space-between; margin-top: 6px; padding: 0 1px;
}
.rangebar .rb-ticks span { width: 1px; height: 6px; background: var(--line); }
.rangebar .rb-ticks span:first-child,
.rangebar .rb-ticks span:last-child { background: var(--ink-faint); height: 9px; }
.rangebar.lg .rb-lo, .rangebar.lg .rb-hi { font-size: 1.5rem; }
.rangebar.lg .rb-track { height: 16px; }

/* ============================================================
   HERO
   ============================================================ */
.hero { padding: 72px 0 52px; }
.hero .eyebrow { margin-bottom: 18px; }
.hero h1 { max-width: 15ch; }
.hero .lead {
  font-size: 1.2rem; color: var(--ink-soft); max-width: 60ch; margin-top: 18px;
}
.hero-range {
  margin: 34px 0 8px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); padding: 26px 28px; box-shadow: var(--shadow); max-width: 560px;
}
.hero-range .rr-label {
  font-family: "JetBrains Mono", monospace; font-size: .74rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-faint); margin-bottom: 14px;
}
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 30px; }

.hero-stats { display: flex; gap: 40px; flex-wrap: wrap; margin-top: 40px; }
.hero-stats .s .n {
  font-family: "Space Grotesk", sans-serif; font-weight: 600; font-size: 2rem; color: var(--ink);
  letter-spacing: -0.02em;
}
.hero-stats .s .l { font-size: .86rem; color: var(--ink-soft); }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 8px; cursor: pointer;
  background: var(--cobalt); color: #fff; border: 0;
  padding: 12px 20px; border-radius: 9px; font-weight: 600; font-size: .96rem;
  font-family: "IBM Plex Sans", sans-serif; text-decoration: none;
  transition: background .15s ease, transform .15s ease;
}
.btn:hover { background: var(--cobalt-dk); color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--cobalt); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.ghost:hover { background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--cobalt); color: var(--cobalt-dk); }
.btn.quote { background: var(--high); }
.btn.quote:hover { background: #9a6009; color: #fff; }
.btn.block { display: flex; width: 100%; justify-content: center; }

/* quote CTA panel under calculator results */
.quote-cta {
  margin-top: 20px; padding: 18px; border-radius: 12px;
  background: var(--high-wash); border: 1px solid #ecd9b4;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.quote-cta p { margin: 0; font-size: .92rem; color: #6b4a0c; max-width: 42ch; }
.quote-cta p strong { color: #4f3606; }

/* ============================================================
   SECTIONS
   ============================================================ */
.section { padding: 60px 0; }
.section-tight { padding: 40px 0; }
.section-head { max-width: 60ch; margin-bottom: 8px; }
.section-head p { color: var(--ink-soft); }

/* ============================================================
   STANDARD CARDS GRID
   ============================================================ */
.std-grid {
  display: grid; gap: 16px; margin-top: 24px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.std-card {
  position: relative; display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 22px 22px 20px; text-decoration: none; color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.std-card:hover { border-color: var(--cobalt); box-shadow: var(--shadow); transform: translateY(-2px); color: var(--ink); text-decoration: none; }
.std-card .std-top { display: flex; align-items: center; gap: 12px; }
.std-card .badge {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-family: "JetBrains Mono", monospace; font-weight: 700; font-size: .62rem;
  color: #fff; letter-spacing: .01em; text-align: center; line-height: 1.05; padding: 3px;
}
.std-card .code { font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: .76rem; letter-spacing: .04em; color: var(--ink-soft); }
.std-card h3 { margin: 0; font-size: 1.14rem; }
.std-card .sub { font-size: .92rem; color: var(--ink-soft); margin: 0; flex-grow: 1; }
.std-card .go {
  font-family: "JetBrains Mono", monospace; font-size: .76rem; font-weight: 600; letter-spacing: .04em;
  color: var(--cobalt); margin-top: 4px;
}
.std-card .tag {
  position: absolute; top: 18px; right: 18px;
  font-family: "JetBrains Mono", monospace; font-size: .58rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--high); background: var(--high-wash);
  padding: 3px 8px; border-radius: 20px;
}

/* ============================================================
   BREADCRUMBS + PAGE HEAD
   ============================================================ */
.breadcrumbs {
  font-family: "JetBrains Mono", monospace; font-size: .78rem; color: var(--ink-faint);
  padding: 20px 0 0;
}
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs .sep { margin: 0 8px; color: var(--line); }

.page-head { padding: 30px 0 34px; border-bottom: 1px solid var(--line); background: var(--surface); }
.page-head .wrap { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.page-head .badge {
  width: 72px; height: 72px; border-radius: 16px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  font-family: "JetBrains Mono", monospace; font-weight: 700; color: #fff;
  font-size: .82rem; text-align: center; line-height: 1.08; padding: 6px;
}
.page-head .meta { font-family: "JetBrains Mono", monospace; font-size: .78rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 6px; }
.page-head h1 { margin: 0 0 .18em; }
.page-head .subtitle { font-size: 1.08rem; color: var(--ink-soft); margin: 0; }

/* ============================================================
   ARTICLE / GUIDE LAYOUT
   ============================================================ */
.content { display: grid; grid-template-columns: minmax(0,1fr) 320px; gap: 48px; padding: 44px 0 64px; }
.content.solo { display: block; }
.prose { min-width: 0; }
.prose > h2 { margin-top: 1.6em; }
.prose > h2:first-child { margin-top: 0; }
.prose p, .prose li { color: #232c3d; }
.prose ul { padding-left: 1.1em; }
.prose li { margin-bottom: .4em; }

.prose ol.steps { counter-reset: step; list-style: none; padding-left: 0; margin: 0; }
.prose ol.steps li {
  counter-increment: step; position: relative; padding: 0 0 20px 52px; border-left: 2px solid var(--line-2);
  margin-left: 16px;
}
.prose ol.steps li::before {
  content: counter(step); position: absolute; left: -17px; top: -2px;
  width: 32px; height: 32px; border-radius: 50%; background: var(--cobalt); color: #fff;
  font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: .82rem;
  display: flex; align-items: center; justify-content: center;
}
.prose ol.steps li:last-child { border-left-color: transparent; padding-bottom: 0; }

.callout {
  background: var(--cobalt-wash); border-left: 3px solid var(--cobalt); border-radius: 0 10px 10px 0;
  padding: 16px 18px; margin: 22px 0;
}
.callout h4 { margin: 0 0 .3em; }
.callout p { margin: 0; color: #2a3346; }
.callout.warn { background: var(--high-wash); border-left-color: var(--high); }
.callout.note { background: var(--low-wash); border-left-color: var(--low); }

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.side-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 20px; }
.side-box h4 { margin: 0 0 12px; font-family: "Space Grotesk", sans-serif; }
.side-box.cta { background: var(--ink); color: #fff; }
.side-box.cta h4 { color: #fff; }
.side-box.cta p { color: #c3cbdb; font-size: .92rem; margin: 0 0 14px; }
.side-box ul { list-style: none; margin: 0; padding: 0; }
.side-box li { padding: 7px 0; border-bottom: 1px solid var(--line-2); font-size: .92rem; }
.side-box li:last-child { border-bottom: 0; }
.side-links a { display: flex; align-items: center; gap: 8px; }

/* ============================================================
   CALCULATOR
   ============================================================ */
.calc { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow); }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; }
.calc-inputs { padding: 26px; border-right: 1px solid var(--line); }
.calc-out { padding: 26px; background: var(--surface-2); }
.calc h3 { font-size: 1.05rem; margin: 0 0 18px; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; }
.seg label {
  padding: 7px 16px; border-radius: 7px; font-size: .9rem; font-weight: 500; cursor: pointer; color: var(--ink-soft);
}
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg input:checked + label { background: var(--cobalt); color: #fff; }

.field { margin-bottom: 16px; }
.field > label { display: block; font-size: .82rem; font-weight: 600; color: var(--ink-soft); margin-bottom: 6px; }
.field select, .field input[type="number"] {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 9px;
  font-family: inherit; font-size: .95rem; background: var(--surface); color: var(--ink);
}
.field select:focus, .field input:focus, .check input:focus-visible {
  outline: 2px solid var(--cobalt); outline-offset: 1px; border-color: var(--cobalt);
}
.checks { display: grid; gap: 9px; margin-top: 4px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .92rem; color: var(--ink-soft); }
.check input { margin-top: 3px; }

/* output */
.calc-out .oh { font-family: "JetBrains Mono", monospace; font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-faint); margin: 0 0 6px; }
.headline-range { margin: 4px 0 20px; }
.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li {
  display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: baseline;
  padding: 11px 0; border-bottom: 1px dashed var(--line);
}
.ledger li:last-child { border-bottom: 0; }
.ledger .k { font-size: .9rem; color: var(--ink-soft); }
.ledger .v { font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: .95rem; color: var(--ink); white-space: nowrap; }
.ledger li.total { margin-top: 6px; border-top: 2px solid var(--ink); border-bottom: 0; padding-top: 14px; }
.ledger li.total .k { font-weight: 600; color: var(--ink); font-size: .98rem; }
.ledger li.total .v { color: var(--cobalt-dk); font-size: 1.02rem; }
.guidance-note {
  background: var(--high-wash); border-radius: 9px; padding: 12px 14px; margin-top: 16px;
  font-size: .88rem; color: #7a5410;
}

/* the drop-in form slot below results */
.form-slot { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.form-slot-admin {
  border: 1px dashed var(--line); border-radius: 10px; padding: 18px; text-align: center;
  color: var(--ink-faint); font-size: .88rem; background: var(--surface-2);
}
.form-slot-admin code { color: var(--cobalt); font-size: .85rem; }

/* per-field explainer */
.explainer { margin: 0; }
.explainer dt { font-family: "Space Grotesk", sans-serif; font-weight: 600; margin-top: 18px; color: var(--ink); }
.explainer dd { margin: 4px 0 0; color: var(--ink-soft); font-size: .96rem; }

/* ============================================================
   RELATED
   ============================================================ */
.related { background: var(--surface); border-top: 1px solid var(--line); padding: 48px 0; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 12px; margin-top: 18px; }
.related-grid a {
  display: flex; align-items: center; gap: 12px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 11px; padding: 14px 16px; text-decoration: none; color: var(--ink); font-weight: 500; font-size: .94rem;
}
.related-grid a:hover { border-color: var(--cobalt); color: var(--cobalt-dk); }
.related-grid .badge { width: 38px; height: 38px; border-radius: 9px; flex: 0 0 auto; display:flex; align-items:center; justify-content:center; color:#fff; font-family:"JetBrains Mono",monospace; font-weight:700; font-size:.5rem; text-align:center; line-height:1; padding:3px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer { background: var(--ink); color: #aeb7c8; margin-top: 40px; }
.footer-cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 40px; padding: 52px 0 36px; }
.site-footer h4 { color: #fff; font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; font-family: "JetBrains Mono", monospace; margin: 0 0 14px; }
.site-footer .f-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.site-footer .f-brand .brand-name { color: #fff; }
.site-footer p { color: #8b95a8; font-size: .92rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { padding: 5px 0; }
.site-footer a { color: #aeb7c8; font-size: .92rem; }
.site-footer a:hover { color: #fff; }
.disclaimer { border-top: 1px solid rgba(255,255,255,.1); padding: 24px 0; }
.disclaimer p { color: #79839a; font-size: .82rem; line-height: 1.6; margin: 0; max-width: 90ch; }
.disclaimer a { color: #aeb7c8; text-decoration: underline; }
.copyright { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; font-size: .82rem; color: #79839a; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .content { grid-template-columns: 1fr; gap: 34px; }
  .sidebar { order: 2; }
  .calc-grid { grid-template-columns: 1fr; }
  .calc-inputs { border-right: 0; border-bottom: 1px solid var(--line); }
  .footer-cols { grid-template-columns: 1fr 1fr; gap: 28px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .main-nav { display: none; }
  .main-nav.open {
    display: block; position: absolute; top: 68px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--line); padding: 10px 24px 16px;
  }
  .main-nav.open ul { flex-direction: column; gap: 2px; }
  .menu-button { display: inline-flex; }
  .hero { padding: 48px 0 40px; }
  .footer-cols { grid-template-columns: 1fr; }
  .hero-stats { gap: 26px; }
}

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