/*
 * Styles for the generated content pages (/library, /pregnancy).
 *
 * Loaded after styles.css and reuses its tokens, so the content pages and the
 * home page stay one site rather than two that happen to share a logo. Nothing
 * here is used by index.html.
 *
 * Reading-first: the measure is capped near 68 characters, body type is larger
 * than the marketing page, and the attribution block is styled to be noticed
 * rather than tucked away — on health content the citation is part of the
 * content, not a footnote.
 */

.doc {
  background: var(--bone);
}

/* ---- Site nav ----
 * Loaded on the home page too, so this is NOT scoped to .doc — the nav is the
 * thing that makes these pages read as one site rather than a landing page with
 * outbuildings.
 */

.site-nav {
  display: flex;
  gap: 26px;
  margin-left: auto;
  margin-right: 26px;
}

.site-nav a {
  font-size: 15px;
  font-weight: 600;
  color: var(--slate);
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.site-nav a:hover {
  color: var(--bark);
}

.site-nav a.active {
  color: var(--moss);
  border-bottom-color: var(--moss);
}

/* ---- App screenshots ----
 * Three real screens, the middle one lifted and the outer two tucked behind.
 * Device chrome is drawn here rather than baked into the images, so a re-shoot
 * is just three new PNGs.
 */

.shots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 20px 0;
}

.shot {
  margin: 0;
  flex: none;
  width: 200px;
  border-radius: 30px;
  background: var(--bark);
  padding: 7px;
  box-shadow: 0 18px 40px rgba(22, 36, 28, 0.18);
}

.shot img {
  width: 100%;
  height: auto;
  aspect-ratio: 390 / 844;
  object-fit: cover;
  object-position: top center;
  border-radius: 24px;
  background: var(--wash);
  display: block;
}

.shot figcaption {
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--bone);
  padding: 8px 0 2px;
  opacity: 0.85;
  /* Above the .missing placeholder, which covers the whole inset area. */
  position: relative;
  z-index: 1;
}

.shot-lead {
  width: 236px;
  z-index: 2;
}

.shot-side {
  z-index: 1;
  opacity: 0.92;
}

.shot-side:first-child {
  transform: rotate(-5deg) translateX(16px);
}

.shot-side:last-child {
  transform: rotate(5deg) translateX(-16px);
}

/*
 * Set by the img onerror handler when a screenshot has not been dropped in yet.
 * Says which file is missing rather than showing a broken-image icon — the two
 * side shots are optional, so a half-built section should still look deliberate.
 */
.shot.missing {
  position: relative;
}

/*
 * A broken <img> renders its alt text at natural width, which blows the layout
 * apart. Collapse it to the frame and let ::after cover the gap.
 */
.shot.missing img {
  visibility: hidden;
  width: 100%;
  height: auto;
  aspect-ratio: 390 / 844;
  overflow: hidden;
}

.shot.missing::after {
  content: "Screenshot pending";
  position: absolute;
  /* Stops short of the caption strip at the bottom of the bezel. */
  inset: 7px 7px 34px;
  border-radius: 24px;
  background: var(--wash);
  color: var(--haze);
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 700px) {
  .shot-side {
    display: none;
  }

  .shot-lead {
    width: 260px;
  }
}

/* ---- Webinars ---- */

.section-h {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 22px;
  margin: 36px 0 14px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.speakers {
  font-size: 16px;
  font-weight: 600;
  color: var(--moss);
  margin: 0 0 22px;
}

.no-action {
  background: var(--wash);
  border-radius: 10px;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--slate);
  margin: 24px 0 0;
}

.doc-wrap .submit-btn {
  display: inline-block;
  width: auto;
  margin-top: 20px;
  padding: 14px 28px;
  text-decoration: none;
}

.doc-main {
  padding: 8px 0 72px;
}

.doc-wrap {
  max-width: 720px;
}

/* ---- Headings and lede ---- */

.doc-wrap h1 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(32px, 5vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.8px;
  margin: 16px 0 12px;
}

.doc-wrap .lede {
  font-size: 19px;
  line-height: 1.6;
  color: var(--slate);
  margin: 0 0 24px;
}

.crumbs {
  font-size: 14px;
  color: var(--haze);
  margin-top: 8px;
}

.crumbs a {
  color: var(--moss);
  text-decoration: none;
}

.crumbs a:hover {
  text-decoration: underline;
}

.crumbs span {
  margin: 0 6px;
  opacity: 0.5;
}

.doc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 40px;
  padding: 0 0 24px;
  border-bottom: 1px solid var(--line);
}

.pill {
  display: inline-block;
  background: var(--sprout);
  color: var(--moss);
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
}

.growing {
  font-size: 15px;
  color: var(--haze);
  margin: 0 0 28px;
}

/* ---- Modules ---- */

.module {
  margin: 0 0 44px;
  padding: 0 0 8px;
}

