/* ==========================================================================
   Keystone Assurance theme
   Palette is the logo's: gold #FFCD00 and grey #57544F, with tints and shades
   of that grey. Typeface: Archivo (bundled, SIL OFL).
   Design system carried over from the Keystone EFQM pages.

   1. Tokens and base          6. Lists, steps, tables, quotes
   2. Buttons and labels       7. FAQ, call to action, contact, offices
   3. Header and navigation    8. Posts, archives, search, forms
   4. Page heads, breadcrumbs  9. Footer
   5. Sections and layouts    10. Responsive, motion, print
   ========================================================================== */

/* 1. Tokens and base ------------------------------------------------------ */
:root {
  --gold: #FFCD00;
  --grey: #57544F;
  --ink: #2A2825;
  --grey-2: #7A7772;
  --grey-3: #B9B6B0;
  --line: #E4E1DB;
  --paper: #F7F6F3;
  --white: #FFFFFF;
  --wrap: 1200px;
  --prose: 760px;
  --gutter: 24px;
  --pad: clamp(20px, 4vw, 48px);
  --section: clamp(64px, 8vw, 112px);
  --header: 80px;
  --keystone: polygon(0 0, 100% 0, 89% 100%, 11% 100%);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header) + 16px); }
body {
  margin: 0;
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 3px; }
p { margin: 0 0 1em; }
h1, h2, h3, h4, h5 { margin: 0 0 .5em; font-weight: 800; letter-spacing: -0.015em; color: var(--ink); line-height: 1.15; }
h1 { font-size: clamp(calc(40px - 2pt), calc(5vw - 2pt), calc(64px - 2pt)); line-height: 1.03; letter-spacing: -0.025em; }
h2 { font-size: clamp(28px, 3.2vw, 42px); line-height: 1.1; }
h3 { font-size: 21px; line-height: 1.3; letter-spacing: -0.005em; }
h4 { font-size: 18px; }
strong, b { font-weight: 600; }
hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
table { border-collapse: collapse; width: 100%; }
address { font-style: normal; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--pad); }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: var(--gold); color: var(--ink); padding: 10px 14px; font-weight: 600; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

/* 2. Buttons and labels --------------------------------------------------- */
.label, .is-style-ks-label, .ks-label {
  display: inline-flex; align-items: center; gap: 12px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--grey); line-height: 1.4;
}
.label::before, .is-style-ks-label::before, .ks-label::before { content: ""; flex: 0 0 28px; height: 3px; background: var(--gold); }
p.is-style-ks-label, p.ks-label { display: flex; margin: 0 0 22px; }

.btn,
.wp-block-button__link,
.wp-element-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px;
  font: 600 16px/1.2 "Archivo", sans-serif; letter-spacing: 0.01em;
  text-decoration: none; border: 2px solid var(--gold); border-radius: 0;
  color: var(--ink); background: var(--gold); cursor: pointer;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn:hover, .wp-block-button__link:hover, .wp-element-button:hover { background: var(--ink); border-color: var(--ink); color: var(--gold); }
.btn .arr { font-weight: 400; transition: transform .15s ease; }
.btn:hover .arr { transform: translateX(3px); }
.btn--gold { background: var(--gold); border-color: var(--gold); }
.btn--dark, .is-style-ks-dark .wp-block-button__link { background: var(--ink); border-color: var(--ink); color: var(--gold); }
.btn--dark:hover, .is-style-ks-dark .wp-block-button__link:hover { background: var(--white); border-color: var(--white); color: var(--ink); }
.is-style-ks-outline .wp-block-button__link { background: transparent; border-color: var(--ink); color: var(--ink); }
.is-style-ks-outline .wp-block-button__link:hover { background: var(--ink); color: var(--white); }
.is-style-ks-text .wp-block-button__link {
  min-height: 0; padding: 0 0 3px; border: 0; background: linear-gradient(var(--gold), var(--gold)) 0 100% / 100% 3px no-repeat; color: var(--ink);
}
.is-style-ks-text .wp-block-button__link:hover { background-size: 100% 100%; color: var(--ink); }
.wp-block-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.wp-block-buttons > .wp-block-button { margin: 0; }

.textlink {
  font-weight: 600; text-decoration: none; color: var(--ink);
  background: linear-gradient(var(--gold), var(--gold)) 0 100% / 100% 3px no-repeat;
  padding-bottom: 2px; transition: background-size .15s ease;
}
.textlink:hover { background-size: 100% 100%; }
.entry-content a:not(.wp-block-button__link):not(.textlink):not(.btn) {
  text-decoration-color: var(--gold); text-decoration-thickness: 2px;
}

/* 3. Header and navigation ------------------------------------------------ */
.ks-topbar { background: var(--ink); color: #EDEBE7; font-size: 13px; }
.ks-topbar .wrap { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 38px; }
.ks-topbar__tag { margin: 0; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: var(--gold); }
.ks-topbar__links { display: flex; flex-wrap: wrap; gap: 6px 24px; list-style: none; margin: 0; padding: 0; }
.ks-topbar a { text-decoration: none; color: #EDEBE7; }
.ks-topbar a:hover { color: var(--gold); }

.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 255, 255, .98);
  border-bottom: 1px solid var(--line);
}
.admin-bar .site-header { top: 32px; }
.site-header > .wrap { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--header); }
.brand img, .custom-logo { height: 40px; width: auto; }
.custom-logo-link { display: block; }

