/* Google Preferred Source.
   Do not restyle the official button. Light theme on paper.
   Footer is site-wide. Other slots are blog-only. */

.footer .footer-sections:has(.bl-preferred-source) {
  align-items: flex-start;
  gap: 32px 24px;
}

.footer .footer-sections:has(.bl-preferred-source) > .footer-section {
  width: auto;
  flex: 1 1 150px;
  min-width: 150px;
}

.footer .footer-section.bl-preferred-source {
  flex: 0 1 220px;
  min-width: 200px;
  max-width: 240px;
  gap: 16px;
}

.bl-ps-fallback,
.footer .bl-preferred-source-fallback {
  display: inline-block;
  line-height: 0;
}

.bl-ps-fallback img,
.footer .bl-preferred-source-fallback img {
  width: 200px;
  height: auto;
}

.bl-preferred-source:has([google-add-preferred-source-btn]:not(:empty)) .bl-ps-fallback,
.bl-preferred-source:has([google-add-preferred-source-btn]:not(:empty)) .bl-preferred-source-fallback,
.bl-ps-rail:has([google-add-preferred-source-btn]:not(:empty)) .bl-ps-fallback,
.bl-ps-after:has([google-add-preferred-source-btn]:not(:empty)) .bl-ps-fallback {
  display: none;
}

.bl-ps-kicker {
  font-family: "IBM Plex Sans", "Source Sans 3", sans-serif;
  font-size: 15px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: -0.15px;
  color: #041122;
  margin: 0 0 6px;
}

.bl-ps-copy {
  font-family: "Source Sans 3", sans-serif;
  font-size: 14px;
  line-height: 20px;
  color: #061d3c;
  margin: 0 0 12px;
}

/* Right rail — old CTA column. Sticky while they read. */
.bl-ps-rail {
  display: none;
}

@media (min-width: 1280px) {
  .bl-ps-rail {
    display: block;
    grid-column: 3;
    position: sticky;
    top: 96px;
    align-self: start;
    /* Official PL iframe wraps in a sidebar. Rail uses the
       200px PNG — that badge is the designed pill. */
    padding: 16px 14px 18px;
    overflow: visible;
    background: #f3f1ef;
    border-radius: 16px;
    transition: opacity 0.2s ease;
  }

  /* Meeting ask sits above Preferred Source. Gold pill, wraps. */
  .bl-ps-meet {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    margin: 0 0 16px;
    padding: 10px 14px;
    background: #f9dc44;
    border: 1px solid #f9dc44;
    border-radius: 48px;
    color: #041122;
    font-family: "Source Sans 3", sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 20px;
    letter-spacing: -0.15px;
    text-align: center;
    text-decoration: none;
  }

  .bl-ps-meet:hover,
  .bl-ps-meet:focus-visible {
    background: #e2bf07;
    border-color: #e2bf07;
    color: #041122;
  }

  .bl-ps-rail .bl-ps-fallback,
  .bl-ps-rail .bl-ps-fallback img {
    display: block;
    width: 200px;
    max-width: 100%;
    height: auto;
  }

  .bl-ps-rail.is-away {
    opacity: 0;
    pointer-events: none;
  }
}

/* Finished the piece. Same width as the article column. */
.bl-ps-after {
  margin: 8px 0 16px;
  padding: 24px 28px;
  background: #f3f1ef;
  border-radius: 16px;
  border-left: 3px solid #f0c400;
}

/* Phone: they are leaving without a mouse. This bar is that moment. */
.bl-ps-sticky {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 9000;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: #041122;
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 28px rgb(4 17 34 / 0.28);
}

.bl-ps-sticky[hidden] {
  display: none;
}

.bl-ps-sticky .bl-ps-copy {
  color: #e8eef5;
  margin: 0;
  flex: 1;
  min-width: 0;
}

.bl-ps-sticky .bl-ps-fallback img {
  width: 168px;
}

.bl-ps-close,
.bl-ps-text-close {
  font: inherit;
  cursor: pointer;
  background: transparent;
  border: 0;
}

.bl-ps-close {
  width: 36px;
  height: 36px;
  color: #fff;
  font-size: 24px;
  line-height: 1;
}

.bl-ps-text-close {
  display: block;
  margin-top: 12px;
  color: #8e7a0e;
  font-weight: 600;
  font-size: 15px;
}

.bl-ps-exit {
  position: fixed;
  inset: 0;
  z-index: 11000;
  background: rgb(4 17 34 / 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.bl-ps-exit[hidden] {
  display: none;
}

.bl-ps-exit-card {
  width: min(28rem, 100%);
  padding: 28px 28px 22px;
  background: #fff;
  border-radius: 16px;
}

@media (min-width: 1280px) {
  .bl-ps-sticky {
    display: none !important;
  }
}

@media screen and (max-width: 1024px) {
  .footer .footer-sections:has(.bl-preferred-source) > .footer-section {
    width: 50%;
    flex: 1 1 42%;
  }

  .footer .footer-section.bl-preferred-source {
    width: 100%;
    flex: 1 1 100%;
    max-width: none;
  }
}

@media screen and (max-width: 768px) {
  /* Theme .mobile-fixed-button is ~84px off the bottom. JS lifts further. */
  .bl-ps-sticky {
    bottom: calc(108px + env(safe-area-inset-bottom, 0px));
  }
}

@media screen and (max-width: 479px) {
  /* Column + wrap treats the tall Google widget as the wrap
     line. The other four sections walk sideways and the
     whole page pans on iPhone. */
  .footer .footer-sections,
  .footer .footer-sections:has(.bl-preferred-source) {
    flex-direction: column;
    flex-wrap: nowrap;
    height: auto;
    max-width: 100%;
  }

  .footer .footer-sections:has(.bl-preferred-source) > .footer-section,
  .footer .footer-section.bl-preferred-source {
    width: 100%;
    flex: 0 0 auto;
    min-width: 0;
    max-width: 100%;
  }

  .bl-ps-sticky {
    flex-wrap: wrap;
  }

  .bl-ps-after {
    padding: 20px;
  }
}
