/*
 * WorkOnWeb Child — shared presentation stylesheet.
 *
 * Single source-of-truth for the WorkOnWeb design system. Authored from
 * DESIGN.md (the canonical visual spec); it is NOT a copy of
 * prototype/styles.css. Phase 9 Step 3A scope: design tokens + minimal global
 * base, button foundation, small shared utilities, and the responsive
 * container foundation. Page components (packages, browser mockups, FAQ,
 * header/footer, forms, case-study layouts) belong to their own steps.
 *
 * Tokens use a --wow- prefix to avoid collisions with Elementor/Hello globals.
 * Real @font-face and font preload are deferred to Step 3B (no font files yet).
 */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* Colours (DESIGN.md §2) */
  --wow-ink: #222645;            /* Editorial Ink */
  --wow-ink-deep: #171a32;       /* Midnight Ink */
  --wow-action: #a8442f;         /* Burnt Terracotta */
  --wow-action-hover: #873221;   /* Deep Terracotta */
  --wow-bg: #f7f3ec;             /* Warm Paper */
  --wow-bg-alt: #eee7dd;         /* Editorial Stone */
  --wow-surface: #ffffff;        /* Clear White */
  --wow-text-strong: #181a21;    /* Near Ink */
  --wow-text: #343842;           /* Graphite */
  --wow-muted: #5f6672;          /* Slate */
  --wow-border: #d6d0c5;         /* Warm Line */
  --wow-focus: #2e5ec6;          /* Accessible Cobalt */
  --wow-success: #176b4d;        /* Forest */
  --wow-warning: #8a5a00;        /* Burnished Ochre */
  --wow-error: #b42318;          /* Deep Red */
  --wow-inverse: #ffffff;        /* Text/icon on Ink or Terracotta */
  /* Functional colour aliases (DESIGN.md §2/§7) */
  --wow-border-control: #5f6672; /* Input/control boundaries */
  --wow-border-strong: #222645;  /* Secondary button / strong rules */

  /* Typography families (DESIGN.md §3). @font-face added in Step 3B. */
  --wow-font-display: Newsreader, Georgia, Cambria, "Times New Roman", serif;
  --wow-font-body: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  --wow-weight-regular: 400;
  --wow-weight-medium: 500;
  --wow-weight-semibold: 600;

  /* Fluid type scale (DESIGN.md §3) */
  --wow-type-display: clamp(3rem, 1.9rem + 5.5vw, 5.75rem);
  --wow-type-h1: clamp(2.5rem, 1.95rem + 2.75vw, 4.5rem);
  --wow-type-h2: clamp(2.125rem, 1.75rem + 1.875vw, 3.5rem);
  --wow-type-h3: clamp(1.625rem, 1.42rem + 1.03vw, 2.375rem);
  --wow-type-h4: clamp(1.25rem, 1.18rem + 0.35vw, 1.5rem);
  --wow-type-body-lg: clamp(1.125rem, 1.08rem + 0.22vw, 1.25rem);
  --wow-type-body: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --wow-type-small: 0.875rem;
  --wow-type-eyebrow: 0.8125rem;
  --wow-type-button: 1rem;
  --wow-type-nav: 0.9375rem;

  /* Spacing scale (DESIGN.md §4) */
  --wow-space-1: 4px;
  --wow-space-2: 8px;
  --wow-space-3: 12px;
  --wow-space-4: 16px;
  --wow-space-5: 24px;
  --wow-space-6: 32px;
  --wow-space-7: 48px;
  --wow-space-8: 64px;
  --wow-space-9: 80px;
  --wow-space-10: 112px;
  --wow-space-11: 144px;

  /* Containers (DESIGN.md §5) */
  --wow-container-reading: 720px;
  --wow-container-standard: 1200px;
  --wow-container-wide: 1440px;
  --wow-container-exceptional: 1600px;
  --wow-gutter: 64px; /* outer gutter; steps down responsively below */

  /* Radii (DESIGN.md §6) */
  --wow-radius-small: 4px;
  --wow-radius-button: 8px;
  --wow-radius-input: 8px;
  --wow-radius-card: 10px;
  --wow-radius-media: 12px;
  --wow-radius-modal: 16px;

  /* Borders & focus (DESIGN.md §7) */
  --wow-focus-width: 3px;
  --wow-focus-offset: 3px;

  /* Elevation (DESIGN.md §8) — default is none */
  --wow-elevation-1: 0 8px 24px rgba(34, 38, 69, 0.08);
  --wow-elevation-2: 0 20px 48px rgba(23, 26, 50, 0.16);

  /* Motion (DESIGN.md §16/§22) */
  --wow-ease: cubic-bezier(0.2, 0, 0, 1);
  --wow-duration: 180ms;
}

