/* ==========================================================================
   Homepage hero (Module 03): quote form beside the hero copy on desktop,
   "Get a Quote" anchor to the form on mobile.
   Uses only Design System tokens defined in component-library.css (--bc-*).
   Loaded by the homepage only.
   ========================================================================== */

/* Anchor jump: smooth unless the visitor prefers reduced motion. Plain anchor
   (#quote-form) still works with no JavaScript. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

.cp-hero {
  /* Reserved height of the embedded form (measured: step 1 of the 3-step survey
     renders ~685px tall). Change this one value when a compact form is swapped in. */
  --cp-form-h: 720px;

  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--bc-primary-dark);
  color: var(--bc-primary-contrast);
  padding-block: var(--bc-space-6) var(--bc-space-7);
}

/* Background photo (LCP element): <img fetchpriority="high"> in the HTML. */
.cp-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
}

/* Scrim per Design System: primaryDark, 92% at the bottom to 70% at the top. */
.cp-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(to top, rgba(26, 29, 32, 0.92), rgba(26, 29, 32, 0.70));
}

.cp-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--bc-space-6);
  align-items: start;
}

/* ---------- Copy column ---------- */

.cp-hero__eyebrow {
  margin: 0 0 var(--bc-space-2);
  font-family: var(--bc-font-body);
  font-weight: 700;
  font-size: var(--bc-text-xs);
  line-height: 1.35;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--bc-accent-on-dark);
}

.cp-hero__title {
  margin: 0 0 var(--bc-space-3);
  font-family: var(--bc-font-display);
  font-weight: 700;
  font-size: 2.375rem; /* Design System hero heading, mobile and tablet (38px) */
  line-height: 1.15;
  letter-spacing: 0;
  text-transform: none;
  color: var(--bc-primary-contrast);
}

.cp-hero__lede {
  margin: 0 0 var(--bc-space-5);
  max-width: 34ch;
  font-size: var(--bc-text-lg);
  line-height: 1.45;
  color: var(--bc-primary-contrast);
}

.cp-hero__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--bc-space-3);
  margin-bottom: var(--bc-space-5);
}

/* Buttons: Design System sizes (Large 56px, radius 6px, Barlow 20px uppercase). */
.cp-hero .bc-btn {
  min-height: 56px;
  padding: 0 28px;
  border-radius: var(--bc-radius);
  font-size: var(--bc-text-lg);
  letter-spacing: 0.04em;
  line-height: 1;
}
.cp-hero .bc-btn--ghost { border-color: #fff; }
.cp-hero .bc-btn svg { flex: none; }

/* Trust chips: compact inline list, 6px radius */
.cp-hero__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bc-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.cp-hero__chips li {
  display: inline-flex;
  align-items: center;
  gap: var(--bc-space-2);
  padding: var(--bc-space-2) var(--bc-space-3);
  border: 1.5px solid #b9bec3;
  border-radius: var(--bc-radius);
  font-size: var(--bc-text-sm);
  line-height: 1.35;
  color: var(--bc-primary-contrast);
}
.cp-hero__chips svg { flex: none; color: var(--bc-accent-on-dark); }

/* ---------- Form card ---------- */

.cp-hero__form {
  /* the sticky site header must not cover the card after the anchor jump */
  scroll-margin-top: var(--bc-space-9);
  /* the survey embed draws its own white card, so this wrapper stays transparent */
  padding: 0;
  color: var(--bc-primary-contrast);
}

.cp-hero__form-title {
  margin: 0 0 var(--bc-space-3);
  font-family: var(--bc-font-display);
  font-weight: 600;
  font-size: var(--bc-text-xl);
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  color: var(--bc-primary-contrast);
}

/* Reserved height: no layout shift while the iframe loads and auto-resizes.
   The iframe itself is untouched (inline style from the embed). */
.cp-hero__embed {
  min-height: var(--cp-form-h);
}
.cp-hero__embed iframe { display: block; }

/* ---------- Tablet (single column, wider card) ---------- */
@media (min-width: 640px) {
  .cp-hero { padding-block: var(--bc-space-7); }
  .cp-hero__actions { grid-template-columns: repeat(2, minmax(0, max-content)); gap: var(--bc-space-4); }
}

/* ---------- Desktop: copy left, form right ---------- */
@media (min-width: 960px) {
  .cp-hero__grid {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
    gap: var(--bc-space-7);
  }
  .cp-hero__copy {
    position: sticky;
    top: var(--bc-space-9);
  }
  .cp-hero__title { font-size: 3.75rem; line-height: 1.1; } /* Design System hero heading, desktop (60px) */
  .cp-hero__eyebrow { font-size: var(--bc-text-sm); }
  .cp-hero__form-title { font-size: var(--bc-text-2xl); }
}

/* ==========================================================================
   Compact variant (service, location, contact, about pages)
   Design System B1 Compact: H1 30px mobile / 48px desktop, flat 88% scrim.
   ========================================================================== */
.cp-hero__title em { font-style: normal; color: var(--bc-accent-on-dark); }

.cp-hero--compact::before { background: rgba(26, 29, 32, 0.88); }
.cp-hero--compact .cp-hero__title { font-size: var(--bc-text-2xl); line-height: 1.15; }

/* Pages without an in-hero form (About): copy only, same styling */
.cp-hero--noform .cp-hero__lede { max-width: 46ch; }

@media (min-width: 960px) {
  .cp-hero--compact .cp-hero__title { font-size: var(--bc-text-4xl); line-height: 1.15; }
  .cp-hero--noform .cp-hero__grid { grid-template-columns: minmax(0, 1fr); }
  .cp-hero--noform .cp-hero__copy { position: static; }
}

/* ---------- Tablet landscape / large tablet (768-959px): copy left, narrow form right so the form sits in the first screen ---------- */
@media (min-width: 768px) and (max-width: 959px) {
  .cp-hero__grid { grid-template-columns: minmax(0, 1fr) 340px; gap: var(--bc-space-5); }
  .cp-hero__actions { grid-template-columns: minmax(0, 1fr); }
  .cp-hero--compact .cp-hero__title { font-size: var(--bc-text-2xl); }
}