.nav { display: flex; align-items: center; gap: 22px; }
.nav .menu { display: flex; align-items: center; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav .menu > li { position: relative; display: flex; align-items: center; }
.nav .menu > li > a {
  display: block; white-space: nowrap;
  font-size: 15px; font-weight: 500; text-decoration: none; color: var(--grey);
  padding: 28px 10px; border-bottom: 3px solid transparent;
}
.nav .menu > li > a:hover,
.nav .menu > li:hover > a { color: var(--ink); }
.nav .menu > .current-menu-item > a,
.nav .menu > .current-menu-ancestor > a,
.nav .menu > .current-page-ancestor > a { color: var(--ink); font-weight: 600; border-bottom-color: var(--gold); }
.nav .menu > li.menu-item-has-children > a { padding-right: 2px; }

.sub-toggle {
  display: inline-grid; place-items: center; width: 22px; height: 28px; margin-right: 6px;
  background: none; border: 0; padding: 0; cursor: pointer; color: var(--grey-2);
}
.sub-toggle::before {
  content: ""; width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg); transition: transform .15s ease;
}
.sub-toggle[aria-expanded="true"]::before { transform: translateY(2px) rotate(-135deg); }

/* Dropdowns (desktop) */
.nav .sub-menu {
  list-style: none; margin: 0; padding: 10px 0;
  position: absolute; top: 100%; left: 0; z-index: 70; min-width: 270px;
  background: var(--white); border-top: 3px solid var(--gold);
  box-shadow: 0 18px 40px -18px rgba(42, 40, 37, .35);
  opacity: 0; visibility: hidden; pointer-events: none; transform: translateY(8px);
  transition: opacity .15s ease, transform .15s ease, visibility 0s linear .15s;
}
/* Opens on click only: site.js toggles .is-open from the label or the arrow button. */
.nav .menu > li.is-open > .sub-menu { opacity: 1; visibility: visible; pointer-events: auto; transform: none; transition-delay: 0s; }
.nav .menu > li > a { cursor: pointer; }
.nav .sub-menu a {
  display: block; padding: 10px 22px; font-size: 15px; font-weight: 500; text-decoration: none; color: var(--ink); line-height: 1.35;
}
.nav .sub-menu a:hover, .nav .sub-menu .current-menu-item > a { background: var(--paper); box-shadow: inset 3px 0 0 var(--gold); }
.nav .sub-menu .sub-menu { position: static; opacity: 1; visibility: inherit; pointer-events: inherit; transform: none; box-shadow: none; border: 0; padding: 0 0 6px 14px; min-width: 0; display: block; }
.nav .sub-menu .sub-toggle { display: none; }
.nav .sub-menu .desc { display: block; font-size: 13px; font-weight: 400; color: var(--grey-2); margin-top: 2px; }

/* Mega menu: top-level item with the CSS class "mega" */
.nav .menu > li.mega { position: static; }
.nav .menu > li.mega > .sub-menu {
  left: var(--pad); right: var(--pad); display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px 28px; padding: 28px 32px 30px;
}
.nav li.mega > .sub-menu > li > a {
  padding: 0 0 10px; margin-bottom: 8px; border-bottom: 1px solid var(--line);
  font-weight: 800; font-size: 16px; background: none; box-shadow: none;
}
.nav li.mega > .sub-menu > li > a:hover { color: var(--grey); background: none; box-shadow: none; }
.nav li.mega > .sub-menu > li > .sub-menu { display: block; padding: 0; }
.nav li.mega > .sub-menu > li > .sub-menu a { padding: 6px 0; font-size: 15px; color: var(--grey); }
.nav li.mega > .sub-menu > li > .sub-menu a:hover { color: var(--ink); background: none; box-shadow: none; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }

.nav .sub-menu .ks-overview { grid-column: 1 / -1; margin-top: 8px; border-top: 1px solid var(--line); }
.nav .sub-menu .ks-overview > a { padding: 12px 22px 2px; font-weight: 700; }
.nav .sub-menu .ks-overview > a::after { content: " \2192"; }
.nav li.mega > .sub-menu > li.ks-overview > a { padding: 12px 0 0; margin: 0; border: 0; font-size: 15px; font-weight: 700; }

.nav-cta { min-height: 44px; padding: 0 20px; font-size: 15px; white-space: nowrap; }
.nav-toggle { display: none; }

/* 4. Page heads and breadcrumbs ------------------------------------------- */
.ks-crumbs { border-bottom: 1px solid var(--line); font-size: 13px; color: var(--grey-2); }
.ks-crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; list-style: none; margin: 0; padding: 12px 0; }
.ks-crumbs li + li::before { content: "/"; margin: 0 10px; color: var(--grey-3); }
.ks-crumbs a { text-decoration: none; color: var(--grey); }
.ks-crumbs a:hover { color: var(--ink); text-decoration: underline; text-decoration-color: var(--gold); }
.ks-crumbs [aria-current] { color: var(--ink); font-weight: 600; }