/* Responsive outer gutter (DESIGN.md §5 gutters: 64/40/32/20/16) */
@media (max-width: 1439px) { :root { --wow-gutter: 40px; } }
@media (max-width: 1024px) { :root { --wow-gutter: 32px; } }
@media (max-width: 767px)  { :root { --wow-gutter: 20px; } }
@media (max-width: 479px)  { :root { --wow-gutter: 16px; } }

/* ============================================================
   2. GLOBAL BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--wow-bg);
  color: var(--wow-text);
  font-family: var(--wow-font-body);
  font-size: var(--wow-type-body);
  font-weight: var(--wow-weight-regular);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 { margin: 0 0 var(--wow-space-4); color: var(--wow-text-strong); }
h1 { font-family: var(--wow-font-display); font-weight: var(--wow-weight-semibold); font-size: var(--wow-type-h1); line-height: 1.04; letter-spacing: -0.02em; }
h2 { font-family: var(--wow-font-display); font-weight: var(--wow-weight-semibold); font-size: var(--wow-type-h2); line-height: 1.08; letter-spacing: -0.015em; }
h3 { font-family: var(--wow-font-body); font-weight: var(--wow-weight-semibold); font-size: var(--wow-type-h3); line-height: 1.18; letter-spacing: -0.01em; }
h4 { font-family: var(--wow-font-body); font-weight: var(--wow-weight-semibold); font-size: var(--wow-type-h4); line-height: 1.3; }

a { color: inherit; }

:focus-visible {
  outline: var(--wow-focus-width) solid var(--wow-focus);
  outline-offset: var(--wow-focus-offset);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   3. LAYOUT UTILITIES
   ============================================================ */
.wow-container {
  width: min(100% - (var(--wow-gutter) * 2), var(--wow-container-standard));
  margin-inline: auto;
}
/* Width variants cap at their own maximum; the outer gutter is shared. */
.wow-container--reading { width: min(100% - (var(--wow-gutter) * 2), var(--wow-container-reading)); }
.wow-container--wide { width: min(100% - (var(--wow-gutter) * 2), var(--wow-container-wide)); }
.wow-container--exceptional { width: min(100% - (var(--wow-gutter) * 2), var(--wow-container-exceptional)); }

/* Section rhythm (DESIGN.md §4 semantic aliases) */
.wow-section { padding-block: var(--wow-space-10); }          /* 112 */
.wow-section--compact { padding-block: var(--wow-space-9); }  /* 80 */
.wow-section--large { padding-block: var(--wow-space-11); }   /* 144 */
@media (max-width: 1024px) {
  .wow-section { padding-block: var(--wow-space-9); }         /* 80 */
  .wow-section--compact { padding-block: var(--wow-space-8); }/* 64 */
  .wow-section--large { padding-block: var(--wow-space-10); } /* 112 */
}
@media (max-width: 767px) {
  .wow-section { padding-block: var(--wow-space-8); }         /* 64 */
  .wow-section--compact { padding-block: var(--wow-space-7); }/* 48 */
  .wow-section--large { padding-block: var(--wow-space-9); }  /* 80 */
}

/* ============================================================
   4. BUTTON FOUNDATION (DESIGN.md §9)
   ============================================================ */
/*
 * In Elementor, the .wow-btn* classes are applied to the widget WRAPPER; the
 * actual control is the descendant `.elementor-button` <a>. Colour, border and
 * radius are set per-widget via Elementor Global Colors (reliable specificity),
 * so these rules only normalise sizing and ensure the wrapper adds NO competing
 * border (which previously produced a doubled outline on the secondary button).
 */
.wow-btn { border: 0; background: transparent; padding: 0; }
.wow-btn .elementor-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--wow-space-2);
  font-family: var(--wow-font-body);
  font-weight: var(--wow-weight-semibold);
  font-size: var(--wow-type-button);
  line-height: 1.2;
  transition: background-color var(--wow-duration) var(--wow-ease),
              border-color var(--wow-duration) var(--wow-ease),
              color var(--wow-duration) var(--wow-ease);
}

/* ============================================================
   5. SHARED UTILITIES
   ============================================================ */
/* Eyebrow / kicker (DESIGN.md §3) */
.wow-eyebrow {
  font-family: var(--wow-font-body);
  font-weight: var(--wow-weight-semibold);
  font-size: var(--wow-type-eyebrow);
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wow-muted);
}

