/* =========================================================
   CFPK Hero Banner V3
   Mobile-first. Split desktop layout kicks in at 992px.

   The heading is always:
     <h1 class="hero-title">
       <span class="hero-eyebrow">…</span>
       <span class="hero-headline">…</span>
     </h1>
   Mobile order is eyebrow → rating → headline. The rating is not
   inside the H1, so the content box is a grid and the H1 is a row
   subgrid spanning rows 1–3: the eyebrow takes row 1, the headline
   row 3, and the rating drops into row 2 between them.
   ========================================================= */

.cfpk-hero {
  /* Fallbacks only — live values come from the inline style attribute */
  --cfpk-hero-panel-bg: #0A3E72;
  --cfpk-hero-text: #FFFFFF;
  --cfpk-hero-accent: #F9550F;
  --cfpk-hero-accent-contrast: #FFFFFF;
  --cfpk-hero-min-h: 586px;
  --cfpk-hero-radius: 20px;
  --cfpk-hero-cut: 150px;
  --cfpk-hero-pos-desktop: center;
  --cfpk-hero-pos-mobile: center;
  --cfpk-hero-scrim: 40;
  --cfpk-hero-gradient: 1;

  --cfpk-hero-font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --cfpk-hero-gutter: 24px;      /* mobile side padding inside the card */
  --cfpk-hero-measure: 460px;    /* mobile max content width */

  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 0 20px;
  background: #FFFFFF;
  font-family: var(--cfpk-hero-font);
  -webkit-font-smoothing: antialiased;
}

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

.cfpk-hero__inner {
  position: relative;
  max-width: 1400px;
  margin: 0 auto;
  overflow: hidden;
  border-radius: 10px;
  isolation: isolate;
}

/* ---------- Media ---------- */

.cfpk-hero__media {
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--cfpk-hero-panel-bg);
}

.cfpk-hero__picture {
  position: absolute;
  inset: 0;
  display: block;
}

.cfpk-hero__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--cfpk-hero-pos-mobile);
}

.cfpk-hero__scrim {
  position: absolute;
  inset: 0;
  display: block;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(4, 28, 53, 0.55) 0%, rgba(4, 28, 53, 0.85) 100%);
  opacity: calc(var(--cfpk-hero-scrim) / 100);
}

/* ---------- Panel (mobile) ---------- */

.cfpk-hero__panel {
  position: relative;
  z-index: 1;
  padding: 0 0 100px;
}

.cfpk-hero--no-eyebrow .cfpk-hero__panel {
  padding-top: 64px;
}

/* Full-width grid so the eyebrow bar can run edge to edge; every other
   row is held to the mobile measure and centred. */
.cfpk-hero__content {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  row-gap: 32px;
  justify-items: center;
  color: var(--cfpk-hero-text);
}

.cfpk-hero__content > *,
.cfpk-hero .hero-headline {
  grid-column: 1;
}

.cfpk-hero .hero-headline,
.cfpk-hero__copy,
.cfpk-hero__actions {
  width: min(100% - (var(--cfpk-hero-gutter) * 2), var(--cfpk-hero-measure));
}

/* ---------- Heading ---------- */

.cfpk-hero .hero-title {
  display: grid;
  grid-column: 1;
  grid-row: 1 / span 3;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: subgrid;
  justify-items: center;
  width: 100%;
  margin: 0;
  padding: 0;
  font-family: var(--cfpk-hero-font);
  font-size: inherit;
  line-height: inherit;
  text-align: center;
}

.cfpk-hero .hero-title,
.cfpk-hero .hero-title span {
  color: var(--cfpk-hero-text) !important;
}

/* Eyebrow — mobile: full-width bar across the top of the card */
.cfpk-hero .hero-eyebrow {
  display: block;
  grid-row: 1;
  width: 100%;
  margin-bottom: 32px;          /* 32 row gap + 32 = 64px to the rating */
  padding: 19px 24px;
  background: var(--cfpk-hero-panel-bg);
  font-family: var(--cfpk-hero-font);
  font-weight: 600;
  font-size: clamp(14px, 3.7vw, 16px); /* with 24px side padding, keeps the default eyebrow on one line down to ~370px */
  line-height: 24px;
  letter-spacing: 0;
  text-align: center;
  text-wrap: balance;
}

