:root {
  --primary: #4F378A;
  --primary-deep: #22005D;
  --primary-tint: #F8F2FA;
  --primary-soft: #E1D4FD;
  --ink: #1D1B20;
  --body: #63597C;
  --muted: #7A7582;
  --page: #FDF7FF;
  --card: #FFFFFF;
  --divider: #ECE6EE;
  --border: #E1D4FD;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--page);
  color: var(--body);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
}
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(253,247,255,0.85);
  backdrop-filter: blur(16px);
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
}
.nav-inner {
  max-width: 900px;
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 24px;
  color: var(--primary);
  text-decoration: none;
}
.back-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; }
main {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}
h1.doc-title {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 44px;
  line-height: 1.1;
  color: var(--ink);
  margin: 0 0 6px;
}
.updated {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 40px;
}
h2 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 26px;
  color: var(--ink);
  margin: 44px 0 14px;
}
main > h2:first-of-type { margin-top: 0; }
h3 { font-size: 16px; font-weight: 700; color: var(--ink); margin: 26px 0 10px; }
p { margin: 0 0 16px; }
strong { color: var(--ink); }
a { color: var(--primary); }
ul, ol { margin: 0 0 16px; padding-left: 22px; }
li { margin-bottom: 8px; }
hr { border: none; border-top: 1px solid var(--divider); margin: 32px 0; }
table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 14.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--divider); vertical-align: top; }
th { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); }
.callout {
  background: var(--primary-tint);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 0 0 20px;
}
.callout p:last-child { margin-bottom: 0; }
footer {
  border-top: 1px solid var(--divider);
  margin-top: 24px;
  padding: 32px 24px 48px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
}

/* ---------------------------------------------------------------------------
   Content pages (articles). The chrome below reproduces the landing page's
   header and footer, whose values are measured from it rather than from the
   tokens above: the landing sets its logo in --primary #381e72, while the
   policy pages above have long used #4F378A. The landing is the reference for
   anything that appears on both.
   --------------------------------------------------------------------------- */

:root {
  --brand: #381e72;          /* the landing page's primary */
  --brand-hover: #4F378A;
  --nav-ink: #494551;        /* the landing page's on-surface-variant */
  --footer-bg: #F8F2FA;
}

