/*
Theme Name: Certification Costs
Theme URI: https://certificationcosts.co.uk/
Author: CertificationCosts.co.uk
Author URI: https://certificationcosts.co.uk/
Description: Independent UK guides and cost calculators for ISO certification. A self-contained theme that auto-generates guide and calculator pages for every ISO standard from a single data file. Brand: ledger-and-seal — warm paper, ink navy, seal green and foil gold.
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
*/

/* ============================================================
   Design tokens
   Palette: paper #f6f1e7 / ink #1c2433 / seal green #2f6f5e
            foil gold #b8893f / line #d8cfbd / wash #ecf3ef
   Type:   Fraunces (display), Public Sans (body), IBM Plex Mono (figures)
   ============================================================ */
:root {
  --paper:   #f6f1e7;
  --paper-2: #fbf8f1;
  --ink:     #1c2433;
  --ink-soft:#46505f;
  --seal:    #2f6f5e;
  --seal-dk: #214f43;
  --gold:    #b8893f;
  --gold-dk: #8f6826;
  --line:    #d8cfbd;
  --line-2:  #e7dfce;
  --wash:    #ecf3ef;
  --rose:    #b8434f;
  --radius:  4px;
  --maxw:    1120px;
  --shadow:  0 1px 0 var(--line), 0 18px 40px -28px rgba(28,36,51,.45);
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* faint ruled-paper baseline grid */
  background-image: linear-gradient(transparent calc(1.65em - 1px), rgba(184,137,63,.045) 1px);
  background-size: 100% 1.65em;
}

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

h1, h2, h3, h4 {
  font-family: "Fraunces", Georgia, "Times New Roman", serif;
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 640; }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); }
h3 { font-size: 1.28rem; }
h4 { font-size: 1.06rem; font-family: "Public Sans", sans-serif; font-weight: 700; letter-spacing: 0; }

p { margin: 0 0 1.1em; }
a { color: var(--seal-dk); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
a:hover { color: var(--gold-dk); }

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

.mono { font-family: "IBM Plex Mono", ui-monospace, "SF Mono", Menlo, monospace; font-variant-numeric: tabular-nums; }

.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--gold-dk);
  margin: 0 0 .8rem;
  display: inline-block;
}

/* skip link */
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--radius);
}
.skip-link:focus { left: 12px; top: 12px; }

/* ============================================================
   Header
   ============================================================ */
.site-header {
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 50;
  background-image: none;
}
.site-header .wrap { display: flex; align-items: center; gap: 20px; min-height: 72px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); margin-right: auto; }
.brand:hover { color: var(--ink); }
.brand-seal { flex: 0 0 auto; }
.brand-name { font-family: "Fraunces", serif; font-weight: 640; font-size: 1.32rem; letter-spacing: -.01em; line-height: 1; }
.brand-name small { display:block; font-family:"IBM Plex Mono",monospace; font-size:.6rem; letter-spacing:.16em; text-transform:uppercase; color:var(--gold-dk); margin-top:3px; font-weight:500;}

.nav-toggle { display: none; }
.main-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; align-items: center; }
.main-nav a {
  display: inline-block; padding: 8px 12px; text-decoration: none; color: var(--ink-soft);
  font-weight: 600; font-size: .92rem; border-radius: var(--radius);
}
.main-nav a:hover, .main-nav a[aria-current="page"] { color: var(--seal-dk); background: var(--wash); }

.menu-button {
  display: none; align-items: center; gap: 8px; background: var(--ink); color: #fff;
  border: 0; padding: 10px 14px; border-radius: var(--radius); font: inherit; font-weight: 600; cursor: pointer;
}

@media (max-width: 860px) {
  .menu-button { display: inline-flex; }
  .main-nav { flex-basis: 100%; display: none; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 2px; padding-bottom: 14px; }
  .main-nav a { padding: 10px 12px; }
}

/* ============================================================
   Hero / homepage
   ============================================================ */
.hero { padding: 64px 0 40px; }
.hero .lead { font-size: 1.22rem; color: var(--ink-soft); max-width: 640px; }
.hero-figures { display: flex; gap: 36px; flex-wrap: wrap; margin-top: 28px; }
.figure-stat .n { font-family:"IBM Plex Mono",monospace; font-size: 1.9rem; font-weight: 600; color: var(--seal-dk); }
.figure-stat .l { font-size: .82rem; color: var(--ink-soft); letter-spacing:.02em; }

/* seal/roundel motif */
.seal {
  display: inline-grid; place-items: center; position: relative;
  border-radius: 50%;
  border: 2px solid currentColor;
  font-family: "IBM Plex Mono", monospace; font-weight: 600;
  letter-spacing: -.02em; line-height: 1; text-align: center;
}
.seal::before {
  content: ""; position: absolute; inset: 4px; border-radius: 50%;
  border: 1px dashed currentColor; opacity: .5;
}

/* ============================================================
   Standards grid (homepage + index)
   ============================================================ */
