/* =========================================================
   Worksonics — Base components (global, loaded on every page)
   All classes are prefixed "ws-" so they never clash with old page CSS
   while sections are being rebuilt.
   ========================================================= */

/* ---------- Page baseline (replaces the old theme resets) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text-on-light);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
:where(img, svg, video) { max-width: 100%; }
:where(a) { color: inherit; text-decoration: none; }
:where(button) { font: inherit; }

/* Spam trap field on forms: invisible to people, bots fill it in */
.ws-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* Container */
.ws-container {
  box-sizing: border-box;
  width: 100%;
  max-width: calc(var(--container) + (var(--container-padding) * 2));
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

/* Icons: 1px outline */
.ws-icon {
  width: var(--icon-size);
  height: var(--icon-size);
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: var(--icon-stroke);
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.ws-icon * { vector-effect: non-scaling-stroke; }

/* Links */
.ws-link {
  color: var(--link);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease), text-shadow var(--dur-fast) var(--ease);
}
.ws-link:hover { color: var(--link-hover); text-shadow: var(--shadow-link-hover); }

/* Gradient border: dark border, lime in the bottom-right half */
.ws-gb { position: relative; isolation: isolate; border-radius: var(--radius); }
.ws-gb::before {
  content: "";
  position: absolute;
  inset: 0;
  padding: var(--border-gradient-width);
  background: var(--gradient-border);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  pointer-events: none;
  z-index: 2;
}

/* Button: transparent, square, gradient border.
   Hover: fill grows from bottom-left to top-right, then a shine passes left to right. */
.ws-btn {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 14px 28px;
  font-family: var(--font);
  font-size: var(--fs-button);
  font-weight: var(--fw-button);
  line-height: 1.2;
  letter-spacing: var(--ls-button);
  text-transform: var(--tt-button);
  color: var(--color-dark);
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  transition: color var(--dur-fill) var(--ease), box-shadow var(--dur-fill) var(--ease);
}
.ws-btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.35) 50%, transparent 60%) no-repeat,
    var(--color-dark);
  background-size: 300% 100%, auto;
  background-position: 100% 0, 0 0;
  clip-path: circle(0% at 0% 100%);
  transition: clip-path var(--dur-fill) var(--ease), background-position 0s;
}
.ws-btn:hover,
.ws-btn:focus-visible { color: var(--text-on-dark); box-shadow: var(--shadow-md); }
.ws-btn:hover::after,
.ws-btn:focus-visible::after {
  clip-path: circle(150% at 0% 100%);
  background-position: 0% 0, 0 0;
  transition:
    clip-path var(--dur-fill) var(--ease),
    background-position var(--dur-shine) ease-in-out var(--dur-fill);
}
.ws-btn .ws-icon { width: 18px; height: 18px; transition: transform var(--dur-fast) var(--ease); }
.ws-btn:hover .ws-icon { transform: translateX(3px); }
.ws-btn:disabled,
.ws-btn[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }

/* Keyboard focus */
.ws-btn:focus-visible,
.ws-link:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .ws-btn,
  .ws-btn::after,
  .ws-link { transition: none !important; }
}

/* ---------- On-dark variants (used on dark green sections) ---------- */
/* Border: white in the top-left half, lime in the bottom-right half */
.ws-gb--on-dark::before {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.35) 50%, var(--color-accent) 100%);
}
/* Button on dark: white text, fills with lime on hover */
.ws-btn--on-dark { color: var(--text-on-dark); }
.ws-btn--on-dark::after {
  background:
    linear-gradient(110deg, transparent 40%, rgba(255, 255, 255, 0.6) 50%, transparent 60%) no-repeat,
    var(--color-accent);
  background-size: 300% 100%, auto;
}
.ws-btn--on-dark:hover,
.ws-btn--on-dark:focus-visible { color: var(--color-dark); box-shadow: 0 0 20px rgba(207, 245, 90, 0.35); }

/* Text link with arrow, on dark */
.ws-link--on-dark { color: var(--link-on-dark); }
.ws-link--on-dark:hover { color: var(--text-on-dark); text-shadow: var(--shadow-link-hover); }
.ws-link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font);
  font-size: var(--fs-button);
  font-weight: var(--fw-button);
  letter-spacing: var(--ls-button);
  text-transform: var(--tt-button);
}
.ws-link-arrow .ws-icon { width: 18px; height: 18px; transition: transform var(--dur-fast) var(--ease); }
.ws-link-arrow:hover .ws-icon { transform: translateX(4px); }

/* Eyebrow (text above a heading) */
.ws-eyebrow {
  display: block;
  margin: 0 0 var(--space-4);
  font-family: var(--font);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-medium);
  line-height: 1.2;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
}

/* Guard: the old WordPress theme colours every <button> on hover/focus.
   Our buttons manage their own background. */
.ws-btn:hover,
.ws-btn:focus,
.ws-btn:active { background: transparent; }

/* ---------- Mobile (≤ 767px): long button labels wrap instead of overflowing ---------- */
@media (max-width: 767px) {
  .ws-btn { white-space: normal; text-align: center; }
}

/* Skip link: hidden until focused with the keyboard */
.ws-skip {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: calc(var(--z-overlay) + 1);
  padding: var(--space-3) var(--space-5);
  font-family: var(--font);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
  color: var(--color-dark);
  background: var(--color-accent);
  transform: translateY(-200%);
}
.ws-skip:focus { transform: none; outline: 2px solid var(--color-dark); }
