/**
 * @file
 * UNB CTA blocks and the shared request-info pop-up.
 *
 * Geometry follows the Figma source at its native widths:
 *   mid-post CTA - 1200 x 496, full-bleed
 *   footer CTA   - 1512 x 590, full-bleed
 *   pop-up form  -  677 x 1079
 */

.unb-cta,
.unb-banner,
.unb-endcta,
.unb-modal {
  --unb-black: #000000;
  --unb-white: #ffffff;
  --unb-red: #d72e3a;
  --unb-red-hover: #bb2531;
  --unb-offwhite: #f5f5f5;
  --unb-grey: #d7dedd;
  --unb-field: #edf5f4;
  --unb-head: "Roboto", "Segoe UI", Arial, sans-serif;
  --unb-body: "Outfit", "Roboto", "Segoe UI", Arial, sans-serif;
}

.unb-popform label a,
.unb-popform .form-item a,
.unb-popform .webform-element-description a {
  color: #ff5663;
}

.unb-popform label a:hover,
.unb-popform label a:focus-visible {
  color: #ff8a93;
}

.unb-cta *,
.unb-banner *,
.unb-endcta *,
.unb-modal * {
  box-sizing: border-box;
}

/* ===========================================================================
 * Shared pill buttons (mid-post + footer CTA)
 * ======================================================================== */

.unb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 165px !important;
    /* min-height: 50.5px; */
    padding: 2px 20.9px;
    border: 0;
    border-radius: 100px;
    font-family: var(--unb-head);
    font-size: 17.54px;
    line-height: 40.35px;
    font-weight: 500;
    letter-spacing: 0.2354px;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    filter: drop-shadow(0 0.504px 0.42px rgba(0, 0, 0, 0.1)) drop-shadow(0 3.362px 3.362px rgba(0, 0, 0, 0.2));
    transition: background-color 0.2s ease;
}

.unb-btn--red {
  background: var(--unb-red);
  color: var(--unb-white);
}

.unb-btn--red:hover,
.unb-btn--red:focus-visible {
  background: var(--unb-red-hover);
  color: var(--unb-white);
}

.unb-btn--light {
  background: var(--unb-offwhite);
  color: var(--unb-red);
}

.unb-btn--light:hover,
.unb-btn--light:focus-visible {
  background: #e4e4e4;
  color: var(--unb-red);
}

/* ===========================================================================
 * Mid-post CTA block
 * ======================================================================== */

/* The block has to respond to the width of the column it is dropped into
   (a blog body is often capped at ~800px), not to the viewport. Hence
   container queries rather than media queries below. */
.unb-cta {
  width: 100%;
  background: var(--unb-black);
  container-type: inline-size;
  container-name: unbcta;
  border-radius: 12px;
  /* Clips the photo to the rounded corners. */
  overflow: hidden;
}

.unb-cta__inner {
  position: relative;
  display: flex;
  align-items: stretch;
  min-height: 496px;
  margin: 0 auto;
}

.unb-cta__content {
  flex: 1 1 auto;
  min-width: 0;
  padding: 78px 26px 58px 65px;
}

.unb-cta__title {
  margin-top: 0px !important;
  margin: 0;
  max-width: 533px;
  font-family: var(--unb-head);
  font-size: 42.9px;
  line-height: 47.19px;
  font-weight: 900;
  color: var(--unb-red);
}

.unb-cta__text {
  margin-top: 29px;
  max-width: 533px;
  font-family: var(--unb-head);
  font-size: 16px;
  line-height: 25.74px;
  font-weight: 400;
  color: var(--unb-white);
}

.unb-cta__text p {
  margin: 0 0 17px;
}

.unb-cta__text ul {
  margin: 0;
  padding-left: 32px;
  list-style: disc;
}

.unb-cta__content .unb-btn {
  /* min-width: 100%; */
  /* margin-top: 31px; */
}

.unb-cta__media {
  position: relative;
  flex: 0 1 549px;
  min-width: 380px;
  overflow: hidden;
}

/* The shipped photo is already cropped to the region the Figma fill showed,
   so a plain cover fit reproduces the design at the 549x498 slot. */
.unb-cta__media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
}

.unb-cta__frame {
  border-radius:12px;
  position: absolute;
  inset: 35px 41px 35px 27px;
  border: 3px solid var(--unb-white);
  pointer-events: none;
}

@container unbcta (max-width: 1279px) {
  .unb-cta__content {
    padding: 60px 24px 48px 40px;
  }

  .unb-cta__title {
    font-size: 36px;
    line-height: 41px;
  }
}