.ks-pagehead { padding: clamp(48px, 6vw, 88px) 0 clamp(36px, 5vw, 64px); border-bottom: 1px solid var(--line); }
.ks-pagehead .label { margin-bottom: 22px; }
.ks-pagehead h1 { max-width: 18em; margin-bottom: 20px; }
.ks-pagehead .lead { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.5; color: var(--grey); max-width: 38em; margin: 0; }
.ks-pagehead--post h1 { font-size: clamp(34px, 4vw, 52px); }

/* 5. Sections and layouts ------------------------------------------------- */
/* Every full-width band built in the editor is a Group with "ks-section";
   its children line up on the same 1200px grid as the header. */
.ks-sections > * { margin-block: 0; }
.ks-section, .ks-hero, .ks-cta, .ks-band { margin: 0; }
.ks-section { padding-block: var(--section); }
.ks-section, .ks-hero, .ks-band, .ks-cta { padding-inline: var(--pad); }
.ks-section > *,
.ks-hero > *,
.ks-band > *,
.ks-cta > * { max-width: calc(var(--wrap) - var(--pad) * 2); margin-left: auto !important; margin-right: auto !important; }
.ks-section > * + * { margin-top: 28px; }
.ks-section.is-paper, .ks-band.is-paper { background: var(--paper); }
.ks-section.is-tight { padding-block: calc(var(--section) * .55); }
.ks-section.is-white + .ks-section.is-white { padding-top: 0; }
.ks-section.is-white + .ks-section.is-white > .ks-split { border-top: 1px solid var(--line); padding-top: calc(var(--section) * .8); }

/* Hero: copy left, keystone-framed image right with the gold block behind. */
.ks-hero { padding-top: clamp(40px, 6vw, 88px); }
.ks-hero__grid { display: flex; gap: var(--gutter); align-items: stretch; margin: 0 auto; }
.ks-hero__copy { flex: 1 1 58% !important; padding-bottom: clamp(40px, 6vw, 88px); align-self: center; }
.ks-hero__copy h1 { margin-bottom: 26px; }
.ks-hero__copy .is-style-ks-lead, .ks-hero__copy .ks-lead { margin-bottom: 34px; }
.ks-hero__media { flex: 1 1 42% !important; position: relative; min-height: 460px; align-self: stretch; }
.ks-hero__media::before {
  content: ""; position: absolute; right: 0; bottom: 0; width: 46%; height: 72%;
  background: var(--gold); clip-path: polygon(0 0, 100% 0, 92% 100%, 8% 100%);
}
.ks-hero__media .wp-block-image { position: absolute; inset: 0 22px 0 0; margin: 0; }
.ks-hero__media .wp-block-image img { width: 100%; height: 100%; object-fit: cover; }
.is-style-ks-lead, .ks-lead { font-size: clamp(19px, 1.6vw, 22px); line-height: 1.5; color: var(--grey); max-width: 36em; }

/* Keystone frame image style: any image takes the keystone silhouette. */
.wp-block-image.is-style-ks-keystone { background: var(--grey); clip-path: var(--keystone); }
.wp-block-image.is-style-ks-keystone img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%) contrast(1.05); }
.wp-block-image.is-style-ks-mono img { filter: grayscale(100%) contrast(1.05); }
.wp-block-image figcaption { font-size: 14px; color: var(--grey-2); margin-top: 10px; }

/* Facts strip directly under a hero. */
ul.ks-facts { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
ul.ks-facts li { padding: 24px 22px 22px 0; font-size: 21px; font-weight: 800; line-height: 1.25; letter-spacing: -0.01em; }
ul.ks-facts li + li { padding-left: 22px; border-left: 1px solid var(--line); }
ul.ks-facts li strong { display: block; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--grey-2); margin-bottom: 6px; }

/* Editorial split: a narrow rail with number and label, a wide main column. */
.ks-split { display: flex; gap: var(--gutter); align-items: flex-start; margin-bottom: 0; }
.ks-split > .ks-rail { flex: 0 0 calc(25% - var(--gutter)) !important; }
.ks-split > .ks-main { flex: 1 1 auto !important; min-width: 0; }
.ks-rail .ks-num { display: block; font-size: 15px; font-weight: 600; color: var(--grey-2); margin: 0 0 8px; font-variant-numeric: tabular-nums; }
.ks-rail .is-style-ks-label { margin: 0; }
.ks-rail h2 { font-size: clamp(26px, 2.5vw, 36px); line-height: 1.12; overflow-wrap: normal; word-break: normal; hyphens: manual; }
.ks-main > h2 { max-width: 20em; margin-bottom: 26px; }
.ks-main > p, .ks-main > .wp-block-paragraph { max-width: 40em; }
.ks-main > * + * { margin-top: 0; }
.ks-main > :last-child { margin-bottom: 0; }
.ks-main > .wp-block-list, .ks-main > .wp-block-table, .ks-main > .wp-block-group, .ks-main > .wp-block-details, .ks-main > .wp-block-quote, .ks-main > .wp-block-columns { margin-top: 28px; margin-bottom: 0; }
.ks-main > p + .wp-block-list { margin-top: 18px; }
.ks-main h3 { margin-top: 36px; }
.ks-main h3:first-child { margin-top: 0; }

