/* =============================================================================
   DND Infusions & Wellness — Styles
   Structure: Variables • Base • Layout • Components • Sections • Utilities • Responsive
   ========================================================================== */

/* ========== Variables ====================================================== */
:root {
  --brand-900: #003087;
  --brand-800: #0b398c;
  --brand-600: #4064a5;
  --brand-300: #7bafd4;
  --white: #ffffff;
  --bg: #ffffff;
  --bg-muted: #f6f8fb;
  --text: #1f2937;
  --muted: #4b5563;
  --radius: 14px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* ========== Base / Reset =================================================== */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
html,
body {
  width: 100%;
  max-width: 100vw;
  overflow-x: clip;
}
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial,
    sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.55;
}
img,
video,
svg,
canvas,
table {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ========== Layout Primitives ============================================= */
.container {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: 20px;
  width: 100%;
}
.grid {
  display: grid;
  gap: 22px;
}
.hide-sm {
  display: inline-flex;
}
.stack {
  display: flex;
  flex-direction: column;
}
.stack.gap-s {
  gap: 12px;
  margin-block: 14px;
}
.groups {
  display: grid;
  gap: 16px;
} /* stack collapsible groups */

/* ========== Header / Nav =================================================== */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  max-width: 100vw;
  overflow-x: clip;
}
.header__row {
  position: relative; /* anchor for absolute mobile toggle */
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  height: 72px;
  gap: 16px;
}
.brand__img {
  height: 44px;
  width: auto;
}

.nav {
  display: flex;
  gap: 20px;
  justify-content: center;
}
.nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  padding: 10px 6px;
  border-radius: 10px;
}
.nav a:hover {
  color: var(--brand-800);
}
.nav-toggle {
  display: none;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

/* ========== Buttons ======================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.15rem;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.btn--primary {
  background: var(--brand-900);
  color: #fff;
  padding-top: 1.1rem;
} /* slight extra top pad */
.btn--primary:hover {
  background: var(--brand-800);
}
.btn--contrast {
  background: #fff;
  color: var(--brand-900);
  border-color: #e5e7eb;
}
.btn--contrast:hover {
  border-color: #e5e7eb;
  color: var(--brand-800);
}
.btn--ghost {
  background: transparent;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
}
.btn--ghost:hover {
  border-color: #fff;
}

/* Center the final CTA button + add spacing */
.section.section--muted .btn.btn--primary[href*='as.me'] {
  display: block;
  max-width: 260px;
  text-align: center;
  margin: 24px auto 0;
}

/* ========== Hero =========================================================== */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 66vh;
  display: grid;
  align-items: center;
  max-width: 100vw;
  overflow-x: clip;
}
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero__tint {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 48, 135, 0.55),
    rgba(0, 48, 135, 0.25) 28%,
    rgba(0, 48, 135, 0.65)
  );
}
.hero__content {
  position: relative;
  z-index: 1;
  color: #fff;
  max-width: 680px;
  padding-block: 64px;
}
.hero h1 {
  font-size: clamp(28px, 6vw, 48px);
  margin: 0 0 8px;
}
.hero p {
  font-size: clamp(16px, 2.5vw, 18px);
  color: #eef2ff;
  margin: 0 0 16px;
}
.hero__cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* ========== Sections ======================================================= */
.section {
  padding: 64px 0;
  max-width: 100vw;
  overflow-x: clip;
}
.section--muted {
  background: var(--bg-muted);
}
.section__head {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}
.section h2 {
  font-size: clamp(22px, 3.2vw, 32px);
  margin: 0;
}
.section p {
  color: var(--muted);
  margin: 0;
}

/* ========== Cards ========================================================== */
.cards {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card__icon {
  font-size: 22px;
  margin-bottom: 6px;
}
.card h3 {
  margin: 0 0 6px;
  font-size: 18px;
}
.card p {
  margin: 0;
  color: var(--muted);
}
.bullets {
  margin: 10px 0 0 18px;
  color: var(--muted);
}
.bullets li {
  margin: 4px 0;
}

/* Flex cards used in a few sections */
.cards-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  justify-content: center;
  align-items: stretch;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.cards-flex > .card {
  flex: 1 1 320px;
  max-width: 360px;
  min-width: 260px;
}
#expect .cards-flex,
#injections .cards-flex {
  gap: 18px;
}