.cfpk-hero .hero-headline {
  display: block;
  grid-row: 3;
  font-family: var(--cfpk-hero-font);
  font-weight: 700;
  font-size: clamp(28px, 8.2vw, 36px);
  line-height: 1.222;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

/* No eyebrow: rating then headline */
.cfpk-hero--no-eyebrow .hero-title {
  grid-row: 2;
  display: block;
}

.cfpk-hero--no-eyebrow .cfpk-hero__trust {
  grid-row: 1;
}

.cfpk-hero--no-eyebrow.cfpk-hero--no-trust .hero-title {
  grid-row: 1;
}

/* Rating hidden: let the headline follow the eyebrow directly */
.cfpk-hero--no-trust:not(.cfpk-hero--no-eyebrow) .hero-title {
  grid-row: 1 / span 2;
}

.cfpk-hero--no-trust:not(.cfpk-hero--no-eyebrow) .hero-headline {
  grid-row: 2;
}

/* ---------- Trust row ---------- */

.cfpk-hero__trust {
  position: relative;            /* sits above the H1's grid area */
  z-index: 1;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--cfpk-hero-text);
  text-decoration: none;
}

a.cfpk-hero__trust--link:hover .cfpk-hero__trust-rating,
a.cfpk-hero__trust--link:focus-visible .cfpk-hero__trust-rating {
  text-decoration: underline;
}

.cfpk-hero__trust-logo {
  display: block;
  flex: 0 0 auto;
  width: 29px;
  height: 29px;
  line-height: 0;
}

.cfpk-hero__trust-logo svg,
.cfpk-hero__trust-logo img {
  display: block;
  width: 29px;
  height: 29px;
  border-radius: 50%;
}

.cfpk-hero__trust-rating {
  font-family: var(--cfpk-hero-font);
  font-weight: 600;
  font-size: 16px;
  line-height: 24px;
  color: var(--cfpk-hero-text);
  white-space: nowrap;
}

.cfpk-hero__stars {
  display: flex;
  align-items: center;
  gap: 4px;
  color: #FEC84B;
}

.cfpk-hero__star {
  display: block;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
}

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

.cfpk-hero .cfpk-hero__copy,
.cfpk-hero .cfpk-hero__copy p,
.cfpk-hero .cfpk-hero__copy span,
.cfpk-hero .cfpk-hero__copy li {
  color: var(--cfpk-hero-text) !important;
}

.cfpk-hero__copy {
  margin-top: -12px;             /* 20px under the headline, as in v2 */
  text-align: center;
}

.cfpk-hero__copy,
.cfpk-hero__copy p {
  margin-bottom: 0;
  font-family: var(--cfpk-hero-font);
  font-weight: 400;
  font-size: 16px;
  line-height: 26px;
}

.cfpk-hero__copy p {
  margin-top: 0;
}

.cfpk-hero__copy p + p {
  margin-top: 12px;
}

.cfpk-hero__copy a {
  color: inherit;
  text-decoration: underline;
}

/* Matches the approved mobile design: heading + buttons only */
.cfpk-hero__copy--desktop-only {
  display: none;
}

/* ---------- Buttons ---------- */

.cfpk-hero__actions {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 20px;
}

.cfpk-hero__btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 48px !important;
  min-height: 48px !important;
  max-height: 48px !important;
  padding: 12px 20px !important;
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  font-family: var(--cfpk-hero-font) !important;
  font-weight: 600 !important;
  font-size: 16px !important;
  line-height: 24px !important;
  letter-spacing: 0 !important;
  text-align: center;
  text-decoration: none !important;
  text-transform: none !important;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.cfpk-hero__btn-label {
  display: block;
}

.cfpk-hero__btn--primary,
.cfpk-hero__btn--primary:visited {
  background-color: var(--cfpk-hero-accent) !important;
  border-color: var(--cfpk-hero-accent) !important;
  color: var(--cfpk-hero-accent-contrast) !important;
}

.cfpk-hero__btn--primary:hover,
.cfpk-hero__btn--primary:focus-visible,
.cfpk-hero__btn--primary:active {
  background-color: var(--cfpk-hero-accent-contrast) !important;
  border-color: var(--cfpk-hero-accent) !important;
  color: var(--cfpk-hero-accent) !important;
}

.cfpk-hero__btn--ghost,
.cfpk-hero__btn--ghost:visited {
  background-color: #FFFFFF !important;
  border-color: var(--cfpk-hero-accent) !important;
  color: var(--cfpk-hero-accent) !important;
}

/* #FFDCCD is the accent tint from the design; override
   --cfpk-hero-accent-soft if the accent colour is changed. */
