/* ============================================================
   Groundwork Studio — Shared Stylesheet
   Imported by all 4 HTML files.
   Tailwind CDN handles utility classes; this file handles:
   - CSS custom properties (accent colors per demo)
   - Base resets
   - Hamburger nav (checkbox hack) — same pattern on all 4 pages
   ============================================================ */

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

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  color: #111827;
  background: #ffffff;
}

/* ============================================================
   CSS Custom Properties
   index.html uses brand green (#16a34a)
   Each demo overrides --accent and --accent-gradient via a
   data-theme attribute or directly in its own <style> block.
   ============================================================ */

:root {
  --brand-green: #16a34a;
  --dark: #111827;
  --secondary: #6b7280;
  --bg: #ffffff;
  --bg-alt: #f9fafb;
  --border: #e5e7eb;
  --footer-dark: #111827;
}

/* Demo accent colors (applied via .theme-plumbing, .theme-restaurant, .theme-landscaping on <body>) */
.theme-plumbing {
  --accent: #1e3a5f;
  --accent-gradient: linear-gradient(135deg, #1e3a5f, #2563eb);
}

.theme-restaurant {
  --accent: #ea580c;
  --accent-gradient: linear-gradient(135deg, #7c2d12, #ea580c);
}

.theme-landscaping {
  --accent: #15803d;
  --accent-gradient: linear-gradient(135deg, #14532d, #15803d);
}

/* ============================================================
   Hamburger Nav — Checkbox Hack
   Works the same on all 4 pages.

   HTML structure required:
   <input type="checkbox" id="nav-toggle" class="nav-toggle-input">
   <label for="nav-toggle" class="nav-toggle-label">&#9776;</label>
   <nav class="mobile-nav">...</nav>
   ============================================================ */

/* Hide the actual checkbox */
.nav-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* Hamburger label — shown on mobile, hidden on desktop */
.nav-toggle-label {
  display: none;
  cursor: pointer;
  font-size: 22px;
  color: #111827;
  user-select: none;
  padding: 4px 8px;
}

/* Mobile nav drawer — hidden by default */
.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 24px;
  z-index: 50;
}

.mobile-nav a {
  display: block;
  padding: 10px 0;
  font-size: 15px;
  font-weight: 600;
  color: #111827;
  text-decoration: none;
  border-bottom: 1px solid #f3f4f6;
}

.mobile-nav a:last-child {
  border-bottom: none;
}

/* When checkbox is checked, show mobile nav */
.nav-toggle-input:checked ~ .mobile-nav {
  display: block;
}

/* Show ✕ when open — hide the ☰ glyph and replace with × via ::before */
.nav-toggle-input:checked + .nav-toggle-label {
  font-size: 0;
}

.nav-toggle-input:checked + .nav-toggle-label::before {
  content: '✕';
  font-size: 20px;
}

/* ============================================================
   Responsive breakpoint — 768px
   ============================================================ */

@media (max-width: 768px) {
  /* Show hamburger, hide desktop nav links */
  .nav-toggle-label {
    display: block;
  }

  .desktop-nav {
    display: none !important;
  }

  /* Hero text scales down ~20% */
  .hero-headline {
    font-size: clamp(28px, 8vw, 38px) !important;
  }

  /* 3-col grids collapse to 1 */
  .grid-3col {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   Focus styles (keyboard accessibility)
   ============================================================ */

a:focus-visible,
button:focus-visible,
.nav-toggle-label:focus-visible {
  outline: 2px solid #16a34a;
  outline-offset: 3px;
  border-radius: 3px;
}