/* --- site header, as on the landing page --- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: 80px;
  background: rgba(253, 247, 255, 0.8);
  backdrop-filter: blur(24px);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}
.site-header .bar {
  max-width: 1280px;
  height: 80px;
  margin: 0 auto;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-mark { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.brand-mark img { width: 32px; height: 32px; border-radius: 32px; object-fit: cover; }
.brand-mark span {
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
  line-height: 36px;
  color: var(--brand);
}
.site-nav { display: flex; align-items: center; gap: 24px; }
.site-nav a { font-size: 14px; line-height: 20px; color: var(--nav-ink); text-decoration: none; }
.site-nav a:hover { color: var(--ink); }
.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 9999px;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
}
.header-cta:hover { background: var(--brand-hover); }
.header-cta .material-symbols-outlined { font-size: 14px; }
.mobile-menu .header-cta { justify-content: center; padding: 12px 16px; margin-top: 8px; color: #fff; }
.mobile-menu .header-cta .material-symbols-outlined { font-size: 16px; }
/* below the project's md breakpoint the nav collapses behind a menu button,
   exactly as the landing page does */
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--brand);
  cursor: pointer;
}
.menu-toggle:hover { background: var(--surface-container-high, #ECE6EE); }
.mobile-menu { display: none; border-top: 1px solid var(--divider); background: var(--page); }
.mobile-menu[data-open] { display: block; }
.mobile-menu nav { max-width: 1280px; margin: 0 auto; padding: 16px 40px; display: flex; flex-direction: column; }
.mobile-menu a { padding: 12px 0; font-size: 16px; line-height: 24px; color: var(--nav-ink); text-decoration: none; }
.mobile-menu a:hover { color: var(--ink); }
@media (max-width: 767px) {
  .site-nav { display: none; }
  .menu-toggle { display: flex; }
  .site-header .header-end > .header-cta { display: none; }
}

/* --- article --- */
article { max-width: 720px; }
.byline {
  font-size: 14px;
  color: var(--muted);
  margin: 0 0 40px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--divider);
}
.byline strong { color: var(--ink); font-weight: 600; }
.byline .todo {
  background: #FFF3C4;
  color: #5C4A03;
  padding: 1px 6px;
  border-radius: 14px;
  font-weight: 600;
}
.standfirst { font-size: 18px; line-height: 1.65; color: var(--ink); margin: 0 0 32px; }

.toc { background: var(--primary-tint); border: 1px solid var(--border); border-radius: 14px;
       padding: 20px 24px; margin: 0 0 40px; }
.toc p { font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
         color: var(--body); margin: 0 0 10px; }
.toc ol { margin: 0; padding-left: 20px; }
.toc li { margin-bottom: 6px; }

.stage-table th { background: var(--primary-tint); }
.stage-table td strong { display: block; }

.cta-card { background: var(--primary-deep); border-radius: 14px; padding: 24px;
            margin: 44px 0; color: #E1D4FD; }
.cta-card h2 { font-size: 26px; color: #fff; margin: 0 0 10px; }
.cta-card p { color: #D7C9F5; }
.cta-card p:last-of-type { margin-bottom: 20px; }
.cta-card a.button {
  display: inline-block; background: #fff; color: var(--primary-deep);
  font-weight: 600; font-size: 16px; text-decoration: none;
  padding: 12px 22px; border-radius: 9999px;
}
.cta-card a.button:hover { background: var(--primary-soft); }
.cta-card .fineprint { font-size: 13px; color: #B9A6E8; margin: 14px 0 0; }

.sources { font-size: 14px; }
.sources li { margin-bottom: 10px; }
.related { border-top: 1px solid var(--divider); margin-top: 44px; padding-top: 24px; }
.related p.label { font-size: 13px; font-weight: 700; letter-spacing: 0.04em;
                   text-transform: uppercase; color: var(--body); margin: 0 0 12px; }
.related ul { list-style: none; padding: 0; margin: 0; }
.related li { margin-bottom: 10px; }

.disclaimer { margin: 32px 0 0; font-size: 14px; }

.site-footer { background: var(--footer-bg); margin-top: 0; border-top: 0; padding: 40px 0; text-align: left; }
.site-footer .inner { max-width: 1280px; margin: 0 auto; padding: 0 40px; font-size: 12px; line-height: 16px; color: var(--nav-ink); }
.site-footer .legal { margin: 0 0 24px; }
.site-footer .row { display: flex; flex-direction: column; align-items: center; gap: 16px; justify-content: space-between; }
.site-footer a { color: var(--nav-ink); }
@media (min-width: 768px) { .site-footer .row { flex-direction: row; } }
@media (max-width: 767px) { .site-footer .legal { text-align: center; } }


/* a wide table keeps its own scroll so the page body never scrolls sideways */
.scroller { overflow-x: auto; margin: 0 0 20px; }
.scroller table { margin: 0; min-width: 460px; }

/* anchor targets clear the sticky header, as on the landing page */
.site-header ~ main [id] { scroll-margin-top: 5.5rem; }

.header-end { display: flex; align-items: center; gap: 16px; }

/* --- the symptom checklist on /am-i-in-perimenopause --- */
.checklist { margin: 0 0 24px; }
.checklist fieldset {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px 20px;
  margin: 0 0 16px;
}
.checklist legend {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--body);
  padding: 0 8px;
}
.checklist .options { display: flex; flex-direction: column; gap: 10px; }
.checklist label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--ink);
  cursor: pointer;
}
.checklist input { margin: 2px 0 0; width: 20px; height: 20px; accent-color: var(--brand); flex: none; }
.checklist label:hover { color: var(--primary); }

.checklist-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.button-primary, .button-quiet {
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 9999px;
  cursor: pointer;
}
.button-primary { background: var(--brand); color: #fff; border: 1px solid var(--brand); }
.button-primary:hover { background: var(--primary); }
.button-quiet { background: transparent; color: var(--primary); border: 1px solid var(--border); }
.button-quiet:hover { background: var(--primary-tint); }
.checklist input:focus-visible, .button-primary:focus-visible, .button-quiet:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.summary {
  background: var(--primary-tint);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  margin: 0 0 24px;
}
.summary h3 { margin-top: 20px; }
.summary > h3:first-child { margin-top: 0; }
.summary ul { margin-bottom: 16px; }
.summary .not-a-diagnosis { color: var(--ink); margin-bottom: 0; }

.callout.warn { background: #FFF3C4; }
.callout.warn strong { color: #5C4A03; }

/* printing the summary: the chrome and the form itself are not worth paper */
@media print {
  .site-header, .site-footer, .toc, .cta-card, .related, .checklist-actions,
  .checklist, .byline, .standfirst, .download, .sheet-figure { display: none; }
  .summary { border: 1px solid #999; background: #fff; }
  article { max-width: none; }
  main { padding: 0; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 11px; }
}

/* a scrollable table is reachable from the keyboard, so it needs a focus state */
.scroller:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* --- the printable tracker page --- */
a.button-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
a.button-primary .material-symbols-outlined { font-size: 20px; }
.download {
  background: var(--primary-tint);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 24px;
  margin: 0 0 32px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px 24px;
}
.download .meta { margin: 0; font-size: 14px; color: var(--body); }
.sheet-figure { margin: 0 0 32px; }
.sheet-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--divider);
  border-radius: 14px;
}
.sheet-figure figcaption { margin-top: 10px; font-size: 14px; color: var(--muted); }

/* --- the guides list every footer carries --- */
.footer-guides { max-width: 1280px; margin: 0 auto; padding: 0 40px 24px; }
.footer-guides .label {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--body);
  margin: 0 0 10px;
}
.footer-guides ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px 24px;
  font-size: 14px;
}
.footer-guides li { margin: 0; }
.footer-guides a { color: var(--nav-ink); text-decoration: none; }
.footer-guides a:hover { color: var(--ink); text-decoration: underline; }
.footer-guides a[aria-current="page"] { color: var(--ink); font-weight: 600; }
@media (min-width: 640px) { .footer-guides ul { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .footer-guides ul { grid-template-columns: 1fr 1fr 1fr; } }
/* the policy pages centre their footer; the guides list stays readable left-aligned */
footer:not(.site-footer) .footer-guides { text-align: left; padding: 0 24px 24px; }

/* a caveat that belongs with the claim above it rather than in the sources list */
.note-small { font-size: 14px; color: var(--muted); }
/* ───────────────────────── Blog index ─────────────────────────
   The only rules the article pages need beyond the ones above. Everything
   else they use — .byline, .standfirst, .toc, .callout, .sources, .related,
   .cta-card, .scroller, the anchor offset and the focus ring — is already
   defined for the guide pages, and the blog follows them rather than
   keeping a second set. */

.post-list { list-style: none; margin: 0; padding: 0; }
.post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 20px;
  margin: 0 0 16px;
  box-shadow: 0 10px 30px rgba(56,30,114,0.04);
}
.post-card h3 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 600;
  font-size: 24px;
  margin: 0 0 6px;
}
.post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h3 a:hover { color: var(--primary); text-decoration: underline; }
.post-card p { margin: 0 0 10px; }
.post-card p:last-child { margin-bottom: 0; }
.card-meta { font-size: 13px; color: var(--muted); }

.group-label {
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 44px 0 14px;
}
main > .group-label:first-of-type { margin-top: 32px; }

@media (max-width: 767px) {
  .post-card h3 { font-size: 22px; }
}
