/* Keep the site's existing sort chip and original option links. */
:root {
  --mr-sort-safe-top: 80px;
  --mr-sort-safe-bottom: 140px;
}
.sort.mr-sort-enhanced > .mr-sort-toggle {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  z-index: 2;
  appearance: none;
  background: transparent !important;
  border: 0 !important;
  border-radius: inherit;
  padding: 0 !important;
  margin: 0 !important;
  box-shadow: none !important;
  cursor: pointer;
}
.sort.mr-sort-enhanced > ul[hidden] {
  display: none !important;
}
.sort.mr-sort-enhanced > ul {
  min-width: min(190px, calc(100vw - 24px)) !important;
  max-width: calc(100vw - 24px) !important;
  left: var(--mr-sort-list-left, auto) !important;
  right: auto !important;
  top: calc(100% + 4px) !important;
  bottom: auto !important;
  max-height: var(--mr-sort-max-height, 60vh) !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  overscroll-behavior: contain;
  background: #ffffff !important;
  color: #163d66 !important;
  box-shadow: 0 8px 24px rgba(20, 40, 70, .16);
}
.sort.mr-sort-enhanced.mr-sort-above > ul {
  top: auto !important;
  bottom: calc(100% + 4px) !important;
  border-radius: 16px 16px 0 0;
}
.sort.mr-sort-enhanced > ul a,
.sort.mr-sort-enhanced > ul button {
  display: flex !important;
  align-items: center;
  min-height: 44px;
  box-sizing: border-box;
  padding: 10px 16px !important;
  text-align: left !important;
  line-height: 1.4;
  color: #163d66 !important;
  background: #ffffff !important;
}
.sort.mr-sort-enhanced > ul a:hover,
.sort.mr-sort-enhanced > ul button:hover {
  background: #eaf3fe !important;
  color: #14233a !important;
}
.sort.mr-sort-enhanced.mr-sort-open > ul:not([hidden]) {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateY(0) !important;
}
.sort.mr-sort-enhanced.mr-sort-open::before {
  transform: translateY(-50%) rotate(180deg) !important;
}
.sort.mr-sort-enhanced:not(.mr-sort-open) {
  border-radius: 20px !important;
}
.sort.mr-sort-enhanced > .mr-sort-toggle:focus-visible {
  outline: 3px solid #1577e5 !important;
  outline-offset: 3px;
}
.sort.mr-sort-enhanced > ul a:focus-visible,
.sort.mr-sort-enhanced > ul button:focus-visible {
  outline: 3px solid #1577e5 !important;
  outline-offset: -3px;
  background: #eaf3fe !important;
  color: #14233a !important;
}

/* Stage 2 proposal. Load after mr-home-qa-v1.css.
   Scope: ordinary site controls and footer. No .bb-si/.bb-push widget rules. */
