/* Homepage hero (Module 03). Implements DESIGN_SYSTEM.md B1 "Full" hero, with the quote form in the
   right column on 768px and up. Uses only --ds-* tokens. Selectors are scoped under .hero so the
   superseded component-library.css cannot leak into it. */

/* Smooth scroll for the "Get a Quote" anchor. Anchor still works as a plain link without this. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background-color: var(--ds-slate-900);
  --hero-overlay: rgba(18, 24, 31, .82); /* slate-900 at 82% (Design System: 80% minimum) */
  color: var(--ds-on-dark);
  font-family: var(--ds-font-body);
  font-size: 17px;
  line-height: 1.6;
  padding-block: var(--ds-section-y);
}
/* Bright photos get the heavier end of the Design System range (85%). */
.hero--bright { --hero-overlay: rgba(18, 24, 31, .85); }

/* Background photo (decorative layer behind everything) */
.hero__bg {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -2;
  width: 100%;
  height: 640px; /* mobile: cap so a tall stacked hero never stretches a small image */
  object-fit: cover;
  object-position: center;
}
/* Flat overlay (no gradient) plus the slat motif: door-panel horizontal bands at ~5% opacity (decoration only). */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    repeating-linear-gradient(180deg, transparent 0 44px, rgba(255, 255, 255, .05) 44px 48px),
    linear-gradient(var(--hero-overlay), var(--hero-overlay));
}
.hero *, .hero *::before, .hero *::after { box-sizing: border-box; }
.hero__inner {
  width: 100%;
  max-width: var(--ds-container);
  margin-inline: auto;
  padding-inline: var(--ds-gutter);
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--ds-s6);
}
.hero a:focus-visible, .hero button:focus-visible {
  outline: 3px solid var(--ds-focus-dark);
  outline-offset: 2px;
}

/* ---------- Content column ---------- */
.hero__eyebrow {
  margin: 0 0 var(--ds-s3);
  font-family: var(--ds-font-body);
  font-weight: 600;
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ds-amber);
}
.hero h1.hero__title {
  margin: 0 0 var(--ds-s4);
  font-family: var(--ds-font-display);
  font-weight: 800;
  /* 40px below 768, interpolating to 64px at 1024 */
  font-size: clamp(40px, calc(40px + 24 * (100vw - 768px) / 256), 64px);
  line-height: 1.05;
  letter-spacing: .01em;
  text-transform: uppercase;
  overflow-wrap: normal;
  color: var(--ds-on-dark);
}
.hero__lede {
  margin: 0 0 var(--ds-s5);
  font-size: 18px;
  line-height: 1.5;
  color: var(--ds-on-dark-soft);
  max-width: 34rem;
}
.hero__lede-more { display: none; }

.hero__actions {
  display: flex;
  flex-direction: column;
  gap: var(--ds-s3);
  margin: 0 0 var(--ds-s4);
}

/* ---------- Buttons (DS A12) ---------- */
.hero .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ds-s2);
  min-height: 56px;
  padding: 0 var(--ds-s6);
  border: 2px solid transparent;
  border-radius: var(--ds-radius-control);
  font-family: var(--ds-font-display);
  font-weight: 700;
  font-size: 20px;
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 150ms ease-out, color 150ms ease-out;
}
.hero .btn svg { width: 24px; height: 24px; flex: none; }
.hero .btn--primary { background: var(--ds-amber); color: var(--ds-ink); }
.hero .btn--primary:hover { background: var(--ds-amber-hover); color: var(--ds-ink); }
.hero .btn--primary:active { background: var(--ds-amber-pressed); }
.hero .btn--secondary-dark { background: transparent; border-color: var(--ds-on-dark); color: var(--ds-on-dark); }
.hero .btn--secondary-dark:hover { background: var(--ds-slate-700); color: var(--ds-on-dark); }

/* ---------- Trust items (DS B2 Facts, compact inline) ---------- */
.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--ds-s2) var(--ds-s5);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ds-on-dark);
}
.hero__trust li { display: inline-flex; align-items: center; gap: var(--ds-s2); }
.hero__trust svg { width: 20px; height: 20px; flex: none; color: var(--ds-amber); }