/* Centered intro for full-width sections (title + text above a grid). */
.ks-intro > * { max-width: 46em; }
.ks-intro h2 { margin-bottom: 18px; }
.ks-intro p { color: var(--grey); }

/* Cards grid (services, values, assessment areas, links). */
.ks-cards { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--gutter); }
.ks-cards.is-2 { grid-template-columns: repeat(2, 1fr); }
.ks-cards.is-3 { grid-template-columns: repeat(3, 1fr); }
.ks-cards.is-4 { grid-template-columns: repeat(4, 1fr); }
.ks-cards > * { margin: 0 !important; }
.wp-block-group.is-style-ks-card, .ks-card {
  position: relative; display: flex; flex-direction: column; gap: 0;
  padding: 28px 26px 26px; background: var(--white); border: 1px solid var(--line); border-top: 4px solid var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.is-paper .is-style-ks-card { background: var(--white); }
.wp-block-group.is-style-ks-card:hover { border-top-color: var(--gold); box-shadow: 0 16px 40px -28px rgba(42,40,37,.5); }
.is-style-ks-card > * { margin: 0 0 12px; }
.is-style-ks-card > :last-child { margin-bottom: 0; }
.is-style-ks-card h3 { font-size: 20px; margin-bottom: 10px; }
.is-style-ks-card p { font-size: 16px; color: var(--grey); }
.is-style-ks-card .ks-card__num, .is-style-ks-card .ks-num { font-size: 13px; font-weight: 600; letter-spacing: .14em; color: var(--grey-2); margin-bottom: 14px; }
.is-style-ks-card .ks-card__more { margin-top: auto; padding-top: 10px; }
.is-style-ks-card .ks-card__more a { font-weight: 600; text-decoration: none; background: linear-gradient(var(--gold), var(--gold)) 0 100% / 100% 3px no-repeat; padding-bottom: 2px; }
.is-style-ks-card .ks-card__more a:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }
.is-style-ks-card .wp-block-details { margin-top: 6px; border-top: 1px solid var(--line); }
.is-style-ks-card .wp-block-details summary { padding: 12px 24px 0 0; font-size: 15px; }
.is-style-ks-card .wp-block-details summary::after { top: 22px; width: 12px; height: 12px; margin-top: -6px; background-size: 12px 2px, 2px 12px; }
.is-style-ks-card .wp-block-details p { font-size: 15px; padding: 10px 0 0; }