@container unbcta (max-width: 1023px) {
  .unb-cta__inner {
    flex-direction: column;
    min-height: 0;
  }

  .unb-cta__content {
    flex: 0 0 auto;
    padding: 56px 40px 48px;
  }

  /* Stacked: show the whole photo at its own aspect ratio, uncropped. */
  .unb-cta__media {
    flex: 0 0 auto;
    min-width: 0;
    height: auto;
  }

  .unb-cta__media img {
    height: auto;
    object-fit: fill;
  }

  .unb-cta__frame {
    inset: 20px;
  }
}

@container unbcta (max-width: 599px) {
  .unb-cta__content {
    padding: 40px 28px 36px;
  }

  .unb-cta__title {
    font-size: 30px;
    line-height: 34px;
  }

  .unb-cta__text {
    margin-top: 20px;
    font-size: 17px;
    line-height: 23px;
  }

  .unb-cta__content .unb-btn {
    width: 100%;
    min-width: 0;
    font-size: 19px;
  }

  .unb-cta__frame {
    inset: 12px;
    border-width: 2px;
  }
}

/* ===========================================================================
 * End-of-post / footer CTA block
 * ======================================================================== */

.unb-endcta {
  border-radius: 12px;
  width: 100%;
  background: var(--unb-black);
  container-type: inline-size;
  container-name: unbendcta;
}

.unb-endcta__inner {
  position: relative;
  min-height: 590px;
  padding: 126px 72px 102px;
  text-align: center;
}

.unb-endcta__title {
  margin-top: 0px !important;
  margin: 0 auto;
  max-width: 1144px;
  font-family: var(--unb-head);
  font-size: 60px;
  line-height: 54.12px;
  font-weight: 900;
  color: var(--unb-white);
}

.unb-endcta__lead,
.unb-endcta__note {
  margin: 0 auto;
  font-family: var(--unb-head);
  font-size: 36px;
  line-height: 40px;
  font-weight: 400;
  color: var(--unb-white);
}

.unb-endcta__lead {
  margin-top: 36px;
  max-width: 1094px;
}

.unb-endcta__note {
  margin-top: 43px;
  max-width: 1218px;
}

.unb-endcta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 66px;
  margin-top: 48px;

}

.unb-endcta__frame {
  border-radius: 12px;
  position: absolute;
  inset: 38px 31px;
  border: 3px solid var(--unb-white);
  pointer-events: none;
}

@container unbendcta (max-width: 1279px) {
  .unb-endcta__inner {
    padding: 90px 56px 72px;
  }

  .unb-endcta__title {
    font-size: 48px;
    line-height: 54px;
  }

  .unb-endcta__lead,
  .unb-endcta__note {
    margin-top: 28px;
    font-size: 28px;
    line-height: 36px;
  }

  .unb-endcta__actions {
    gap: 40px;
    margin-top: 40px;
  }
}

@container unbendcta (max-width: 767px) {
  .unb-endcta__inner {
    min-height: 0;
    padding: 56px 32px;
  }

  .unb-endcta__title {
    font-size: 32px;
    line-height: 38px;
  }

  .unb-endcta__lead,
  .unb-endcta__note {
    margin-top: 20px;
    font-size: 16px;
    line-height: 27px;
  }

  .unb-endcta__actions {
    flex-direction: row;
    align-items: stretch;
    gap: 16px;
    margin-top: 32px;
  }

  /* Side by side on small screens, so split the row evenly instead of
     letting each button size to its own label. */
  .unb-endcta__actions .unb-btn {
   
    min-width: 0;
    /* padding: 10px 24px; */
    font-size: 19px;
  }

  .unb-endcta__frame {
    inset: 16px;
    border-width: 2px;
  }
}

/* ===========================================================================
 * Background-image CTA block
 * ======================================================================== */

.unb-banner {
  position: relative;
  width: 100%;
  background: var(--unb-black);
  container-type: inline-size;
  container-name: unbbanner;
  border-radius: 12px;
  /* Clips the background photo to the rounded corners. */
  overflow: hidden;
}

.unb-banner__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.unb-banner__media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center 25%;
  opacity: 0.3;
  pointer-events: none;
}

.unb-banner__inner {
  position: relative;
  min-height: 496px;
  padding: 78px 65px 58px;
}

.unb-banner__title {
  margin: 0;
  max-width: 640px;
  font-family: var(--unb-head);
  font-size: 42.9px;
  line-height: 47.19px;
  font-weight: 900;
  color: var(--unb-white);
}

