@media (max-width: 760px),
  (orientation: landscape) and (max-width: 950px) and (max-height: 500px) {
  :is(div, footer):has(> [data-bl-footer-copy]) {
    display: flex !important;
    flex-direction: column;
    align-items: center !important;
    text-align: center !important;
  }

  :is(div, footer):has(> [data-bl-footer-copy]) > img[alt="Boundlearn"] {
    margin-right: auto;
    margin-left: auto;
  }

  :is(div, footer):has(> [data-bl-footer-copy]) > a:has(img[alt="Boundlearn"]) {
    display: flex;
    justify-content: center;
    width: 100%;
  }

  [data-bl-footer-copy] {
    max-width: 340px !important;
    margin: 14px auto 0 !important;
    text-align: center !important;
  }

  :is(div, footer):has(> [data-bl-footer-copy]) > div {
    justify-content: center !important;
    width: 100%;
  }

  :is(div, footer):has(> [data-bl-footer-copy]) > div > span {
    justify-content: center !important;
  }

  :is(div, footer):has(> [data-bl-footer-copyright]) {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    text-align: center !important;
  }

  [data-bl-footer-slogan] {
    order: 1;
  }

  [data-bl-footer-copyright] {
    order: 2;
  }

  .yfl-footer-links {
    gap: 0 !important;
  }

  .yfl-footer-links a {
    min-height: 26px;
    font-size: 12px !important;
    line-height: 1.15;
  }
}

.delta-join-us-cta {
  color: #fff !important;
  background: transparent !important;
  transition:
    color 180ms ease,
    background-color 180ms ease !important;
}

.delta-join-us-cta:hover,
.delta-join-us-cta:focus-visible {
  color: #1a1a1e !important;
  background: #fff !important;
  outline: none !important;
}

.delta-join-us-cta:active {
  color: #1a1a1e !important;
  background: #edeaf2 !important;
}

.bl-footer-mobile-break {
  display:none;
}

/* Boundlearn hub: brand spans the footer, navigation stays in two clear columns. */
@media (orientation: portrait) and (max-width: 600px) {
  .bl-hub-footer-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 26px 20px !important;
  }

  .bl-hub-footer-grid > .bl-hub-footer-brand,
  .bl-hub-footer-grid > :first-child {
    grid-column: 1 / -1 !important;
  }
}

/* Boundlearn homepage footer only: keep both navigation columns and the final
   meta pair on shared rows without altering programme footers. */
@media (max-width: 600px) {
  .bl-hub-footer .bl-footer-mobile-break {
    display:block;
  }

  .bl-hub-footer .bl-hub-footer-grid {
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    gap:24px 18px!important;
  }

  .bl-hub-footer .bl-hub-footer-bottom {
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:12px!important;
    text-align:left!important;
  }

  .bl-hub-footer .bl-hub-footer-bottom > * {
    flex:1 1 0!important;
    min-width:0!important;
    font-size:9.5px!important;
    line-height:1.35!important;
  }

  .bl-hub-footer .bl-hub-footer-bottom > :last-child {
    text-align:right!important;
  }
}

/* Approved Boundlearn tablet footer geometry: brand and the two navigation
   columns share one row, with a compact meta row below. */
@media (min-width:601px) and (max-width:1180px) {
  .bl-hub-footer {
    box-sizing:border-box!important;
    width:100%!important;
    padding:38px 34px 24px!important;
  }

  .bl-hub-footer .bl-hub-footer-grid {
    display:grid!important;
    grid-template-columns:minmax(220px,1.35fr) repeat(2,minmax(0,1fr))!important;
    align-items:start!important;
    gap:30px!important;
    padding-bottom:28px!important;
  }

  .bl-hub-footer .bl-hub-footer-grid > * {
    min-width:0!important;
  }

  .bl-hub-footer .bl-hub-footer-bottom {
    display:flex!important;
    flex-direction:row!important;
    align-items:center!important;
    justify-content:space-between!important;
    gap:18px!important;
    padding-top:18px!important;
  }
}

/* Boundlearn homepage mobile landscape: retain the tablet footer's left-led
   brand hierarchy without changing programme footers or portrait layouts. */
