/* Page structure: container, header, sections, footer. */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

@media (min-width: 960px) {
  .section {
    padding-block: var(--space-8);
  }
}

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

.section--brand {
  background: var(--navy-900);
  color: var(--gray-0);
}

.section--brand h2,
.section--brand h3 {
  color: var(--gray-0);
}

.section__header {
  max-width: 40rem;
  margin-bottom: var(--space-6);
}

.section__header p {
  color: var(--color-text-muted);
  font-size: var(--text-lg);
}

.section--brand .section__header p {
  color: var(--blue-100);
}

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

@media (min-width: 640px) {
  .grid--2,
  .grid--3 {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 960px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
}

.prose {
  max-width: 44rem;
}

/* On a container, keep the full width so text lines up with the page heading. */
.container.prose {
  max-width: var(--container);
}

.container.prose > * {
  max-width: 44rem;
}

.prose h2 {
  margin-top: var(--space-6);
  font-size: var(--text-xl);
}

.prose li {
  margin-bottom: var(--space-1);
}

/* Header */
.site-header {
  position: relative;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.site-header::after {
  content: "";
  position: absolute;
  inset: auto 0 -1px;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-600) 0 70%, var(--green-500) 70%);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--header-height);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin-right: auto;
  color: var(--navy-900);
  text-decoration: none;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
  min-height: 2.75rem;
}

.brand img {
  width: 2.5rem;
  height: 2.5rem;
}

.brand span {
  color: var(--blue-600);
}

.site-nav__list {
  display: flex;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__link {
  display: flex;
  align-items: center;
  min-height: 2.75rem; /* 44px touch target */
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-size: 1.0625rem;
  font-weight: 500;
  text-decoration: none;
}

@media (hover: hover) {
  .site-nav__link:hover {
    background: var(--color-surface-brand);
    color: var(--color-primary);
  }
}

.site-nav__link:active {
  background: var(--color-surface-brand);
}

/* The drawer's own "Order a prescription" button; the desktop bar has room for the link. */
.site-nav__cta {
  display: none;
}

.site-nav__link[aria-current="page"] {
  color: var(--color-primary);
  box-shadow: inset 0 -2px 0 var(--color-primary);
}

/* Seven links, the brand and the call button have to fit the page width, so the desktop
   menu is a little tighter than the drawer. */
@media (min-width: 1180px) {
  .site-header__inner {
    gap: var(--space-3);
  }

  .site-nav__link {
    padding-inline: var(--space-2);
    font-size: 1rem;
  }
}

/* .site-header prefix so these beat .button's display rule */
.site-header .nav-toggle {
  display: none;
}

@media (max-width: 1179px) {
  .site-header .nav-toggle {
    display: inline-flex;
  }

  .site-header .site-header__call {
    display: none;
  }

  /* Without JS the nav stays visible below the header; JS collapses it. */
  .js .site-nav {
    display: none;
  }

  .js .site-nav[data-open="true"] {
    display: block;
  }

  .site-nav {
    position: absolute;
    inset: 100% 0 auto;
    z-index: 20;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow);
  }

  .site-nav__list {
    flex-direction: column;
    padding: var(--space-3) var(--gutter) var(--space-5);
  }

  .site-nav__link {
    padding: var(--space-3);
    font-size: var(--text-lg);
  }

  .site-nav__cta {
    display: block;
    margin-bottom: var(--space-3);
  }

  .site-nav__cta .button {
    width: 100%;
  }

  /* The header sits above the dimmed page so the Close button stays reachable. */
  .site-header {
    z-index: 25;
  }

  /* Dims the page behind the open menu: the page is still there, just paused. */
  .nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 24;
    background: oklch(0.22 0.05 262 / 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .nav-backdrop[data-open="true"] {
    opacity: 1;
    pointer-events: auto;
  }
}

@media (min-width: 1180px) {
  .nav-backdrop {
    display: none;
  }
}

/* Footer */
.site-footer {
  background: var(--navy-950);
  color: var(--blue-100);
  padding-block: var(--space-7) var(--space-5);
  font-size: var(--text-sm);
}

.site-footer h2 {
  color: var(--gray-0);
  font-size: var(--text-lg);
}

.site-footer a {
  color: var(--gray-0);
}

.site-footer__grid {
  display: grid;
  gap: var(--space-6);
}

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

@media (min-width: 960px) {
  .site-footer__grid {
    grid-template-columns: 1.3fr 1fr 1fr 1fr;
  }
}

/* Home and Contact: just the brand and the links, because the page shows the details. */
@media (min-width: 640px) {
  .site-footer__grid--compact {
    grid-template-columns: 1.3fr 1fr;
  }
}

.site-footer__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__list li + li {
  margin-top: var(--space-2);
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  justify-content: space-between;
  margin-top: var(--space-6);
  padding-top: var(--space-5);
  border-top: 1px solid rgb(255 255 255 / 0.15);
}

/* Room for the sticky mobile action bar */
@media (max-width: 639px) {
  body {
    padding-bottom: 4.25rem;
  }
}

.brand--light,
.brand--light:hover {
  color: var(--gray-0);
}

.site-footer__legal p {
  margin: 0;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}
