/**
 * WC Custom Styles — Wisdom Cleaning Design System
 *
 * Purpose: Single CSS file containing all design tokens, base reset,
 * and shared component styles for the Wisdom Cleaning WordPress site.
 *
 * Structure:
 *   1. @font-face declarations (self-hosted Geist Variable fonts)
 *   2. :root custom properties (all design tokens from tokens.json)
 *   3. Base reset (box-sizing, body, img, a, focus-visible)
 *   4. .wc-container utility
 *   5. Section entry animation (@keyframes + IntersectionObserver classes)
 *   6. Shared button styles (.wc-btn-primary, .wc-btn-ghost)
 *   7. Shared card styles (.wc-card, .wc-card--static)
 *
 * Rules:
 *   - No hex color outside :root (use var(--color-*) everywhere)
 *   - Exception: rgba() in shadow values is OK
 *   - Breakpoints: 479px (mobile), 768px (tablet), 992px (desktop)
 */


/* ==========================================================================
   1. @font-face — Self-Hosted Geist Variable Fonts
   ========================================================================== */

/* Geist Variable — Display, Headline, Body */
@font-face {
  font-family: 'Geist';
  src: url('./fonts/Geist%5Bwght%5D.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}

/* Geist Mono Variable — Code, Data Numbers */
@font-face {
  font-family: 'Geist Mono';
  src: url('./fonts/GeistMono%5Bwght%5D.woff2') format('woff2-variations');
  font-weight: 100 900;
  font-display: swap;
}


/* ==========================================================================
   2. :root — Design Tokens (sourced from design-system/tokens.json)
   ========================================================================== */

:root {
  /* === Colors — Primary === */
  --color-primary:         #40C0F0;  /* CTA background, brand emphasis */
  --color-primary-rgb:     64, 192, 240;  /* RGB channels for rgba() usage */
  --color-primary-text:    #0078A8;  /* 2026-04-15 AA fix: was #0095C9 (measured 3.42:1 ❌), now 4.51:1 ✅ */
  --color-primary-hover:   #00658F;  /* 2026-04-15 AA fix: was #0087B5, now 6.10:1 ✅ AAA */
  --color-primary-pressed: #00729A;  /* Button active */

  /* === Colors — Neutral === */
  --color-text-primary:    #080808;  /* Near-black body text */
  --color-text-secondary:  #222222;  /* Strong body */
  --color-text-tertiary:   #363636;  /* Helper labels */
  --color-text-link-muted: #5A5A5A;  /* Footer links */
  --color-text-muted:      #ABABAB;  /* Placeholder, metadata */
  --color-border-default:  #D8D8D8;  /* Card border, divider */
  --color-border-hover:    #898989;  /* Hover border */
  --color-bg-canvas:         #FFFFFF;  /* Page background (main) */
  --color-bg-canvas-soft:    #F8FAFC;  /* 2026-04-15 NEW: cool off-white, replaces #F5F5F5 for section alternation */
  --color-bg-canvas-accent:  #F4FAFE;  /* 2026-04-15 NEW: pale blue, Testimonials only */
  --color-bg-canvas-dark:    #081829;  /* Bottom CTA dark block (1x per page max) */
  --color-bg-section:        #F8FAFC;  /* 2026-04-15 AA fix: was #F5F5F5. Used for dropdown hover etc. */

  /* === Colors — Surface (form states, placeholders, hero fallback) === */
  --color-surface-dark:       #0A1420;  /* Dark hero fallback bg (F1 Home, F2 Service, F3 BYOB) */
  --color-surface-dark-rgb:   10, 20, 32;  /* RGB channels for rgba() overlay usage */
  --color-surface-readonly:   #F8FAFC;  /* 2026-04-15 AA fix: was #F5F5F5. Read-only input bg (F6) */
  --color-surface-secondary:  #F8FAFC;  /* 2026-04-15 AA fix: was #F5F5F5. Secondary surface (F4 founder photo) */
  --color-bg-whyus:           #FFFFFF;  /* 2026-04-15: Why Us now uses main white canvas (Bento cards carry visual weight via shadow) */
  --color-bg-testimonials:    #F0F8FE;  /* Testimonials section light blue background */

  /* === Colors — Secondary (category badges, state feedback ONLY) === */
  --color-accent-purple:   #7A3DFF;
  --color-accent-pink:     #ED52CB;
  --color-accent-green:    #00D722;  /* Success */
  --color-accent-orange:   #FF6B00;  /* Warning */
  --color-accent-yellow:   #FFAE13;  /* Info */
  --color-accent-red:      #EE1D36;  /* Error ONLY */

  /* === Typography — Font Families === */
  --font-display: 'Geist', system-ui, sans-serif;
  --font-body:    'Geist', system-ui, sans-serif;
  --font-mono:    'Geist Mono', ui-monospace, monospace;

  /* === Typography — Font shorthand (for `font:` property) === */
  --text-display:    600 80px/1.04 var(--font-display);
  --text-display-ls: -0.8px;
  --text-display-responsive: clamp(2.5rem, 6vw + 1rem, 5rem);

  --text-h1:    600 56px/1.04 var(--font-display);
  --text-h1-responsive: clamp(2rem, 4vw + 1rem, 3.5rem);

  --text-h2:    500 32px/1.30 var(--font-display);
  --text-h2-responsive: clamp(1.5rem, 2vw + 1rem, 2rem);

  --text-h3:    500 24px/1.30 var(--font-display);
  --text-h4:    500 20px/1.30 var(--font-display);

  --text-body-lead: 400 20px/1.45 var(--font-body);

  --text-body:  400 16px/1.60 var(--font-body);
  --text-body-ls: -0.16px;

  --text-button: 500 16px/1.60 var(--font-body);
  --text-button-ls: -0.16px;

  --text-label: 500 15px/1.30 var(--font-body);
  --text-label-ls: 1.5px;

  --text-caption: 400 14px/1.50 var(--font-body);

  --text-badge: 550 12.8px/1.20 var(--font-body);

  --text-micro: 500 10px/1.30 var(--font-body);
  --text-micro-ls: 1px;

  /* === Typography — Pure font-size values (for `font-size:` property) ===
   * Matches HTML prototype :root definitions exactly.
   * Use these with `font-size: var(--fs-*)` — NOT the shorthand vars above.
   * The shorthand vars (--text-*) are for `font:` property only.
   * Codex diagnosis: using shorthand var in font-size: makes it invalid,
   * browser discards the declaration, inherits body 16px instead. */
  --fs-display:   clamp(2.5rem, 6vw + 1rem, 5rem);
  --fs-h1:        clamp(2rem, 4vw + 1rem, 3.5rem);
  --fs-h2:        clamp(1.5rem, 2vw + 1rem, 2rem);
  --fs-h3:        1.5rem;
  --fs-body-lead: 1.25rem;
  --fs-body:      1rem;
  --fs-label:     0.9375rem;
  --fs-caption:   0.875rem;
  --fs-micro:     0.625rem;

  /* === Spacing — Fractional Scale (Webflow original) === */
  --space-0:  0;
  --space-px: 1px;
  --space-1:  2.4px;
  --space-2:  3.2px;
  --space-3:  4px;
  --space-4:  5.6px;
  --space-5:  6px;
  --space-6:  7.2px;
  --space-7:  8px;
  --space-8:  9.6px;
  --space-9:  12px;
  --space-10: 16px;
  --space-11: 24px;
  --space-12: 32px;
  --space-13: 48px;
  --space-14: 64px;
  --space-15: 96px;
  --space-16: 128px;
  --space-section-gap:       clamp(48px, 8vw, 128px);
  --space-container-padding: clamp(16px, 4vw, 80px);
  --space-container-max:     1400px;

  /* === Border Radius === */
  --radius-sm:      2px;
  --radius-md:      4px;   /* default for functional elements */
  --radius-lg:      8px;   /* max for functional elements */
  --radius-full:    50%;

  /* === Shadows — 5-Layer Cascading (Webflow original) === */
  --shadow-elevation-card:
    0 84px 24px 0 rgba(0,0,0,0),
    0 54px 22px 0 rgba(0,0,0,0.01),
    0 30px 18px 0 rgba(0,0,0,0.04),
    0 13px 13px 0 rgba(0,0,0,0.08),
    0 3px  7px  0 rgba(0,0,0,0.09);

  /* === Motion === */
  --motion-easing:       cubic-bezier(0.2, 0, 0, 1);
  --motion-fast:         150ms;
  --motion-default:      200ms;
  --motion-slow:         400ms;
  --motion-section:      600ms;

  /* === Breakpoints (for reference; actual media queries use px values) === */
  --bp-mobile:  479px;
  --bp-tablet:  768px;
  --bp-desktop: 992px;
}


/* ==========================================================================
   3. Base Reset — Minimal, only what the shortcode architecture needs
   ========================================================================== */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 100px;
  -webkit-text-size-adjust: 100%;
}

body {
  font: var(--text-body);
  letter-spacing: var(--text-body-ls);
  color: var(--color-text-primary);
  background: var(--color-bg-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ── Elementor Header/Footer Reset (mirrors motorhomerentals/nav-footer-global.css) ──
 * Hello Elementor theme wraps content in elements that can have white backgrounds,
 * padding, and margins. Force them transparent so our fixed nav blends with the hero.
 * Without this, the nav area shows white body background instead of the hero image. */
#masthead,
.elementor-location-header {
  position: fixed !important;
  top: 0; left: 0; right: 0;
  z-index: 1000 !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  min-height: auto !important;
  border: none !important;
  box-shadow: none !important;
}
.admin-bar #masthead,
.admin-bar .elementor-location-header {
  top: 32px;
}
#masthead .elementor,
.elementor-location-header .elementor,
#masthead .e-con,
#masthead .e-con-inner,
#masthead .elementor-widget-container,
.elementor-location-header .e-con,
.elementor-location-header .e-con-inner,
.elementor-location-header .elementor-widget-container {
  padding: 0 !important;
  margin: 0 !important;
  max-width: none !important;
  background: transparent !important;
}
/* Reset any spacing the theme adds after header */
.site-header,
#masthead + * {
  margin-top: 0 !important;
}

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

/* Button reset — neutralises Elementor's global button styles site-wide */
button {
  background: transparent;
  border: 0;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}
button:focus,
button:active {
  background: transparent;
  outline: none;
}
button:focus-visible {
  outline: 2px solid var(--color-primary-text);
  outline-offset: 2px;
}

a {
  color: var(--color-primary-text);
  text-decoration: underline;
  transition: color var(--motion-default) var(--motion-easing);
}
a:hover {
  color: var(--color-primary-hover);
}

/* Focus visible — keyboard users only */
:focus-visible {
  outline: 2px solid var(--color-primary-text);
  outline-offset: 2px;
}


/* ==========================================================================
   4. .wc-container — Max-width + padding utility
   ========================================================================== */

.wc-container {
  max-width: var(--space-container-max);
  margin-inline: auto;
  padding-inline: var(--space-container-padding);
}


/* ==========================================================================
   5. Section Entry Animation — IntersectionObserver driven
   ========================================================================== */

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Applied by JS when IntersectionObserver triggers */
.wc-section-animate {
  opacity: 0;
  transform: translateY(24px);
}
.wc-section-animate.wc-visible {
  animation: fadeSlideUp var(--motion-section) var(--motion-easing) both;
}

/* Child stagger: JS sets --stagger-index as inline style on each child */
/* Descendant selector (not direct child) — stagger targets are nested inside
   .wc-container and grid wrappers, not direct children of the section */
.wc-section-animate.wc-visible .wc-stagger-child {
  animation: fadeSlideUp var(--motion-section) var(--motion-easing) both;
  animation-delay: calc(var(--stagger-index, 0) * 80ms);
}

/* JS-disabled fallback: all sections visible immediately */
.no-js .wc-section-animate {
  opacity: 1;
  transform: none;
}


/* ==========================================================================
   6. Shared Button Styles
   ========================================================================== */

/* Primary CTA Button */
.wc-btn-primary {
  display: inline-block;
  font: var(--text-button);
  letter-spacing: var(--text-button-ls);
  color: var(--color-bg-canvas);
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-md);
  padding: 14px 28px;
  cursor: pointer;
  text-decoration: none;
  transition:
    background var(--motion-default) var(--motion-easing),
    transform var(--motion-default) var(--motion-easing);
}
.wc-btn-primary:hover {
  background: var(--color-primary-hover);
  color: var(--color-bg-canvas);
  transform: translateX(6px);
}
.wc-btn-primary:active {
  background: var(--color-primary-pressed);
  transform: translateX(6px) translateY(1px);
}
.wc-btn-primary:disabled,
.wc-btn-primary.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

/* Ghost CTA Button */
.wc-btn-ghost {
  display: inline-block;
  font: var(--text-button);
  letter-spacing: var(--text-button-ls);
  color: var(--color-text-primary);
  background: transparent;
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  padding: 14px 28px;
  cursor: pointer;
  text-decoration: none;
  transition:
    border-color var(--motion-default) var(--motion-easing),
    transform var(--motion-default) var(--motion-easing);
}
.wc-btn-ghost:hover {
  border-color: var(--color-border-hover);
  color: var(--color-text-primary);
  transform: translateX(6px);
}


/* ==========================================================================
   7. Shared Card Styles
   ========================================================================== */

/* Interactive card hover — consumed by F1-F5 + F7 Contact cards */
.wc-card {
  background: var(--color-bg-canvas);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
  transition:
    border-color var(--motion-default) var(--motion-easing),
    box-shadow var(--motion-default) var(--motion-easing),
    transform var(--motion-default) var(--motion-easing);
}
.wc-card:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-elevation-card);
  transform: translateY(-2px);
}