/* Feature card badge */
.card--feature {
  position: relative;
  padding-left: 56px;
}
.card--feature .card__num {
  position: absolute;
  top: 18px;
  left: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--brand-900);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  box-shadow: 0 6px 14px rgba(0, 48, 135, 0.25);
}
.card--feature h3 {
  margin-top: 0;
}

/* ========== Collapsible Groups ============================================ */
.group {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
details.group {
  padding: 0;
}
.group > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
  outline: none;
  padding: 18px 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
}
.group > summary::-webkit-details-marker {
  display: none;
}
.group[open] > summary {
  border-bottom: 1px solid #e5e7eb;
  background: #fdfefe;
}
.group__chev {
  transition: transform 0.2s ease;
}
.group[open] .group__chev {
  transform: rotate(90deg);
}
.group__body {
  padding: 16px 20px 22px;
}
.group__grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.group__grid .card h3 {
  margin-bottom: 6px;
}

/* ========== Content Blocks (About / Split / Contact) ======================= */
.about {
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
}
.about__copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.about__copy h2 {
  margin: 0;
  font-size: clamp(22px, 3.2vw, 32px);
}
.about__media img {
  border-radius: var(--radius);
}

.grid-2 {
  display: grid;
  gap: 22px;
  grid-template-columns: 1.1fr 0.9fr;
}
.split {
  display: grid;
  gap: 22px;
  grid-template-columns: 1.1fr 0.9fr;
  align-items: center;
}

.contact {
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}
.contact__card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.contact__list {
  list-style: none;
  padding: 0;
  margin: 14px 0 18px;
  display: grid;
  gap: 10px;
}
.contact__list li {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  color: var(--muted);
}
.contact__media img {
  border-radius: var(--radius);
}

/* ========== Typographic Helpers =========================================== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
}
.h4 {
  font-size: 1.05rem;
  margin: 0.2rem 0 0.6rem;
}
.h5 {
  font-size: 0.98rem;
}
.checklist {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 16px;
  list-style: none;
  padding: 0;
  margin: 14px 0;
}
.checklist li {
  display: contents;
}
.checklist li strong {
  font-weight: 700;
  color: var(--text);
}
.checklist li span {
  color: var(--muted);
}
.steps {
  counter-reset: step;
  display: grid;
  gap: 12px;
  padding-left: 0;
  margin: 14px 0;
}
.steps li {
  list-style: none;
  border-left: 3px solid --brand-300;
  padding: 8px 0 8px 12px;
}

/* ========== Footer ========================================================= */
.footer {
  background: linear-gradient(180deg, var(--brand-800), var(--brand-900));
  color: #e8efff;
  padding: 24px 0;
  max-width: 100vw;
  overflow-x: clip;
}
.footer__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 14px;
}
.footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}
.footer__nav a {
  color: #e8efff;
  text-decoration: none;
  line-height: 1.3;
}
.footer__nav a:hover {
  color: #fff;
}

/* =============================================================================
   Responsive
   Breakpoints: 980px (mid), 900px (tablet), 680px (phone), 600px (narrow/legacy)
   ========================================================================== */

/* Mid */
@media (max-width: 980px) {
  .cards-flex > .card {
    flex-basis: 300px;
  }
}