.cfpk-hero__btn--ghost:hover,
.cfpk-hero__btn--ghost:focus-visible,
.cfpk-hero__btn--ghost:active {
  background-color: var(--cfpk-hero-accent-soft, #FFDCCD) !important;
  border-color: var(--cfpk-hero-accent) !important;
  color: var(--cfpk-hero-accent) !important;
}

.cfpk-hero__arrow {
  display: block;
  flex: 0 0 auto;
  width: 22px;
  height: 11px;
  color: inherit;
}

.cfpk-hero__btn-icon {
  display: block;
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  color: inherit;
}

.cfpk-hero__btn:focus-visible,
.cfpk-hero__trust--link:focus-visible {
  outline: 3px solid #FFFFFF;
  outline-offset: 3px;
}

/* Browsers without subgrid (pre-2023): the H1 stays one block, so the
   order becomes eyebrow → headline → rating. Markup is unchanged. */
@supports not (grid-template-rows: subgrid) {
  .cfpk-hero .hero-title {
    display: block;
    grid-row: 1;
  }
  .cfpk-hero .hero-eyebrow {
    margin-bottom: 64px;
  }
  .cfpk-hero .hero-headline {
    margin: 0 auto;
  }
  .cfpk-hero__trust {
    grid-row: auto;
  }
}

/* =========================================================
   Desktop split layout
   ========================================================= */

@media (min-width: 992px) {
  .cfpk-hero {
    margin-top: 20px;
  }

  .cfpk-hero__inner {
    display: grid;
    grid-template-columns: minmax(0, 865fr) minmax(0, 536fr);
    align-items: stretch;
    min-height: var(--cfpk-hero-min-h);
    border-radius: var(--cfpk-hero-radius) var(--cfpk-hero-radius) var(--cfpk-hero-cut) var(--cfpk-hero-radius);
  }

  .cfpk-hero__media {
    position: relative;
    inset: auto;
    grid-column: 2;
    grid-row: 1;
    min-height: var(--cfpk-hero-min-h);
  }

  .cfpk-hero__img {
    object-position: var(--cfpk-hero-pos-desktop);
  }

  .cfpk-hero__scrim {
    background: linear-gradient(146.68deg, rgba(0, 0, 0, 0) 66.82%, rgba(0, 0, 0, 0.2) 124.74%);
    opacity: var(--cfpk-hero-gradient);
  }

  /* static so the review badge can anchor to .cfpk-hero__inner */
  .cfpk-hero__panel,
  .cfpk-hero--no-eyebrow .cfpk-hero__panel {
    position: static;
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: center;
    min-height: var(--cfpk-hero-min-h);
    /* 117px left / 90px right at 1401px gives the 658px text column from the design */
    padding: 100px clamp(32px, 6.25vw, 90px) 100px clamp(40px, 8.36vw, 117px);
    background: var(--cfpk-hero-panel-bg);
  }

  .cfpk-hero__content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    max-width: 658px;
  }

  .cfpk-hero .hero-title,
  .cfpk-hero--no-eyebrow .hero-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 48px;
    text-align: left;
  }

  .cfpk-hero .hero-headline,
  .cfpk-hero__copy,
  .cfpk-hero__actions {
    width: auto;
  }

  /* Eyebrow — desktop: plain label with an accent dot */
  .cfpk-hero .hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    margin: 0;
    padding: 0;
    background: none;
    text-align: left;
  }

  .cfpk-hero .hero-eyebrow--dot::before {
    content: "";
    flex: 0 0 auto;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--cfpk-hero-accent);
  }

  .cfpk-hero .hero-headline {
    font-size: clamp(34px, 3.3vw, 46px);
    line-height: 1.13;            /* 52px at 46px */
    letter-spacing: 0;
    text-wrap: pretty;
  }

  .cfpk-hero__copy,
  .cfpk-hero__copy--desktop-only {
    display: block;
    margin-top: 24px;
    text-align: left;
  }

  .cfpk-hero__actions {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 16px;
    width: fit-content;
    max-width: 100%;
    margin-top: 48px;
  }

  /* Review badge — navy pill over the image, centred in the image column */
  .cfpk-hero__trust {
    position: absolute;
    z-index: 2;
    left: calc(100% - (100% * 268 / 1401));
    bottom: 100px;
    transform: translateX(-50%);
    padding: 10px 15px 10px 10px;
    border-radius: 36px;
    background: var(--cfpk-hero-panel-bg);
  }

  .cfpk-hero__trust-rating {
    font-weight: 700;
    line-height: 28px;
  }

  .cfpk-hero__stars {
    gap: 3.62px;
  }

  .cfpk-hero__star {
    width: 18.1px;
    height: 18.1px;
  }

  .cfpk-hero__btn {
    flex: 1 1 auto;
    width: auto;
    height: 62px !important;
    min-height: 62px !important;
    max-height: 62px !important;
    padding: 16px 28px !important;
    font-size: 18px !important;
    line-height: 28px !important;
  }

  .cfpk-hero__btn--primary {
    gap: 20px;
  }

  .cfpk-hero__arrow {
    width: 28px;
    height: 14px;
  }
}

