/* ==========================================================================
   Cleanworld theme, base styles
   Ported from design/final/styles.css (sections 2, 3 and 16).
   The font faces of section 1 are declared in theme.json (settings.typography
   .fontFamilies), so WordPress prints them on the front end and in the editor.
   The tokens read the presets of theme.json and fall back to the values of
   the design, so theme.json stays the single source for colours and sizes.
   ========================================================================== */

/* --------------------------------------------------------------------------
   2. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Brand palette (style guide). The seven colours are the palette of
     theme.json, which is also what the colour picker of the editor offers. */
  --c-blue: var(--wp--preset--color--blue, #02135B);          /* primary blue: frame of the site, text, headings, actions */
  --c-white: var(--wp--preset--color--white, #FFFFFF);        /* primary: alternating panels */
  --c-grey: var(--wp--preset--color--warm-grey, #EBE8E3);     /* primary warm grey: page canvas */
  --c-cyan: var(--wp--preset--color--cyan, #00E6FF);          /* primary: small marks on blue only */
  --c-navy: var(--wp--preset--color--navy, #0C2140);          /* original Cleanworld blue: darkest tone, image placeholder only */
  --c-ice: var(--wp--preset--color--ice-blue, #82D3FF);       /* secondary: labels and arch on blue only */
  --c-orange: var(--wp--preset--color--orange, #E16733);      /* secondary: reserved, not used on the website */

  /* Derived tints of the primary blue (no new hue). They are technical
     values of the stylesheet (theme.json, settings.custom.color), so the
     colour picker of the editor does not offer them. */
  --c-text: var(--c-blue);
  --c-text-muted: var(--wp--custom--color--text-muted, #485384);                    /* 6.0:1 on warm grey, 7.3:1 on white */
  --c-rule: var(--wp--custom--color--rule, rgb(2 19 91 / 0.16));                    /* decorative hairline */
  --c-rule-strong: var(--wp--custom--color--rule-strong, rgb(2 19 91 / 0.30));      /* hairline that opens a block */
  --c-rule-control: var(--wp--custom--color--rule-control, rgb(2 19 91 / 0.55));    /* boundary of a control, 3.8:1 on warm grey */
  --c-on-dark: #FFFFFF;
  --c-on-dark-muted: var(--wp--custom--color--on-blue-muted, #C0C4D6);              /* blue at 25 percent on white, 9.7:1 on blue */
  --c-rule-on-dark: var(--wp--custom--color--rule-on-blue, rgb(235 232 227 / 0.24));

  /* Font families */
  --ff-title: var(--wp--preset--font-family--title, "Inter", Arial, sans-serif);
  --ff-serif: var(--wp--preset--font-family--serif, "Inter", Arial, sans-serif);
  --ff-body: var(--wp--preset--font-family--body, Arial, Helvetica, sans-serif);

  /* Fluid type scale, laptop scale (about 11 percent below the first
     design). theme.json is the source, the values here are the fall back.
     Floors: running text 16px, small print 13px. */
  --fs-display: var(--wp--preset--font-size--display, clamp(2.25rem, 1.65rem + 2.6vw, 3.75rem));   /* 36 to 60 */
  --fs-h1: var(--wp--preset--font-size--h-1, clamp(2rem, 1.6rem + 1.8vw, 3rem));                   /* 32 to 48 */
  --fs-h2: var(--wp--preset--font-size--h-2, clamp(1.5625rem, 1.34rem + 1vw, 2.125rem));           /* 25 to 34 */
  --fs-h3: var(--wp--preset--font-size--h-3, clamp(1rem, 0.96rem + 0.16vw, 1.0625rem));            /* 16 to 17 */
  --fs-lead: var(--wp--preset--font-size--lead, clamp(1.0625rem, 0.97rem + 0.38vw, 1.25rem));      /* 17 to 20 */
  --fs-body: var(--wp--preset--font-size--body, 1rem);                                             /* 16 */
  --fs-small: var(--wp--preset--font-size--small, 0.8125rem);                                      /* 13 */
  --fs-eyebrow: var(--wp--preset--font-size--eyebrow, 0.8125rem);                                  /* 13 */
  --fs-nav: 0.875rem;                                                                              /* 14, header navigation */

  /* Spacing scale */
  --sp-1: var(--wp--preset--spacing--1, 0.25rem);
  --sp-2: var(--wp--preset--spacing--2, 0.5rem);
  --sp-3: var(--wp--preset--spacing--3, 0.75rem);
  --sp-4: var(--wp--preset--spacing--4, 0.875rem);
  --sp-5: var(--wp--preset--spacing--5, 1.375rem);
  --sp-6: var(--wp--preset--spacing--6, 1.75rem);
  --sp-7: var(--wp--preset--spacing--7, 2.625rem);
  --sp-8: var(--wp--preset--spacing--8, 3.5rem);
  --sp-section: var(--wp--preset--spacing--section, clamp(3rem, 1.9rem + 5vw, 6.25rem));
  --sp-block: clamp(1.75rem, 1.4rem + 1.8vw, 3.125rem);      /* title area to the grid below it */
  --sp-block-wide: clamp(2.25rem, 1.6rem + 2.6vw, 4rem);     /* split to the cards below it */

  /* Widths */
  --w-content: var(--wp--style--global--content-size, 42rem);   /* reading column */
  --w-wide: var(--wp--style--global--wide-size, 72rem);         /* grids, header, footer */
  --w-lead: 34rem;                                              /* lead paragraph next to a title */
  --gutter: var(--wp--custom--gutter, clamp(1.25rem, 0.6rem + 2.6vw, 2.625rem));
  --col-gap: var(--wp--custom--column-gap, clamp(1.75rem, 5.3vw, 5.25rem));   /* gap of the one 5 to 7 column split */
  --card-gap: clamp(1.25rem, 2.6vw, 2.25rem);                   /* gap between cards and between contact cards */

  /* Heights of the frame. The home hero also looks at the height of the
     window, so the statement below it starts above the fold of a laptop. */
  --touch: 2.75rem;                                             /* 44px, smallest touch target */
  --header-pad: clamp(0.75rem, 0.6rem + 0.6vw, 1.125rem);
  --header-h: calc(2 * var(--header-pad) + var(--touch));       /* 68 to 80 */
  --logo-h: clamp(1.375rem, 1.2rem + 0.6vw, 1.75rem);           /* 22 to 28 */
  --hero-min: clamp(18.5rem, 14rem + 18vw, 25.5rem);            /* 296 to 408 */
  --hero-home-min: clamp(22rem, min(19rem + 22vw, 100vh - 20rem), 31rem);
  --hero-pad-top: clamp(3.5rem, 2.6rem + 4.5vw, 6.25rem);
  --hero-pad-bottom: clamp(2.25rem, 1.4rem + 3.6vw, 4rem);
  --band-pad-top: clamp(1.375rem, 0.5rem + 3.6vw, 4.5rem);
  --band-pad-bottom: clamp(1.75rem, 1.4rem + 2.1vw, 3.125rem);

  /* Components */
  --cta-mark: 2.5rem;                                           /* round arrow marker of the action */
  --cta-indent: 3.25rem;                                        /* marker plus gap */
  --portrait-max: 19.5rem;                                      /* portrait of the profile, square image on phones */
  --portrait-thumb: clamp(5rem, 26%, 6.75rem);                  /* portrait column of a contact card */

  --radius: var(--wp--custom--radius, 2px);
  --t-fast: var(--wp--custom--transition, 200ms ease);
}
@supports (height: 100svh) {
  :root { --hero-home-min: clamp(22rem, min(19rem + 22vw, 100svh - 20rem), 31rem); }
}

/* --------------------------------------------------------------------------
   3. Base
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--c-grey);
  color: var(--c-text);
  font-family: var(--ff-body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  /* Safety net for every text: a word that is wider than its box breaks
     instead of running out of it. It never changes a line that fits. */
  overflow-wrap: break-word;
}

body.is-locked { overflow: hidden; }

img, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; }

button, input, select { font: inherit; color: inherit; }

[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 3px;
  border-radius: 1px;
}
.site-header :focus-visible,
.hero :focus-visible,
.band :focus-visible,
.site-footer :focus-visible {
  outline-color: var(--c-cyan);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: 0;
  z-index: 100;
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-white);
  color: var(--c-blue);
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
}
.skip-link:focus { top: var(--sp-3); opacity: 1; pointer-events: auto; outline-color: var(--c-cyan); }
/* Logged in: the toolbar of WordPress covers the top of the window */
.admin-bar .skip-link:focus { top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--sp-3)); }

/* Text links inside running text and contact details */
.link,
.prose a:not(.cta) {
  color: var(--c-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  text-decoration-color: var(--c-rule-control);
  transition: text-decoration-color var(--t-fast);
}
.link:hover,
.prose a:not(.cta):hover { text-decoration-color: currentColor; }


/* --------------------------------------------------------------------------
   16. Motion and high contrast (print rules: print.css)
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (forced-colors: active) {
  .chip__label { border: 1px solid ButtonText; }
  .chip__input:checked + .chip__label { border-width: 3px; border-color: Highlight; }
  .chip__input:checked + .chip__label::before { background-color: ButtonText; forced-color-adjust: none; }
  .cta::before, .index__link::after { border-color: LinkText; }
  .cta::after { background-color: LinkText; forced-color-adjust: none; }
  .field__control { border-bottom: 1px solid ButtonText; }
  .site-nav__chevron, .site-nav__external { background-color: CanvasText; forced-color-adjust: none; }
  .hero__overlay, .band__arch { display: none; }
}

/* Wider desktop layouts with bounded, fluid typography. Phone/tablet tokens stay unchanged. */
@media (min-width: 64rem) {
  :root {
    --wp--style--global--wide-size: 90rem;
    --w-wide: 90rem;
    --gutter: clamp(2rem, 3vw, 4rem);
    --wp--preset--font-size--display: clamp(3.3rem, 1.7rem + 2.5vw, 4.5rem);
    --wp--preset--font-size--h-1: clamp(2.75rem, 1.55rem + 1.875vw, 3.75rem);
    --wp--preset--font-size--h-2: clamp(2rem, 1.25rem + 1.172vw, 2.75rem);
    --wp--preset--font-size--h-3: clamp(1.0625rem, 0.88rem + 0.285vw, 1.25rem);
    --wp--preset--font-size--lead: clamp(1.2rem, 1rem + 0.3125vw, 1.4rem);
    --wp--preset--font-size--body: clamp(1rem, 0.86rem + 0.22vw, 1.125rem);
    --fs-nav: clamp(0.875rem, 0.8rem + 0.117vw, 1rem);
    --wp--preset--spacing--section: clamp(5.1rem, 2rem + 4.84vw, 7.5rem);
  }
}

@media (min-width: 64rem) {
  .prose p,
  .split__body > p { max-inline-size: 68ch; }
}
