/* ==========================================================================
   components.css — reusable UI. Section-specific rules live in sections.css.
   ========================================================================== */

/* --- Buttons -------------------------------------------------------------
   Both hero CTAs are pill-shaped with a trailing arrow, measured at
   50px and 55px tall respectively in the comp.
   ---------------------------------------------------------------------- */

.btn {
  --btn-pad-x: 1.875rem;
  --btn-pad-y: 1rem;
  --btn-bg: var(--navy);
  --btn-fg: var(--white);

  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  /* Longhands, not the shorthand: a two-value --btn-pad-x would otherwise land
     on padding-bottom instead of padding-right and drop the label off centre. */
  padding-block: var(--btn-pad-y);
  padding-inline: var(--btn-pad-x);
  min-height: 3.125rem;                     /* 50px */
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-ui);
  font-size: 0.8125rem;                       /* 13px — Montserrat runs wider than the comp's Proxima */
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1;
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-pill);
  white-space: nowrap;
  transition: background var(--dur) var(--ease),
              transform var(--dur) var(--ease),
              box-shadow var(--dur) var(--ease);
}

.btn:hover {
  background: var(--royal-600);
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn__arrow {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  transition: transform var(--dur) var(--ease);
}

.btn:hover .btn__arrow {
  transform: translateX(3px);
}

/* Header pill measures 180x50 in the comp: 30px inline pad either side, which
   is what this now actually applies — previously the second value here was
   consumed as padding-bottom (10px), leaving 16px on top and pulling the label
   and arrow 3px below the pill's centre line. */
.btn--partner {
  --btn-pad-x: 1.875rem;
  gap: 0.3125rem;
}

.btn--partner .btn__arrow {
  width: 0.6875rem;
  height: 0.6875rem;
}

/* Tall variant — the "Explore Our Network" pill measures 55px. */
.btn--tall {
  --btn-pad-y: 1.125rem;
  min-height: 3.4375rem;                    /* 55px */
  --btn-pad-x: 2.125rem;
}

.btn--light {
  --btn-bg: var(--white);
  --btn-fg: var(--navy);
  box-shadow: var(--shadow-md);
}

.btn--light:hover {
  background: var(--off-white);
}

/* Text-only CTA with a circular icon affordance — "Become a Prime Physician" */
.link-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.875rem;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--navy);
}

.link-cta__icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.9375rem;                          /* 31px — measured */
  height: 1.9375rem;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}

.link-cta__icon svg {
  width: 0.5625rem;
  height: 0.5625rem;
  margin-left: 2px;
}

.link-cta:hover .link-cta__icon {
  background: var(--navy);
  color: var(--white);
}

/* --- Uppercase label ----------------------------------------------------- */

.label {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: var(--fs-label);
  font-weight: 600;
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--royal);
}

/* --- Standfirst / lead --------------------------------------------------- */

.lead {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--fs-lead);
  line-height: 1.5;
  color: var(--navy);
}

/* --- Header -------------------------------------------------------------- */

.site-header {
  position: absolute;
  inset: 0 0 auto;
  z-index: 100;
  color: var(--navy);
}

.site-header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2rem;
  /* The comp aligns the nav and the pill on a ~50px band at the very top
     of the hero; the logo hangs below them rather than centring the row. */
  min-height: 5rem;
  padding-top: 1.875rem;                     /* 30px — pill top in the comp */
  padding-right: 2.5rem;                     /* 40px — pill ends at x1320 */
}

/* Solid variant used once the page scrolls past the hero. */
.site-header--sticky {
  position: fixed;
  background: var(--white);
  box-shadow: 0 1px 0 var(--hairline), 0 6px 18px rgba(10, 30, 63, 0.06);
  animation: header-drop var(--dur) var(--ease);
}

.site-header--sticky .site-header__inner {
  min-height: 0;
  padding-block: 0.5rem;                         /* 8px top + 8px bottom → 16px total */
  padding-right: 2.5rem;
}