.std-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin: 8px 0 0;
}
.std-card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px 22px 18px; text-decoration: none; color: var(--ink);
  display: flex; flex-direction: column; gap: 12px; position: relative;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  background-image: none;
}
.std-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--line); color: var(--ink); }
.std-card .seal { width: 54px; height: 54px; font-size: .62rem; flex: 0 0 auto; }
.std-card .code { font-family:"IBM Plex Mono",monospace; font-weight:600; font-size:.78rem; letter-spacing:.04em; color: var(--ink-soft); }
.std-card h3 { margin: 0; font-size: 1.18rem; }
.std-card .sub { font-size: .9rem; color: var(--ink-soft); margin: 0; flex-grow: 1; }
.std-card .links { display: flex; gap: 14px; font-size: .82rem; font-weight: 600; margin-top: 4px; }
.std-card .links span { color: var(--seal-dk); }
.std-card .tag {
  position: absolute; top: 16px; right: 16px; font-family:"IBM Plex Mono",monospace;
  font-size:.6rem; letter-spacing:.1em; text-transform:uppercase; color: var(--gold-dk);
  border: 1px solid var(--line-2); padding: 2px 7px; border-radius: 20px;
}

/* ============================================================
   Article / guide layout
   ============================================================ */
.page-head { padding: 48px 0 28px; border-bottom: 1px solid var(--line); background: var(--paper-2); background-image: none; }
.page-head .wrap { display: flex; gap: 26px; align-items: center; flex-wrap: wrap; }
.page-head .seal { width: 84px; height: 84px; font-size: .78rem; }
.page-head h1 { margin: 0 0 .2em; }
.page-head .subtitle { font-size: 1.1rem; color: var(--ink-soft); margin: 0; }
.page-head .meta { font-family:"IBM Plex Mono",monospace; font-size:.74rem; letter-spacing:.06em; color: var(--gold-dk); text-transform:uppercase; margin-bottom:.4rem;}

.content { padding: 40px 0 60px; display: grid; grid-template-columns: 1fr 280px; gap: 54px; align-items: start; }
.content.full { grid-template-columns: 1fr; }
@media (max-width: 900px) { .content { grid-template-columns: 1fr; gap: 32px; } }

.prose { max-width: 720px; }
.prose h2 { margin-top: 1.8em; padding-top: .2em; }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .5em; }
.prose ol.steps { counter-reset: step; list-style: none; padding-left: 0; }
.prose ol.steps li {
  position: relative; padding: 0 0 1.1em 52px; counter-increment: step; border-left: 2px solid var(--line-2); margin-left: 16px;
}
.prose ol.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute; left: -17px; top: -2px;
  width: 32px; height: 32px; background: var(--paper); border: 2px solid var(--seal);
  color: var(--seal-dk); border-radius: 50%; display: grid; place-items: center;
  font-family:"IBM Plex Mono",monospace; font-size:.74rem; font-weight: 600;
}
.prose ol.steps li:last-child { border-left-color: transparent; }