/* Dark band (one per page at most): grey ground, white text. */
.ks-section.is-dark { background: var(--grey); color: var(--white); }
.is-dark h2, .is-dark h3, .is-dark strong { color: var(--white); }
.is-dark .is-style-ks-label, .is-dark .ks-rail .ks-num { color: #EDEBE7; }
.is-dark p, .is-dark li { color: #EDEBE7; }
.is-dark .is-style-ks-ticks li, .is-dark .is-style-ks-list li { border-color: rgba(255,255,255,.22); }
.is-dark a { color: var(--white); }

/* Statement: large line with a gold rule above. */
.ks-statement, .wp-block-quote.is-style-ks-pull {
  margin: 36px 0 0; padding: 26px 0 0; border: 0; border-top: 3px solid var(--gold);
  font-size: clamp(22px, 2.2vw, 28px); line-height: 1.35; font-weight: 600; letter-spacing: -0.01em; max-width: 28em;
}
.wp-block-quote.is-style-ks-pull p { margin: 0 0 .4em; }
.wp-block-quote.is-style-ks-pull cite { display: block; font-size: 15px; font-weight: 500; color: var(--grey-2); font-style: normal; margin-top: 8px; }
.wp-block-quote:not(.is-style-ks-pull) { margin: 28px 0; padding: 4px 0 4px 24px; border-left: 4px solid var(--gold); }

.is-style-ks-note {
  margin-top: 28px; padding: 18px 22px; border: 1px solid var(--line); border-left: 6px solid var(--gold); background: var(--white);
  font-size: 16px; color: var(--grey);
}

/* Media rows: copy beside an image. */
.ks-media-row { gap: calc(var(--gutter) * 2) !important; align-items: center; }

/* 6. Lists, steps, tables ---------------------------------------------- */
ul.is-style-ks-ticks, ul.is-style-ks-list, ol.is-style-ks-ticks, ol.is-style-ks-list {
  list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; column-gap: 48px;
}
ul.is-style-ks-list, ol.is-style-ks-list { grid-template-columns: 1fr; }
.is-style-ks-ticks li, .is-style-ks-list li { position: relative; padding: 16px 0 16px 30px; border-bottom: 1px solid var(--line); }
.is-style-ks-ticks li::before, .is-style-ks-list li::before {
  content: ""; position: absolute; left: 0; top: 24px; width: 12px; height: 13px;
  background: var(--gold); clip-path: polygon(0 0, 100% 0, 80% 100%, 20% 100%);
}
.is-style-ks-ticks li strong, .is-style-ks-list li strong { color: var(--ink); }
.is-style-ks-ticks li > ul, .is-style-ks-list li > ul { margin: 10px 0 0; padding-left: 18px; color: var(--grey); }
.is-style-ks-ticks li > ul li, .is-style-ks-list li > ul li { padding: 4px 0; border: 0; }
.is-style-ks-ticks li > ul li::before, .is-style-ks-list li > ul li::before { display: none; }

ul.is-style-ks-rows, ol.is-style-ks-rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.is-style-ks-rows li { padding: 20px 0; border-bottom: 1px solid var(--line); color: var(--grey); }
.is-style-ks-rows li strong { display: block; color: var(--ink); font-size: 19px; margin-bottom: 4px; }

ul.is-style-ks-chips { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 0; padding: 0; }
.is-style-ks-chips li { font-size: 15px; font-weight: 500; padding: 8px 14px; border: 1px solid var(--grey-3); color: var(--grey); }

ol.is-style-ks-steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 36px var(--gutter); }
ol.is-style-ks-steps > li { position: relative; padding-top: 62px; counter-increment: s; color: var(--grey); font-size: 16px; }
ol.is-style-ks-steps > li::before {
  content: counter(s); position: absolute; top: 0; left: 0; width: 44px; height: 44px; z-index: 1;
  display: grid; place-items: center; background: var(--white); border: 2px solid var(--ink);
  font-weight: 800; font-size: 18px; color: var(--ink);
}
ol.is-style-ks-steps > li::after { content: ""; position: absolute; top: 21px; left: 44px; right: calc(var(--gutter) * -1); height: 2px; background: var(--gold); }
ol.is-style-ks-steps > li:last-child::after { display: none; }
ol.is-style-ks-steps > li strong { display: block; color: var(--ink); font-size: 19px; margin-bottom: 6px; line-height: 1.3; }
.is-paper ol.is-style-ks-steps > li::before { background: var(--paper); }
.ks-main ol.is-style-ks-steps { grid-template-columns: 1fr; gap: 0; }
.ks-main ol.is-style-ks-steps > li { padding: 0 0 26px 66px; min-height: 44px; }
.ks-main ol.is-style-ks-steps > li::after { top: 44px; bottom: 0; left: 21px; right: auto; width: 2px; height: auto; }
.ks-main ol.is-style-ks-steps > li:last-child { padding-bottom: 0; }

.wp-block-table { margin: 0; overflow-x: auto; }
.wp-block-table table { width: 100%; border-collapse: collapse; font-size: 16px; }
.wp-block-table th, .wp-block-table td { text-align: left; vertical-align: top; padding: 14px 16px 14px 0; border: 0; border-bottom: 1px solid var(--line); }
.wp-block-table thead th { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--grey-2); border-bottom: 3px solid var(--ink); }
.wp-block-table td:first-child { font-weight: 600; color: var(--ink); }
.wp-block-table td { color: var(--grey); }
.wp-block-table.is-style-ks-spec tbody tr:first-child td { border-top: 3px solid var(--ink); }
.wp-block-table.is-style-ks-spec td:first-child { width: 34%; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--grey-2); padding-top: 18px; }
.wp-block-table.is-style-ks-spec td:last-child { font-size: 19px; font-weight: 600; color: var(--ink); }
.wp-block-table.is-style-ks-grid table { border: 1px solid var(--line); }
.wp-block-table.is-style-ks-grid th, .wp-block-table.is-style-ks-grid td { padding: 16px 18px; border: 1px solid var(--line); }
.wp-block-table.is-style-ks-grid thead th { background: var(--grey); color: var(--white); border-color: var(--grey); }
.wp-block-table.is-style-ks-grid thead th:nth-child(2) { background: var(--gold); color: var(--ink); border-color: var(--gold); }
.wp-block-table figcaption, .wp-element-caption { font-size: 14px; color: var(--grey-2); margin-top: 10px; }

/* 7. FAQ, call to action, contact, offices ------------------------------ */
.ks-faq { border-top: 3px solid var(--ink); }
.ks-faq > * + * { margin-top: 0 !important; }
.wp-block-details { border-bottom: 1px solid var(--line); margin: 0; }
.wp-block-details summary {
  list-style: none; cursor: pointer; position: relative; padding: 22px 48px 22px 0;
  font-size: 19px; font-weight: 600; line-height: 1.35; color: var(--ink);
}
.wp-block-details summary::-webkit-details-marker { display: none; }
.wp-block-details summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 16px; height: 16px; margin-top: -8px;
  background:
    linear-gradient(var(--ink), var(--ink)) center / 16px 2px no-repeat,
    linear-gradient(var(--ink), var(--ink)) center / 2px 16px no-repeat;
  transition: transform .2s ease;
}
.wp-block-details[open] summary::after { transform: rotate(45deg); }
.wp-block-details > :not(summary) { padding-right: 48px; color: var(--grey); max-width: 44em; }
.wp-block-details > :last-child { padding-bottom: 22px; margin-bottom: 0; }

