/**
 * UCFER public site — modern platform layer (2026).
 * Loaded after align. Progressive enhancement only; no third-party CDNs.
 */

html.ucfer-wb-clone {
  color-scheme: light dark;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  interpolate-size: allow-keywords;
}

html.ucfer-wb-clone body {
  text-rendering: optimizeLegibility;
}

html.ucfer-wb-clone .wb-hero-copy h1,
html.ucfer-wb-clone .wb-services h2,
html.ucfer-wb-clone .wb-offices h2,
html.ucfer-wb-clone .wb-enquire h2,
html.ucfer-wb-clone .section-title,
html.ucfer-wb-clone .section-title-centered {
  text-wrap: balance;
}

html.ucfer-wb-clone .wb-hero-copy p,
html.ucfer-wb-clone .wb-services > .container > p,
html.ucfer-wb-clone .wb-enquire p {
  text-wrap: pretty;
}

/* Sticky header + align rail: in-page targets land cleanly */
html.ucfer-wb-clone main section[id],
html.ucfer-wb-clone main [id] {
  scroll-margin-top: calc(var(--ucfer-strip-h, 40px) + var(--ucfer-nav-h, 64px) + 16px);
}

/* Below-fold sections: skip layout until near viewport */
html.ucfer-wb-clone .wb-services,
html.ucfer-wb-clone .wb-offices,
html.ucfer-wb-clone .wb-enquire,
html.ucfer-wb-clone .trust-pillars,
html.ucfer-wb-clone .process-steps,
html.ucfer-wb-clone footer.footer {
  content-visibility: auto;
  contain-intrinsic-size: auto 480px;
}

html.ucfer-wb-clone .wb-hero-media {
  content-visibility: visible;
}

@supports (view-transition-name: none) {
  html.ucfer-wb-clone::view-transition-old(root),
  html.ucfer-wb-clone::view-transition-new(root) {
    animation-duration: 180ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  html.ucfer-wb-clone {
    interpolate-size: auto;
  }

  html.ucfer-wb-clone::view-transition-old(root),
  html.ucfer-wb-clone::view-transition-new(root) {
    animation: none !important;
  }

  html.ucfer-wb-clone .wb-services,
  html.ucfer-wb-clone .wb-offices,
  html.ucfer-wb-clone .wb-enquire,
  html.ucfer-wb-clone .trust-pillars,
  html.ucfer-wb-clone .process-steps,
  html.ucfer-wb-clone footer.footer {
    content-visibility: visible;
  }
}

html.ucfer-wb-clone :focus-visible {
  outline: 2px solid var(--ucfer-black, #0a0a0a);
  outline-offset: 3px;
}

html.ucfer-wb-clone[color-mode="dark"] :focus-visible {
  outline-color: var(--ucfer-black, #f5f5f5);
}

/* Command palette (dialog) */
.ucfer-cmd {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid rgba(10, 10, 10, 0.16);
  border-radius: 12px;
  background: #f7f4ee;
  color: #111;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
}

.ucfer-cmd::backdrop {
  background: rgba(10, 10, 10, 0.45);
}

.ucfer-cmd-form {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.ucfer-cmd-label {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #5a5a5a;
}

.ucfer-cmd input[type="search"] {
  width: 100%;
  border: 1px solid #d8d5ce;
  border-radius: 8px;
  padding: 12px 14px;
  font: inherit;
  background: #fff;
  color: inherit;
}

.ucfer-cmd ul {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow: auto;
}

.ucfer-cmd li a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
}

.ucfer-cmd li a:hover,
.ucfer-cmd li a:focus-visible {
  background: rgba(10, 10, 10, 0.06);
}

.ucfer-cmd-empty,
.ucfer-cmd-hint {
  margin: 0;
  font-size: 0.85rem;
  color: #5a5a5a;
}

html.ucfer-wb-clone[color-mode="dark"] .ucfer-cmd {
  background: #171717;
  color: #f5f5f5;
  border-color: rgba(255, 255, 255, 0.14);
}

html.ucfer-wb-clone[color-mode="dark"] .ucfer-cmd input[type="search"] {
  background: #111;
  border-color: rgba(255, 255, 255, 0.18);
  color: inherit;
}