:root {
  --mr-ui-footer: #1264b0;
  --mr-ui-footer-muted: #e6f1ff;
  --mr-ui-blue: #1267c5;
  --mr-ui-blue-hover: #0f58a8;
  --mr-ui-wa: #137c3a;
  --mr-ui-wa-hover: #106a32;
  --mr-ui-tg: #0875a7;
  --mr-ui-tg-hover: #06648f;
  --mr-ui-max: linear-gradient(135deg, #6842d7, #8640bd);
  --mr-ui-max-hover: linear-gradient(135deg, #5935c2, #7433a8);
}

/* Retain the blue footer, with opaque secondary text instead of low alpha. */
.footer .footer-wrap {
  background: var(--mr-ui-footer) !important;
}
.footer .footer-col li,
.footer .footer-col p,
.footer .footer-col p.footer-about,
.footer .footer-col p.footer-since,
.footer .footer-col-summary.footer-col-empty,
.footer .footer-label,
.footer .footer-address,
.footer .footer-address > span:not(.footer-addr-name),
.footer .footer-row .footer-value.footer-value,
.footer .footer-legal-meta,
.footer .footer-legal-links a,
.footer .trust-stat-lbl,
.footer .trust-group-label {
  color: var(--mr-ui-footer-muted) !important;
}
.footer .footer-col h3.footer-col-title,
.footer .footer-col h4,
.footer .footer-address .footer-addr-name,
.footer .footer-legal .copyright,
.footer .footer-legal .copyright a,
.footer .footer-summary,
.footer .trust-badge {
  color: #fff !important;
}
.footer .trust-badge:hover {
  background: rgba(255, 255, 255, .10) !important;
}
.footer .footer-legal-links a:hover {
  color: #fff !important;
}

/* The maximum specificity inside :is is deliberate: existing colors use
   !important and duplicated footer classes. Geometry remains unchanged. */
body :is(.hero-pills a.hpill-wa, .mr-cta-bar a.mr-cta-wa, .footer .footer-cta-buttons a.footer-btn-wa) {
  background: var(--mr-ui-wa) !important;
}
body :is(.hero-pills a.hpill-tg, .mr-cta-bar a.mr-cta-tg, .footer .footer-cta-buttons a.footer-btn-tg) {
  background: var(--mr-ui-tg) !important;
}
body :is(.hero-pills a.hpill-max, .mr-cta-bar a.mr-cta-max, .footer .footer-cta-buttons a.footer-btn-max) {
  background: var(--mr-ui-max) !important;
}
body :is(.hero-pills a.hpill-wa, .mr-cta-bar a.mr-cta-wa, .footer .footer-cta-buttons a.footer-btn-wa):hover {
  background: var(--mr-ui-wa-hover) !important;
}
body :is(.hero-pills a.hpill-tg, .mr-cta-bar a.mr-cta-tg, .footer .footer-cta-buttons a.footer-btn-tg):hover {
  background: var(--mr-ui-tg-hover) !important;
}
body :is(.hero-pills a.hpill-max, .mr-cta-bar a.mr-cta-max, .footer .footer-cta-buttons a.footer-btn-max):hover {
  background: var(--mr-ui-max-hover) !important;
}

/* Ordinary in-content contact cards have ID-specific overrides in the base CSS. */
:is(#list_albums_common_albums_list, #list_videos_common_videos_list, body) .bbad-sea .cta a.btn.mr-adbtn-wa {
  background: var(--mr-ui-wa) !important;
}
:is(#list_albums_common_albums_list, #list_videos_common_videos_list, body) .bbad-sea .cta a.btn.mr-adbtn-tg {
  background: var(--mr-ui-tg) !important;
}
:is(#list_albums_common_albums_list, #list_videos_common_videos_list, body) .bbad-sea .cta a.btn.mr-adbtn-max {
  background: var(--mr-ui-max) !important;
}
:is(#list_albums_common_albums_list, #list_videos_common_videos_list, body) .bbad-sea .cta a.btn.mr-adbtn-wa:hover {
  background: var(--mr-ui-wa-hover) !important;
}
:is(#list_albums_common_albums_list, #list_videos_common_videos_list, body) .bbad-sea .cta a.btn.mr-adbtn-tg:hover {
  background: var(--mr-ui-tg-hover) !important;
}
:is(#list_albums_common_albums_list, #list_videos_common_videos_list, body) .bbad-sea .cta a.btn.mr-adbtn-max:hover {
  background: var(--mr-ui-max-hover) !important;
}

/* Disable the old brightness/opacity effects, which can weaken text contrast. */
body :is(.hero-pills a.hpill, .mr-cta-bar a.mr-cta, .footer .footer-cta-buttons a.footer-btn):is(:hover, :active),
:is(#list_albums_common_albums_list, #list_videos_common_videos_list, body) .bbad-sea .cta a.btn.mr-adbtn:is(:hover, :active) {
  color: #fff !important;
  filter: none !important;
  opacity: 1 !important;
}

#search_form .search-button,
body a.mr-pch-contact,
#mr-mobtop a.mr-mobtop-c,
body #mr-drawer ul.mr-d-list li.mr-d-cta a {
  background: var(--mr-ui-blue) !important;
  color: #fff !important;
}
#search_form .search-button:is(:hover, :active),
body a.mr-pch-contact:is(:hover, :active),
#mr-mobtop a.mr-mobtop-c:is(:hover, :active),
body #mr-drawer ul.mr-d-list li.mr-d-cta a:hover {
  background: var(--mr-ui-blue-hover) !important;
  filter: none !important;
  opacity: 1 !important;
}
#search_form {
  background: #fff !important;
}
#search_form input[type="text"] {
  color: #1a2b3c !important;
}
#search_form input[type="text"]::placeholder {
  color: #526475 !important;
  opacity: 1 !important;
}
body .mr-burger.mr-burger-hero {
  background: var(--mr-ui-blue) !important;
}
body .mr-burger.mr-burger-sticky .bicon i {
  background: var(--mr-ui-blue) !important;
}
#mr-drawer .mr-d-t {
  color: #526475 !important;
}

