/* BP Sidebar Builder 0.2.0 – isolated styles, independent of RealHomes widgets. */
.widget.bp-sidebar-builder-host { background: transparent; }
.bp-sidebar-builder-host .bp-sb-card {
  container: bp-sidebar-card / inline-size;
  font-family: "Open Sans", Arial, sans-serif;
  color: #394041;
  background: #fff;
  margin: 0 0 26px;
  padding: 0 0 15px;
  border: 0;
  box-sizing: border-box;
}
.bp-sidebar-builder-host .bp-sb-card, .bp-sidebar-builder-host .bp-sb-card * { box-sizing: border-box; }
/* Match the clean RealHomes sidebar heading (e.g. Property Collection), not a dark banner. */
.sidebar .widget.bp-sidebar-builder-host .bp-sb-heading,
.bp-sidebar-builder-host .bp-sb-heading {
  display: block;
  background: transparent !important;
  color: #394041 !important;
  border: 0 !important;
  font-family: "Open Sans", Arial, sans-serif !important;
  font-size: 18px !important;
  font-weight: 300 !important;
  line-height: 1.4 !important;
  text-transform: none !important;
  padding: 0 18px !important;
  margin: 0 0 16px !important;
  min-height: 0 !important;
}
.bp-sidebar-builder-host .bp-sb-text {
  min-width: 0;
  padding: 0 18px;
  margin: 0 0 15px;
  color: #394041;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.7;
  overflow-wrap: break-word;
}
.bp-sidebar-builder-host .bp-sb-text p { margin: 0 0 12px; color: inherit; font: inherit; }
.bp-sidebar-builder-host .bp-sb-text p:last-child { margin-bottom: 0; }
/* Images never expand to the whole width of a sidebar moved below the content. */
.bp-sidebar-builder-host .bp-sb-image-wrap {
  width: 100%;
  max-width: 260px;
  margin: 0 0 16px;
}
.bp-sidebar-builder-host .bp-sb-image-wrap a { display: block; }
.bp-sidebar-builder-host img.bp-sb-image {
  display: block;
  width: 100% !important;
  height: auto !important;
  max-width: 100% !important;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  margin: 0;
}
.bp-sidebar-builder-host .bp-sb-action {
  display: flex;
  margin: 15px 0;
  padding: 0 18px;
  min-width: 0;
  align-items: flex-start;
}
.bp-sidebar-builder-host .bp-sb-action--left { justify-content: flex-start; }
.bp-sidebar-builder-host .bp-sb-action--center { justify-content: center; }
.bp-sidebar-builder-host .bp-sb-action--right { justify-content: flex-end; }
.bp-sidebar-builder-host .bp-sb-button,
.bp-sidebar-builder-host .bp-sb-button:visited {
  display: inline-block;
  max-width: 100%;
  padding: 12px 18px;
  border: 1px solid #394041;
  border-radius: 0;
  font-family: "Open Sans", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 500 !important;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
  transition: border-color .18s ease, background-color .18s ease, color .18s ease;
}
/* Brochure / blog style: anthracite outline, orange on hover. */
.bp-sidebar-builder-host .bp-sb-button--outline,
.bp-sidebar-builder-host .bp-sb-button--outline:visited {
  background: transparent !important;
  color: #394041 !important;
  border-color: #394041 !important;
  font-weight: 500 !important;
}
.bp-sidebar-builder-host a.bp-sb-button--outline:hover,
.bp-sidebar-builder-host a.bp-sb-button--outline:focus-visible {
  background: transparent !important;
  color: #394041 !important;
  border-color: #f58220 !important;
  font-weight: 500 !important;
}
/* Search-button style: solid grey with white text. */
.bp-sidebar-builder-host .bp-sb-button--filled,
.bp-sidebar-builder-host .bp-sb-button--filled:visited {
  color: #fff !important;
  background: #595959 !important;
  border-color: #595959 !important;
  font-weight: 300 !important;
}
.bp-sidebar-builder-host a.bp-sb-button--filled:hover,
.bp-sidebar-builder-host a.bp-sb-button--filled:focus-visible {
  color: #fff !important;
  background: #394041 !important;
  border-color: #394041 !important;
  font-weight: 300 !important;
}
/* A pressed Filled button remains anthracite, never orange. */
.bp-sidebar-builder-host a.bp-sb-button--filled:active {
  color: #fff !important;
  background: #313131 !important;
  border-color: #313131 !important;
  font-weight: 300 !important;
}
/* Accessible focus states follow the respective button design. */
.bp-sidebar-builder-host a.bp-sb-button--outline:focus-visible { outline: 2px solid #f58220; outline-offset: 3px; }
.bp-sidebar-builder-host a.bp-sb-button--filled:focus-visible { outline: 2px solid #313131; outline-offset: 3px; }
.bp-sidebar-builder-host .bp-sb-button--disabled { cursor: default; opacity: .55; }
/* Compact editorial module: heading above, then image / text / button. */
.bp-sidebar-builder-host .bp-sb-card--editorial .bp-sb-content { display: block; min-width: 0; }
/* Regular narrow RealHomes sidebar: compact single column. */
.bp-sidebar-builder-host .bp-sb-card--editorial .bp-sb-image-wrap { margin-left: 18px; max-width: min(240px, calc(100% - 36px)); }
/* Wide area (sidebar below content), measured by ACTUAL card width instead of viewport. */
@container bp-sidebar-card (min-width: 540px) {
  .bp-sidebar-builder-host .bp-sb-card--editorial .bp-sb-content {
    display: grid;
    grid-template-columns: minmax(170px, 31%) minmax(0, 1fr);
    grid-template-areas: "bp-media bp-copy" "bp-media bp-action";
    column-gap: 22px;
    row-gap: 12px;
    align-items: start;
    padding: 0 18px;
  }
  .bp-sidebar-builder-host .bp-sb-card--editorial .bp-sb-image-wrap { grid-area: bp-media; margin: 0; max-width: 100%; }
  .bp-sidebar-builder-host .bp-sb-card--editorial .bp-sb-text { grid-area: bp-copy; margin: 0; padding: 0; }
  .bp-sidebar-builder-host .bp-sb-card--editorial .bp-sb-action { grid-area: bp-action; margin: 0; padding: 0; }
}
@container bp-sidebar-card (min-width: 850px) {
  .bp-sidebar-builder-host .bp-sb-card--editorial .bp-sb-content {
    grid-template-columns: minmax(210px, 28%) minmax(0, 1fr) minmax(160px, 25%);
    grid-template-areas: "bp-media bp-copy bp-action";
    column-gap: 24px;
  }
}
/* Small phone: no huge edge-to-edge image even if the sidebar is full width. */
@container bp-sidebar-card (max-width: 539px) {
  .bp-sidebar-builder-host .bp-sb-card--editorial .bp-sb-image-wrap { max-width: min(230px, calc(100% - 36px)); }
}

/* BP Sidebar Builder 0.2.0 – media / contacts / people / posts */
.bp-sidebar-builder-host .bp-sb-gallery,
.bp-sidebar-builder-host .bp-sb-video,
.bp-sidebar-builder-host .bp-sb-posts,
.bp-sidebar-builder-host .bp-sb-team,
.bp-sidebar-builder-host .bp-sb-contact-links,
.bp-sidebar-builder-host .bp-sb-contact-name { margin: 0 18px 18px; max-width: 100%; }
.bp-sidebar-builder-host .bp-sb-gallery,
.bp-sidebar-builder-host .bp-sb-video { width: min(260px, calc(100% - 36px)); }
.bp-sidebar-builder-host .bp-sb-gallery-stage { aspect-ratio: 16 / 9; background: #f2f2f2; overflow: hidden; }
.bp-sidebar-builder-host .bp-sb-gallery-slide,
.bp-sidebar-builder-host .bp-sb-gallery-slide img { display: block; width: 100%; height: 100%; }
.bp-sidebar-builder-host .bp-sb-gallery-slide[hidden] { display: none !important; }
.bp-sidebar-builder-host .bp-sb-gallery-slide img { object-fit: cover; }
.bp-sidebar-builder-host .bp-sb-gallery-nav { display: flex; justify-content: center; align-items: center; gap: 13px; padding-top: 8px; color: #7e8486; font: 400 12px 'Open Sans', Arial, sans-serif; }
.bp-sidebar-builder-host .bp-sb-gallery-nav button { color: #394041; border: 1px solid #d7d9da; background: #fff; padding: 2px 10px; min-width: 32px; min-height: 32px; font-size: 19px; cursor: pointer; }
.bp-sidebar-builder-host .bp-sb-gallery-nav button:hover:not(:disabled) { border-color: #e38b0d; color: #e38b0d; }
.bp-sidebar-builder-host .bp-sb-gallery-nav button:disabled { color: #c5c7c9; border-color: #eee; cursor: default; }
.bp-sidebar-builder-host .bp-sb-video { aspect-ratio: 16 / 9; background: #222; }
.bp-sidebar-builder-host .bp-sb-video-play { display: block; position: relative; width: 100%; height: 100%; padding: 0; margin: 0; border: 0; background: #222; cursor: pointer; }
.bp-sidebar-builder-host .bp-sb-video-play img { display: block; width: 100%; height: 100%; object-fit: cover; }
.bp-sidebar-builder-host .bp-sb-play-symbol { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); background: #f03; color: #fff; border-radius: 10px; padding: 8px 18px; font-size: 24px; line-height: 1; }
.bp-sidebar-builder-host .bp-sb-video-play:hover .bp-sb-play-symbol { background: #d00; }
.bp-sidebar-builder-host .bp-sb-video iframe { width: 100%; height: 100%; border: 0; display: block; }
.bp-sidebar-builder-host .bp-sb-posts { display: grid; gap: 17px; grid-template-columns: minmax(0,1fr); }
.bp-sidebar-builder-host .bp-sb-post-image { display: block; aspect-ratio: 16 / 9; overflow: hidden; }
.bp-sidebar-builder-host .bp-sb-post-image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bp-sidebar-builder-host .bp-sb-post h4 { margin: 7px 0 0 !important; font-family: 'Open Sans',Arial,sans-serif; font-size: 14px !important; line-height: 1.45; font-weight: 400 !important; min-height: 0 !important; }
.bp-sidebar-builder-host .bp-sb-post a { color: #394041; text-decoration: none; }
.bp-sidebar-builder-host .bp-sb-post a:hover { color: #e38b0d; text-decoration: underline; }
.bp-sidebar-builder-host .bp-sb-contact-name,
.bp-sidebar-builder-host .bp-sb-team-name { font-size: 16px; font-weight: 500; color: #394041; margin-bottom: 5px; }
.bp-sidebar-builder-host .bp-sb-team-role { color: #777; font-size: 12px; font-weight: 400; margin: 0 0 13px; }
.bp-sidebar-builder-host .bp-sb-contact-links { display: flex; flex-direction: column; gap: 9px; }
.bp-sidebar-builder-host .bp-sb-contact-link { display: inline-flex; gap: 11px; align-items: center; color: #394041 !important; text-decoration: none !important; font-family: 'Open Sans',Arial,sans-serif; font-size: 13px; font-weight: 400; line-height: 1.4; overflow-wrap: anywhere; }
.bp-sidebar-builder-host .bp-sb-contact-link .bp-sb-contact-text { color: inherit; text-decoration: none; text-underline-offset: 3px; }
.bp-sidebar-builder-host .bp-sb-contact-link .bp-sb-contact-icon { flex: 0 0 19px; display: inline-flex; justify-content: center; align-items: center; color: #394041; }
.bp-sidebar-builder-host .bp-sb-contact-link svg { display: block; width: 18px !important; height: 18px !important; color: currentColor; fill: currentColor; max-width: 18px; max-height: 18px; }
.bp-sidebar-builder-host .bp-sb-contact-link:hover .bp-sb-contact-icon,
.bp-sidebar-builder-host .bp-sb-contact-link:focus-visible .bp-sb-contact-icon { color: #e38b0d !important; }
.bp-sidebar-builder-host .bp-sb-contact-link:hover .bp-sb-contact-text,
.bp-sidebar-builder-host .bp-sb-contact-link:focus-visible .bp-sb-contact-text { text-decoration: underline !important; }
.bp-sidebar-builder-host .bp-sb-team { max-width: min(360px,calc(100% - 36px)); }
.bp-sidebar-builder-host .bp-sb-team-portrait { width: 100%; max-width: 230px; margin-bottom: 12px; }
.bp-sidebar-builder-host .bp-sb-team-portrait img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; }
.bp-sidebar-builder-host .bp-sb-team .bp-sb-contact-links { margin: 0; }
.bp-sidebar-builder-host .bp-sb-posts { max-width: min(350px,calc(100% - 36px)); }
@container bp-sidebar-card (min-width: 540px) {
  .bp-sidebar-builder-host .bp-sb-gallery,.bp-sidebar-builder-host .bp-sb-video { width: min(420px,calc(100% - 36px)); }
  .bp-sidebar-builder-host .bp-sb-posts { grid-template-columns: repeat(2,minmax(0,1fr)); max-width: 650px; }
  .bp-sidebar-builder-host .bp-sb-team { max-width: 650px; }
}
@container bp-sidebar-card (min-width: 850px) {
  .bp-sidebar-builder-host .bp-sb-posts { grid-template-columns: repeat(3,minmax(0,1fr)); max-width: 950px; }
}
.bp-sb-lightbox { width: min(95vw,1150px); max-width: none; padding: 0; border: none; background: #222; color: #fff; box-shadow: 0 15px 70px #0008; }
.bp-sb-lightbox::backdrop { background: rgba(0,0,0,.85); }
.bp-sb-lightbox-inner { display: flex; align-items: center; justify-content: space-around; position: relative; min-height: 200px; padding: 40px 6px 15px; gap: 5px; }
.bp-sb-lightbox img { display: block; max-width: calc(100% - 100px); max-height: 80vh; width: auto; height: auto; object-fit: contain; }
.bp-sb-lightbox button { font-size: 30px; border: none; background: transparent; color: #fff; cursor: pointer; }
.bp-sb-lightbox button:disabled { opacity: .2; cursor: default; }
.bp-sb-lightbox .bp-sb-lb-close { position: absolute; top: 4px; right: 14px; z-index: 1; }

.bp-sidebar-builder-host .bp-sb-post-excerpt { color: #777; font: 400 12px/1.65 'Open Sans',Arial,sans-serif; margin: 7px 0 0; }
.bp-sidebar-builder-host .bp-sb-contact-link:active .bp-sb-contact-icon { color: #e38b0d !important; }
.bp-sidebar-builder-host .bp-sb-contact-link:active .bp-sb-contact-text { text-decoration: underline !important; }

/* BP Sidebar Builder 0.2.1 – same [bp_icon] contact symbols as BP contact page.
   Scoped to the builder, avoiding the contact page's special 30px phone scaling. */
.bp-sidebar-builder-host .bp-sb-contact-link {
  gap: 9px;
  align-items: center;
  color: #394041 !important;
  font-weight: 300;
  text-decoration: none !important;
}
.bp-sidebar-builder-host .bp-sb-contact-link .bp-sb-contact-icon {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #394041 !important;
  line-height: 1;
}
.bp-sidebar-builder-host .bp-sb-contact-link .bp-sb-contact-icon .bp_icon,
.bp-sidebar-builder-host .bp-sb-contact-link .bp-sb-contact-icon .bp-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit !important;
}
.bp-sidebar-builder-host .bp-sb-contact-link .bp-sb-contact-icon svg,
.bp-sidebar-builder-host .bp-sb-contact-link .bp-sb-contact-icon svg.bp-social-icon,
.bp-sidebar-builder-host .bp-sb-contact-link .bp-sb-contact-icon svg.bp-icon {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  min-height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  display: block;
  flex: 0 0 22px;
  transform: none !important;
  margin: 0 !important;
  color: currentColor !important;
  fill: currentColor;
  transition: color .2s ease, fill .2s ease;
}
.bp-sidebar-builder-host .bp-sb-contact-link .bp-sb-contact-text {
  color: #394041 !important;
  text-decoration: none !important;
  text-decoration-color: #e38b0d !important;
  text-decoration-thickness: 1px;
  text-underline-offset: 6px;
}
.bp-sidebar-builder-host .bp-sb-contact-link:hover .bp-sb-contact-icon,
.bp-sidebar-builder-host .bp-sb-contact-link:focus-visible .bp-sb-contact-icon,
.bp-sidebar-builder-host .bp-sb-contact-link:active .bp-sb-contact-icon {
  color: #e38b0d !important;
}
.bp-sidebar-builder-host .bp-sb-contact-link:hover .bp-sb-contact-icon svg,
.bp-sidebar-builder-host .bp-sb-contact-link:focus-visible .bp-sb-contact-icon svg,
.bp-sidebar-builder-host .bp-sb-contact-link:active .bp-sb-contact-icon svg {
  color: #e38b0d !important;
  fill: #e38b0d !important;
}
.bp-sidebar-builder-host .bp-sb-contact-link:hover .bp-sb-contact-icon svg path:not([fill="none"]),
.bp-sidebar-builder-host .bp-sb-contact-link:focus-visible .bp-sb-contact-icon svg path:not([fill="none"]),
.bp-sidebar-builder-host .bp-sb-contact-link:active .bp-sb-contact-icon svg path:not([fill="none"]) {
  fill: #e38b0d !important;
}
.bp-sidebar-builder-host .bp-sb-contact-link:hover .bp-sb-contact-text,
.bp-sidebar-builder-host .bp-sb-contact-link:focus-visible .bp-sb-contact-text,
.bp-sidebar-builder-host .bp-sb-contact-link:active .bp-sb-contact-text {
  color: #394041 !important;
  text-decoration: underline !important;
  text-decoration-color: #e38b0d !important;
}

/* BP Sidebar Builder 0.2.2 – single RealHomes-style separator at insertion
   boundary (above when placed after widgets; below when placed before them).
   No separators are added at the outer end of an otherwise empty area. */
.bp-sidebar-builder-host .bp-sb-boundary {
  /* Footer columns keep their existing styling; this divider is for sidebars. */
  display: none;
  box-sizing: border-box;
  height: 0;
  padding: 0;
  background: none;
  border: 0;
  border-top: 1px solid #e8e8e8;
  pointer-events: none;
}
.sidebar .bp-sidebar-builder-host .bp-sb-boundary {
  display: block;
}
.bp-sidebar-builder-host .bp-sb-boundary--before {
  margin: 0 0 26px;
}
.bp-sidebar-builder-host .bp-sb-boundary--after {
  margin: 0;
}
/* The Child Theme already draws a border under most legacy sidebar widgets.
   Suppress ONLY the adjoining legacy border so two grey lines never appear.
   :has() is supported by modern Chrome, Firefox and Safari. */
body:not(.blog):not(.single-post) .sidebar .widget:has(+ .widget.bp-sidebar-builder-host .bp-sb-boundary--before) {
  border-bottom: 0 !important;
}
/* The virtual BP host gets its one intentional boundary from above; prevent
   RealHomes/Child-theme generic widget rules from appending another one. */
body:not(.blog):not(.single-post) .sidebar .widget.bp-sidebar-builder-host,
.sidebar .widget.bp-sidebar-builder-host {
  border-bottom: 0 !important;
}

/* 0.2.3 – Team portrait and details use two columns only when there is enough
   actual widget width. The card's container query already exists in 0.2.x.
   All legacy modules and the independent Contact block are unaffected. */
.bp-sidebar-builder-host .bp-sb-team {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  width: calc(100% - 36px);
  max-width: 360px;
  margin: 0 18px 18px;
  align-items: start;
  min-width: 0;
}
.bp-sidebar-builder-host .bp-sb-team-portrait {
  width: 100%;
  max-width: 230px;
  margin: 0 0 14px;
  min-width: 0;
}
.bp-sidebar-builder-host .bp-sb-team-details { min-width: 0; }
.bp-sidebar-builder-host .bp-sb-team .bp-sb-contact-links {
  margin: 0;
  max-width: 100%;
  min-width: 0;
}
.bp-sidebar-builder-host .bp-sb-team .bp-sb-contact-link {
  font-size: 14px !important;
  line-height: 1.55;
  max-width: 100%;
  min-width: 0;
}
.bp-sidebar-builder-host .bp-sb-team.bp-sb-team--contact-13 .bp-sb-contact-link { font-size: 13px !important; }
.bp-sidebar-builder-host .bp-sb-team.bp-sb-team--contact-15 .bp-sb-contact-link { font-size: 15px !important; }
.bp-sidebar-builder-host .bp-sb-team .bp-sb-team-role {
  font-size: 14px;
  line-height: 1.5;
  margin-bottom: 12px;
}
.bp-sidebar-builder-host .bp-sb-team .bp-sb-team-note {
  margin: 0 0 14px;
  color: #394041;
  font: 400 14px/1.55 "Open Sans", Arial, sans-serif;
  overflow-wrap: anywhere;
}
.bp-sidebar-builder-host .bp-sb-team .bp-sb-team-note:last-child { margin-bottom: 0; margin-top: 13px; }
@container bp-sidebar-card (min-width: 540px) {
  .bp-sidebar-builder-host .bp-sb-team { max-width: min(850px, calc(100% - 36px)); }
  .bp-sidebar-builder-host .bp-sb-team--with-portrait {
    grid-template-columns: minmax(170px, 32%) minmax(0, 1fr);
    column-gap: 24px;
  }
  .bp-sidebar-builder-host .bp-sb-team-portrait {
    max-width: 230px;
    margin: 0;
  }
}
@container bp-sidebar-card (min-width: 850px) {
  .bp-sidebar-builder-host .bp-sb-team--with-portrait {
    grid-template-columns: minmax(200px, 30%) minmax(0, 1fr);
    column-gap: 26px;
  }
}

/* BP Sidebar Builder 0.2.4 – one divider between adjacent BP modules.
   The previous boundary elements still handle BP ↔ RealHomes transitions.
   No line appears inside a module or around a solitary BP module. */
.bp-sidebar-builder-host .bp-sb-card:not(:last-of-type) {
  margin-bottom: 0;
  padding-bottom: 0;
}
.bp-sidebar-builder-host .bp-sb-card + .bp-sb-card {
  margin-top: 26px;
  border-top: 1px solid #e8e8e8;
  padding-top: 26px;
}

/* 0.2.4 – understated Signature-inspired accent below name and position. */
.bp-sidebar-builder-host .bp-sb-team .bp-sb-team-details,
.bp-sidebar-builder-host .bp-sb-team .bp-sb-team-identity,
.bp-sidebar-builder-host .bp-sb-team .bp-sb-team-contacts {
  min-width: 0;
}
.bp-sidebar-builder-host .bp-sb-team .bp-sb-team-role {
  margin-bottom: 0;
}
.bp-sidebar-builder-host .bp-sb-team .bp-sb-team-accent {
  display: block;
  width: 48px;
  max-width: 100%;
  height: 2px;
  margin: 13px 0 14px;
  background: #e38b0d;
}
.bp-sidebar-builder-host .bp-sb-team .bp-sb-team-identity {
  margin-bottom: 12px;
}
.bp-sidebar-builder-host .bp-sb-team .bp-sb-team-contacts .bp-sb-contact-links {
  margin: 0;
}
/* In a narrow sidebar/phone all sections stay in one readable column. */
.bp-sidebar-builder-host .bp-sb-team .bp-sb-team-details {
  display: block;
}
/* Two columns: start the complete text group in the upper third of the
   portrait, never vertically centered. Give identity/contacts breathing room. */
@container bp-sidebar-card (min-width: 540px) {
  .bp-sidebar-builder-host .bp-sb-team--with-portrait .bp-sb-team-details {
    display: block;
    padding-top: 55px;
  }
  .bp-sidebar-builder-host .bp-sb-team--with-portrait .bp-sb-team-identity {
    margin-bottom: 20px;
  }
}
/* Large widget moved under main content: real three-column composition.
   Columns: portrait | identity and optional intro | contact methods. */
@container bp-sidebar-card (min-width: 700px) {
  .bp-sidebar-builder-host .bp-sb-team {
    max-width: none;
  }
  .bp-sidebar-builder-host .bp-sb-team--with-portrait {
    /* Wider identity track gives longer names a better chance to fit on one
       line. The contact track moves right without sacrificing responsiveness. */
    grid-template-columns: minmax(155px, 30%) minmax(195px, 31%) minmax(0, 1fr);
    column-gap: 28px;
  }
  .bp-sidebar-builder-host .bp-sb-team--with-portrait > .bp-sb-team-portrait {
    grid-column: 1;
    grid-row: 1;
  }
  .bp-sidebar-builder-host .bp-sb-team--with-portrait > .bp-sb-team-details {
    display: contents;
  }
  .bp-sidebar-builder-host .bp-sb-team--with-portrait .bp-sb-team-identity {
    grid-column: 2;
    grid-row: 1;
    margin-bottom: 0;
    padding-top: 55px;
  }
  .bp-sidebar-builder-host .bp-sb-team--with-portrait .bp-sb-team-contacts {
    grid-column: 3;
    grid-row: 1;
    padding-top: 55px;
  }
  /* Without a portrait, do not reserve an empty picture column. */
  .bp-sidebar-builder-host .bp-sb-team:not(.bp-sb-team--with-portrait) > .bp-sb-team-details {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr);
    column-gap: 24px;
    align-items: start;
  }
  .bp-sidebar-builder-host .bp-sb-team:not(.bp-sb-team--with-portrait) .bp-sb-team-identity {
    margin-bottom: 0;
  }
}

/* 0.2.9 – opt-in module presets only. Without a preset class, every
   established 0.2.8.1 spacing and breakpoint remains pixel-identical. */
.bp-sidebar-builder-host .bp-sb-layout-block-spacing--compact > :is(
  .bp-sb-heading,.bp-sb-text,.bp-sb-image-wrap,.bp-sb-action,
  .bp-sb-gallery,.bp-sb-video,.bp-sb-posts,.bp-sb-team,
  .bp-sb-contact-links,.bp-sb-contact-name):not(:last-child) { margin-bottom: 8px !important; }
.bp-sidebar-builder-host .bp-sb-layout-block-spacing--spacious > :is(
  .bp-sb-heading,.bp-sb-text,.bp-sb-image-wrap,.bp-sb-action,
  .bp-sb-gallery,.bp-sb-video,.bp-sb-posts,.bp-sb-team,
  .bp-sb-contact-links,.bp-sb-contact-name):not(:last-child) { margin-bottom: 26px !important; }
/* On narrow devices, image/text separation is vertical. */
@container bp-sidebar-card (max-width: 539px) {
  .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-layout-column-gap--compact .bp-sb-image-wrap { margin-bottom: 8px; }
  .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-layout-column-gap--spacious .bp-sb-image-wrap { margin-bottom: 26px; }
  .bp-sidebar-builder-host .bp-sb-layout-column-gap--compact .bp-sb-team--with-portrait > .bp-sb-team-portrait { margin-bottom: 8px; }
  .bp-sidebar-builder-host .bp-sb-layout-column-gap--spacious .bp-sb-team--with-portrait > .bp-sb-team-portrait { margin-bottom: 26px; }
}
/* Column spacing affects grid tracks only: portrait/text and editorial grids. */
@container bp-sidebar-card (min-width: 540px) {
  .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-layout-column-gap--compact .bp-sb-content { column-gap: 14px; }
  .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-layout-column-gap--spacious .bp-sb-content { column-gap: 38px; }
  .bp-sidebar-builder-host .bp-sb-layout-column-gap--compact .bp-sb-team--with-portrait { column-gap: 14px; }
  .bp-sidebar-builder-host .bp-sb-layout-column-gap--spacious .bp-sb-team--with-portrait { column-gap: 38px; }
  /* Team identity plus contacts should always move as one group. */
  .bp-sidebar-builder-host .bp-sb-layout-team-offset--higher .bp-sb-team--with-portrait .bp-sb-team-details { padding-top: 25px; }
  .bp-sidebar-builder-host .bp-sb-layout-team-offset--lower .bp-sb-team--with-portrait .bp-sb-team-details { padding-top: 75px; }
}
@container bp-sidebar-card (min-width: 700px) {
  .bp-sidebar-builder-host .bp-sb-layout-column-gap--compact .bp-sb-team:not(.bp-sb-team--with-portrait) > .bp-sb-team-details { column-gap: 14px; }
  .bp-sidebar-builder-host .bp-sb-layout-column-gap--spacious .bp-sb-team:not(.bp-sb-team--with-portrait) > .bp-sb-team-details { column-gap: 38px; }
  .bp-sidebar-builder-host .bp-sb-layout-team-offset--higher .bp-sb-team--with-portrait .bp-sb-team-identity,
  .bp-sidebar-builder-host .bp-sb-layout-team-offset--higher .bp-sb-team--with-portrait .bp-sb-team-contacts { padding-top: 25px; }
  .bp-sidebar-builder-host .bp-sb-layout-team-offset--lower .bp-sb-team--with-portrait .bp-sb-team-identity,
  .bp-sidebar-builder-host .bp-sb-layout-team-offset--lower .bp-sb-team--with-portrait .bp-sb-team-contacts { padding-top: 75px; }
}

/* Editorial cards contain a nested .bp-sb-content: adjust the spacing
   between its children as well, while keeping the existing default untouched. */
@container bp-sidebar-card (max-width: 539px) {
  .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-layout-block-spacing--compact .bp-sb-content > .bp-sb-text { margin-bottom: 8px; }
  .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-layout-block-spacing--spacious .bp-sb-content > .bp-sb-text { margin-bottom: 26px; }
  .bp-sidebar-builder-host .bp-sb-card--editorial:is(.bp-sb-layout-block-spacing--compact,.bp-sb-layout-block-spacing--spacious) .bp-sb-content > .bp-sb-action { margin-top: 0; }
}
@container bp-sidebar-card (min-width: 540px) {
  .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-layout-block-spacing--compact .bp-sb-content { row-gap: 8px; }
  .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-layout-block-spacing--spacious .bp-sb-content { row-gap: 26px; }
}

/* 0.3.2: privacy-enhanced videos have a local, request-free click placeholder. */
.bp-sidebar-builder-host .bp-sb-video--nocookie .bp-sb-video-play { background: #202326; }

/* 0.3.2 – Responsive media: a desktop widget is deliberately narrow, while
   tablets/phones place the sidebar below the main content. The old fixed
   260/420px caps made galleries and YouTube embeds needlessly small there.
   Keep the same 18px inline gutter used by text and the other content blocks.
   This viewport rule complements (rather than replaces) the card-width
   container queries, and also works in the sandboxed device preview. */
@media (max-width: 1024px) {
  .bp-sidebar-builder-host .bp-sb-gallery,
  .bp-sidebar-builder-host .bp-sb-video {
    width: calc(100% - 36px);
    max-width: none;
  }
}

/* Clip fractional-pixel / thumbnail letterbox seams without modifying the
   YouTube player itself. The preview shows the thumbnail, not a running iframe. */
.bp-sidebar-builder-host .bp-sb-video {
  position: relative;
  overflow: hidden;
}
.bp-sidebar-builder-host .bp-sb-video-play {
  overflow: hidden;
}
.bp-sidebar-builder-host .bp-sb-video-play img {
  transform: scale(1.04);
  transform-origin: center center;
}
.bp-sidebar-builder-host .bp-sb-video iframe {
  position: absolute;
  top: -1px;
  left: 0;
  width: 100% !important;
  height: calc(100% + 2px) !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  outline: 0 !important;
  box-shadow: none !important;
}


/* 0.3.3 – Optional media + immediately following text pair. Other blocks,
   existing modules and the narrow desktop sidebar remain unchanged.
   Device selection uses BOTH viewport and actual module container width:
   a 300px sidebar never turns into cramped two-column content. */
.bp-sidebar-builder-host .bp-sb-media-pair {
  min-width: 0;
  width: 100%;
}
@media (min-width: 601px) and (max-width: 1024px) {
  @container bp-sidebar-card (min-width: 540px) {
    .bp-sidebar-builder-host .bp-sb-media-pair--tablet-side {
      display: grid;
      grid-template-columns: minmax(0, 43fr) minmax(0, 57fr);
      column-gap: 20px;
      padding: 0 18px;
      margin-bottom: 18px;
      align-items: start;
    }
    .bp-sidebar-builder-host .bp-sb-media-pair--tablet-side > :is(.bp-sb-image-wrap, .bp-sb-video, .bp-sb-gallery) {
      width: 100%;
      max-width: none;
      margin: 0;
    }
    .bp-sidebar-builder-host .bp-sb-media-pair--tablet-side > .bp-sb-text {
      min-width: 0;
      padding: 0;
      margin: 0;
    }
  }
}
@media (max-width: 600px) {
  @container bp-sidebar-card (min-width: 320px) {
    .bp-sidebar-builder-host .bp-sb-media-pair--mobile-side {
      display: grid;
      grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
      column-gap: 12px;
      padding: 0 18px;
      margin-bottom: 18px;
      align-items: start;
    }
    .bp-sidebar-builder-host .bp-sb-media-pair--mobile-side > :is(.bp-sb-image-wrap, .bp-sb-video, .bp-sb-gallery) {
      width: 100%;
      max-width: none;
      margin: 0;
    }
    .bp-sidebar-builder-host .bp-sb-media-pair--mobile-side > .bp-sb-text {
      min-width: 0;
      padding: 0;
      margin: 0;
    }
  }
}

/* Respect the existing compact/spacious module presets for opt-in pairs. */
@media (min-width: 601px) and (max-width: 1024px) {
  @container bp-sidebar-card (min-width: 540px) {
    .bp-sidebar-builder-host .bp-sb-layout-block-spacing--compact > .bp-sb-media-pair--tablet-side:not(:last-child) { margin-bottom: 8px !important; }
    .bp-sidebar-builder-host .bp-sb-layout-block-spacing--spacious > .bp-sb-media-pair--tablet-side:not(:last-child) { margin-bottom: 26px !important; }
    .bp-sidebar-builder-host .bp-sb-layout-column-gap--compact > .bp-sb-media-pair--tablet-side { column-gap: 14px; }
    .bp-sidebar-builder-host .bp-sb-layout-column-gap--spacious > .bp-sb-media-pair--tablet-side { column-gap: 38px; }
  }
}
@media (max-width: 600px) {
  @container bp-sidebar-card (min-width: 320px) {
    .bp-sidebar-builder-host .bp-sb-layout-block-spacing--compact > .bp-sb-media-pair--mobile-side:not(:last-child) { margin-bottom: 8px !important; }
    .bp-sidebar-builder-host .bp-sb-layout-block-spacing--spacious > .bp-sb-media-pair--mobile-side:not(:last-child) { margin-bottom: 26px !important; }
    .bp-sidebar-builder-host .bp-sb-layout-column-gap--compact > .bp-sb-media-pair--mobile-side { column-gap: 8px; }
    .bp-sidebar-builder-host .bp-sb-layout-column-gap--spacious > .bp-sb-media-pair--mobile-side { column-gap: 22px; }
  }
}


/* 0.3.4 – Image joins the video/slideshow responsive layout choices.
   Legacy image-only and editorial blocks remain unchanged until saved
   with these options. The desktop widget continues to use the compact image. */
@media (max-width: 1024px) {
  .bp-sidebar-builder-host .bp-sb-image-wrap--device-layout {
    width: calc(100% - 36px);
    max-width: none;
    margin: 0 18px 16px;
  }
}
/* The image must fill its selected media track without inheriting gutters. */
@media (min-width: 601px) and (max-width: 1024px) {
  @container bp-sidebar-card (min-width: 540px) {
    .bp-sidebar-builder-host .bp-sb-media-pair--tablet-side > .bp-sb-image-wrap--device-layout {
      width: 100%; max-width: none; margin: 0;
    }
    /* Special image + text (+ optional heading/button) editorial modules
       retain their old desktop grid, but honor tablet device selection. */
    .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-card--image-tablet-full > .bp-sb-content {
      display: block;
      padding: 0 18px;
    }
    .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-card--image-tablet-side > .bp-sb-content {
      display: grid;
      grid-template-columns: minmax(0, 43fr) minmax(0, 57fr);
      grid-template-areas: "bp-media bp-copy" "bp-media bp-action";
      column-gap: 20px;
      padding: 0 18px;
      align-items: start;
    }
    .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-card--image-layout-custom > .bp-sb-content > .bp-sb-image-wrap--device-layout {
      width: 100%; max-width: none; margin: 0 0 16px;
    }
    .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-card--image-layout-custom > .bp-sb-content > .bp-sb-text {
      padding: 0;
    }
    .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-card--image-layout-custom > .bp-sb-content > .bp-sb-action {
      padding: 0;
    }
  }
}
@media (max-width: 600px) {
  @container bp-sidebar-card (min-width: 320px) {
    .bp-sidebar-builder-host .bp-sb-media-pair--mobile-side > .bp-sb-image-wrap--device-layout {
      width: 100%; max-width: none; margin: 0;
    }
    .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-card--image-mobile-side > .bp-sb-content {
      display: grid;
      grid-template-columns: minmax(0, 45fr) minmax(0, 55fr);
      grid-template-areas: "bp-media bp-copy" "bp-media bp-action";
      gap: 12px;
      padding: 0 18px;
      align-items: start;
    }
    .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-card--image-mobile-side > .bp-sb-content > .bp-sb-image-wrap--device-layout {
      grid-area: bp-media; width: 100%; max-width: none; margin: 0;
    }
    .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-card--image-mobile-side > .bp-sb-content > .bp-sb-text {
      grid-area: bp-copy; min-width: 0; padding: 0; margin: 0;
    }
    .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-card--image-mobile-side > .bp-sb-content > .bp-sb-action {
      grid-area: bp-action; min-width: 0; padding: 0; margin: 0;
    }
  }
  .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-card--image-mobile-full > .bp-sb-content > .bp-sb-image-wrap--device-layout {
    max-width: none; width: calc(100% - 36px); margin: 0 18px 16px;
  }
}

@media (max-width: 600px) {
  @container bp-sidebar-card (min-width: 540px) {
    .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-card--image-mobile-full > .bp-sb-content {
      display: block;
      padding: 0 18px;
    }
    .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-card--image-mobile-full > .bp-sb-content > .bp-sb-image-wrap--device-layout {
      width: 100%; max-width: none; margin: 0 0 16px;
    }
    .bp-sidebar-builder-host .bp-sb-card--editorial.bp-sb-card--image-mobile-full > .bp-sb-content > :is(.bp-sb-text, .bp-sb-action) {
      padding: 0;
    }
  }
}

/* BP Sidebar Builder 0.3.6 – Gallery-only controls: precise arrow alignment and
   button sizes based on the ACTUAL media width, not the page viewport.
   Desktop widget, two-column media and full-width mobile/tablet are independent. */
.bp-sidebar-builder-host .bp-sb-gallery {
  container: bp-sb-slider / inline-size;
}
.bp-sidebar-builder-host .bp-sb-gallery-stage { position: relative; }
.bp-sidebar-builder-host .bp-sb-gallery-nav {
  display: block;
  padding: 0;
  margin: 0;
}
.bp-sidebar-builder-host .bp-sb-gallery-nav button {
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  z-index: 4;
  top: 50%;
  width: 30px;
  height: 36px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 0;
  background: rgba(57,64,65,.67);
  color: #fff;
  font-size: 0; /* Hide font-dependent ‹/›; aria-label remains available. */
  line-height: 0;
  cursor: pointer;
  box-shadow: none;
}
/* ViewBox chevrons stay horizontally and vertically centred at every width. */
.bp-sidebar-builder-host .bp-sb-gallery-nav button::before { content: none; }
.bp-sidebar-builder-host .bp-sb-gallery-nav button > svg {
  display: block;
  flex: none;
  width: 18px;
  height: 18px;
  padding: 0;
  margin: 0;
  pointer-events: none;
}
.bp-sidebar-builder-host .bp-sb-gallery-nav [data-bpsb-prev] { left: 0; }
.bp-sidebar-builder-host .bp-sb-gallery-nav [data-bpsb-next] { right: 0; }
.bp-sidebar-builder-host .bp-sb-gallery-nav button:hover:not(:disabled),
.bp-sidebar-builder-host .bp-sb-gallery-nav button:focus-visible {
  border: 0;
  background: rgba(57,64,65,.90);
  color: #fff;
}
.bp-sidebar-builder-host .bp-sb-gallery-nav button:focus-visible {
  outline: 2px solid #e38b0d;
  outline-offset: -2px;
}
.bp-sidebar-builder-host .bp-sb-gallery-nav [data-bpsb-count] {
  position: absolute;
  z-index: 4;
  bottom: 10px;
  right: 10px;
  background: rgba(57,64,65,.78);
  color: #fff;
  font: 400 11px/1.4 'Open Sans',Arial,sans-serif;
  padding: 3px 8px;
  pointer-events: none;
}
/* Short slides (e.g. optional two columns on a phone). */
@container bp-sb-slider (max-width: 210px) {
  .bp-sidebar-builder-host .bp-sb-gallery-nav button { width: 22px; height: 28px; }
  .bp-sidebar-builder-host .bp-sb-gallery-nav button > svg { width: 13px; height: 13px; }
}
/* Actual narrow DESKTOP sidebar or a medium two-column slide. */
@container bp-sb-slider (min-width: 211px) and (max-width: 280px) {
  .bp-sidebar-builder-host .bp-sb-gallery-nav button { width: 24px; height: 30px; }
  .bp-sidebar-builder-host .bp-sb-gallery-nav button > svg { width: 15px; height: 15px; }
}
/* Full-width smartphone or tablet two-column slide. Defaults 30 × 36 px. */
/* Full-width tablet gallery, with enough room for the larger touch targets. */
@container bp-sb-slider (min-width: 421px) {
  .bp-sidebar-builder-host .bp-sb-gallery-nav button { width: 36px; height: 42px; }
  .bp-sidebar-builder-host .bp-sb-gallery-nav button > svg { width: 20px; height: 20px; }
}