.callout {
  background: var(--wash); border: 1px solid var(--line); border-left: 3px solid var(--seal);
  border-radius: var(--radius); padding: 18px 20px; margin: 0 0 1.4em;
}
.callout.warn { background: #fbf0ec; border-left-color: var(--rose); }
.callout h4 { margin: 0 0 .35em; }
.callout p:last-child { margin: 0; }

/* sidebar */
.sidebar { position: sticky; top: 92px; }
.sidebar .box { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 14px; margin-bottom: 18px; background-image:none;}
.sidebar h4 { margin: 0 0 .6em; font-family:"IBM Plex Mono",monospace; font-size:.72rem; letter-spacing:.14em; text-transform:uppercase; color: var(--gold-dk); }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar li { margin-bottom: 8px; font-size: .92rem; }
.sidebar a { text-decoration: none; }
.sidebar a:hover { text-decoration: underline; }
.cta-box { background: var(--ink); color: var(--paper); border:0; }
.cta-box h4 { color: var(--gold); }
.cta-box p { color: #cdd4de; font-size: .92rem; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; background: var(--seal); color: #fff;
  text-decoration: none; padding: 11px 18px; border-radius: var(--radius); font-weight: 700; font-size: .95rem;
  border: 0; cursor: pointer;
}
.btn:hover { background: var(--seal-dk); color: #fff; }
.btn.gold { background: var(--gold); }
.btn.gold:hover { background: var(--gold-dk); }
.btn.block { display: flex; width: 100%; justify-content: center; }
.btn.ghost { background: transparent; color: var(--seal-dk); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { background: var(--paper-2); color: var(--seal-dk); box-shadow: inset 0 0 0 1px var(--seal); }

/* ============================================================
   Calculator
   ============================================================ */
.calc {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); margin: 0 0 36px; background-image: none;
}
.calc-grid { display: grid; grid-template-columns: 1fr 360px; }
@media (max-width: 820px) { .calc-grid { grid-template-columns: 1fr; } }

.calc-inputs { padding: 26px 26px 30px; }
.calc-inputs h3 { margin-top: 0; }
.field { margin-bottom: 18px; }
.field > label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; }
.field .hint { font-size: .8rem; color: var(--ink-soft); margin: 3px 0 0; }
.field select, .field input[type="number"] {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--paper); font: inherit; color: var(--ink);
}
.field select:focus, .field input:focus, .check input:focus-visible {
  outline: 2px solid var(--seal); outline-offset: 1px;
}
.checks { display: grid; gap: 8px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-size: .92rem; }
.check input { margin-top: 3px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.seg label { flex: 1; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: block; padding: 9px 14px; text-align: center; cursor: pointer; font-weight: 600; font-size: .9rem; background: var(--paper);
}
.seg input:checked + span { background: var(--seal); color: #fff; }
.seg label:not(:last-child) span { border-right: 1px solid var(--line); }

/* results panel */
.calc-out {
  background: var(--ink); color: var(--paper); padding: 26px 24px 28px; background-image: none;
  display: flex; flex-direction: column;
}
.calc-out .headline { text-align: center; padding: 8px 0 18px; border-bottom: 1px solid rgba(255,255,255,.12); margin-bottom: 16px; }
.calc-out .headline .label { font-family:"IBM Plex Mono",monospace; font-size:.7rem; letter-spacing:.12em; text-transform:uppercase; color: var(--gold); }
.calc-out .headline .big { font-family:"IBM Plex Mono",monospace; font-size: 2.5rem; font-weight: 600; line-height:1.1; margin-top: 4px; }
.calc-out .ledger { list-style: none; margin: 0; padding: 0; font-size: .92rem; }
.calc-out .ledger li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px dotted rgba(255,255,255,.14); }
.calc-out .ledger li span:first-child { color: #c6cdd8; }
.calc-out .ledger li .v { font-family:"IBM Plex Mono",monospace; font-variant-numeric: tabular-nums; }
.calc-out .ledger li.total { border-bottom: 0; border-top: 2px solid rgba(255,255,255,.3); margin-top: 6px; padding-top: 12px; font-weight: 700; }
.calc-out .ledger li.total span:first-child { color: #fff; }
.calc-out .ledger li.total .v { color: var(--gold); font-size: 1.25rem; }
.calc-out .ledger li.sub span:first-child { padding-left: 14px; color: #9aa3b0; font-size: .85rem; }
.calc-out .gnote { font-size: .82rem; color: #c6cdd8; margin-top: 14px; background: rgba(255,255,255,.06); padding: 10px 12px; border-radius: var(--radius); }
.calc-out .disclaim { font-size:.74rem; color:#9aa3b0; margin-top:14px; }

/* the explain-each-field section under the calculator */
.explainer { margin: 0 0 40px; }
.explainer dl { display: grid; gap: 0; margin: 0; border-top: 1px solid var(--line); }
.explainer dt { font-weight: 700; padding: 16px 0 4px; font-size: 1rem; }
.explainer dd { margin: 0 0 16px; padding: 0 0 16px; border-bottom: 1px solid var(--line-2); color: var(--ink-soft); }

/* ============================================================
   Related links band
   ============================================================ */
.related { background: var(--paper-2); border-top:1px solid var(--line); border-bottom:1px solid var(--line); padding: 40px 0; background-image:none;}
.related h2 { font-size: 1.4rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; }
.related-grid a { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; text-decoration:none; color: var(--ink); font-weight:600; font-size:.92rem; display:flex; align-items:center; gap:10px;}
.related-grid a:hover { border-color: var(--seal); color: var(--seal-dk); }

/* ============================================================
   Footer + disclaimer
   ============================================================ */
.site-footer { background: var(--ink); color: #c6cdd8; padding: 50px 0 30px; margin-top: 0; background-image: none; }
.site-footer a { color: #e7dfce; }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 34px; }
@media (max-width: 760px) { .footer-cols { grid-template-columns: 1fr; gap: 24px; } }
.site-footer h4 { color: var(--gold); font-family:"IBM Plex Mono",monospace; font-size:.72rem; letter-spacing:.14em; text-transform:uppercase; }
.site-footer ul { list-style:none; margin:0; padding:0; }
.site-footer li { margin-bottom: 7px; font-size: .9rem; }
.site-footer .brand-name { color: #fff; }
.site-footer .brand-name small { color: var(--gold); }
.disclaimer {
  border-top: 1px solid rgba(255,255,255,.14); padding-top: 22px; font-size: .82rem; line-height: 1.6; color: #9aa3b0;
}
.disclaimer a { color: #cdd4de; }
.copyright { margin-top: 18px; font-size:.8rem; color:#7c8492; }

/* ============================================================
   Misc
   ============================================================ */
.breadcrumbs { font-size:.82rem; color: var(--ink-soft); padding: 16px 0 0; }
.breadcrumbs a { color: var(--ink-soft); }
.breadcrumbs .sep { color: var(--line); margin: 0 6px; }
.section { padding: 56px 0; }
.section-tight { padding: 36px 0; }
hr.rule { border:0; border-top:1px solid var(--line); margin: 40px 0; }
.text-center { text-align: center; }
