/* ==========================================================================
   style.css — Custom styles that complement Tailwind utility classes.
   Tailwind handles layout, spacing, color, and typography via HTML classes.
   This file covers: design tokens, focus styles, selection, animations,
   form polish, and print rules.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens (CSS custom properties matching the Tailwind theme)
   -------------------------------------------------------------------------- */
:root {
  --color-brand-50:  #eff6ff;
  --color-brand-100: #dbeafe;
  --color-brand-500: #2563eb;
  --color-brand-600: #1d4ed8;
  --color-brand-700: #1e40af;
  --color-brand-900: #1e3a8a;
  --color-accent:    #f59e0b;

  --font-sans: 'Inter', system-ui, sans-serif;

  --transition-base: 150ms ease;
}

/* --------------------------------------------------------------------------
   2. Base overrides
   -------------------------------------------------------------------------- */

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

/* Remove default margin on common elements (Tailwind's preflight covers most) */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* Consistent box-sizing */
*,
*::before,
*::after {
  box-sizing: border-box;
}

/* --------------------------------------------------------------------------
   3. Typography
   -------------------------------------------------------------------------- */

/* Improve text rendering */
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* --------------------------------------------------------------------------
   4. Focus styles — visible only for keyboard navigation
   -------------------------------------------------------------------------- */

/* Remove default outline; replaced by :focus-visible below */
*:focus {
  outline: none;
}

/* Keyboard-only focus ring */
*:focus-visible {
  outline: 3px solid var(--color-brand-500);
  outline-offset: 3px;
  border-radius: 4px;
}

/* --------------------------------------------------------------------------
   5. Text selection
   -------------------------------------------------------------------------- */
::selection {
  background-color: var(--color-brand-100);
  color: var(--color-brand-900);
}

/* --------------------------------------------------------------------------
   6. Navigation — active link underline indicator
   -------------------------------------------------------------------------- */
nav a {
  position: relative;
}

nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-brand-600);
  transition: width var(--transition-base);
}

nav a:hover::after {
  width: 100%;
}

/* Don't apply underline animation to the CTA button in the nav */
nav a[href^="tel"]::after,
nav a.rounded-full::after {
  display: none;
}

/* --------------------------------------------------------------------------
   7. Service cards — lift animation
   -------------------------------------------------------------------------- */
.service-card {
  transition: transform 200ms ease, box-shadow 200ms ease;
  will-change: transform;
}

.service-card:hover {
  transform: translateY(-4px);
}

/* --------------------------------------------------------------------------
   8. Form inputs — consistent focus ring & invalid state
   -------------------------------------------------------------------------- */
input,
select,
textarea {
  transition: border-color var(--transition-base), box-shadow var(--transition-base);
}

/* Webkit: remove inner padding on search inputs */
input[type="search"]::-webkit-search-decoration,
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Normalise select arrow across browsers */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px;
}

/* Submit button disabled state */
button[type="submit"]:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* --------------------------------------------------------------------------
   9. Scroll offset — prevent fixed header from hiding section anchors
   -------------------------------------------------------------------------- */
[id] {
  scroll-margin-top: 80px;
}

/* --------------------------------------------------------------------------
   10. Print styles
   -------------------------------------------------------------------------- */
@media print {
  header,
  footer,
  #contact form,
  nav {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
  }

  a[href]::after {
    content: ' (' attr(href) ')';
    font-size: 10pt;
    color: #555;
  }

  a[href^="tel"]::after,
  a[href^="#"]::after {
    content: '';
  }
}
