/* Shared blue palette, loaded last on all English, Arabic and Spanish pages.
   Keep legacy token aliases so existing components use the same colors. */
@media screen {
  html body, html body.site-design {
    --ahad-navy: #173a56;
    --ahad-blue: #1d5f91;
    --ahad-blue-hover: #164c75;
    --ahad-sky: #c9e0f2;
    --ahad-soft: #e4eff8;
    --ahad-mist: #eef4fa;
    --ahad-paper: #f7f9fc;
    --ahad-line: #c4d6e5;
    --ahad-text: #172b3a;
    --ahad-muted: #475e70;
    --ink: var(--ahad-navy);
    --navy: var(--ahad-navy);
    --blue: var(--ahad-blue);
    --teal: var(--ahad-blue);
    --teal-soft: var(--ahad-soft);
    --soft: var(--ahad-soft);
    --mist: var(--ahad-mist);
    --paper: var(--ahad-paper);
    --gold: var(--ahad-sky);
    --gold-deep: #759dbd;
    --gold-dark: #759dbd;
    --line: var(--ahad-line);
    --text: var(--ahad-text);
    --muted: var(--ahad-muted);
    --shadow: 0 2px 4px #173a5608, 0 16px 36px -22px #173a5640;
    margin: 0 !important;
    background: var(--ahad-paper) !important;
    color: var(--ahad-text) !important;
  }

  /* The same header and direct, keyboard-accessible Services link everywhere. */
  html body .locale-header {
    background: #fff !important;
    border-bottom: 1px solid var(--ahad-line) !important;
  }
  html body .locale-languages a[aria-current=page] {
    background: var(--ahad-navy) !important;
    color: #fff !important;
  }
  html body .locale-header .locale-nav > a.site-link.locale-services-link {
    display: inline-flex !important;
    align-items: center !important;
    min-height: 44px !important;
    padding: 9px 14px !important;
    border-radius: 10px !important;
    background: var(--ahad-soft) !important;
    color: var(--ahad-navy) !important;
    font-weight: 600 !important;
    text-decoration: none !important;
  }
  html body .locale-header .locale-nav > a.site-link.locale-services-link:hover {
    background: var(--ahad-sky) !important;
  }
  html body :is(a, button, summary):focus-visible {
    outline: 3px solid var(--ahad-blue) !important;
    outline-offset: 4px !important;
  }

  /* Soft-blue service tiles distinguish the choices from the page surface. */
  html body.site-design section.services {
    background: var(--ahad-paper) !important;
  }
  html body.site-design section.services .service-block.text-service-cards ul li > .site-link {
    background: var(--ahad-soft) !important;
    border: 1px solid var(--ahad-line) !important;
    border-top: 4px solid var(--ahad-blue) !important;
    border-radius: 16px !important;
    box-shadow: 0 3px 8px #173a5608 !important;
    transition: background-color .18s, border-color .18s, box-shadow .18s, transform .18s !important;
  }
  html body.site-design section.services .service-block.text-service-cards ul li > .site-link:is(:hover, :focus-visible) {
    background: #d3e5f3 !important;
    border-color: var(--ahad-blue) !important;
    box-shadow: var(--shadow) !important;
  }
  html body.site-design section.services .service-block.text-service-cards ul li > .site-link .service-name {
    color: var(--ahad-navy) !important;
  }
  html body.site-design section.services .service-block.text-service-cards ul li > .site-link .service-more {
    color: var(--ahad-blue) !important;
  }

  /* Banners, callouts and footers share the same navy and blue tones. */
  html body.site-design .herosub,
  html body > section.hero,
  html body #osteoporosis-content .bone-hero {
    background: var(--ahad-navy) !important;
  }
  html body > section.hero :is(h1, .lead, .provider, .breadcrumb, .breadcrumb a),
  html body #osteoporosis-content .bone-hero :is(h1, p) {
    color: #fff !important;
  }
  html body > section.hero :is(h1 span, .eyebrow) {
    color: var(--ahad-sky) !important;
  }
  html body.site-design :is(.respiratory-highlight, .respiratory-urgent, .mental-crisis, .diabetes-nav a),
  html body :is(.panel.soft, .result, .stage) {
    background: var(--ahad-soft) !important;
    border-color: var(--ahad-line) !important;
  }
  html body.site-design :is(.diabetes-nav a, .diabetes-table thead th) {
    color: var(--ahad-navy) !important;
  }
  html body.site-design .diabetes-table thead th {
    background: var(--ahad-soft) !important;
  }
  html body :is(.sectionbar, .bone-sectionbar) {
    background: var(--ahad-mist) !important;
  }
  html body footer {
    background: var(--ahad-navy) !important;
    color: #e4eff8 !important;
  }
  html body footer :is(p, a, strong, .nap, .nap *) {
    color: #e4eff8 !important;
  }

  /* Primary actions use white text on blue; secondary actions stay pale. */
  html body .locale-nav .locale-book,
  html body.site-design .modern-actions .site-link:first-child,
  html body.site-design :is(.ted-button, .respiratory-button, .btn-book-online, .primary-btn.site-link, .ahad-review-primary.site-link, .language-care-primary, .btn-submit, button[type=submit], .intake-page .button, #prepare-pdfs),
  html body .hero-actions .btn.primary,
  html body .result .btn.primary {
    background: var(--ahad-blue) !important;
    color: #fff !important;
    border-color: var(--ahad-blue) !important;
    box-shadow: 0 2px 0 var(--ahad-blue-hover) !important;
  }
  html body .locale-nav .locale-book:hover,
  html body.site-design .modern-actions .site-link:first-child:hover,
  html body.site-design :is(.ted-button, .respiratory-button, .btn-book-online, .primary-btn.site-link, .ahad-review-primary.site-link, .language-care-primary, .btn-submit, button[type=submit], .intake-page .button, #prepare-pdfs):hover,
  html body .hero-actions .btn.primary:hover,
  html body .result .btn.primary:hover {
    background: var(--ahad-blue-hover) !important;
    color: #fff !important;
  }
  html body > section.hero .btn:focus-visible,
  html body footer a:focus-visible {
    outline-color: var(--ahad-sky) !important;
  }

  /* The newer bone-health template uses locally scoped variables. */
  html body #osteoporosis-content {
    --blue: var(--ahad-blue) !important;
    --navy: var(--ahad-navy) !important;
    --pale: var(--ahad-soft) !important;
    --line: var(--ahad-line) !important;
    --ink: var(--ahad-text) !important;
    --bg: var(--ahad-paper) !important;
  }
  html body #osteoporosis-content .bone-btn {
    border-radius: 999px !important;
  }
  html body #osteoporosis-content .bone-btn:hover {
    background: var(--ahad-blue-hover) !important;
    color: #fff !important;
  }
  html body #osteoporosis-content .bone-contact {
    border-radius: 16px !important;
  }
  html body #osteoporosis-content .bone-sectionbar {
    background: var(--ahad-mist) !important;
  }
  html body #osteoporosis-content :is(a, button):focus-visible {
    outline-color: var(--ahad-blue) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body.site-design section.services .service-block.text-service-cards ul li > .site-link {
    transition: none !important;
    transform: none !important;
  }
}

/* Keep the bone-health introduction readable when printed or saved as PDF. */
@media print {
  html body #osteoporosis-content .bone-hero :is(h1, p) {
    color: #000 !important;
  }
}