/* =========================================================
   Mobile layout (<992px): 20px gap above the card
   ========================================================= */

@media (max-width: 991px) {
  .cfpk-hero {
    padding-top: 20px;
  }

  /* V2 hero CSS shares this class and caps it at 460px when both modules
     are on a page. Keep the content box (and so the eyebrow bar) the full
     width of the image card; headline, copy and buttons keep their own
     --cfpk-hero-measure cap. */
  .cfpk-hero__content {
    width: 100%;
    max-width: none;
  }

  /* Image starts under the eyebrow bar instead of running behind it.
     62px = 19px padding x2 + one 24px line; module.js replaces it with
     the measured height if the eyebrow wraps. */
  .cfpk-hero {
    --cfpk-hero-bar-h: 62px;
  }

  .cfpk-hero:not(.cfpk-hero--no-eyebrow) .cfpk-hero__media {
    top: var(--cfpk-hero-bar-h);
  }
}

/* =========================================================
   Small phones
   ========================================================= */

@media (max-width: 380px) {
  .cfpk-hero {
    padding-left: 16px;
    padding-right: 16px;
    --cfpk-hero-gutter: 20px;
    --cfpk-hero-bar-h: 56px;      /* 16px padding x2 + 24px line */
  }

  .cfpk-hero__panel {
    padding-bottom: 72px;
  }

  .cfpk-hero .hero-eyebrow {
    padding: 16px 24px;
  }

  .cfpk-hero__btn {
    padding: 12px 14px !important;
    white-space: normal;
  }
}

/* =========================================================
   Motion
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .cfpk-hero__btn {
    transition: none;
  }
}

/* ==================================================================
   Secondary button — video popup
   Values copied from Video Testimonials 2026 V2 so the popup looks
   identical. Class names are hero-specific so the two modules can sit
   on the same page without their styles or scripts colliding.
   ================================================================== */

/* .cfpk-hero__video-trigger carries no styling of its own. It is only ever
   applied alongside .cfpk-hero__btn--ghost, and the bare-<button> reset it
   used to carry (background:transparent; border:none) beat .cfpk-hero__btn
   on source order and stripped the button's 1px border. The JS hook is the
   data-cfpk-hero-video attribute, not this class. */

.cfpk-hero-video-popup {
  background-color: rgba(0, 0, 0, .85);
  height: 100%;
  left: 0;
  opacity: 0;
  overflow-x: hidden;
  overflow-y: scroll;
  padding: 30px 20px;
  position: fixed;
  top: 0;
  transition: opacity .3s ease 0s, visibility 0s ease .3s;
  visibility: hidden;
  width: 100%;
  z-index: 9999;
}

.cfpk-hero-video-popup::-webkit-scrollbar-track {
  border-radius: 0;
}

.cfpk-hero-video-popup::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 0;
}

.cfpk-hero-video-popup.is-visible {
  opacity: 1;
  transition: opacity .3s ease 0s, visibility 0s ease 0s;
  visibility: visible;
}

.cfpk-hero-video-popup__modal {
  display: none;
}

.cfpk-hero-video-popup.is-visible .cfpk-hero-video-popup__modal {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100%;
}

.cfpk-hero-video-popup__overlay {
  position: absolute;
  inset: 0;
}

.cfpk-hero-video-popup__dialog {
  position: relative;
}

.cfpk-hero-video-popup__video-frame video {
  height: calc(100vh - 110px);
  width: 100%;
}

.cfpk-hero-video-popup__modal.as-h .cfpk-hero-video-popup__video-frame video {
  max-height: 506.5px;
}

.cfpk-hero-video-popup__modal.as-v .cfpk-hero-video-popup__video-frame video {
  max-height: 700px;
}

.cfpk-hero-video-popup__close {
  background: #fff;
  border: 0;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  width: 40px;
  padding: 0;
  transition: background .18s ease, transform .18s ease;
  position: absolute;
  top: -20px;
  right: -20px;
  z-index: 1;
}

.cfpk-hero-video-popup__close svg {
  height: 20px;
  width: 20px;
}

.cfpk-hero-video-popup__close svg path {
  stroke: #0a3e72;
}

@media (max-width: 767px) {
  .cfpk-hero-video-popup__modal.as-h .cfpk-hero-video-popup__video-frame video {
    height: auto !important;
  }
}

/* Scoped to this popup rather than any .is-visible element on the page. */
body:has(.cfpk-hero-video-popup.is-visible) {
  overflow: hidden;
}
