/*
 * Shared Boundlearn programme footer contract for landscape phones.
 * Keep this file loaded after each programme's local responsive stylesheet.
 */
@media (orientation: landscape) and (max-width: 950px) and (max-height: 500px) {
  html.cfi-option-a-preview footer,
  .os-footer,
  .spark-footer,
  .yfl-footer {
    margin: 0 !important;
    padding: 26px 28px 18px !important;
    border-radius: 0 !important;
    background: #0b1221 !important;
    color: #fff !important;
    font-family: "Manrope", system-ui, sans-serif !important;
    text-align: left !important;
  }

  html.cfi-option-a-preview footer > div,
  .os-footer > div,
  .spark-footer > div,
  .yfl-footer > div {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
  }

  .ci-foot-grid,
  .os-foot-grid,
  .spark-footer-grid,
  .yfl-footer-grid {
    display: grid !important;
    grid-template-columns: minmax(220px, 1.42fr) repeat(3, minmax(112px, 1fr)) !important;
    align-items: start !important;
    gap: 22px !important;
    padding: 0 0 20px !important;
    border-bottom: 1px solid rgba(212, 175, 55, 0.24) !important;
    text-align: left !important;
  }

  .ci-foot-grid > *,
  .os-foot-grid > *,
  .spark-footer-grid > *,
  .yfl-footer-grid > * {
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
  }

  .ci-foot-grid > :first-child,
  .os-foot-grid > :first-child,
  .spark-footer-grid > :first-child,
  .yfl-footer-brand {
    grid-column: 1 !important;
    align-self: start !important;
  }

  .spark-footer-grid > :first-child {
    display: block !important;
    align-items: flex-start !important;
  }

  .ci-foot-grid > :first-child img,
  .os-foot-grid > :first-child img,
  .spark-footer-grid > :first-child img,
  .yfl-footer-brand > img,
  .yfl-footer-brand > a > img {
    display: block !important;
    width: auto !important;
    height: 20px !important;
    margin: 0 !important;
    object-fit: contain !important;
    object-position: left center !important;
  }

  .spark-footer-grid > :first-child > img,
  .spark-footer-grid > :first-child > a > img {
    margin-inline: 0 !important;
    object-position: left center !important;
  }

  .ci-foot-grid [data-bl-footer-copy],
  .os-foot-grid [data-bl-footer-copy],
  .spark-footer-grid [data-bl-footer-copy],
  .yfl-footer-grid [data-bl-footer-copy] {
    max-width: 250px !important;
    margin: 10px 0 0 !important;
    color: #8593ac !important;
    font-family: "Manrope", system-ui, sans-serif !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    line-height: 1.45 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
  }

  .ci-foot-grid > :first-child p + div,
  .os-foot-grid > :first-child p + div,
  .spark-footer-grid > :first-child p + div,
  .yfl-footer-brand > p + div {
    justify-content: flex-start !important;
    margin: 11px 0 0 !important;
    gap: 8px !important;
    text-align: left !important;
  }

  .ci-foot-grid > :first-child p + div a,
  .os-foot-grid > :first-child p + div a,
  .spark-footer-grid > :first-child p + div a,
  .yfl-footer-brand > p + div a {
    width: 30px !important;
    height: 30px !important;
    flex: 0 0 30px !important;
    border-radius: 7px !important;
  }

  .ci-foot-grid > :not(:first-child) > :first-child,
  .os-foot-grid > :not(:first-child) > :first-child,
  .spark-footer-grid > :not(:first-child) > :first-child,
  .yfl-footer-grid > :not(:first-child) > :first-child {
    margin: 0 0 9px !important;
    color: #d4af37 !important;
    font-family: "Manrope", system-ui, sans-serif !important;
    font-size: 9.5px !important;
    font-weight: 700 !important;
    line-height: 1.2 !important;
    letter-spacing: 0.1em !important;
    text-transform: uppercase !important;
    white-space: normal !important;
    text-align: left !important;
  }

  .ci-foot-grid > :not(:first-child) > :last-child,
  .os-foot-grid > :not(:first-child) > :last-child,
  .spark-footer-grid > :not(:first-child) > :last-child,
  .yfl-footer .yfl-footer-links,
  .yfl-footer .yfl-footer-programs .yfl-footer-links {
    display: flex !important;
    flex-direction: column !important;
    grid-template-columns: none !important;
    align-items: flex-start !important;
    gap: 6px !important;
    margin: 0 !important;
    text-align: left !important;
  }

  .ci-foot-grid a,
  .os-foot-grid a,
  .spark-footer-grid a,
  .yfl-footer-grid a {
    color: #cbd5e1 !important;
    font-family: "Manrope", system-ui, sans-serif !important;
    font-size: 11px !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    overflow-wrap: anywhere !important;
  }

  body.yfl-page .yfl-footer .yfl-footer-links {
    gap: 5px !important;
  }

  body.yfl-page .yfl-footer .yfl-footer-links a {
    min-height: 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
  }

  .yfl-footer-boundlearn {
    grid-column: 2 !important;
  }

  .yfl-footer-yfl {
    grid-column: 3 !important;
  }

  .yfl-footer-programs {
    grid-column: 4 !important;
  }

  .spark-footer .spark-footer-meta,
  body.yfl-page .yfl-footer .yfl-footer-meta,
  html.cfi-option-a-preview footer > div > div:last-child,
  .os-footer > div > div:last-child {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 16px !important;
    margin: 0 !important;
    padding: 13px 0 0 !important;
    text-align: left !important;
  }

  body.yfl-page .yfl-footer .yfl-footer-meta [data-bl-footer-slogan],
  body.yfl-page .yfl-footer .yfl-footer-meta [data-bl-footer-copyright],
  .spark-footer .spark-footer-meta [data-bl-footer-slogan],
  .spark-footer .spark-footer-meta [data-bl-footer-copyright] {
    flex: 0 0 auto !important;
    text-align: left !important;
  }

  [data-bl-footer-slogan],
  [data-bl-footer-copyright] {
    margin: 0 !important;
    color: #8593ac !important;
    font-size: 10px !important;
    line-height: 1.25 !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    white-space: nowrap !important;
  }
}

/* Final YFL portrait footer ownership, loaded after the legacy page styles. */
@media (orientation: portrait) and (max-width: 600px) {
  body.yfl-page .yfl-footer {
    padding: 38px 20px 24px !important;
  }

  body.yfl-page .yfl-footer .yfl-footer-grid {
    gap: 18px 16px !important;
  }

  body.yfl-page .yfl-footer .yfl-footer-grid > :not(:first-child) > :first-child {
    margin-bottom: 9px !important;
  }

  body.yfl-page .yfl-footer .yfl-footer-links {
    gap: 0 !important;
    row-gap: 0 !important;
  }

  body.yfl-page .yfl-footer .yfl-footer-links a {
    min-height: 24px !important;
    padding: 3px 0 !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
  }
}