/* Tablet & down */
@media (max-width: 900px) {
  .hide-sm {
    display: none;
  }
  .header__row {
    grid-template-columns: auto 1fr auto;
  }

  /* Single-column everywhere for .cards grids */
  .cards {
    grid-template-columns: 1fr !important;
  }
  .cards > .card {
    min-width: 0;
  }

  .about,
  .grid-2,
  .split,
  .contact {
    grid-template-columns: 1fr;
  }
  .reasons {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .group__grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Phone */
@media (max-width: 680px) {
  /* dropdown panel (header nav) */
  .nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    display: none;
    padding: 12px 20px;
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    box-sizing: border-box;
    width: 100%;
    max-width: 100vw;
    overflow-x: clip;
    z-index: 40;
    pointer-events: none;
  }
  .nav.nav--open {
    display: flex;
    flex-direction: column;
    pointer-events: auto;
  }

  /* hamburger in the top-right, perfectly centered */
  .nav-toggle {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 41;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 10px;
    line-height: 1;
    font-size: 22px;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
  }
  .nav-toggle:focus-visible {
    outline: 2px solid var(--brand-600);
    outline-offset: 2px;
  }

  /* Let grid children shrink within their tracks (avoid overflow) */
  .grid > * {
    min-width: 0;
  }
  .cards > .card {
    min-width: 0;
  }

  /* Tighter lists in Programs */
  #programs .bullets {
    padding-left: 18px;
    margin-left: 0;
  }
  #programs .card {
    padding: 16px;
  }

  .section {
    padding: 32px 0;
  }
  .hero__bg {
    object-position: 30% center;
  }

  .footer__row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .footer__nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px 12px;
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }
  .footer__nav a {
    display: block;
    padding: 8px 4px;
    word-break: break-word;
  }

  .stack.gap-s {
    margin-block: 18px;
  }
  .stack .btn {
    margin-inline: auto;
    width: auto;
  }
    header .nav{
    position: absolute;
    top: 72px; left: 0; right: 0;
    display: none;               /* hidden by default */
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    z-index: 40;
    pointer-events: none;        /* don't steal taps while closed */
  }
  header .nav.nav--open{
    display: flex;               /* <-- becomes visible when open */
    flex-direction: column;
    gap: 10px;
    padding: 12px 20px;
    pointer-events: auto;        /* re-enable taps when open */
  }
  header .nav-toggle{ z-index: 41; }  /* toggle stays above panel edge */
}

/* Narrow legacy */
@media (max-width: 600px) {
  .reasons {
    grid-template-columns: 1fr;
  }
}

/* Lists-as-cards: remove default UL padding/bullets */
.grid.cards {
  list-style: none;
  padding-left: 0;
  margin: 10px 0 0;
}
.grid.cards > li {
  margin: 0;
}

/* Injections tweaks (kept from previous) */
#injections .cards {
  gap: 16px;
}
#injections .card h3 {
  font-size: 17px;
  margin-bottom: 4px;
}
#injections .card p {
  line-height: 1.5;
}

/* Centering hack for 3-col grids on wide layouts (optional legacy) */
@media (min-width: 901px) {
  .grid.cards > :last-child:nth-child(3n + 1) {
    grid-column: 2;
  }
  .grid.cards > :nth-last-child(2):nth-child(3n + 1) {
    grid-column: 2;
  }
  .grid.cards.cards--center-last > :last-child:nth-child(3n + 1),
  .grid.cards.cards--center-last > :nth-last-child(2):nth-child(3n + 1) {
    grid-column: 2;
  }
}

/* Make all CTA buttons a consistent width */
.btn {
  min-width: 220px; /* consistent base size */
  text-align: center; /* keeps text centered */
}

.stack .btn {
  align-self: center; /* center buttons in stacks */
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center; /* centers horizontally */
  gap: 10px;
  margin-top: 14px;
}

/* Mobile nav: render above everything and avoid clipping on iOS */
@media (max-width: 680px) {
  .header {
    position: sticky; /* keep your behavior */
    top: 0;
    z-index: 1000;    /* ensure header stack is above hero/tints */
    overflow: visible;/* guard against accidental clipping */
  }

  /* Put the mobile panel on the viewport, not inside a possibly-clipping parent */
  header .nav {
    position: fixed;      /* CHANGED from absolute */
    top: 72px;            /* below header */
    left: 0;
    right: 0;
    display: none;        /* closed state */
    background: #fff;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 20px;
    gap: 10px;
    flex-direction: column;
    z-index: 1001;        /* panel layer */
    pointer-events: none; /* closed should not intercept taps */
  }
  header .nav.nav--open {
    display: flex;        /* visible when open */
    pointer-events: auto; /* re-enable taps */
  }

  /* Ensure the button itself can always be tapped */
  .nav-toggle {
    position: relative;
    z-index: 1002;        /* above the panel edge */
  }

  /* Optional: ensure hero layers never cover the header/nav */
  .hero__bg, .hero__tint {
    z-index: 0 !important;  /* keep them behind */
  }
}

/* Keep hamburger pinned to the right on mobile */
@media (max-width: 680px){
  .header .header__row{ position: relative; }

  .nav-toggle{
    position: absolute;        /* take it out of the flow */
    right: 16px;               /* pin to right edge */
    top: 50%;                  /* vertically center in header */
    transform: translateY(-50%);
    margin: 0;
    z-index: 1002;             /* above the panel edge */
  }

  /* Make sure the brand stays left and doesn't collide */
  .brand{ margin-right: auto; }
}