/* The one top bar on every public MyClinicFlo page (lib/site-bar.js writes
   its markup). Its sizes are the EMR page's bar. A page sets
   --mcf-page-max and --mcf-page-gutter to line the bar up with its content,
   and reads the bar's height from --mcf-bar-h. Wide screens: one row.
   Below 1240px a full bar (a button or several section links) takes two
   rows and a short one (Home) stays one; a phone adds a row to each. The
   rows always read in markup order, so the keyboard follows them. */
:root {
  --mcf-bar-h: 94px;
}
.mcf-bar {
  --mcf-bar-pad: 24px;
  --mcf-bar-logo: 176px;
  --mcf-bar-gap: 28px;
  --mcf-bar-text: 16px;
  --mcf-bar-control: 46px;
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--color-ground);
  font:
    var(--mcf-bar-text) / 1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  color: var(--color-ink-soft);
}
.mcf-bar *,
.mcf-bar *::before,
.mcf-bar *::after {
  box-sizing: border-box;
}
.mcf-bar-inner {
  display: flex;
  align-items: center;
  gap: var(--mcf-bar-gap);
  max-width: var(--mcf-page-max, 1680px);
  margin-inline: auto;
  padding: var(--mcf-bar-pad) var(--mcf-page-gutter, clamp(24px, 3.333vw, 64px));
}
.mcf-bar a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.mcf-bar a:hover {
  color: var(--color-ink);
}
.mcf-bar a:focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 4px;
}
.mcf-bar-logo {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.mcf-bar-logo img {
  display: block;
  width: var(--mcf-bar-logo);
  height: auto;
}
.mcf-bar-nav,
.mcf-bar-sections,
.mcf-bar-end {
  display: flex;
  align-items: center;
  gap: var(--mcf-bar-gap);
}
.mcf-bar-nav {
  margin-left: auto;
}
.mcf-bar a[aria-current="page"] {
  color: var(--color-primary);
  font-weight: 600;
}
.mcf-bar-country {
  display: inline-flex;
  align-items: center;
  min-height: var(--mcf-bar-control);
  border: 1px solid var(--color-line);
  border-radius: var(--rounded-control);
  overflow: hidden;
  font-size: 14px;
  font-weight: 500;
}
.mcf-bar-country a,
.mcf-bar-country-on {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-width: 44px;
  padding: 0 10px;
}
.mcf-bar-country-on {
  background: var(--color-primary-soft);
  color: var(--color-primary-ink);
}
.mcf-bar .mcf-bar-signin,
.mcf-bar .mcf-bar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--mcf-bar-control);
  padding: 10px 18px;
  border-radius: var(--rounded-control);
  font-weight: 500;
}
.mcf-bar .mcf-bar-signin {
  border: 1px solid var(--color-line);
  color: var(--color-ink);
}
.mcf-bar .mcf-bar-button,
.mcf-bar .mcf-bar-button:hover {
  border: 1px solid var(--color-primary);
  background: var(--color-primary);
  color: var(--color-on-primary);
}
@media (max-width: 1240px) {
  :root {
    --mcf-bar-h: 134px;
  }
  :root:has(.mcf-bar[data-bar="short"]) {
    --mcf-bar-h: 94px;
  }
  .mcf-bar {
    --mcf-bar-gap: 20px;
    --mcf-bar-logo: 160px;
    /* Links get 44px boxes from even side padding, so the visible gaps
       between labels stay equal whatever their length. */
    --mcf-bar-link-pad: 15px;
  }
  .mcf-bar-nav,
  .mcf-bar-sections {
    gap: 0;
  }
  .mcf-bar-nav a,
  .mcf-bar-sections a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding-inline: var(--mcf-bar-link-pad);
  }
  /* The products end flush with the gutter, the section links start flush
     with it; their padding reaches into it unseen. */
  .mcf-bar-nav {
    margin-right: calc(-1 * var(--mcf-bar-link-pad));
  }
  .mcf-bar-sections {
    flex-wrap: wrap;
    margin-left: calc(-1 * var(--mcf-bar-link-pad));
  }
  .mcf-bar[data-bar="short"] .mcf-bar-nav {
    margin-right: 0;
  }
  .mcf-bar[data-bar="short"] .mcf-bar-sections {
    margin-left: calc(-1 * var(--mcf-bar-gap));
  }
  /* Full bar: the logo and the products; then the section links, the
     country switch, Sign in and the button. */
  .mcf-bar[data-bar="full"] .mcf-bar-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "logo nav"
      "sections end";
    row-gap: 12px;
    padding-block: 16px;
  }
  .mcf-bar[data-bar="full"] .mcf-bar-logo {
    grid-area: logo;
    justify-self: start;
  }
  .mcf-bar[data-bar="full"] .mcf-bar-nav {
    grid-area: nav;
    justify-self: end;
  }
  .mcf-bar[data-bar="full"] .mcf-bar-sections {
    grid-area: sections;
  }
  .mcf-bar[data-bar="full"] .mcf-bar-end {
    grid-area: end;
    justify-self: end;
  }
}
@media (max-width: 820px) {
  /* A phone: the bar scrolls away with the page. Full bar: the logo and
     the products; the section links; the country switch, Sign in and the
     button. Short bar: the logo and the products; the section link, the
     country switch and Sign in. */
  :root {
    --mcf-bar-h: 192px;
  }
  :root:has(.mcf-bar[data-bar="short"]) {
    --mcf-bar-h: 136px;
  }
  .mcf-bar {
    --mcf-bar-pad: 16px;
    --mcf-bar-gap: 16px;
    --mcf-bar-logo: 136px;
    position: static;
  }
  .mcf-bar .mcf-bar-inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: 12px;
    padding-block: 16px;
  }
  .mcf-bar[data-bar="full"] .mcf-bar-inner {
    grid-template-areas:
      "logo nav"
      "sections sections"
      "end end";
  }
  .mcf-bar[data-bar="short"] .mcf-bar-inner {
    grid-template-areas:
      "logo nav"
      "sections end";
  }
  .mcf-bar-logo {
    grid-area: logo;
    min-height: var(--mcf-bar-control);
  }
  .mcf-bar .mcf-bar-nav {
    grid-area: nav;
    justify-self: end;
    margin-left: 0;
    margin-right: calc(-1 * var(--mcf-bar-link-pad));
  }
  .mcf-bar .mcf-bar-sections {
    grid-area: sections;
    margin-left: calc(-1 * var(--mcf-bar-link-pad));
    margin-right: calc(-1 * var(--mcf-bar-link-pad));
  }
  .mcf-bar[data-bar] .mcf-bar-end {
    grid-area: end;
    justify-self: stretch;
  }
  .mcf-bar[data-bar="short"] .mcf-bar-end {
    justify-self: end;
  }
  .mcf-bar .mcf-bar-button {
    margin-left: auto;
  }
  .mcf-bar .mcf-bar-signin {
    padding: 8px 12px;
  }
}