.unb-banner__text {
  margin-top: 30px;
  max-width: 640px;
  font-family: var(--unb-head);
  font-size: 16px;
  line-height: 25.74px;
  font-weight: 400;
  color: var(--unb-white);
}

.unb-banner__text p {
  margin: 0 0 17px;
}

.unb-banner__text ul {
  margin: 0;
  padding-left: 32px;
  list-style: disc;
}

/* Width comes from .unb-btn, shared with the other blocks. */
.unb-banner__inner .unb-btn {
  /* margin-top: 31px; */
}

.unb-banner__frame {
  border-radius: 12px;
  position: absolute;
  inset: 35px 41px 35px 27px;
  border: 3px solid var(--unb-white);
  pointer-events: none;
}

@container unbbanner (max-width: 1279px) {
  .unb-banner__inner {
    padding: 60px 40px 48px;
  }

  .unb-banner__title {
    font-size: 36px;
    line-height: 41px;
  }
}

@container unbbanner (max-width: 1023px) {
  .unb-banner__inner {
    min-height: 0;
    padding: 56px 40px 48px;
  }

  .unb-banner__title {
    font-size: 36px;
    line-height: 41px;
  }

  .unb-banner__frame {
    inset: 20px;
  }
}

@container unbbanner (max-width: 599px) {
  .unb-banner__inner {
    padding: 40px 28px 36px;
  }

  .unb-banner__title {
    font-size: 30px;
    line-height: 34px;
  }

  .unb-banner__text {
    margin-top: 20px;
    font-size: 17px;
    line-height: 23px;
  }

  .unb-banner__inner .unb-btn {
    width: 100%;
    min-width: 0;
    font-size: 19px;
  }

  .unb-banner__frame {
    inset: 12px;
    border-width: 2px;
  }
}

/* ===========================================================================
 * Request-info pop-up
 *
 * Sizes live in custom properties so the viewport-height tiers only have to
 * override the values once. Both the built-in markup and a Webform rendered
 * inside the dialog read the same properties.
 * ======================================================================== */

/* position/inset/margin are set explicitly: a theme that styles bare
   <dialog> with `inset: 0` would otherwise break the browser's own
   centering and pin the panel to the top-left corner. */
.unb-modal {
  position: fixed;
  inset: 0;
  width: min(677px, calc(100vw - 32px));
  max-width: none;
  height: fit-content;
  max-height: 92vh;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.unb-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
}

/* Fallback for the no-JS path: a dialog without [open] stays hidden. */
.unb-modal:not([open]) {
  display: none;
}

.unb-modal__panel {
  position: relative;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--unb-black);
  /* Scroll without showing a scrollbar over the panel. */
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.unb-modal__panel::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.unb-modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--unb-white);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.unb-modal__close:hover,
.unb-modal__close:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}

body.unb-modal-open {
  overflow: hidden;
}

/* --- the form itself --- */

.unb-popform {
  --pf-pad: 94px 108px 104px;
  --pf-title: 44px;
  --pf-title-lh: 47.188px;
  --pf-sub-mt: 24px;
  --pf-divider-mt: 35px;
  --pf-form-mt: 51.7px;
  --pf-field-gap: 20.71px;
  --pf-label: 32px;
  --pf-label-lh: 1.26;
  --pf-input-h: 57.62px;
  --pf-input-mt: 5.762px;
  --pf-input-font: 20px;
  --pf-submit-h: 59px;
  --pf-submit-mt: 44.27px;
  --pf-submit-font: 22px;
  --pf-submit-lh: 26.4px;

  padding: var(--pf-pad);
  font-family: var(--unb-body);
}

.unb-popform__title,
.unb-popform__subtitle {
  margin: 0;
  max-width: 444px;
  font-family: var(--unb-head);
  font-size: var(--pf-title);
  line-height: var(--pf-title-lh);
  font-weight: 900;
  text-align: center;
  color: var(--unb-white);
}

.unb-popform__subtitle {
  margin-top: var(--pf-sub-mt);
}

.unb-popform__divider {
  display: block;
  margin-top: var(--pf-divider-mt);
  max-width: 100%;
  height: auto;
}

.unb-popform__form,
.unb-popform .webform-submission-form {
  margin-top: var(--pf-form-mt);
}

/* Field rows: .unb-field is the built-in markup, .form-item is Drupal's. */
.unb-popform .unb-field + .unb-field,
.unb-popform .form-item + .form-item,
.unb-popform .js-form-item + .js-form-item {
  margin-top: var(--pf-field-gap);
}

.unb-popform .form-item,
.unb-popform .js-form-item {
  margin-bottom: 0;
}