/* ---------- Form panel (DS B11: white panel, 12px radius) ---------- */
.hero__form {
  background: var(--ds-white);
  color: var(--ds-ink);
  border-radius: var(--ds-radius-panel);
  padding: var(--ds-s5);
  scroll-margin-top: calc(72px + var(--ds-s4)); /* clears the sticky header when the anchor scrolls here */
}
.hero__form a:focus-visible, .hero__form button:focus-visible, .hero__form iframe:focus-visible {
  outline-color: var(--ds-focus-light);
}
.hero .hero__form-title {
  margin: 0 0 var(--ds-s1);
  font-family: var(--ds-font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  overflow-wrap: normal;
  color: var(--ds-ink);
}
.hero__form-sub {
  margin: 0 0 var(--ds-s4);
  font-size: 15px;
  line-height: 1.5;
  color: var(--ds-ink-soft);
}
/* Reserved height: prevents layout shift when the real embed (e.g. GHL iframe) replaces the placeholder. */
.hero__embed {
  min-height: 560px;
  width: 100%;
}
.hero__embed iframe { width: 100%; min-height: 560px; border: 0; }
.hero__embed-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--ds-s2);
  min-height: 560px;
  padding: var(--ds-s5);
  background: var(--ds-mist);
  border: 2px dashed var(--ds-slate-500);
  border-radius: var(--ds-radius-control);
  text-align: center;
  color: var(--ds-ink-soft);
  font-size: 15px;
  line-height: 1.5;
}
.hero__embed-placeholder strong {
  font-family: var(--ds-font-display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--ds-ink);
}
.hero__embed-placeholder p { margin: 0; max-width: 28ch; }

/* ---------- Intent tiles (DS B1 Full: "What do you need?") ---------- */
.hero__intent { grid-column: 1 / -1; }
.hero .hero__intent-title {
  margin: 0 0 var(--ds-s4);
  font-family: var(--ds-font-display);
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  overflow-wrap: normal;
  color: var(--ds-on-dark);
}
.hero__tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--ds-s4);
  list-style: none;
  margin: 0;
  padding: 0;
}
.hero__tiles li:last-child { grid-column: 1 / -1; }
.hero__tile {
  display: flex;
  flex-direction: column;
  gap: var(--ds-s3);
  height: 100%;
  min-height: 96px;
  padding: var(--ds-s5);
  background: var(--ds-slate-800);
  border: 1px solid var(--ds-slate-700);
  border-radius: var(--ds-radius-card);
  color: var(--ds-on-dark);
  text-decoration: none;
  transition: background-color 200ms ease-out;
}
.hero__tile:hover { background: var(--ds-slate-700); color: var(--ds-on-dark); }
.hero__tile svg { width: 32px; height: 32px; color: var(--ds-amber); flex: none; }
.hero__tile span {
  font-family: var(--ds-font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.25;
}

/* ---------- Tablet and up: form moves beside the content ---------- */
@media (min-width: 768px) {
  .hero__bg { height: 100%; }
  .hero__inner { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); gap: var(--ds-s5); align-items: start; }
  .hero__lede-more { display: inline; }
  .hero .hero__quote-link { display: none; } /* form is already visible beside the text */
  .hero__tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hero__tiles li:last-child { grid-column: auto; }
  .hero__content { align-self: center; } /* balances the shorter text column against the taller form */
}

/* Variant without a form panel (About): single column, same content styling. */
.hero--solo .hero__inner { grid-template-columns: minmax(0, 1fr); }
.hero--solo .hero__content { align-self: start; }
.hero--solo .hero__lede { max-width: 40rem; }
.hero.hero--solo .hero__quote-link { display: inline-flex; } /* no form beside the text, so the scroll button stays visible */

/* ---------- Desktop ---------- */
@media (min-width: 1024px) {
  .hero__inner { grid-template-columns: minmax(0, 1fr) 440px; gap: var(--ds-s7); }
  .hero__eyebrow { font-size: 14px; }
  .hero h1.hero__title { line-height: 1; }
  .hero__lede { font-size: 20px; }
  .hero__actions { flex-direction: row; }
  .hero__tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .hero__tiles li:last-child { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .hero .btn, .hero__tile { transition: none; }
}