/* Two colors keep keyboard focus visible against pale cards and blue/image
   surfaces. The opaque white inner band isolates the navy outer ring. */
body :is(.footer-col a[href], .footer-legal-links a[href], .footer-legal .copyright a[href], .footer .trust-badge[href], .footer .footer-cta-buttons a.footer-btn, .hero-pills a.hpill, .mr-cta-bar a.mr-cta, a.mr-pch-contact, #mr-mobtop a.mr-mobtop-c, #search_form button.search-button, #search_form input[type="text"], [data-nav-open], #mr-drawer .mr-d-x, #mr-drawer ul.mr-d-list li a[href], .mr-pch-nav a[href]):focus-visible,
:is(#list_albums_common_albums_list, #list_videos_common_videos_list, body) .bbad-sea .cta a.btn.mr-adbtn:focus-visible {
  outline: 3px solid #082f5b !important;
  outline-offset: 3px !important;
  box-shadow: 0 0 0 3px #fff !important;
  -webkit-box-shadow: 0 0 0 3px #fff !important;
}
@media (forced-colors: active) {
  body :is(.footer-col a[href], .footer-legal-links a[href], .footer-legal .copyright a[href], .footer .trust-badge[href], .footer .footer-cta-buttons a.footer-btn, .hero-pills a.hpill, .mr-cta-bar a.mr-cta, a.mr-pch-contact, #mr-mobtop a.mr-mobtop-c, #search_form button.search-button, #search_form input[type="text"], [data-nav-open], #mr-drawer .mr-d-x, #mr-drawer ul.mr-d-list li a[href], .mr-pch-nav a[href]):focus-visible,
  :is(#list_albums_common_albums_list, #list_videos_common_videos_list, body) .bbad-sea .cta a.btn.mr-adbtn:focus-visible {
    outline-color: Highlight !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
  }
}

/* Leave space for the site's fixed header and ordinary contact bar. */
html {
  scroll-padding-top: var(--mr-ui-safe-top, 80px);
  scroll-padding-bottom: var(--mr-ui-safe-bottom, 140px);
}
body :is(.mr-sort-toggle, .sort a, .pagination a[href], .mr-dir-toggle,
  #search_form input, #search_form button, .footer a[href],
  .list-videos .item > a[href], .list-albums .item > a[href]):focus {
  scroll-margin-top: var(--mr-ui-safe-top, 80px);
  scroll-margin-bottom: var(--mr-ui-safe-bottom, 140px);
}
.pagination a[href]:focus-visible,
.mr-dir-toggle:focus-visible {
  outline: 3px solid #1267c5 !important;
  outline-offset: 3px !important;
}
:is(.list-videos, .list-albums) .item:has(> a[href]:focus-visible) {
  outline: 3px solid #1267c5 !important;
  outline-offset: 3px !important;
}
@media (forced-colors: active) {
  .pagination a[href]:focus-visible,
  .mr-dir-toggle:focus-visible,
  :is(.list-videos, .list-albums) .item:has(> a[href]:focus-visible) {
    outline-color: Highlight !important;
  }
}

/* Small card metadata uses the same readable secondary text color. */
.list-videos .item .yt-meta,
.list-albums .item .wrap.meta-compact {
  color: #526475 !important;
}

/* Legal text must fit the footer and remain above the fixed contact bar. */
body:has(.mr-cta-bar) { padding-bottom: var(--mr-ui-safe-bottom, 140px) !important; }
@media (max-width: 768px) {
  .footer .footer-wrap > * {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }
  .footer .footer-legal { width: 100%; min-width: 0; max-width: 100%; }
  .footer .footer-legal .copyright {
    display: block !important;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    overflow-wrap: anywhere;
    white-space: normal;
  }
  .footer .footer-legal .copyright a {
    display: inline !important;
    white-space: normal;
  }
}
