/* ============================================================
   GLOBAL STYLES — shared design system for all client sites.
   Theme via CSS custom properties (set per client in :root).
   ============================================================ */

:root {
  /* Brand — overridden per client via inline style in Seo.astro.
     These are safe fallbacks. */
  --accent: #c2410c;
  --accent-dark: #9a3412;
  --accent-soft: #fff1e6;
  /* Light accent for use on dark backgrounds (e.g. footer hover) */
  --accent-light: #ffa066;

  /* Neutrals */
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --paper: #ffffff;
  --paper-soft: #f6f6f4;
  --line: #e5e5e2;

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  --font-display: var(--font-sans);

  /* Layout */
  --container: 72rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 0.75rem;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.06);
}

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

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

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* prevent horizontal scroll from full-bleed content */
}

/* Sticky header offset for in-page anchors */
[id] {
  scroll-margin-top: 5rem;
}

/* Visible focus for keyboard users */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* Prevent double-tap zoom delay on touch */
a,
button {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Respect reduced-motion preferences */
@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;
  }
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}
a:hover {
  color: var(--accent-dark);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  margin: 0 0 0.75rem;
  letter-spacing: -0.02em;
  font-weight: 800;
  text-wrap: balance; /* prevents widows/orphans in headings */
}

h1 {
  font-size: clamp(2.25rem, 5vw, 3.5rem);
}
h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
}
h3 {
  font-size: 1.25rem;
}

p {
  margin: 0 0 1rem;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section {
  padding-block: clamp(3.5rem, 8vw, 6rem);
}

.section--soft {
  background: var(--paper-soft);
}

.section__label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.section__lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
  max-width: 46rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  min-height: 44px; /* WCAG touch-target minimum */
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease, color 0.15s ease;
}
.btn:active {
  transform: translateY(1px);
}
.btn--primary {
  background: var(--accent);
  color: #fff;
}
.btn--primary:hover {
  background: var(--accent-dark);
  color: #fff;
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}
.btn--ghost:hover {
  border-color: var(--ink);
  color: var(--ink);
}

/* Cards */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  box-shadow: var(--shadow);
}

/* Utility */
.grid {
  display: grid;
  gap: 1.5rem;
}
.grid--3 {
  grid-template-columns: 1fr;
}
@media (min-width: 720px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Skip link — visible only on keyboard focus */
.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 0.5rem 0.5rem;
  font-weight: 700;
}
.skip-link:focus {
  top: 0;
}

/* Print styles — clean output for pages users might print */
@media print {
  .header,
  .footer,
  .contact__form,
  .btn {
    display: none !important;
  }
  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }
  a {
    color: #000;
    text-decoration: underline;
  }
  .section {
    padding-block: 1rem;
  }
}