/* Labels */
.unb-popform .unb-field__label,
.unb-popform .form-item label,
.unb-popform .js-form-item label {
  display: block;
  margin: 0;
  font-family: var(--unb-body);
  font-size: var(--pf-label);
  line-height: var(--pf-label-lh);
  font-weight: 400;
  color: var(--unb-white);
}

.unb-popform label.form-required::after,
.unb-popform .form-required::after,
.unb-popform .webform-element-description::after {  
  content: "*";
  margin-left: 2px;
  color: #ff5663;
}

/* Inputs */
.unb-popform .unb-field__input,
.unb-popform input[type="text"],
.unb-popform input[type="email"],
.unb-popform input[type="tel"],
.unb-popform input[type="url"],
.unb-popform input[type="number"],
.unb-popform input[type="date"],
.unb-popform input[type="password"],
.unb-popform select,
.unb-popform textarea {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  height: var(--pf-input-h);
  margin-top: var(--pf-input-mt);
  padding: 11.524px;
  border: 0;
  border-radius: 6px;
  background: var(--unb-field);
  font-family: var(--unb-body);
  font-size: var(--pf-input-font);
  line-height: normal;
  color: var(--unb-black);
}

.unb-popform textarea {
  height: auto;
  min-height: calc(var(--pf-input-h) * 2);
  resize: vertical;
}

.unb-popform .unb-field__input:focus-visible,
.unb-popform input:focus-visible,
.unb-popform select:focus-visible,
.unb-popform textarea:focus-visible {
  outline: 2px solid var(--unb-red);
  outline-offset: 2px;
}

/* Descriptions, errors and other Webform chrome */
.unb-popform .description,
.unb-popform .form-item__description,
.unb-popform .webform-element-description {
  /* margin-top: 6px; */
  font-size: 0.8em;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.7);
}

.unb-popform .form-item--error-message,
.unb-popform .messages--error {
  margin-top: 6px;
  font-size: 0.85em;
  line-height: 1.4;
  color: #ff9ba2;
}

.unb-popform .unb-popform__status {
  margin: 20px 0 0;
  font-size: 18px;
  line-height: 24px;
  color: var(--unb-white);
}

/* Inline confirmation: Webform swaps this in where the form was, so it has
   to read on the dark panel rather than on the theme's own light one. */
.unb-popform .webform-confirmation {
  margin-top: var(--pf-form-mt);
  color: var(--unb-white);
}

.unb-popform .webform-confirmation__message {
  font-size: var(--pf-input-font);
  line-height: 1.5;
  color: var(--unb-white);
}

.unb-popform .webform-confirmation__message :first-child {
  margin-top: 0;
}

.unb-popform .webform-confirmation__message :last-child {
  margin-bottom: 0;
}

.unb-popform .webform-confirmation a {
  color: #ff5663;
}

/* Webform's "Back to form" link, when that setting is on. */
.unb-popform .webform-confirmation__back {
  margin-top: 20px;
}

/* Submit. The configured webform is a wizard, so this row can hold
   Previous/Next as well as a final Submit. */
.unb-popform .form-actions,
.unb-popform .webform-actions {
  display: flex;
  gap: 12px;
  margin: 0;
}

.unb-popform .form-actions input[type="submit"],
.unb-popform .form-actions button[type="submit"],
.unb-popform .webform-actions input[type="submit"],
.unb-popform .webform-actions button[type="submit"] {
  flex: 1 1 0;
  min-width: 0;
}

.unb-popform .webform-button--previous {
  background: var(--unb-offwhite);
  color: var(--unb-red);
}

.unb-popform .webform-button--previous:hover,
.unb-popform .webform-button--previous:focus-visible {
  background: #e4e4e4;
  color: var(--unb-red);
}

/* Ajax wrapper must not introduce its own spacing. */
.unb-popform .webform-ajax-form-wrapper {
  margin: 0;
}

