/* ==========================================================================
   Layout — containers, section rhythm, header, navigation, heroes, footer.
   ========================================================================== */

/* --- Container & grid -------------------------------------------------- */

.container {
  width: min(100% - var(--gutter) * 2, var(--container));
  margin-inline: auto;
}

.container--narrow {
  width: min(100% - var(--gutter) * 2, var(--container-narrow));
}

/* Grid and flex children default to `min-width: auto`, which lets wide content
   — an illustration at its intrinsic size, a long e-mail address — push the
   track past the viewport. Every multi-column wrapper opts out. */
.grid > *,
.split > *,
.hero__inner > *,
.info-strip > *,
.cta-band > *,
.stat-grid > *,
.steps > *,
.form-grid > *,
.footer__grid > * {
  min-width: 0;
}

.grid {
  display: grid;
  gap: var(--gap-grid);
}

.grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.grid--3 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
}

.grid--4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
}

/* Two-column feature layout: content beside media. */
.split {
  display: grid;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

@media (min-width: 62em) {
  .split {
    grid-template-columns: 1fr 1fr;
  }

  /* Form pages give the form the wider column. */
  .split--form {
    grid-template-columns: 1.35fr 1fr;
    align-items: start;
  }

  .split--media-first > .split__media {
    order: -1;
  }
}

/* --- Section rhythm ---------------------------------------------------- */

.section {
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: clamp(2.5rem, 4vw, 4rem);
}

.section--alt {
  background: var(--surface-alt);
}

.section--navy {
  background: var(--navy-700);
  color: #fff;
}

.section--navy h2,
.section--navy h3 {
  color: #fff;
}

.section--navy .lede,
.section--navy .text-muted {
  color: rgba(255, 255, 255, 0.75);
}

/* Eyebrow pill on dark surfaces: the light blue chip inverts to a soft veil. */
.section--navy .eyebrow,
.page-hero .eyebrow {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.section-head {
  max-width: 46rem;
  margin-inline: auto;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
  text-align: center;
  display: grid;
  gap: 0.85rem;
  justify-items: center;
}

.section-head--start {
  margin-inline: 0;
  text-align: left;
  justify-items: start;
}

/* --- Skip target ------------------------------------------------------- */

#main:focus {
  outline: none;
}

/* ==========================================================================
   Site header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

/* --- Navigation bar ---------------------------------------------------- */

.navbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 0.85rem;
}

.brand {
  display: inline-flex;
  flex: none;
}

.brand img {
  width: auto;
  height: clamp(2.25rem, 4vw, 2.75rem);
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2rem);
}

.primary-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 2vw, 1.75rem);
  list-style: none;
}

.primary-nav__link {
  position: relative;
  display: inline-block;
  /* Deep enough that the inline nav still clears the 44px touch target on
     tablets wide enough to skip the hamburger — iPad Pro and up. */
  padding-block: 0.55rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--navy-700);
  text-decoration: none;
}

.primary-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: var(--rose-600);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration) var(--ease);
}

.primary-nav__link:hover::after,
.primary-nav__link[aria-current="page"]::after {
  transform: scaleX(1);
}

.primary-nav__link[aria-current="page"] {
  color: var(--rose-600);
}

.nav-toggle {
  display: none;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  color: var(--navy-700);
  place-items: center;
}

.nav-toggle svg {
  width: 1.5rem;
  height: 1.5rem;
}

.nav-toggle__close,
.site-header.is-open .nav-toggle__open {
  display: none;
}

.site-header.is-open .nav-toggle__close {
  display: block;
}

@media (max-width: 61.99em) {
  .nav-toggle {
    display: grid;
  }

  .primary-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    z-index: var(--z-nav-panel);
    flex-direction: column;
    align-items: stretch;
    gap: 0.25rem;
    padding: 1rem var(--gutter) 1.5rem;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    display: none;
  }

  .site-header.is-open .primary-nav {
    display: flex;
  }

  .primary-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .primary-nav__list li + li {
    border-top: 1px solid var(--border);
  }

  .primary-nav__link {
    display: block;
    padding-block: 0.9rem;
  }

  .primary-nav__link::after {
    display: none;
  }

  .nav-cta {
    margin-top: 0.85rem;
    justify-content: center;
  }
}

/* Landscape phones. Paddings that read as generous on a tall screen eat into
   a 360px-tall viewport, so they are tightened; the 44px toggle sets the
   floor for how short the bar can get. */
@media (max-width: 61.99em) and (max-height: 30em) {
  .navbar__inner {
    padding-block: 0.4rem;
  }

  /* Tightened so the whole panel, CTA included, fits a short screen; the
     links keep their 44px depth. overflow-y is the backstop. */
  .primary-nav {
    padding: 0.5rem var(--gutter) 0.75rem;
    max-height: calc(100dvh - 4rem);
    overflow-y: auto;
  }

  .primary-nav__link {
    padding-block: 0.7rem;
  }

  .nav-cta {
    margin-top: 0.5rem;
  }
}