/* Closing call to action — the only full-gold surface. */
.cta, .ks-cta { background: var(--gold); padding-block: clamp(64px, 8vw, 104px); }
.cta-grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); align-items: end; }
.cta h2, .ks-cta h2 { font-size: clamp(32px, 4vw, 52px); line-height: 1.05; }
.cta h2 { grid-column: 1 / span 7; margin: 0; }
.cta .cta-copy { grid-column: 1 / span 6; margin-top: 22px; font-size: 20px; line-height: 1.5; }
.cta .cta-copy p { margin: 0; }
.cta .contact { grid-column: 8 / span 5; grid-row: 1 / span 2; align-self: end; }
.ks-cta .wp-block-columns { gap: calc(var(--gutter) * 2); align-items: flex-end; }
.ks-cta p { font-size: 20px; line-height: 1.5; max-width: 34em; }
.ks-cta .wp-block-button__link { background: var(--ink); border-color: var(--ink); color: var(--gold); }
.ks-cta .wp-block-button__link:hover { background: var(--white); border-color: var(--white); color: var(--ink); }
.ks-cta .is-style-ks-outline .wp-block-button__link { background: transparent; color: var(--ink); }
.contact-list, .ks-contact-list { list-style: none; margin: 0 0 24px; padding: 0; border-top: 2px solid var(--ink); }
.contact-list li, .ks-contact-list li { border-bottom: 1px solid rgba(42, 40, 37, .25); }
.contact-list a, .ks-contact-list a, .ks-contact-list .row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 16px 0; text-decoration: none; }
.contact-list .k, .ks-contact-list .k { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; flex: 0 0 auto; }
.contact-list .v, .ks-contact-list .v { font-size: 17px; font-weight: 600; text-align: right; word-break: break-word; }
.contact-list a:hover .v, .ks-contact-list a:hover .v { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.ks-section .ks-contact-list { border-top-color: var(--ink); }
.ks-section .ks-contact-list li { border-color: var(--line); }

.ks-offices { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 28px var(--gutter); border-top: 3px solid var(--ink); padding-top: 26px; }
.ks-office address { font-size: 17px; line-height: 1.6; color: var(--grey); margin-bottom: 10px; }
.ks-office .ks-label { display: flex; margin-bottom: 12px; }
.ks-office a { font-weight: 600; text-decoration-color: var(--gold); text-decoration-thickness: 2px; }

/* 8. Posts, archives, search, forms -------------------------------------- */
.section { padding-block: var(--section); }
.section--tight-top { padding-top: clamp(32px, 4vw, 56px); }
.ks-filter { display: flex; flex-wrap: wrap; gap: 10px; list-style: none; margin: 28px 0 0; padding: 0; }
.ks-filter a { display: block; padding: 8px 14px; border: 1px solid var(--grey-3); font-size: 15px; font-weight: 500; text-decoration: none; color: var(--grey); }
.ks-filter a:hover, .ks-filter a[aria-current] { border-color: var(--ink); background: var(--ink); color: var(--gold); }
.ks-postgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 32px var(--gutter); }
.ks-postcard { border: 1px solid var(--line); border-top: 4px solid var(--ink); background: var(--white); }
.ks-postcard:hover { border-top-color: var(--gold); }
.ks-postcard__link { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.ks-postcard__media { aspect-ratio: 3 / 2; overflow: hidden; background: var(--grey); }
.ks-postcard__media img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(100%); transition: filter .3s ease; }
.ks-postcard:hover .ks-postcard__media img { filter: none; }
.ks-postcard__body { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px 26px; flex: 1; }
.ks-postcard h3 { margin: 0; }
.ks-postcard p { color: var(--grey); font-size: 16px; margin: 0 0 8px; }
.ks-postcard .textlink { margin-top: auto; align-self: flex-start; }
.ks-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--grey-2); }
.ks-meta span { color: var(--ink); }
.ks-empty { padding: 48px; background: var(--paper); border-left: 6px solid var(--gold); }
.ks-empty h2 { font-size: 28px; }
.ks-single__media { margin-top: 40px; }
.ks-single__media img { width: 100%; }
.nav-links { display: flex; justify-content: center; gap: 8px; margin-top: 48px; }
.page-numbers { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 12px; border: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.page-numbers.current, .page-numbers:hover { background: var(--ink); color: var(--gold); border-color: var(--ink); }
.ks-postnav .nav-links { justify-content: space-between; gap: 24px; border-top: 1px solid var(--line); padding-top: 28px; }
.ks-postnav a { text-decoration: none; display: flex; flex-direction: column; gap: 4px; max-width: 26em; }
.ks-postnav .k { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--grey-2); }
.ks-postnav .v { font-weight: 600; }

.is-prose { max-width: calc(var(--prose) + var(--pad) * 2); padding-block: clamp(40px, 5vw, 72px); }
.is-prose > * + * { margin-top: 1.1em; }
.is-prose h2 { font-size: clamp(26px, 2.6vw, 34px); margin-top: 1.6em; }
.is-prose h3 { margin-top: 1.4em; }
.is-prose ul, .is-prose ol { padding-left: 1.2em; }
.is-prose li { margin-bottom: .4em; }