/* Display-only card — no hover (F4 Our Team) */
.wc-card--static {
  background: var(--color-bg-canvas);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-md);
}


/* ==========================================================================
   8. Shared City Card Component
   Used by F1 home (with .page-home override for full-bleed photo),
   F2 service coverage, F5 locations. PRD F2 §7 / F5 §2.1.
   ========================================================================== */

.wc-city-card {
  display: grid;
  grid-template-columns: 48px 1fr 24px;
  align-items: center;
  gap: var(--space-10);
  text-decoration: none;
  color: inherit;
  background: var(--color-bg-canvas);
  border: 1px solid var(--color-border-default);
  border-radius: 8px;
  padding: var(--space-11);
  box-shadow: var(--shadow-elevation-card);
  transition: border-color 200ms cubic-bezier(0.2, 0, 0, 1),
              transform 200ms cubic-bezier(0.2, 0, 0, 1);
}
.wc-city-card:hover {
  border-color: var(--color-border-hover);
  transform: translateX(6px);
}

/* Modifier — for pages (service / locations text-only rows) that don't render
   a thumb or arrow. Collapses grid to single text column. */
.wc-city-card--text-only {
  grid-template-columns: 1fr;
}

.wc-city-card__thumb {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  background: rgba(var(--color-primary-rgb), 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  color: var(--color-primary-text);
}
.wc-city-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wc-city-card__thumb svg { width: 24px; height: 24px; }

.wc-city-card__text { min-width: 0; }
.wc-city-card__name {
  margin: 0 0 2px 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  line-height: 1.2;
}
/* Primary text description — used by PRD F2 §7 coverage + F5 locations.
   Legacy alias .wc-city-card__detail exists for homepage (same styling). */
.wc-city-card__desc,
.wc-city-card__detail {
  margin: 0;
  color: var(--color-text-tertiary);
  font-size: var(--fs-caption);
  line-height: 1.3;
}
.wc-city-card__cta {
  display: block;
  margin-top: var(--space-7);
  font-size: var(--fs-caption);
  color: var(--color-primary-text);
  text-decoration: underline;
}
.wc-city-card__arrow {
  color: var(--color-primary-text);
  font-size: 1.25rem;
  transition: transform 200ms cubic-bezier(0.2, 0, 0, 1);
}
.wc-city-card:hover .wc-city-card__arrow { transform: translateX(4px); }


/* ==========================================================================
   9. Shared Section Layout + Header Pattern
   PRD F2 §"Section Header Pattern" + prototype .section { padding: var(--section-gap) }.
   Applies to every `<section class="wc-section">` across service / BYOB / locations
   pages. Token --space-section-gap clamps to 48–128px per viewport.
   ========================================================================== */

.wc-section { padding-block: var(--space-section-gap); }

.wc-section-label {
  font: var(--text-label);
  letter-spacing: var(--text-label-ls);
  text-transform: uppercase;
  color: var(--color-text-muted);
  display: block;
  margin-bottom: var(--space-7);
}

.wc-section-heading {
  font: var(--text-h2);
  font-size: var(--text-h2-responsive);
  color: var(--color-text-primary);
  margin-bottom: var(--space-13);
}