@media (orientation:landscape) and (max-width:950px) and (max-height:500px) {
  .bl-hub-footer .bl-hub-footer-brand {
    align-items:flex-start!important;
    text-align:left!important;
  }

  .bl-hub-footer .bl-hub-footer-brand > img[alt="Boundlearn"] {
    margin-right:auto!important;
    margin-left:0!important;
  }

  .bl-hub-footer .bl-hub-footer-brand > [data-bl-footer-copy] {
    margin:14px 0 0!important;
    text-align:left!important;
  }

  .bl-hub-footer .bl-hub-footer-brand > div,
  .bl-hub-footer .bl-hub-footer-brand > div > span {
    width:auto!important;
    justify-content:flex-start!important;
  }
}

/*
 * Program portrait footer contract.
 * Keep the Boundlearn brand full-width, then present the ecosystem links in
 * three compact columns, matching the approved RISE, HSA, and Delta footers.
 */
@media (orientation: portrait) and (max-width: 600px) {
  :is(.cfi-footer, .os-footer, .spark-footer, .yfl-footer) {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 28px 20px 20px !important;
    border-radius: 0 !important;
    text-align: center !important;
  }

  :is(.cfi-footer, .os-footer, .spark-footer, .yfl-footer) > div {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 1080px !important;
    margin-right: auto !important;
    margin-left: auto !important;
  }

  html.cfi-option-a-preview .cfi-footer .ci-foot-grid,
  .cfi-footer .ci-foot-grid,
  .os-footer .os-foot-grid,
  .spark-footer .spark-footer-grid,
  .yfl-footer .yfl-footer-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: start !important;
    gap: 22px 16px !important;
    padding-bottom: 24px !important;
    text-align: left !important;
  }

  :is(.cfi-footer .ci-foot-grid,
      .os-footer .os-foot-grid,
      .spark-footer .spark-footer-grid,
      .yfl-footer .yfl-footer-grid) > div {
    min-width: 0 !important;
  }

  :is(.cfi-footer .ci-foot-grid,
      .os-footer .os-foot-grid,
      .spark-footer .spark-footer-grid,
      .yfl-footer .yfl-footer-grid) > div:first-child {
    grid-column: 1 / -1 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
  }

  .spark-footer .spark-footer-grid > .spark-foot-links--programs,
  .yfl-footer .yfl-footer-grid > .yfl-footer-programs,
  .os-footer .os-foot-grid > .os-foot-links--programs {
    grid-column: auto !important;
  }

  .yfl-footer .yfl-footer-grid > .yfl-footer-brand {
    order: 0 !important;
  }

  .yfl-footer .yfl-footer-grid > .yfl-footer-boundlearn {
    order: 1 !important;
  }

  .yfl-footer .yfl-footer-grid > .yfl-footer-yfl {
    order: 2 !important;
  }

  .yfl-footer .yfl-footer-grid > .yfl-footer-programs {
    order: 3 !important;
  }

  :is(.cfi-footer, .os-footer, .spark-footer, .yfl-footer)
    :is(.ci-foot-grid, .os-foot-grid, .spark-footer-grid, .yfl-footer-grid)
    > div:first-child
    > img,
  :is(.cfi-footer, .os-footer, .spark-footer, .yfl-footer)
    :is(.ci-foot-grid, .os-foot-grid, .spark-footer-grid, .yfl-footer-grid)
    > div:first-child
    > a
    > img {
    width: auto !important;
    height: 21px !important;
    margin-right: auto !important;
    margin-left: auto !important;
  }

  :is(.cfi-footer, .os-footer, .spark-footer, .yfl-footer)
    :is(.ci-foot-grid, .os-foot-grid, .spark-footer-grid, .yfl-footer-grid)
    > div:first-child
    > p {
    max-width: 330px !important;
    margin: 13px auto 0 !important;
    font-size: 12px !important;
    line-height: 1.5 !important;
    text-align: center !important;
  }

  :is(.cfi-footer, .os-footer, .spark-footer, .yfl-footer)
    :is(.ci-foot-grid, .os-foot-grid, .spark-footer-grid, .yfl-footer-grid)
    > div:first-child
    > div {
    justify-content: center !important;
    width: 100% !important;
    margin-top: 14px !important;
  }

  :is(.cfi-footer, .os-footer, .spark-footer, .yfl-footer)
    :is(.ci-foot-grid, .os-foot-grid, .spark-footer-grid, .yfl-footer-grid)
    > div:not(:first-child)
    > div:first-child {
    margin-bottom: 9px !important;
    font-size: 9px !important;
    line-height: 1.2 !important;
    letter-spacing: .06em !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: anywhere !important;
    text-align: left !important;
  }

  :is(.cfi-footer, .os-footer, .spark-footer, .yfl-footer)
    :is(.ci-foot-grid, .os-foot-grid, .spark-footer-grid, .yfl-footer-grid)
    > div:not(:first-child)
    > div:last-child,
  .spark-footer .spark-foot-links--programs > div:last-child,
  .yfl-footer .yfl-footer-programs .yfl-footer-links,
  .os-footer .os-foot-links--programs > div:last-child {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    gap: 7px !important;
  }

  :is(.cfi-footer, .os-footer, .spark-footer, .yfl-footer)
    :is(.ci-foot-grid, .os-foot-grid, .spark-footer-grid, .yfl-footer-grid)
    > div:not(:first-child)
    a {
    display: block !important;
    min-height: 0 !important;
    padding: 0 !important;
    font-size: 10.5px !important;
    line-height: 1.3 !important;
    overflow-wrap: anywhere !important;
    text-align: left !important;
  }

  body.yfl-page .yfl-footer .yfl-footer-grid .yfl-footer-links a,
  .yfl-footer .yfl-footer-grid .yfl-footer-links a {
    display: block !important;
    min-height: 0 !important;
    padding: 0 !important;
    font-size: 10.5px !important;
    line-height: 1.3 !important;
  }

  :is(.cfi-footer, .os-footer, .spark-footer, .yfl-footer)
    :is(.spark-footer-meta, .yfl-footer-meta, div:has(> [data-bl-footer-copyright])) {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    padding-top: 17px !important;
    text-align: center !important;
  }

  :is(.cfi-footer, .os-footer, .spark-footer, .yfl-footer)
    :is([data-bl-footer-slogan], [data-bl-footer-copyright]) {
    font-size: 10px !important;
    line-height: 1.35 !important;
    text-align: center !important;
  }
}