.ks-search { display: flex; gap: 0; max-width: 560px; margin-top: 28px; }
.ks-search input { flex: 1; min-width: 0; height: 52px; padding: 0 16px; border: 2px solid var(--ink); border-right: 0; font: 400 17px "Archivo", sans-serif; background: var(--white); border-radius: 0; }
.ks-search .btn { border-radius: 0; }

/* Forms (enquiry and certificate verification from the Keystone Core plugin). */
.ks-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px var(--gutter); border-top: 3px solid var(--ink); padding-top: 28px; }
.ks-form .full { grid-column: 1 / -1; }
.ks-form label { display: block; font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--grey); margin-bottom: 8px; }
.ks-form input[type="text"], .ks-form input[type="email"], .ks-form input[type="tel"], .ks-form select, .ks-form textarea {
  width: 100%; min-height: 50px; padding: 12px 14px; border: 1px solid var(--grey-3); border-radius: 0; background: var(--white);
  font: 400 17px/1.4 "Archivo", sans-serif; color: var(--ink);
}
.ks-form textarea { min-height: 140px; resize: vertical; }
.ks-form input:focus, .ks-form select:focus, .ks-form textarea:focus { outline: none; border-color: var(--ink); box-shadow: inset 0 -3px 0 var(--gold); }
.ks-form .check { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; color: var(--grey); text-transform: none; letter-spacing: 0; font-weight: 400; }
.ks-form .check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--ink); }
.ks-form .hp { position: absolute; left: -9999px; }
.ks-form .actions { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: center; }
.ks-form .small { font-size: 14px; color: var(--grey-2); margin: 0; }
.ks-notice { margin: 0 0 24px; padding: 18px 22px; background: var(--paper); border-left: 6px solid var(--gold); font-weight: 600; }
.ks-notice.is-error { border-left-color: #B3261E; }
.ks-cert-result { margin-top: 28px; border: 1px solid var(--line); border-top: 4px solid var(--gold); background: var(--white); }
.ks-cert-result.is-bad { border-top-color: var(--grey); }
.ks-cert-result header { padding: 18px 22px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; }
.ks-cert-result header strong { font-size: 20px; }
.ks-status { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; padding: 6px 10px; background: var(--ink); color: var(--gold); }
.ks-cert-result dl { display: grid; grid-template-columns: minmax(140px, 30%) 1fr; margin: 0; padding: 8px 22px 18px; }
.ks-cert-result dt, .ks-cert-result dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ks-cert-result dt { font-size: 13px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--grey-2); }
.ks-cert-result dd { font-weight: 600; }

/* 9. Footer ------------------------------------------------------------- */
.site-footer { padding: 64px 0 28px; border-top: 1px solid var(--line); background: var(--white); }
.foot-grid { display: grid; grid-template-columns: repeat(12, 1fr); column-gap: var(--gutter); row-gap: 40px; }
.foot-brand { grid-column: 1 / span 4; }
.foot-brand .brand img { width: 230px; height: auto; }
.foot-about { font-weight: 600; margin: 22px 0 6px; font-size: 15px; }
.foot-brand address { font-size: 15px; line-height: 1.55; color: var(--grey); }
.foot-col { grid-column: span 2; }
.foot-col--end { grid-column: span 4; }
.foot-h { font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--grey-2); margin-bottom: 14px; }
.foot-col ul { list-style: none; margin: 0; padding: 0; }
.foot-col li { margin-bottom: 8px; font-size: 15px; }
.foot-col a { text-decoration: none; color: var(--ink); }
.foot-col a:hover { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.foot-contact li { margin-bottom: 0; }
.foot-contact a { display: flex; flex-direction: column; padding: 8px 0; border-bottom: 1px solid var(--line); }
.foot-contact .k { font-size: 12px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--grey-2); }
.foot-contact .v { font-weight: 600; }
.foot-legal { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; color: var(--grey-2); }
.foot-legal p { margin: 0; }
.legal-menu { display: flex; flex-wrap: wrap; gap: 6px 20px; list-style: none; margin: 0; padding: 0; }
.legal-menu a { text-decoration: none; color: var(--grey-2); }
.legal-menu a:hover { color: var(--ink); }