.module h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.3px;
  margin: 0 0 4px;
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.module-n {
  flex: none;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 700;
  color: var(--moss);
  background: var(--sprout);
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.module-meta {
  font-size: 14px;
  color: var(--haze);
  margin: 0 0 14px 38px;
}

.module p:not(.module-meta) {
  font-size: 17px;
  line-height: 1.7;
  color: var(--bark);
  margin: 0 0 14px;
}

/* ---- Attribution — deliberately visible ---- */

.attribution {
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: var(--wash);
  border-left: 3px solid var(--fern);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin: 18px 0 0;
  font-size: 14px;
}

.src-lead {
  font-weight: 600;
  color: var(--bark);
}

.src-note {
  color: var(--slate);
}

.src-link {
  color: var(--moss);
  font-weight: 600;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.src-link:hover {
  text-decoration: underline;
}

/* ---- Library cards ---- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.card {
  display: block;
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover {
  border-color: var(--fern);
  transform: translateY(-2px);
}

.card h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 20px;
  line-height: 1.25;
  margin: 12px 0 6px;
}

.card p {
  font-size: 15px;
  color: var(--slate);
  margin: 0 0 12px;
}

.card-meta {
  font-size: 13px;
  color: var(--haze);
}

/* ---- Week pages ---- */

.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.week-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--bone);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.week-chip:hover {
  border-color: var(--fern);
}

.week-n {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 17px;
}

.week-size {
  font-size: 14px;
  color: var(--haze);
}

.size {
  font-size: 19px;
  color: var(--slate);
  margin: 0 0 20px;
}

.size strong {
  color: var(--moss);
}

.week-body {
  font-size: 17px;
  line-height: 1.7;
  margin: 0 0 8px;
}

/* ---- Foot CTA ---- */

.doc-cta {
  background: var(--sprout);
  padding: 56px 0;
  text-align: center;
}

.doc-cta h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 28px;
  margin: 0 0 8px;
}

.doc-cta p {
  color: var(--slate);
  margin: 0 0 20px;
}

.doc-cta .submit-btn {
  display: inline-block;
  width: auto;
  padding: 14px 28px;
  text-decoration: none;
}

/* ---- Footer disclaimer ---- */

.disclaimer {
  max-width: 560px;
  margin: 12px auto;
  font-size: 13px;
  line-height: 1.6;
  color: var(--haze);
}

@media (max-width: 600px) {
  .doc-wrap h1 { font-size: 30px; }
  .module h2 { font-size: 21px; }
}

/*
 * Below ~860px the wordmark, three section links and the CTA stop fitting on one
 * line, so the sections drop to their own row. Not a hamburger: three links do
 * not earn a menu, and a visible row is one fewer tap to the Library — which is
 * the whole reason the nav exists.
 *
 * NOT scoped to .doc. The nav is shared with the hand-written home page, and
 * scoping an earlier version of this to .doc is exactly why the home page kept
 * a broken nav while every generated page looked fine.
 */
@media (max-width: 860px) {
  .nav {
    padding: 16px 0;
  }

  .nav .wrap {
    flex-wrap: wrap;
    row-gap: 14px;
  }

  .site-nav {
    order: 3;
    width: 100%;
    margin: 0;
    gap: 24px;
    overflow-x: auto;
    scrollbar-width: none;
    /* Bleeds to the screen edge so a scrolled row reads as scrollable. */
    margin-inline: -24px;
    padding: 2px 24px 0;
    border-top: 1px solid var(--line);
    padding-top: 12px;
    -webkit-overflow-scrolling: touch;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav a {
    white-space: nowrap;
    padding-bottom: 2px;
  }
}

/*
 * Icon-only wordmark on small screens.
 *
 * The full lockup is 169px and the CTA is 180px, which overflows the 342px of
 * usable width at 390px and pushes the button onto its own line. Dropping the
 * word gives back ~115px, which is enough for one clean row down to 320px —
 * where the trimmed-text version was still stacking.
 *
 * The name is hidden visually, NOT removed: it stays in the accessibility tree,
 * so a screen reader still announces the link as "mumbuddie" rather than
 * reading out an unlabelled image. That matters here because the mark is the
 * only home link on the page.
 */
@media (max-width: 480px) {
  .nav .logo span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .nav .logo-mark {
    width: 36px;
  }

  .nav-cta {
    flex: none;
    white-space: nowrap;
    font-size: 13px;
    padding: 9px 16px;
  }

  /*
   * Three links at 15px/24px gap measure ~298px against 272px of usable width
   * at 320, so the last one sat half-cut. Scrolling works, but a clipped word
   * reads as a bug rather than an invitation to swipe — better that they fit.
   */
  .site-nav {
    gap: 18px;
  }

  .site-nav a {
    font-size: 14px;
  }
}

/* Last 11px, for 320px-wide phones. */
@media (max-width: 360px) {
  .site-nav {
    gap: 14px;
  }

  .site-nav a {
    font-size: 13px;
  }
}