.unb-popform__submit,
.unb-popform input[type="submit"],
.unb-popform button[type="submit"] {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: var(--pf-submit-h);
  margin-top: var(--pf-submit-mt);
  padding: 11.524px;
  border: 0;
  border-radius: 6px;
  background: var(--unb-red);
  font-family: var(--unb-body);
  font-size: var(--pf-submit-font);
  line-height: var(--pf-submit-lh);
  font-weight: 400;
  color: var(--unb-white);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.unb-popform__submit:hover,
.unb-popform__submit:focus-visible,
.unb-popform input[type="submit"]:hover,
.unb-popform input[type="submit"]:focus-visible,
.unb-popform button[type="submit"]:hover,
.unb-popform button[type="submit"]:focus-visible {
  background: var(--unb-red-hover);
}

/* The Figma panel is 677 x 1079, which only fits very tall viewports. Each
   tier below shrinks the panel so the whole form stays reachable without
   scrolling inside the dialog. */
@media (max-height: 1120px) {
  .unb-modal {
    width: min(560px, calc(100vw - 32px));
  }

  .unb-popform {
    --pf-pad: 48px 56px 56px;
    --pf-title: 28px;
    --pf-title-lh: 32px;
    --pf-sub-mt: 12px;
    --pf-divider-mt: 20px;
    --pf-form-mt: 24px;
    --pf-field-gap: 12px;
    --pf-label: 20px;
    --pf-input-h: 44px;
    --pf-input-mt: 4px;
    --pf-input-font: 16px;
    --pf-submit-h: 48px;
    --pf-submit-mt: 22px;
    --pf-submit-font: 18px;
    --pf-submit-lh: 24px;
  }

  .unb-popform .unb-popform__status {
    margin-top: 14px;
    font-size: 15px;
    line-height: 20px;
  }
}

/* Laptop screens. */
@media (max-height: 820px) {
  .unb-modal {
    width: min(500px, calc(100vw - 32px));
  }

  .unb-popform {
    --pf-pad: 36px 40px 44px;
    --pf-title: 24px;
    --pf-title-lh: 28px;
    --pf-sub-mt: 10px;
    --pf-divider-mt: 16px;
    --pf-form-mt: 20px;
    --pf-field-gap: 10px;
    --pf-label: 17px;
    --pf-input-h: 40px;
    --pf-input-mt: 3px;
    --pf-input-font: 15px;
    --pf-submit-h: 44px;
    --pf-submit-mt: 18px;
    --pf-submit-font: 17px;
    --pf-submit-lh: 22px;
  }

  .unb-modal__close {
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
  }
}

/* Very short windows (a laptop with several toolbars open). */
@media (max-height: 620px) {
  .unb-modal {
    width: min(460px, calc(100vw - 32px));
  }

  .unb-popform {
    --pf-pad: 28px 32px 32px;
    --pf-title: 21px;
    --pf-title-lh: 25px;
    --pf-sub-mt: 8px;
    --pf-divider-mt: 12px;
    --pf-form-mt: 16px;
    --pf-field-gap: 8px;
    --pf-label: 15px;
    --pf-input-h: 34px;
    --pf-input-mt: 2px;
    --pf-input-font: 14px;
    --pf-submit-h: 38px;
    --pf-submit-mt: 14px;
    --pf-submit-font: 15px;
    --pf-submit-lh: 20px;
  }
}

@media (max-width: 676px) {
  .unb-popform {
    --pf-pad: 56px 24px 64px;
    --pf-title: 28px;
    --pf-title-lh: 32px;
    --pf-label: 20px;
    --pf-input-h: 48px;
    --pf-input-font: 16px;
    --pf-submit-h: 52px;
    --pf-submit-font: 18px;
    --pf-submit-lh: 24px;
  }
}

/* Fallback for browsers without container queries (pre-2023). They lose the
   narrow-column layout, but still stack on small screens. */
@supports not (container-type: inline-size) {
  @media (max-width: 1023px) {
    .unb-cta__inner {
      flex-direction: column;
      min-height: 0;
    }

    .unb-cta__content {
      flex: 0 0 auto;
      padding: 48px 48px 48px;
    }

    .unb-cta__media {
      flex: 0 0 auto;
      min-width: 0;
      height: auto;
    }

    .unb-cta__media img {
      height: auto;
      object-fit: fill;
    }

    .unb-cta__frame {
      inset: 20px;
    }

    .unb-endcta__inner {
      min-height: 0;
      padding: 56px 32px;
    }

    .unb-endcta__title {
      font-size: 32px;
      line-height: 38px;
    }

    .unb-endcta__lead,
    .unb-endcta__note {
      margin-top: 20px;
      font-size: 16px;
      line-height: 27px;
    }

    .unb-endcta__actions {
      flex-direction: row;
      align-items: stretch;
      gap: 16px;
      margin-top: 32px;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .unb-btn,
  .unb-modal__close,
  .unb-popform__submit {
    transition: none;
  }
}
@container unbendcta (max-width: 400px) {
    .unb-endcta__actions {
        flex-direction: column;
        align-items: stretch;
        gap: 16px;
        margin-top: 32px;
    }
  }
  .webform-submission-form .webform-button--previous {
    display: none !important;
  }