/* ==========================================================================
   mb-how-it-works.module — "How Methylene Blue Works in Your Cells"
   Figma: "Methylene Blue - Desktop" › Section 3 (13274:176)
   ========================================================================== */

.mb-how-it-works {
  --mb-blue: var(--color-blue-ocean, #0077BA);
  --mb-blue-dark: var(--color-blue-dark, #005381);
  --mb-blue-accent: #7FB4D8;
  --mb-blue-mid: #508AC5;
  --mb-blue-pale: #8CCAE5;
  --mb-card: #D5E9F4;
  --mb-bg-soft: #E7F2FA;
  --mb-text: #4A5B67;
  --mb-muted: #55697A;
  --mb-body: var(--color-gray-dark, #3C3C3C);
  --mb-orange: var(--color-cta-primary, #F96F48);
  --mb-orange-hover: var(--color-cta-primary-hover, #E05C34);
  --mb-font-head: 'Montserrat', sans-serif;
  --mb-font-body: 'Source Sans Pro', 'Lato', sans-serif;
  --mb-shell: 1200px;
  --mb-pad-y: 96px;
  --mb-pad-x: 120px;
  background: var(--mb-bg-soft);
  font-family: var(--mb-font-body);
  padding: var(--mb-pad-y) var(--mb-pad-x);
}

.mb-how-it-works,
.mb-how-it-works *,
.mb-how-it-works *::before,
.mb-how-it-works *::after {
  box-sizing: border-box;
}

/* The parent theme sets `li { margin: .7rem }`, which insets every grid and
   flex item by 11.2px per side and knocks card rows out of alignment with the
   full-width panels around them. Lists here space themselves with `gap`. */
.mb-how-it-works ul,
.mb-how-it-works ol {
  margin: 0;
  padding: 0;
}

.mb-how-it-works li {
  margin: 0;
}

.mb-how-it-works__inner {
  max-width: var(--mb-shell);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.mb-how-it-works__intro-row {
  display: flex;
  align-items: flex-start;
  gap: 60px;
}

.mb-how-it-works__intro-copy {
  flex: 0 1 556px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.mb-how-it-works__heading {
  margin: 0;
  font-family: var(--mb-font-head);
  font-weight: 600;
  font-size: 36px;
  line-height: 1.25;
  color: var(--mb-blue-dark);
}

.mb-how-it-works__heading-accent { color: var(--mb-blue-accent); }

.mb-how-it-works__intro {
  margin: 0;
  color: var(--mb-text);
  font-size: 18px;
  line-height: 1.5;
}

.mb-how-it-works__media {
  flex: 0 0 584px;
  height: 330px;
  border-radius: 18px;
  overflow: hidden;
}

.mb-how-it-works__media-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Mechanism cards */
.mb-how-it-works__cards {
  width: 100%;
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.mb-how-it-works__card,
.mb-how-it-works__closing {
  display: flex;
  gap: 24px;
  padding: 32px;
  border-radius: 16px;
  background: #FFFFFF;
}

.mb-how-it-works__card { align-items: flex-start; }
.mb-how-it-works__closing { align-items: center; }

.mb-how-it-works__card-icon,
.mb-how-it-works__closing-icon {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
}

.mb-how-it-works__card-body {
  margin: 0;
  color: var(--mb-text);
  font-size: 16px;
  line-height: 1.5;
}

.mb-how-it-works__closing-body {
  margin: 0;
  color: var(--mb-blue-dark);
  font-size: 18px;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Full-bleed inside drag-and-drop areas
   The parent @hubspot/growth theme gives .dnd-section side gutters, a centred
   max-width and vertical padding. This section is designed edge-to-edge, so it
   releases those constraints on the wrapper it sits in. :has() is already used
   this way in the theme — see pdp-hero.module.
   -------------------------------------------------------------------------- */
.dnd-section:has(.mb-how-it-works) {
  max-width: none !important;
  padding: 0 !important;
}

.dnd-section:has(.mb-how-it-works) > .row-fluid,
.dnd-section:has(.mb-how-it-works) .dnd-row,
.dnd-section:has(.mb-how-it-works) .dnd-column,
.dnd-section:has(.mb-how-it-works) .widget-span {
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Fallback for engines without :has() — 100vw overhangs by the scrollbar width,
   which child.css clips via `overflow-x: clip` on html/body. */
@supports not selector(:has(*)) {
  .mb-how-it-works {
    width: 100vw;
    max-width: 100vw;
    margin-left: calc(50%% - 50vw);
    margin-right: calc(50%% - 50vw);
  }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .mb-how-it-works { padding: 64px var(--mb-pad-x); }

  .mb-how-it-works__intro-row {
    flex-direction: column;
    gap: 32px;
  }

  .mb-how-it-works__intro-copy,
  .mb-how-it-works__media {
    flex: 0 0 auto;
    width: 100%;
  }

  .mb-how-it-works__media { height: 280px; }
  .mb-how-it-works__heading { font-size: 30px; }
  .mb-how-it-works__cards { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 599px) {
  .mb-how-it-works { padding: 48px var(--mb-pad-x); }
  .mb-how-it-works__heading { font-size: 26px; }
  .mb-how-it-works__card,
  .mb-how-it-works__closing { padding: 24px; gap: 16px; }
}

/* --------------------------------------------------------------------------
   Shared gutter scale — every mb-* section steps down together so blocks stay
   edge-aligned with each other at every width.
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
  .mb-how-it-works { --mb-pad-x: 40px; --mb-pad-y: 64px; }
}

@media (max-width: 599px) {
  .mb-how-it-works { --mb-pad-x: 20px; --mb-pad-y: 48px; }
}
