/* ===========================================================
   Medicross — shared site header
   One header, identical on every page. Self-contained: uses
   var() with literal fallbacks so it renders the same whether
   the page loads home.css, styles.css or portal.css.
   =========================================================== */
.mh {
  position: sticky; top: 0; z-index: 200;
  background: #fff;
  border-bottom: 1px solid var(--line, rgba(33, 30, 26, .1));
  font-family: 'Manrope', system-ui, sans-serif;
}
.mh a { text-decoration: none; color: inherit; }
.mh-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 5px 32px; max-width: 1600px; margin: 0 auto;
}
.mh-logo { flex: none; display: block; }
/* The source lockup was 500x206 with ~133px of empty margin baked in, so most
   of the header's height was blank image. medicross-logo.png is the same
   artwork cropped to its ink (286x77, ratio ~3.71). 56px is a regular,
   nav-scale mark rather than the oversized one the crop produced at 84px.
   The min() keeps it from crowding the inline nav; the constant is the width
   the rest of the header needs. */
.mh-logo img { height: 56px; width: auto; display: block; }
@media (max-width: 1780px) {
  .mh-logo img { height: clamp(24px, min(56px, (100vw - 1258px) / 3.714), 56px); }
}

/* ---------- desktop nav ---------- */
.mh-nav { display: flex; align-items: center; gap: 19px; font-weight: 600; font-size: 14px; color: #4a453d; }
.mh-nav > a,
.mh-item > a {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 10px 0; white-space: nowrap;
  transition: color .2s ease;
}
.mh-nav > a:hover,
.mh-item > a:hover,
.mh-item:hover > a { color: var(--brand, #D42B2B); }
.mh-nav a.current { color: var(--brand, #D42B2B); }
.mh-item { position: relative; }
.mh-item > a svg { width: 13px; height: 13px; flex: none; transition: transform .2s ease; }
.mh-item:hover > a svg { transform: rotate(180deg); }

/* ---------- dropdown ---------- */
.mh-sub {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%) translateY(8px);
  min-width: 250px; padding: 8px;
  background: #fff; border: 1px solid var(--line, rgba(33, 30, 26, .1));
  border-radius: 16px; box-shadow: 0 24px 48px -20px rgba(33, 30, 26, .28);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.mh-item:hover .mh-sub,
.mh-item:focus-within .mh-sub {
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}
.mh-sub a {
  display: block; padding: 10px 14px; border-radius: 10px;
  font-size: 14px; font-weight: 600; color: #4a453d; white-space: nowrap;
  transition: background .18s ease, color .18s ease;
}
.mh-sub a:hover { background: var(--bg-soft, #F3EEE7); color: var(--brand, #D42B2B); }

/* ---------- right side ---------- */
.mh-right { display: flex; align-items: center; gap: 14px; flex: none; }
.mh-phone { font-weight: 700; font-size: 14px; color: var(--ink, #211E1A); white-space: nowrap; }
.mh-phone:hover { color: var(--brand, #D42B2B); }
.mh-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-weight: 700; cursor: pointer; border: none;
  white-space: nowrap; border-radius: 999px; transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.mh-btn-ghost {
  padding: 10px 18px; font-size: 14px;
  background: #fff; color: var(--ink, #211E1A);
  border: 1px solid var(--line, rgba(33, 30, 26, .18));
}
.mh-btn-ghost:hover { border-color: var(--brand, #D42B2B); color: var(--brand, #D42B2B); }
.mh-btn-primary {
  padding: 12px 20px; font-size: 14px;
  background: var(--brand, #D42B2B); color: #fff;
  box-shadow: 0 14px 26px -14px rgba(212, 43, 43, .8);
}
.mh-btn-primary:hover { transform: translateY(-2px); background: var(--brand-dark, #ae2323); }
/* `.mh a { color: inherit }` outranks the button classes, which left the red
   header CTA with dark ink text — restate at matching specificity */
.mh a.mh-btn-primary { color: #fff; }
.mh a.mh-btn-ghost { color: var(--ink, #211E1A); }
.mh a.mh-btn-ghost:hover { color: var(--brand, #D42B2B); }

/* ---------- burger ---------- */
.mh-burger { display: none; background: none; border: none; cursor: pointer; padding: 8px; flex: none; }
.mh-burger span { display: block; width: 24px; height: 2.5px; background: var(--ink, #211E1A); border-radius: 2px; margin: 5px 0; transition: transform .3s ease, opacity .2s ease; }
.mh-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7.5px) rotate(45deg); }
.mh-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.mh-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7.5px) rotate(-45deg); }

/* ---------- mobile panel ---------- */
.mh-mobile { display: none; background: #fff; border-top: 1px solid var(--line, rgba(33, 30, 26, .1)); max-height: calc(100vh - 128px); overflow-y: auto; }
.mh-mobile.open { display: block; }
.mh-mobile > a,
.mh-group > button {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; padding: 15px 26px; text-align: left;
  font-family: inherit; font-weight: 600; font-size: 15px; color: var(--ink, #211E1A);
  background: none; border: none; border-top: 1px solid var(--line, rgba(33, 30, 26, .1)); cursor: pointer;
}
.mh-mobile > a:first-child { border-top: none; }
.mh-group > button svg { width: 15px; height: 15px; flex: none; transition: transform .25s ease; }
.mh-group > button[aria-expanded="true"] svg { transform: rotate(180deg); }
.mh-group-items { display: none; background: var(--bg-soft, #F3EEE7); }
.mh-group-items.open { display: block; }
.mh-group-items a {
  display: block; padding: 13px 26px 13px 42px;
  font-size: 14px; font-weight: 600; color: #4a453d;
  border-top: 1px solid var(--line, rgba(33, 30, 26, .08));
}
.mh-mobile .mh-btn-primary { margin: 16px 26px 22px; justify-content: center; padding: 14px 20px; }

/* the phone number is the first thing to go when space gets tight —
   it stays reachable in the mobile panel and the footer */
@media (max-width: 1800px) {
  .mh-phone { display: none; }
}
@media (max-width: 1400px) {
  .mh-nav { display: none; }
  .mh-burger { display: block; }
  /* no inline nav from here, so the mark can sit at its full size */
  .mh-logo img { height: 38px; }
}
@media (max-width: 1180px) {
  .mh-inner { padding: 5px 26px; }
  .mh-nav { display: none; }
  .mh-burger { display: block; }
}
@media (max-width: 620px) {
  .mh-inner { padding: 5px 16px; gap: 8px; }
  /* 240px = the padding, the gap and the CTA+burger block measured at this
     breakpoint, so the mark takes exactly the width that is left over */
  .mh-logo img { height: clamp(20px, (100vw - 240px) / 3.714, 38px); }
  .mh-btn-ghost { display: none; }
  .mh-btn-primary { padding: 10px 13px; font-size: 12.5px; }
  .mh-burger { padding: 6px; }
  .mh-mobile > a, .mh-group > button { padding-left: 18px; padding-right: 18px; }
  .mh-group-items a { padding-left: 34px; }
  .mh-mobile .mh-btn-primary { margin: 14px 18px 20px; }
}
/* below ~400px the CTA has to give ground too, or there is nothing left for
   the mark; tightening it first buys the logo ~15px of width */
@media (max-width: 400px) {
  .mh-right { gap: 6px; }
  .mh-btn-primary { padding: 9px 11px; font-size: 12px; }
  .mh-logo img { height: clamp(17px, (100vw - 224px) / 3.714, 38px); }
}