/* ==========================================================================
   Home hero
   ========================================================================== */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(60rem 40rem at 85% -10%, var(--blue-100), transparent 60%),
    radial-gradient(45rem 35rem at 0% 100%, var(--rose-100), transparent 55%),
    var(--surface-alt);
  padding-block: clamp(2.5rem, 6vw, 5rem);
}

.hero__inner {
  display: grid;
  gap: clamp(2.5rem, 5vw, 4rem);
  align-items: center;
}

@media (min-width: 62em) {
  .hero__inner {
    grid-template-columns: 1.05fr 1fr;
  }
}

.hero__content {
  display: grid;
  gap: 1.25rem;
  justify-items: start;
}

.hero__content h1 {
  max-width: 16ch;
}

.hero__content .lede {
  max-width: 46ch;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.5rem;
}

.hero__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  gap: 1.25rem 1.75rem;
  width: 100%;
  margin-top: 1.75rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-strong);
  list-style: none;
}

.hero__fact-value {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--navy-700);
  line-height: 1.2;
}

.hero__fact-label {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.hero__media img {
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
}

/* ==========================================================================
   Inner page hero
   ========================================================================== */

.page-hero {
  position: relative;
  isolation: isolate;
  padding-block: clamp(3rem, 7vw, 5.5rem);
  background:
    radial-gradient(45rem 30rem at 80% 0%, var(--navy-600), transparent 65%),
    linear-gradient(135deg, var(--navy-700), var(--navy-900));
  color: #fff;
  overflow: hidden;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: url("../img/illustrations/pattern-pulse.svg");
  background-size: 200px 120px;
  background-repeat: repeat;
  opacity: 0.85;
}

.page-hero__inner {
  display: grid;
  gap: 0.85rem;
  max-width: 46rem;
}

.page-hero h1 {
  color: #fff;
}

.page-hero__lede {
  font-size: var(--text-lg);
  color: rgba(255, 255, 255, 0.8);
  max-width: 52ch;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.7);
}

.breadcrumb a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: #fff;
  text-decoration: underline;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 0.5rem;
  color: rgba(255, 255, 255, 0.45);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--navy-900);
  color: rgba(255, 255, 255, 0.72);
  font-size: var(--text-base);
}

.footer__grid {
  display: grid;
  gap: clamp(2rem, 4vw, 3rem);
  padding-block: clamp(3rem, 6vw, 4.5rem);
}

@media (min-width: 48em) {
  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* The "Visit us" column carries the clinic e-mail, which must not wrap. A
   1.2fr share of the 1184px container left it ~2px short, so the address broke
   across two lines; the floor reserves enough room for the icon plus the
   longest line at every width from 1024px up. */
@media (min-width: 64em) {
  .footer__grid {
    grid-template-columns: 1.6fr 1fr 1fr minmax(19rem, 1.2fr);
  }
}

.footer__brand {
  display: grid;
  gap: 1.25rem;
  justify-items: start;
  max-width: 26rem;
}

.footer__brand img {
  height: 3.25rem;
  width: auto;
}

.footer__title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 700;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 1.15rem;
}

.footer__list {
  display: grid;
  gap: 0.35rem;
  list-style: none;
}

/* min-height, rather than padding, keeps each link a comfortable touch target
   without shifting its text — the extra space falls below the baseline. */
.footer__list a {
  display: inline-block;
  min-height: 1.75rem;
  color: inherit;
  text-decoration: none;
}

.footer__list a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer__contact {
  display: grid;
  gap: 0.6rem;
  list-style: none;
  font-style: normal;
}

.footer__contact li {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.footer__contact svg {
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
  margin-top: 0.35rem;
  color: var(--rose-500);
}

/* The clinic e-mail is one unbreakable token, so without a break opportunity
   its min-content width can push the whole page sideways. From 1024px up the
   grid reserves enough room for it (see .footer__grid); this is the safety
   valve for very narrow screens and enlarged text. */
.footer__contact a {
  display: inline-block;
  min-height: 1.75rem;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.footer__contact a:hover {
  color: #fff;
  text-decoration: underline;
}

.social-links {
  display: flex;
  gap: 0.6rem;
  list-style: none;
}

.social-links a {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.8);
  transition: background var(--duration) var(--ease),
    color var(--duration) var(--ease), border-color var(--duration) var(--ease);
}

.social-links a:hover {
  background: var(--rose-600);
  border-color: var(--rose-600);
  color: #fff;
}

.social-links svg {
  width: 1.1rem;
  height: 1.1rem;
}

.footer__bar {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  font-size: var(--text-sm);
}

.footer__bar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding-block: 1.35rem;
}

.footer__bar a {
  display: inline-block;
  min-height: 1.75rem;
  color: rgba(255, 255, 255, 0.85);
  overflow-wrap: anywhere;
}