.site-header--sticky .brand {
  position: static;
  transform: none;
  width: 9rem;                              /* 144px — shrinks from 200px, keeps header at ~120px */
  /* The row is packed to the right, which strands the logo mid-header once
     the nav is beside it. margin-right:auto returns it to the left edge. */
  margin-right: auto;
}

/* With the desktop nav in play there is rail slack to spare, so the logo can
   sit nearer the corner than the content rail. */
@media (min-width: 992px) {
  .site-header--sticky .brand {
    margin-left: 0;                          /* keeps logo at rail edge, not off-screen */
  }
}

@keyframes header-drop {
  from { transform: translateY(-100%); opacity: 0; }
  to   { transform: translateY(0);     opacity: 1; }
}

/* --- Brand --------------------------------------------------------------- */

.brand {
  position: absolute;
  left: 0.125rem;                            /* measured x82 vs rail x80 */
  top: 2rem;                                 /* measured y32 */
  display: block;
}

.brand__logo {
  width: 18.6875rem;                         /* 299px — native logo width */
  height: auto;
}

/* --- Primary navigation -------------------------------------------------- */

.site-nav__list {
  display: flex;
  align-items: center;
  gap: 1.5rem;                               /* 24px — tuned to the comp's 485px run */
  margin-right: 6.6875rem;                   /* 107px — nav run ends at x1001, starts x523 */
}

.site-nav__link {
  position: relative;
  font-family: var(--font-ui);
  font-size: var(--fs-nav);
  font-weight: 500;
  letter-spacing: -0.012em;
  color: var(--navy);
  padding-block: 0.25rem;
}

.site-nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--royal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur) var(--ease);
}

.site-nav__link:hover::after,
.site-nav__link:focus-visible::after {
  transform: scaleX(1);
}

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* --- Mobile menu toggle -------------------------------------------------- */

.nav-toggle {
  display: none;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  color: var(--navy);
}

.nav-toggle__bars {
  position: relative;
  width: 1.125rem;
  height: 0.6875rem;
}

.nav-toggle__bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  border-radius: 2px;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.nav-toggle__bars span:nth-child(1) { top: 0; }
.nav-toggle__bars span:nth-child(2) { top: 50%; transform: translateY(-50%); }
.nav-toggle__bars span:nth-child(3) { bottom: 0; }

.nav-toggle[aria-expanded='true'] .nav-toggle__bars span:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded='true'] .nav-toggle__bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded='true'] .nav-toggle__bars span:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }

/* --- Mobile drawer ------------------------------------------------------- */

.nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: grid;
  grid-template-rows: var(--nav-height) 1fr;
  background: var(--white);
  /* visibility flips instantly so the drawer is focusable in the same tick
     it opens; only opacity animates. */
  visibility: hidden;
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.nav-drawer[data-open='true'] {
  visibility: visible;
  opacity: 1;
}

.nav-drawer__body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1.5rem var(--gutter) 3rem;
  overflow-y: auto;
}

.nav-drawer__link {
  padding: 1.0625rem 0;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--navy);
}

.nav-drawer__cta {
  margin-top: 2rem;
  align-self: flex-start;
}

body.nav-open {
  overflow: hidden;
}

@media (max-width: 991px) {
  .site-nav,
  .site-header__actions .btn {
    display: none;
  }

  .nav-toggle {
    display: grid;
  }

  .site-header__inner {
    min-height: 0;
    padding-top: 1rem;
    padding-right: 0;
    justify-content: flex-end;
  }

  /* Back in flow for the mobile bar. */
  .brand {
    position: static;
    margin-right: auto;
  }

  .brand__logo {
    width: 11.25rem;                          /* 180px */
  }
}

@media (max-width: 479px) {
  .brand__logo {
    width: 9.5rem;                            /* 152px */
  }
}
