/* ==========================================================================
   Homepage hero (Module 03). Uses only Design System tokens (design-tokens.css).
   Mobile-first. Class prefix .hx- keeps it isolated from legacy .bc- styles.
   ========================================================================== */

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

.hx-hero {
  position: relative;
  isolation: isolate;
  background-color: var(--ds-teal);
  background-image: url('/images/uploads/2023/04/concrete-sunshine-coast-advance.jpg');
  background-size: cover;
  background-position: center;
  color: var(--ds-on-dark);
  font-family: var(--ds-font-body);
  padding: var(--ds-sp-6) 0 var(--ds-sp-7);
}
/* Teal overlay: 80% on mobile, 70% on desktop (keeps >= 4.5:1 text contrast) */
.hx-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(11, 59, 69, 0.80);
}

.hx-container {
  width: 100%;
  max-width: var(--ds-container);
  margin: 0 auto;
  padding: 0 var(--ds-gutter);
}
.hx-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ds-sp-6);
}

/* ---------- Copy column ---------- */
.hx-eyebrow {
  margin: 0 0 var(--ds-sp-2);
  font-family: var(--ds-font-head);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  /* cream, not gold: gold on the photo overlay measured below 4.5:1 */
  color: var(--ds-on-dark);
}
.hx-title {
  margin: 0 0 var(--ds-sp-3);
  font-family: var(--ds-font-head);
  font-weight: 800;
  font-size: 34px;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--ds-on-dark);
}
.hx-lede {
  margin: 0 0 var(--ds-sp-5);
  max-width: 34em;
  font-size: 19px;
  line-height: 1.5;
  color: var(--ds-on-dark);
}
.hx-nowrap { white-space: nowrap; }
.hx-actions {
  display: grid;
  gap: var(--ds-sp-3);
  margin: 0 0 var(--ds-sp-5);
}

/* ---------- Buttons (Design System button system) ---------- */
.hx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 56px;
  padding: 0 var(--ds-sp-5);
  border: 2px solid transparent;
  border-radius: var(--ds-radius-btn);
  font-family: var(--ds-font-head);
  font-weight: 700;
  font-size: 17px;
  line-height: 1;
  letter-spacing: 0.01em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--ds-ease), color var(--ds-ease), border-color var(--ds-ease);
}
.hx-btn--primary { background: var(--ds-red); color: var(--ds-white); }
.hx-btn--outline { background: transparent; color: var(--ds-on-dark); border-color: var(--ds-on-dark); }
@media (hover: hover) {
  .hx-btn--primary:hover { background: var(--ds-red-deep); }
  .hx-btn--outline:hover { background: var(--ds-on-dark); color: var(--ds-teal); }
}
.hx-btn:focus-visible,
.hx-link:focus-visible {
  outline: 3px solid var(--ds-gold);
  outline-offset: 2px;
}

/* ---------- Trust chips ---------- */
.hx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-sp-2);
  margin: 0;
  padding: 0;
  list-style: none;
}
.hx-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--ds-sp-2);
  padding: var(--ds-sp-2) var(--ds-sp-3);
  border: 1px solid var(--ds-border-teal);
  border-radius: var(--ds-radius-pill);
  font-size: 14px;
  line-height: 1.3;
  color: var(--ds-on-dark);
}
.hx-chip svg {
  flex: none;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--ds-gold);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- Form card ---------- */
.hx-formwrap {
  scroll-margin-top: var(--ds-sp-4);
}
.hx-card {
  box-sizing: border-box;
  /* Reserved height: prevents layout shift when the real embed replaces the placeholder */
  min-height: var(--hx-form-min-h, 440px);
  padding: var(--ds-sp-5);
  background: var(--ds-white);
  color: var(--ds-ink);
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-card);
  box-shadow: var(--ds-shadow-md);
}
.hx-card__title {
  margin: 0 0 var(--ds-sp-4);
  font-family: var(--ds-font-head);
  font-weight: 700;
  font-size: 20px;
  line-height: 1.25;
  color: var(--ds-teal);
}
/* Placeholder label (remove together with the placeholder when the real embed is added) */
.hx-placeholder-note {
  margin: 0 0 var(--ds-sp-4);
  padding: var(--ds-sp-3);
  border: 2px dashed var(--ds-sand);
  border-radius: var(--ds-radius-field);
  background: var(--ds-paper);
  font-size: 14px;
  line-height: 1.5;
  color: var(--ds-ink);
}
.hx-placeholder-note strong { color: var(--ds-sand); }
.hx-skeleton { display: grid; gap: var(--ds-sp-4); margin: 0 0 var(--ds-sp-4); }
.hx-skeleton__field { display: grid; gap: var(--ds-sp-2); }
.hx-skeleton__label { font-size: 15px; font-weight: 500; line-height: 1.3; color: var(--ds-ink-soft); }
.hx-skeleton__input {
  box-sizing: border-box;
  height: 48px;
  border: 1px solid var(--ds-border);
  border-radius: var(--ds-radius-field);
  background: var(--ds-paper);
}
.hx-skeleton__submit {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  min-height: 56px;
  border-radius: var(--ds-radius-btn);
  background: var(--ds-red);
  color: var(--ds-white);
  font-family: var(--ds-font-head);
  font-weight: 700;
  font-size: 17px;
  opacity: 0.5;
}
.hx-card__call {
  margin: var(--ds-sp-4) 0 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ds-ink-soft);
}
.hx-link { color: var(--ds-teal-mid); text-decoration: underline; font-weight: 500; }
@media (hover: hover) { .hx-link:hover { color: var(--ds-teal); } }
.hx-link:focus-visible { outline-color: var(--ds-teal-mid); }