/* Inline editorial link (DESIGN.md §10) */
.wow-link {
  color: var(--wow-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.wow-link:hover, .wow-link:active {
  color: var(--wow-ink-deep);
  text-decoration-thickness: 2px;
}

/* Persistent project labels (DESIGN.md §12) — foundation only */
.wow-project-label {
  display: inline-block;
  padding: var(--wow-space-1) var(--wow-space-2);
  border: 1px solid transparent;
  border-radius: var(--wow-radius-small);
  font-family: var(--wow-font-body);
  font-weight: var(--wow-weight-semibold);
  font-size: 13px;
  line-height: 1.35;
}
.wow-project-label--client {
  background: var(--wow-surface);
  color: var(--wow-ink);
  border-color: var(--wow-ink);
}
.wow-project-label--concept {
  background: var(--wow-bg-alt);
  color: var(--wow-action);
  border-color: var(--wow-action);
}

/* Visually-hidden (accessible names, skip-link text) */
.wow-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   6. HEADER MOBILE MENU (Phase 9.5)
   Enhances the Elementor header Nav Menu ([data-elementor-type="header"]) into the approved
   near-full-height editorial panel at the tablet breakpoint and below.
   Desktop (>=1025px) is untouched. Open/close state is toggled by workonweb.js
   via the .wow-menu-open class on <html>, synced to Elementor aria-expanded.
   ============================================================ */
@media (max-width: 1024px) {
  /* Toggle: at least 44x44 tap target (also serves as the visible Close (X)). */
  [data-elementor-type="header"] .elementor-menu-toggle {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Near-full-height panel below the sticky header. */
  [data-elementor-type="header"] .elementor-nav-menu--dropdown {
    position: fixed;
    z-index: 999;
    left: 0;
    right: 0;
    top: var(--wow-header-h, 64px);
    bottom: 0;
    height: auto;
    max-height: none !important;
    display: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--wow-bg);
    border-top: 1px solid var(--wow-border);
    padding: var(--wow-space-6) var(--wow-space-5) var(--wow-space-8);
  }
  html.wow-menu-open [data-elementor-type="header"] .elementor-nav-menu--dropdown {
    display: block;
  }

  /* Editorial navigation hierarchy inside the panel. */
  [data-elementor-type="header"] .elementor-nav-menu--dropdown .elementor-item {
    font-family: var(--wow-font-body);
    font-weight: var(--wow-weight-semibold);
    font-size: 1.375rem;
    line-height: 1.3;
    padding: var(--wow-space-4) 0;
    color: var(--wow-ink);
    border-bottom: 1px solid var(--wow-border);
  }
  [data-elementor-type="header"] .elementor-nav-menu--dropdown .elementor-item:hover,
  [data-elementor-type="header"] .elementor-nav-menu--dropdown .elementor-item:focus-visible {
    color: var(--wow-action);
  }
}

/* ============================================================
   7. PAGE COMPONENTS (Phase 9.6)
   Reusable, token-driven visual patterns for content pages. Layout (flex,
   columns, gaps) is handled by Elementor containers; these classes carry the
   shared visual treatment so values are not duplicated widget-by-widget.
   ============================================================ */

/* Numbered index label (01, 02 …) used by capability/process/card headers. */
.wow-index {
  font: var(--wow-weight-semibold) var(--wow-type-eyebrow) / 1.2 var(--wow-font-body);
  letter-spacing: 0.08em;
  color: var(--wow-action);
}

/* Border-first editorial card (DESIGN.md §11). */
.wow-card {
  background: var(--wow-surface);
  border: 1px solid var(--wow-border);
  border-radius: var(--wow-radius-card);
  padding: var(--wow-space-6);
}

/* Package card foundation (DESIGN.md §13, equal credibility — no fake emphasis). */
.wow-package {
  background: var(--wow-surface);
  border: 1px solid var(--wow-border);
  border-radius: var(--wow-radius-card);
  padding: var(--wow-space-7) var(--wow-space-6);
}

/* Browser/mockup concept frame (DESIGN.md §12/§21). Honest concept visual. */
.wow-mock {
  background: var(--wow-surface);
  border: 1px solid var(--wow-border);
  border-radius: var(--wow-radius-media);
  overflow: hidden;
}
.wow-mock__bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--wow-space-3) var(--wow-space-4);
  background: var(--wow-bg-alt);
  border-bottom: 1px solid var(--wow-border);
}
.wow-mock__bar i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--wow-border);
}
.wow-mock__screen {
  padding: var(--wow-space-6);
  color: var(--wow-text);
}
.wow-mock__eyebrow {
  display: block;
  font: var(--wow-weight-semibold) var(--wow-type-eyebrow) / 1.35 var(--wow-font-body);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--wow-muted);
  margin-bottom: var(--wow-space-3);
}
.wow-mock__title {
  font-family: var(--wow-font-display);
  font-weight: var(--wow-weight-semibold);
  font-size: var(--wow-type-h3);
  line-height: 1.1;
  color: var(--wow-ink);
  margin: 0 0 var(--wow-space-4);
}
.wow-mock__rows {
  display: grid;
  gap: var(--wow-space-2);
}
.wow-mock__rows span {
  display: block;
  padding: var(--wow-space-3) var(--wow-space-4);
  background: var(--wow-bg);
  border: 1px solid var(--wow-border);
  border-radius: var(--wow-radius-small);
  font-size: var(--wow-type-small);
  color: var(--wow-muted);
}
