/*
 * .hubspot-embed — rounded textured card, centred head and a zone for a HubSpot form
 * (template-parts/flexible/hubspot-embed.php).
 * Figma phase 2: Assessment "How would you rate your current manufacturing environment?"
 * D 510:64488 (card 1400, zone 926) / M 510:70581 (zone 335).
 *
 * Only the wrapper is ours: the zone holds HubSpot's iframe, which sets its own height
 * (the card grows with it) and is not styled from here.
 */

.hubspot-embed {
  /* head → form zone: 40 → 50 px (Figma M 510:70581 / D 510:64488) */
  --he-zone-gap: clamp(2.5rem, 2.28rem + 0.939vw, 3.125rem);

  padding-top: var(--nv-section-y);
  padding-bottom: var(--nv-section-y);
  background-color: var(--nv-white);
  scroll-margin-top: 7.5rem;
}

/* .page-sections .hubspot-embed — the card starts where the previous section ends, like .cta (Figma: 50 → 100 px under the cards) */
.page-sections .hubspot-embed {
  padding-top: 0;
}

/* .hubspot-embed__box — rounded card; phones: full width as in the phone frame.
   The gradient is measured on the Figma export: #e9eef4 → #edf1f5 → #e1e9f0 */
.hubspot-embed__box {
  position: relative;
  margin-left: -1.25rem;
  margin-right: -1.25rem;
  border-radius: var(--nv-radius-m);
  background: linear-gradient(180deg, #e9eef4 0%, #edf1f5 52%, #e1e9f0 100%);
  overflow: hidden;

  /* @media (width >= 48em) .hubspot-embed__box */
  @media (width >= 48em) {
    margin-left: 0;
    margin-right: 0;
  }
}

/* .hubspot-embed__body — head and form zone over the texture */
.hubspot-embed__body {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--he-zone-gap);
  padding: var(--nv-section-y) 1.25rem;

  /* @media (width >= 48em) .hubspot-embed__body */
  @media (width >= 48em) {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }
}

/* .hubspot-embed__texture — decorative layer under the content */
.hubspot-embed__texture {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* .hubspot-embed__texture-image — texture chosen in the admin fills the card */
.hubspot-embed__texture-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* .hubspot-embed__texture--default — theme wave (Figma 0746dd, 50 %, lightened as in the frame) over the top of the card:
   D 1401 × 792 from 335 px above the card edge, M 700 × 396 centred from 130 px above;
   the edges fade out through a mask, so the card gradient shows through */
.hubspot-embed__texture--default {
  /* .hubspot-embed__texture--default::before */
  &::before {
    content: "";
    position: absolute;
    inset: -8.125rem auto auto 50%;
    width: 43.75rem;
    height: 24.75rem;
    translate: -50% 0;
    background: url("../../img/card-grid-texture.webp") 50% 50% / 100% 100% no-repeat;
    opacity: 0.5;
    filter: brightness(1.19) saturate(0.83);
    mask-image: radial-gradient(ellipse farthest-side at 50% 50%, #000 45%, transparent 100%);

    /* @media (width >= 48em) .hubspot-embed__texture--default::before */
    @media (width >= 48em) {
      inset: -20.9375rem auto auto 50%;
      width: 87.5625rem;
      height: 49.5rem;
    }
  }
}

/* .hubspot-embed__head */
.hubspot-embed__head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(1.875rem, 1.4306rem + 1.8957vw, 3.125rem);
  text-align: center;
}

/* .hubspot-embed__eyebrow — green label with a rhomb, 10 px around the cap height as in Figma Frame 20 */
.hubspot-embed__eyebrow {
  display: inline-flex;
  max-width: 100%;
  overflow-wrap: anywhere;
  align-items: flex-start;
  gap: 0.3125rem;
  padding: calc(0.625rem - 0.14em) 0;
  color: var(--nv-green);
  font-weight: 500;
  font-size: var(--nv-fs-eyebrow);
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;

  /* @media (width >= 64.0625em) .hubspot-embed__eyebrow */
  @media (width >= 64.0625em) {
    letter-spacing: 0.1em;
  }

  /* .hubspot-embed__eyebrow::before — rhomb */
  &::before {
    content: "";
    flex-shrink: 0;
    width: 0.53rem;
    height: 0.53rem;
    margin-top: calc(0.5lh - 0.265rem);
    background: url("../../img/icons/rhomb.svg") center / contain no-repeat;
  }
}

/* .hubspot-embed__title — 40 → 90 px, 1160 px wide (12.9 em) so it breaks into 3 lines on desktop;
   line box trimmed to cap / baseline */
.hubspot-embed__title {
  max-width: 12.9em;
  margin-top: -0.14em;
  margin-bottom: -0.14em;
  color: var(--nv-navy);
  font-weight: 400;
  font-size: var(--nv-fs-h2);
  line-height: 1;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;

  /* @media (width >= 48em) .hubspot-embed__title */
  @media (width >= 48em) {
    letter-spacing: -0.02em;
  }

  /* any tag from the editor keeps the heading look */
  & > * {
    margin: 0;
    font: inherit;
    letter-spacing: inherit;
  }

  & strong {
    color: var(--nv-green);
    font-weight: inherit;
  }
}

/* .hubspot-embed__subtitle — 20 → 23 px, 40 → 50 px under the heading (head gap 30 → 50 + 10 → 0),
   line box trimmed to cap / baseline, bold text darker (navy 70 % body) */
.hubspot-embed__subtitle {
  max-width: 65.25rem;
  margin-top: calc(clamp(0rem, 0.8472rem - 0.9479vw, 0.625rem) - 0.14em);
  margin-bottom: -0.14em;
  color: rgba(19, 33, 50, 0.7);
  font-size: var(--nv-fs-lead);
  line-height: 1;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;

  & > * {
    margin: 0;
    font: inherit;
    letter-spacing: inherit;
  }

  & > * + * {
    margin-top: 1.25rem;
  }

  & strong {
    color: var(--nv-navy);
    font-weight: 700;
  }
}

/* .hubspot-embed__zone — 926 px (phones: the content width), centred; HubSpot's frame sets the height */
.hubspot-embed__zone {
  width: 100%;
  max-width: 57.875rem;
  margin-left: auto;
  margin-right: auto;
}

/* .hubspot-embed__frame — ConvertSite assessment; its script sets the height to the content.
   The frame document keeps its own space around the white card (measured 2026-11-19: 72 px above,
   80 px below, 16 px at the sides while the card is narrower than its 760 px limit); negative margins
   take that space back, so the card sits 50 px under the head and the section padding stays as in Figma */
.hubspot-embed__frame {
  display: block;
  width: calc(100% + 2rem);
  margin: -4.5rem -1rem -5rem;
  border: 0;
}

/* .hubspot-embed__note — notice for editors when the form ID is missing (visitors never see it) */
.hubspot-embed__note {
  border: 1px dashed var(--nv-blue);
  border-radius: var(--nv-radius-s);
  padding: 1.25rem;
  color: var(--nv-blue);
  font-size: 1rem;
  line-height: 1.4;
  text-align: center;
}