/* ---------- Tablet (768+): still stacked, roomier ---------- */
@media (min-width: 768px) {
  .hx-hero { padding: var(--ds-sp-7) 0; }
  .hx-actions { grid-template-columns: repeat(2, max-content); }
  .hx-btn { min-height: 48px; }
  .hx-title { font-size: 44px; line-height: 1.1; }
  .hx-lede { font-size: 21px; }
  .hx-card { padding: var(--ds-sp-6); min-height: var(--hx-form-min-h, 420px); }
}

/* ---------- Desktop (1024+): two columns, form beside copy ---------- */
@media (min-width: 1024px) {
  .hx-hero::before { background: rgba(11, 59, 69, 0.70); }
  .hx-hero { padding: var(--ds-sp-8) 0; }
  .hx-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: var(--ds-sp-7);
    align-items: center;
  }
  .hx-eyebrow { font-size: 14px; }
  .hx-title { font-size: 56px; line-height: 1.05; }
  .hx-card__title { font-size: 24px; }
}

/* ==========================================================================
   Inner-page variant (service, location, contact, about).
   Same hero; Design System "H1" size (30px mobile / 44px desktop) instead of the
   homepage "Hero heading". DOM order is H1 first, then the existing page headings
   as H2 eyebrows; they are shown above the H1 using flex order only.
   ========================================================================== */
.hx-hero--page { background-image: none; }
.hx-hero__bg {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hx-hero--page .hx-copy { display: flex; flex-direction: column; align-items: stretch; }
.hx-hero--page .hx-eyebrow { order: 1; }
.hx-hero--page .hx-eyebrow--sub { color: var(--ds-on-dark-soft); font-weight: 600; margin-top: calc(-1 * var(--ds-sp-1)); }
.hx-hero--page .hx-title { order: 2; font-size: 30px; line-height: 1.15; }
.hx-hero--page .hx-lede { order: 3; }
.hx-hero--page .hx-actions { order: 4; }
.hx-hero--page .hx-chips { order: 5; }
.hx-hero--noform .hx-grid { grid-template-columns: minmax(0, 1fr); }
.hx-hero--noform .hx-copy { max-width: 720px; }
@media (min-width: 768px) {
  .hx-hero--page .hx-title { font-size: 44px; line-height: 1.1; }
}

/* Inner pages: stacked page headings make the copy taller, so use the top of the
   Design System overlay range (80%) at every width, and tighten tablet spacing
   (spacing-scale values only) so the form card stays above the fold at 768x1024. */
.hx-hero--page::before { background: rgba(7, 42, 49, 0.80); } /* --ds-teal-deep at 80% */
@media (min-width: 768px) and (max-width: 1023px) {
  .hx-hero--page { padding-top: var(--ds-sp-6); }
  .hx-hero--page .hx-grid { gap: var(--ds-sp-5); }
  .hx-hero--page .hx-lede { margin-bottom: var(--ds-sp-4); }
  .hx-hero--page .hx-actions { margin-bottom: var(--ds-sp-4); }
  .hx-hero--page .hx-card { padding: var(--ds-sp-5); }
  .hx-hero--page .hx-skeleton { gap: var(--ds-sp-3); }
}

/* ==========================================================================
   Live GHL form (single iframe per page, #contact-form).
   Container styling only: the iframe and its script are used exactly as supplied.
   The GHL survey grows from ~150px to ~690-745px after it loads, so the container
   reserves that height up front (no layout shift), and from 768px the hero is two
   columns so the whole form stays above the fold on tablet.
   ========================================================================== */
.hx-card { min-height: var(--hx-form-min-h, 880px); }
.contact-form-wrapper iframe { display: block; }

@media (min-width: 768px) and (max-width: 1023px) {
  .hx-grid { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: var(--ds-sp-5); align-items: start; }
  .hx-title, .hx-hero--page .hx-title { font-size: 32px; line-height: 1.15; }
  .hx-lede { font-size: 19px; }
  .hx-actions, .hx-hero--page .hx-actions { grid-template-columns: minmax(0, 1fr); }
  .hx-card, .hx-hero--page .hx-card { padding: var(--ds-sp-4); min-height: var(--hx-form-min-h, 830px); }
}
@media (min-width: 1024px) {
  .hx-card { min-height: var(--hx-form-min-h, 850px); }
  .hx-hero--page .hx-grid { align-items: start; }
}