/* 10. Responsive --------------------------------------------------------- */
@media (max-width: 1240px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 10px; background: none; border: 0; cursor: pointer;
    font: 600 15px "Archivo", sans-serif; color: var(--ink); padding: 10px 0;
  }
  .nav-toggle .bars { display: block; width: 22px; height: 2px; background: var(--ink); box-shadow: 0 6px 0 var(--ink), 0 -6px 0 var(--ink); }
  .nav-toggle[aria-expanded="true"] .bars { background: transparent; box-shadow: none; position: relative; }
  .nav-toggle[aria-expanded="true"] .bars::before, .nav-toggle[aria-expanded="true"] .bars::after { content: ""; position: absolute; left: 0; top: 0; width: 22px; height: 2px; background: var(--ink); transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .bars::after { transform: rotate(-45deg); }
  .nav {
    display: none; position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--white); border-bottom: 1px solid var(--line);
    padding: 8px var(--pad) 28px; max-height: calc(100vh - var(--header) - 38px); overflow-y: auto;
    box-shadow: 0 24px 40px -24px rgba(42,40,37,.4);
  }
  .nav.open { display: flex; }
  .nav .menu { flex-direction: column; align-items: stretch; }
  .nav .menu > li { flex-wrap: wrap; border-bottom: 1px solid var(--line); }
  .nav .menu > li > a { flex: 1; padding: 15px 0; border-bottom: 0; font-size: 17px; }
  .nav .menu > .current-menu-item > a, .nav .menu > .current-menu-ancestor > a, .nav .menu > .current-page-ancestor > a { box-shadow: inset 4px 0 0 var(--gold); padding-left: 14px; border: 0; }
  .sub-toggle { width: 48px; height: 48px; margin: 0; }
  .nav .sub-menu, .nav .menu > li.mega > .sub-menu {
    position: static; display: none; flex-basis: 100%; opacity: 1; visibility: visible; pointer-events: auto; transform: none;
    box-shadow: none; border-top: 0; padding: 0 0 12px 14px; min-width: 0; grid-template-columns: 1fr;
  }
  .nav .menu > li.is-open > .sub-menu, .nav .menu > li.mega.is-open > .sub-menu { display: block; }
  .nav .sub-menu a { padding: 10px 0; }
  .nav .sub-menu a:hover { background: none; box-shadow: none; }
  .nav li.mega > .sub-menu > li > a { border: 0; margin: 10px 0 2px; padding: 4px 0; }
  .nav li.mega > .sub-menu > li > .sub-menu { padding-left: 14px; }
  .nav .sub-menu .sub-menu { display: block; }
  .nav .sub-menu .ks-overview { display: none; }
  .nav-cta { margin-top: 20px; }
}

@media (max-width: 1020px) {
  .ks-hero__grid { flex-direction: column; }
  .ks-hero__copy { padding-bottom: 32px; }
  .ks-hero__media { min-height: 0; height: 380px; flex-basis: auto !important; }
  ul.ks-facts { grid-template-columns: 1fr 1fr; }
  ul.ks-facts li:nth-child(3) { padding-left: 0; border-left: 0; }
  ul.ks-facts li:nth-child(n+3) { border-top: 1px solid var(--line); }
  .ks-split { flex-direction: column; gap: 22px; }
  .ks-split > .ks-rail, .ks-split > .ks-main { flex-basis: auto !important; width: 100%; }
  .ks-cards.is-3, .ks-cards.is-4 { grid-template-columns: repeat(2, 1fr); }
  .cta h2, .cta .cta-copy, .cta .contact { grid-column: 1 / -1; grid-row: auto; }
  .cta .contact { margin-top: 32px; }
  .foot-brand { grid-column: 1 / -1; }
  .foot-col, .foot-col--end { grid-column: span 6; }
  .ks-topbar__tag { display: none; }
  .ks-topbar .wrap { justify-content: center; }
}

@media (max-width: 781px) {
  .wp-block-columns { flex-wrap: wrap !important; }
  .wp-block-columns > .wp-block-column { flex-basis: 100% !important; }
  .ks-media-row { gap: 28px !important; }
}

@media (max-width: 680px) {
  :root { --header: 68px; }
  body { font-size: 17px; }
  .brand img, .custom-logo { height: 34px; }
  .ks-topbar { font-size: 12px; }
  .ks-hero__media { height: 300px; }
  ul.ks-facts li { padding: 18px 12px 16px 0; font-size: 18px; }
  ul.ks-facts li + li { padding-left: 12px; }
  ul.is-style-ks-ticks, ol.is-style-ks-ticks { grid-template-columns: 1fr; }
  .ks-cards.is-2, .ks-cards.is-3, .ks-cards.is-4 { grid-template-columns: 1fr; }
  ol.is-style-ks-steps { grid-template-columns: 1fr; gap: 0; }
  ol.is-style-ks-steps > li { padding: 0 0 26px 64px; min-height: 44px; }
  ol.is-style-ks-steps > li::after { display: block; top: 44px; bottom: 0; left: 21px; right: auto; width: 2px; height: auto; }
  ol.is-style-ks-steps > li:last-child::after { display: none; }
  .wp-block-table.is-style-ks-spec td:first-child { width: 40%; }
  .ks-form { grid-template-columns: 1fr; }
  .foot-col, .foot-col--end { grid-column: 1 / -1; }
  .contact-list a, .ks-contact-list a, .ks-contact-list .row { flex-direction: column; gap: 2px; }
  .contact-list .v, .ks-contact-list .v { text-align: left; }
  .ks-cert-result dl { grid-template-columns: 1fr; }
  .ks-cert-result dt { border-bottom: 0; padding-bottom: 0; }
  .ks-empty { padding: 28px; }
  .admin-bar .site-header { top: 0; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; } }
@media print {
  .ks-topbar, .site-header, .cta, .ks-cta, .site-footer, .ks-crumbs { display: none !important; }
  .ks-hero__media { display: none; }
  body { font-size: 12pt; }
}