/* Standard Boundlearn portrait footer — mirror the approved RISE hierarchy. */
@media (orientation:portrait) and (max-width:600px) {
  :is(div, footer):has(> :first-child > [data-bl-footer-copy]):has(> :nth-child(3):last-child) {
    display:grid!important;
    grid-template-columns:repeat(2,minmax(0,1fr))!important;
    align-items:start!important;
  }

  :is(div, footer):has(> :first-child > [data-bl-footer-copy]):has(> :nth-child(3):last-child) > :first-child {
    grid-column:1 / -1!important;
    order:0!important;
  }

  :is(div, footer):has(> :first-child > [data-bl-footer-copy]):has(> :nth-child(3):last-child) > :nth-child(3) {
    order:1!important;
  }

  :is(div, footer):has(> :first-child > [data-bl-footer-copy]):has(> :nth-child(3):last-child) > :nth-child(2) {
    order:2!important;
  }

  .bl-hub-footer .bl-hub-footer-bottom,
  :is(div, footer):has(> [data-bl-footer-copyright]) {
    display:flex!important;
    flex-direction:column!important;
    align-items:center!important;
    justify-content:center!important;
    gap:6px!important;
    text-align:center!important;
  }

  .bl-hub-footer .bl-hub-footer-bottom > *,
  :is(div, footer):has(> [data-bl-footer-copyright]) > * {
    flex:none!important;
    width:auto!important;
    font-size:10px!important;
    line-height:1.35!important;
    text-align:center!important;
  }
}


/* Boundlearn portrait meta: two stacked rows, one unbroken line per row. */
@media (orientation:portrait) and (max-width:600px) {
  .bl-hub-footer .bl-footer-mobile-break {
    display:none!important;
  }

  :is([data-bl-footer-slogan], [data-bl-footer-copyright]) {
    white-space:nowrap!important;
  }
}
